From c05caca971a56acabcdb511fcf42895e173affe3 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 14 Nov 2026 10:59:12 -0800 Subject: [PATCH] Move Help and Troubleshooting screen contents back to main settings screen. --- Shared/Localizable.xcstrings | 21 -- iOS/Settings/HelpSettingsViewController.swift | 118 ----------- iOS/Settings/Settings.storyboard | 186 ++++++++++++++++-- iOS/Settings/SettingsViewController.swift | 112 +++++++++-- ...roubleshootingSettingsViewController.swift | 103 ---------- 5 files changed, 266 insertions(+), 274 deletions(-) delete mode 100644 iOS/Settings/HelpSettingsViewController.swift delete mode 100644 iOS/Settings/TroubleshootingSettingsViewController.swift diff --git a/Shared/Localizable.xcstrings b/Shared/Localizable.xcstrings index 6648f0367..e052ec269 100644 --- a/Shared/Localizable.xcstrings +++ b/Shared/Localizable.xcstrings @@ -74,9 +74,6 @@ } } }, - "About NetNewsWire" : { - "comment" : "About NetNewsWire" - }, "Account" : { "comment" : "Account" }, @@ -272,9 +269,6 @@ "Automatic" : { "comment" : "Automatic" }, - "Bug Tracker" : { - "comment" : "Bug Tracker" - }, "Can’t add a feed because no feed was found." : { "comment" : "Feed finder" }, @@ -511,9 +505,6 @@ } } }, - "Dinosaurs" : { - "comment" : "Dinosaurs" - }, "Dinosaurs Help" : { "comment" : "Help link" }, @@ -966,12 +957,6 @@ "comment" : "A dedication to those working to save democracy.", "isCommentAutoGenerated" : true }, - "NetNewsWire Forum" : { - "comment" : "NetNewsWire Forum" - }, - "NetNewsWire Help" : { - "comment" : "NetNewsWire Help" - }, "NetNewsWire News" : { "comment" : "NetNewsWire News" }, @@ -1160,9 +1145,6 @@ "Refresh to Clear Read Articles" : { "comment" : "Refresh to Clear Read Articles" }, - "Release Notes" : { - "comment" : "Release Notes" - }, "Remove" : { "comment" : "Remove" }, @@ -1629,9 +1611,6 @@ "Totals" : { "comment" : "Totals section" }, - "Troubleshooting" : { - "comment" : "Troubleshooting" - }, "Type:" : { "localizations" : { "es" : { diff --git a/iOS/Settings/HelpSettingsViewController.swift b/iOS/Settings/HelpSettingsViewController.swift deleted file mode 100644 index d8638926f..000000000 --- a/iOS/Settings/HelpSettingsViewController.swift +++ /dev/null @@ -1,118 +0,0 @@ -// -// HelpSettingsViewController.swift -// NetNewsWire-iOS -// -// Created by Brent Simmons on 11/12/26. -// Copyright © 2026 Ranchero Software. All rights reserved. -// - -import UIKit -import SafariServices -import SwiftUI - -final class HelpSettingsViewController: UITableViewController { - - private enum Row: Int, CaseIterable { - case help - case forum - case releaseNotes - case bugTracker - case about - - var title: String { - switch self { - case .help: - return NSLocalizedString("NetNewsWire Help", comment: "NetNewsWire Help") - case .forum: - return NSLocalizedString("NetNewsWire Forum", comment: "NetNewsWire Forum") - case .releaseNotes: - return NSLocalizedString("Release Notes", comment: "Release Notes") - case .bugTracker: - return NSLocalizedString("Bug Tracker", comment: "Bug Tracker") - case .about: - return NSLocalizedString("About NetNewsWire", comment: "About NetNewsWire") - } - } - } - - private static let cellIdentifier = "Cell" - - init() { - super.init(style: .insetGrouped) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func viewDidLoad() { - super.viewDidLoad() - title = NSLocalizedString("Help", comment: "Help") - tableView.register(VibrantTableViewCell.self, forCellReuseIdentifier: Self.cellIdentifier) - } - - // MARK: - UITableViewDataSource - - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return Row.allCases.count - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: Self.cellIdentifier, for: indexPath) - let row = Row.allCases[indexPath.row] - cell.textLabel?.text = row.title - cell.textLabel?.adjustsFontForContentSizeCategory = true - cell.accessoryType = row == .about ? .disclosureIndicator : .none - return cell - } - - // MARK: - UITableViewDelegate - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - switch Row.allCases[indexPath.row] { - case .help: - openURL(HelpURL.helpHome.rawValue) - tableView.selectRow(at: nil, animated: true, scrollPosition: .none) - case .forum: - openURL(HelpURL.discourse.rawValue) - tableView.selectRow(at: nil, animated: true, scrollPosition: .none) - case .releaseNotes: - openURL(HelpURL.releaseNotes.rawValue) - tableView.selectRow(at: nil, animated: true, scrollPosition: .none) - case .bugTracker: - openURL(HelpURL.bugTracker.rawValue) - tableView.selectRow(at: nil, animated: true, scrollPosition: .none) - case .about: - navigationController?.pushViewController(UIHostingController(rootView: AboutView()), animated: true) - } - } -} - -// MARK: - Private - -private extension HelpSettingsViewController { - - func openURL(_ urlString: String) { - guard let url = URL(string: urlString) else { - return - } - - // Open GitHub links in the GitHub app when installed. - if let host = url.host, host == "github.com" || host.hasSuffix(".github.com") { - UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { [weak self] openedInApp in - if !openedInApp { - self?.presentSafariViewController(for: url) - } - } - return - } - - presentSafariViewController(for: url) - } - - func presentSafariViewController(for url: URL) { - let vc = SFSafariViewController(url: url) - vc.modalPresentationStyle = .pageSheet - present(vc, animated: true) - } -} diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 49f948aa7..674702c91 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -117,6 +117,23 @@ + + + + + + + + + + + @@ -168,23 +185,10 @@ - - - - - - - - - - - + + + + @@ -192,7 +196,7 @@ - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +