From a6a632a800c0c69bdf90e5ade5fbe65334cb2803 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 1 Jan 2026 17:50:37 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=92=84=20Modernises=20Widgets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Simplied layout code - Modern i18n/l10n (removed SwiftGen) --- NetNewsWire.xcodeproj/project.pbxproj | 20 ---- Widget/Resources/Localizable.stringsdict | 76 ------------- Widget/Resources/Localizable.xcstrings | 105 ++++++++++++++++++ Widget/Resources/Localized.swift | 86 -------------- Widget/Resources/en.lproj/Localizable.strings | 37 ------ Widget/Widget Views/StarredWidget.swift | 62 ++++++----- Widget/Widget Views/TodayWidget.swift | 62 ++++++----- Widget/Widget Views/UnreadWidget.swift | 61 +++++----- Widget/Widget Views/WidgetLayout.swift | 4 +- Widget/WidgetBundle.swift | 12 +- 10 files changed, 209 insertions(+), 316 deletions(-) delete mode 100644 Widget/Resources/Localizable.stringsdict create mode 100644 Widget/Resources/Localizable.xcstrings delete mode 100644 Widget/Resources/Localized.swift delete mode 100644 Widget/Resources/en.lproj/Localizable.strings diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 82184cec8..c2c98f127 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -666,7 +666,6 @@ 176813EF2564BB2C00D98635 /* Sources */, 176813F02564BB2C00D98635 /* Frameworks */, 176813F12564BB2C00D98635 /* Resources */, - 1701E1BF25689B44009453D8 /* SwiftGen Localization */, 17EF6A1725C4E59D002C9F81 /* Embed Frameworks */, 84BB8F7F26224B5F00DB61F8 /* Delete Unnecessary Frameworks */, ); @@ -1068,25 +1067,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1701E1BF25689B44009453D8 /* SwiftGen Localization */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "SwiftGen Localization"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if ! command -v swiftgen &> /dev/null\nthen\n echo \"swiftgen could not be found\"\n exit\nfi\n\nswiftgen run strings -t structured-swift5 \"$PROJECT_DIR/Widget/Resources/en.lproj/Localizable.strings\" \"$PROJECT_DIR/Widget/Resources/Localizable.stringsdict\" --output \"$PROJECT_DIR/Widget/Resources/Localized.swift\";\n"; - }; 513F328A2593EFCE0003048F /* Delete Unnecessary Frameworks */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; diff --git a/Widget/Resources/Localizable.stringsdict b/Widget/Resources/Localizable.stringsdict deleted file mode 100644 index 9fcbb129d..000000000 --- a/Widget/Resources/Localizable.stringsdict +++ /dev/null @@ -1,76 +0,0 @@ - - - - - UnreadCount - - NSStringLocalizedFormatKey - %#@unread_count@ - unread_count - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - u - zero - No more unread articles - one - + 1 more unread article - other - + %u more unread articles - - - StarredCount - - NSStringLocalizedFormatKey - %#@starred_count@ - starred_count - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - u - zero - No more starred articles - one - + 1 more starred article - other - + %u more starred articles - - - TodayCount - - NSStringLocalizedFormatKey - %#@today_count@ - today_count - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - u - zero - No more recent articles - one - + 1 more recent article - other - + %u more recent articles - - - LocalizedCount - - NSStringLocalizedFormatKey - %#@localized_count@ - localized_count - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - u - zero - 0 - other - %u - - - - diff --git a/Widget/Resources/Localizable.xcstrings b/Widget/Resources/Localizable.xcstrings new file mode 100644 index 000000000..e4917abee --- /dev/null +++ b/Widget/Resources/Localizable.xcstrings @@ -0,0 +1,105 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "label.text.starred" : { + "comment" : "Starred", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Starred" + } + } + } + }, + "label.text.starred-no-articles" : { + "comment" : "There are no starred articles.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "There are no starred articles." + } + } + } + }, + "label.text.starred-widget-description" : { + "comment" : "A description of the Starred widget.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "This widget displays your starred articles." + } + } + } + }, + "label.text.today" : { + "comment" : "Today", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Today" + } + } + } + }, + "label.text.today-no-articles" : { + "comment" : "There are no recent articles.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "There are no recent articles." + } + } + } + }, + "label.text.today-widget-description" : { + "comment" : "A description of the Today widget.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "This widget displays articles posted within the last 24 hours." + } + } + } + }, + "label.text.unread" : { + "comment" : "Unread", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Unread" + } + } + } + }, + "label.text.unread-no-articles" : { + "comment" : "There are no unread articles.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "There are no unread articles." + } + } + } + }, + "label.text.unread-widget-description" : { + "comment" : "A description of the Unread widget.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "This widget display unread articles." + } + } + } + } + }, + "version" : "1.1" +} \ No newline at end of file diff --git a/Widget/Resources/Localized.swift b/Widget/Resources/Localized.swift deleted file mode 100644 index f8a05b221..000000000 --- a/Widget/Resources/Localized.swift +++ /dev/null @@ -1,86 +0,0 @@ -// swiftlint:disable all -// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen - -import Foundation - -// swiftlint:disable superfluous_disable_command file_length implicit_return - -// MARK: - Strings - -// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length -// swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces -internal enum L10n { - /// Plural format key: "%#@localized_count@" - internal static func localizedCount(_ p1: Int) -> String { - return L10n.tr("Localizable", "LocalizedCount", p1) - } - /// Your smart feeds, summarized. - internal static let smartFeedSummaryWidgetDescription = L10n.tr("Localizable", "SmartFeedSummary_Widget_Description") - /// Your Smart Feed Summary - internal static let smartFeedSummaryWidgetTitle = L10n.tr("Localizable", "SmartFeedSummary_Widget_Title") - /// Starred - internal static let starred = L10n.tr("Localizable", "Starred") - /// A sneak peek at your starred articles. - internal static let starredWidgetDescription = L10n.tr("Localizable", "Starred_Widget_Description") - /// When you mark articles as Starred, they'll appear here. - internal static let starredWidgetNoItems = L10n.tr("Localizable", "Starred_Widget_NoItems") - /// Starred - internal static let starredWidgetNoItemsTitle = L10n.tr("Localizable", "Starred_Widget_NoItemsTitle") - /// Your Starred Articles - internal static let starredWidgetTitle = L10n.tr("Localizable", "Starred_Widget_Title") - /// Plural format key: "%#@starred_count@" - internal static func starredCount(_ p1: Int) -> String { - return L10n.tr("Localizable", "StarredCount", p1) - } - /// Today - internal static let today = L10n.tr("Localizable", "Today") - /// A sneak peek at recently published unread articles. - internal static let todayWidgetDescription = L10n.tr("Localizable", "Today_Widget_Description") - /// There are no recent unread articles left to read. - internal static let todayWidgetNoItems = L10n.tr("Localizable", "Today_Widget_NoItems") - /// Today - internal static let todayWidgetNoItemsTitle = L10n.tr("Localizable", "Today_Widget_NoItemsTitle") - /// Your Today Articles - internal static let todayWidgetTitle = L10n.tr("Localizable", "Today_Widget_Title") - /// Plural format key: "%#@today_count@" - internal static func todayCount(_ p1: Int) -> String { - return L10n.tr("Localizable", "TodayCount", p1) - } - /// Unread - internal static let unread = L10n.tr("Localizable", "Unread") - /// A sneak peek at your unread articles. - internal static let unreadWidgetDescription = L10n.tr("Localizable", "Unread_Widget_Description") - /// There are no unread articles left to read. - internal static let unreadWidgetNoItems = L10n.tr("Localizable", "Unread_Widget_NoItems") - /// Unread - internal static let unreadWidgetNoItemsTitle = L10n.tr("Localizable", "Unread_Widget_NoItemsTitle") - /// Your Unread Articles - internal static let unreadWidgetTitle = L10n.tr("Localizable", "Unread_Widget_Title") - /// Plural format key: "%#@unread_count@" - internal static func unreadCount(_ p1: Int) -> String { - return L10n.tr("Localizable", "UnreadCount", p1) - } -} -// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length -// swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces - -// MARK: - Implementation Details - -extension L10n { - private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { - let format = BundleToken.bundle.localizedString(forKey: key, value: nil, table: table) - return String(format: format, locale: Locale.current, arguments: args) - } -} - -// swiftlint:disable convenience_type -private final class BundleToken { - static let bundle: Bundle = { - #if SWIFT_PACKAGE - return Bundle.module - #else - return Bundle(for: BundleToken.self) - #endif - }() -} -// swiftlint:enable convenience_type diff --git a/Widget/Resources/en.lproj/Localizable.strings b/Widget/Resources/en.lproj/Localizable.strings deleted file mode 100644 index b6c9ab00f..000000000 --- a/Widget/Resources/en.lproj/Localizable.strings +++ /dev/null @@ -1,37 +0,0 @@ -/* - Localizable.strings - NetNewsWire - - Created by Stuart Breckenridge on 21/11/2020. - Copyright © 2020 Ranchero Software. All rights reserved. -*/ - -/* Bundle */ -"Unread_Widget_Title" = "Unread Articles"; -"Unread_Widget_Description" = "See unread articles."; - -"Today_Widget_Title" = "Today Articles"; -"Today_Widget_Description" = "See the latest articles."; - -"Starred_Widget_Title" = "Starred Articles"; -"Starred_Widget_Description" = "See your starred articles."; - -"SmartFeedSummary_Widget_Title" = "Your Smart Feed Summary"; -"SmartFeedSummary_Widget_Description" = "Your smart feeds, summarized."; - -/* Unread Widget */ -"Unread_Widget_NoItemsTitle" = "Unread"; -"Unread_Widget_NoItems" = "There are no unread articles."; - -/* Today Widget */ -"Today_Widget_NoItemsTitle" = "Today"; -"Today_Widget_NoItems" = "There are no recent articles."; - -/* Starred Widget */ -"Starred_Widget_NoItemsTitle" = "Starred"; -"Starred_Widget_NoItems" = "There are no starred articles."; - -/* Smart Feed Summary Widget */ -"Unread" = "Unread"; -"Today" = "Today "; -"Starred" = "Starred"; diff --git a/Widget/Widget Views/StarredWidget.swift b/Widget/Widget Views/StarredWidget.swift index ddc897a54..5c625683e 100644 --- a/Widget/Widget Views/StarredWidget.swift +++ b/Widget/Widget Views/StarredWidget.swift @@ -17,50 +17,52 @@ struct StarredWidgetView: View { var entry: Provider.Entry var body: some View { - if entry.widgetData.starredArticles.count == 0 { + if entry.widgetData.currentStarredCount == 0 { inboxZero .widgetURL(WidgetDeepLink.starred.url) } else { - GeometryReader { metrics in - starredImage - .frame(width: WidgetLayout.titleImageSize, alignment: .leading) - VStack(alignment: .leading, spacing: 0) { + VStack { + Spacer() + HStack { + starredImage + .layoutPriority(1) + Text("label.text.starred", comment: "Starred") + .font(.caption2) + .bold() + .lineLimit(1) + .minimumScaleFactor(0.8) + .fixedSize(horizontal: false, vertical: true) + .layoutPriority(1) + Spacer() + .layoutPriority(0) + if entry.widgetData.currentStarredCount - maxCount() > 0 { + Text(verbatim: entry.widgetData.currentStarredCount.formatted()) + .font(.caption2) + .bold() + .foregroundColor(.secondary) + .lineLimit(1) + .minimumScaleFactor(0.8) + .fixedSize(horizontal: false, vertical: true) + } + } + .widgetURL(WidgetDeepLink.starred.url) + Divider() + if entry.widgetData.starredArticles.count > 0 { ForEach(0.. 0 { - Text(L10n.starredCount(entry.widgetData.currentStarredCount - maxCount())) - .font(.caption2) - .bold() - .foregroundColor(.secondary) - } - } - } - .padding(.horizontal) - ) - + Spacer() } - .widgetURL(WidgetDeepLink.starred.url) + .padding(.vertical, 2) } } @@ -95,11 +97,11 @@ struct StarredWidgetView: View { .foregroundColor(.yellow) - Text(L10n.starredWidgetNoItemsTitle) + Text("label.text.starred", comment: "Starred") .font(.headline) .foregroundColor(.primary) - Text(L10n.starredWidgetNoItems) + Text("label.text.starred-no-articles", comment: "There are no starred articles.") .font(.caption) .foregroundColor(.gray) Spacer() diff --git a/Widget/Widget Views/TodayWidget.swift b/Widget/Widget Views/TodayWidget.swift index f63733595..5839ea8d5 100644 --- a/Widget/Widget Views/TodayWidget.swift +++ b/Widget/Widget Views/TodayWidget.swift @@ -17,50 +17,52 @@ struct TodayWidgetView: View { var entry: Provider.Entry var body: some View { - if entry.widgetData.todayArticles.count == 0 { + if entry.widgetData.currentTodayCount == 0 { inboxZero .widgetURL(WidgetDeepLink.today.url) } else { - GeometryReader { metrics in - todayImage - .frame(width: WidgetLayout.titleImageSize, alignment: .leading) - VStack(alignment: .leading, spacing: 0) { + VStack { + Spacer() + HStack { + todayImage + .layoutPriority(1) + Text("label.text.today", comment: "Today") + .font(.caption2) + .bold() + .lineLimit(1) + .minimumScaleFactor(0.8) + .fixedSize(horizontal: false, vertical: true) + .layoutPriority(1) + Spacer() + .layoutPriority(0) + if entry.widgetData.currentTodayCount - maxCount() > 0 { + Text(verbatim: entry.widgetData.currentTodayCount.formatted()) + .font(.caption2) + .bold() + .foregroundColor(.secondary) + .lineLimit(1) + .minimumScaleFactor(0.8) + .fixedSize(horizontal: false, vertical: true) + } + } + .widgetURL(WidgetDeepLink.today.url) + Divider() + if entry.widgetData.todayArticles.count > 0 { ForEach(0.. 0 { - Text(L10n.todayCount(entry.widgetData.currentTodayCount - maxCount())) - .font(.caption2) - .bold() - .foregroundColor(.secondary) - } - } - } - .padding(.horizontal) - ) - + Spacer() } - .widgetURL(WidgetDeepLink.today.url) + .padding(.vertical, 2) } } @@ -94,11 +96,11 @@ struct TodayWidgetView: View { .foregroundColor(.orange) - Text(L10n.todayWidgetNoItemsTitle) + Text("label.text.today", comment: "Today") .font(.headline) .foregroundColor(.primary) - Text(L10n.todayWidgetNoItems) + Text("label.text.today-no-articles", comment: "There are no recent articles.") .font(.caption) .foregroundColor(.gray) Spacer() diff --git a/Widget/Widget Views/UnreadWidget.swift b/Widget/Widget Views/UnreadWidget.swift index 22b0765ce..617c1ae4d 100644 --- a/Widget/Widget Views/UnreadWidget.swift +++ b/Widget/Widget Views/UnreadWidget.swift @@ -22,47 +22,50 @@ struct UnreadWidgetView: View { .widgetURL(WidgetDeepLink.unread.url) } else { - GeometryReader { metrics in - unreadImage - .frame(width: WidgetLayout.titleImageSize, alignment: .leading) - VStack(alignment: .leading, spacing: 0) { + VStack { + Spacer() + HStack { + unreadImage + .layoutPriority(1) + Text("label.text.unread", comment: "Unread") + .font(.caption2) + .bold() + .lineLimit(1) + .minimumScaleFactor(0.8) + .fixedSize(horizontal: false, vertical: true) + .layoutPriority(1) + Spacer() + .layoutPriority(0) + if entry.widgetData.currentUnreadCount - maxCount() > 0 { + Text(verbatim: entry.widgetData.currentUnreadCount.formatted()) + .font(.caption2) + .bold() + .foregroundColor(.secondary) + .lineLimit(1) + .minimumScaleFactor(0.8) + .fixedSize(horizontal: false, vertical: true) + } + } + .widgetURL(WidgetDeepLink.unread.url) + Divider() + if entry.widgetData.unreadArticles.count > 0 { ForEach(0.. 0 { - Text(L10n.unreadCount(entry.widgetData.currentUnreadCount - maxCount())) - .font(.caption2) - .bold() - .foregroundColor(.secondary) - } - } - } - .padding(.horizontal) - ) + Spacer() } - .widgetURL(WidgetDeepLink.unread.url) + .padding(.vertical, 2) } } - + var unreadImage: some View { Image(systemName: "largecircle.fill.circle") .resizable() @@ -91,11 +94,11 @@ struct UnreadWidgetView: View { .foregroundColor(.accentColor) .frame(width: 30) - Text(L10n.unreadWidgetNoItemsTitle) + Text("label.text.unread", comment: "Unread") .font(.headline) .foregroundColor(.primary) - Text(L10n.unreadWidgetNoItems) + Text("label.text.unread-no-articles", comment: "There are no unread articles.") .font(.caption) .foregroundColor(.gray) Spacer() diff --git a/Widget/Widget Views/WidgetLayout.swift b/Widget/Widget Views/WidgetLayout.swift index 38e5b4d23..71e441009 100644 --- a/Widget/Widget Views/WidgetLayout.swift +++ b/Widget/Widget Views/WidgetLayout.swift @@ -10,10 +10,10 @@ import Foundation struct WidgetLayout { - static let titleImageSize = CGFloat(20) + static let titleImageSize = CGFloat(14) static let titleImagePaddingRight = CGFloat(6) static let leftSideWidth = titleImageSize + titleImagePaddingRight - static let feedIconSize = CGFloat(24) + static let feedIconSize = CGFloat(14) static let articleItemViewPaddingTop = CGFloat(8) static let articleItemViewPaddingBottom = CGFloat(4) } diff --git a/Widget/WidgetBundle.swift b/Widget/WidgetBundle.swift index 9dc304484..92e47cb89 100644 --- a/Widget/WidgetBundle.swift +++ b/Widget/WidgetBundle.swift @@ -23,8 +23,8 @@ struct UnreadWidget: Widget { Color.clear } }) - .configurationDisplayName(L10n.unreadWidgetTitle) - .description(L10n.unreadWidgetDescription) + .configurationDisplayName(Text("label.text.unread", comment: "Unread")) + .description(Text("label.text.unread-widget-description", comment: "A description of the Unread widget.")) .supportedFamilies([.systemMedium, .systemLarge]) } } @@ -41,8 +41,8 @@ struct TodayWidget: Widget { Color.clear } }) - .configurationDisplayName(L10n.todayWidgetTitle) - .description(L10n.todayWidgetDescription) + .configurationDisplayName(Text("label.text.today", comment: "Today")) + .description(Text("label.text.today-widget-description", comment: "A description of the Today widget.")) .supportedFamilies([.systemMedium, .systemLarge]) } } @@ -59,8 +59,8 @@ struct StarredWidget: Widget { Color.clear } }) - .configurationDisplayName(L10n.starredWidgetTitle) - .description(L10n.starredWidgetDescription) + .configurationDisplayName(Text("label.text.starred", comment: "Starred")) + .description(Text("label.text.starred-widget-description", comment: "A description of the Starred widget.")) .supportedFamilies([.systemMedium, .systemLarge]) } } From d139f2d38db6674a22f7f1040c1e5f588b1b58ea Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 1 Jan 2026 17:51:29 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A9=B9=20Add=20delay=20to=20selecting?= =?UTF-8?q?=20widget=20articles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This small delay allows viewDidAppear logic to clear any currently selected articles and associated animation before selecting the widget article. --- iOS/SceneDelegate.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/iOS/SceneDelegate.swift b/iOS/SceneDelegate.swift index 25e2240f4..d9449780b 100644 --- a/iOS/SceneDelegate.swift +++ b/iOS/SceneDelegate.swift @@ -137,7 +137,9 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { AccountManager.shared.resumeAll() } self.coordinator.selectAllUnreadFeed() { - self.coordinator.selectArticleInCurrentFeed(id!) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: { + self.coordinator.selectArticleInCurrentFeed(id!) + }) } } else { self.coordinator.selectAllUnreadFeed() @@ -153,7 +155,9 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { AccountManager.shared.resumeAll() } self.coordinator.selectTodayFeed() { - self.coordinator.selectArticleInCurrentFeed(id!) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: { + self.coordinator.selectArticleInCurrentFeed(id!) + }) } } else { self.coordinator.selectTodayFeed() @@ -169,7 +173,9 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { AccountManager.shared.resumeAll() } self.coordinator.selectStarredFeed() { - self.coordinator.selectArticleInCurrentFeed(id!) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: { + self.coordinator.selectArticleInCurrentFeed(id!) + }) } } else { self.coordinator.selectStarredFeed() From f44995968472b4b349f9e09b66b571b9880fddd6 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 1 Jan 2026 19:51:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=92=84=20Fix=204749=20-=20New=20iOS?= =?UTF-8?q?=20About=20View?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Settings/AboutContributor.swift | 69 +++++++++++++++++++++ iOS/Settings/AboutCreditView.swift | 46 ++++++++++++++ iOS/Settings/AboutView.swift | 74 +++++++++++++++++++++++ iOS/Settings/AboutViewController.swift | 60 ------------------ iOS/Settings/SettingsViewController.swift | 4 +- 5 files changed, 191 insertions(+), 62 deletions(-) create mode 100644 iOS/Settings/AboutContributor.swift create mode 100644 iOS/Settings/AboutCreditView.swift create mode 100644 iOS/Settings/AboutView.swift delete mode 100644 iOS/Settings/AboutViewController.swift diff --git a/iOS/Settings/AboutContributor.swift b/iOS/Settings/AboutContributor.swift new file mode 100644 index 000000000..a64b19817 --- /dev/null +++ b/iOS/Settings/AboutContributor.swift @@ -0,0 +1,69 @@ +// +// AboutContributor.swift +// NetNewsWire-iOS +// +// Created by Stuart Breckenridge on 01/01/2026. +// Copyright © 2026 Ranchero Software. All rights reserved. +// + +import Foundation + +public struct AboutContributor: Identifiable, Hashable { + public let id: UUID = UUID() + + let name: String + let url: URL +} + + +public enum Contributors: CaseIterable { + + case mauriceParker + case stuartBreckenridge + case bradEllis + case keilGillard + case anhDo + case nateWeaver + case andrewBrehaut + case danielJalkut + case joeHeck + case olofHellman + case rizwanMohamedIbrahim + case philViso + case ryanDotson + case others + + + public var contributor: AboutContributor { + switch self { + case .mauriceParker: + return AboutContributor(name: "Maurice Parker", url: URL(string: "https://vincode.io")!) + case .stuartBreckenridge: + return AboutContributor(name: "Stuart Breckenridge", url: URL(string: "https://stuartbreckenridge.net")!) + case .bradEllis: + return AboutContributor(name: "Brad Ellis", url: URL(string: "https://hachyderm.io/@bradellis")!) + case .keilGillard: + return AboutContributor(name: "Keil Gillard", url: URL(string: "https://twitter.com/kielgillard")!) + case .anhDo: + return AboutContributor(name: "Anh Do", url: URL(string:"https://mastodon.social/@anhdo")!) + case .nateWeaver: + return AboutContributor(name: "Nate Weaver", url: URL(string: "https://github.com/wevah")!) + case .andrewBrehaut: + return AboutContributor(name: "Andrew Brehaut", url: URL(string: "https://github.com/brehaut/")!) + case .danielJalkut: + return AboutContributor(name: "Daniel Jalkut", url: URL(string: "https://github.com/danielpunkass")!) + case .joeHeck: + return AboutContributor(name: "Joe Heck", url: URL(string: "https://rhonabwy.com/")!) + case .olofHellman: + return AboutContributor(name: "Olof Hellman", url: URL(string: "https://github.com/olofhellman")!) + case .rizwanMohamedIbrahim: + return AboutContributor(name: "Rizwan Mohamed Ibrahim", url: URL(string: "https://blog.rizwan.dev/")!) + case .philViso: + return AboutContributor(name: "Phil Viso", url: URL(string: "https://github.com/philviso")!) + case .ryanDotson: + return AboutContributor(name: "Ryan Dotson", url: URL(string: "https://github.com/nostodnayr")!) + case .others: + return AboutContributor(name: "and many more", url: URL(string: "https://github.com/Ranchero-Software/NetNewsWire/graphs/contributors")!) + } + } +} diff --git a/iOS/Settings/AboutCreditView.swift b/iOS/Settings/AboutCreditView.swift new file mode 100644 index 000000000..594f6665e --- /dev/null +++ b/iOS/Settings/AboutCreditView.swift @@ -0,0 +1,46 @@ +// +// AboutCreditView.swift +// NetNewsWire-iOS +// +// Created by Stuart Breckenridge on 15/09/2025. +// Copyright © 2025 Ranchero Software. All rights reserved. +// + +import SwiftUI + +struct AboutCreditView: View { + + let contributorType: String + let contributors: [Contributors] + + var body: some View { + HStack(alignment: .top) { + Spacer() + Text(verbatim: contributorType) + .foregroundStyle(.secondary) + .frame(maxWidth: .infinity, alignment: .trailing) + .lineLimit(3) + .multilineTextAlignment(.trailing) + .minimumScaleFactor(0.8) + VStack { + ForEach(contributors, id: \.self) { item in + Text(verbatim: item.contributor.name) + .frame(maxWidth: .infinity, alignment: .leading) + .lineLimit(2) + .multilineTextAlignment(.leading) + .minimumScaleFactor(0.8) + .foregroundStyle(.link) + .onTapGesture { + UIApplication.shared.open(item.contributor.url) + } + } + } + Spacer() + } + + } +} + +#Preview { + AboutCreditView(contributorType: "Contributing Developers", contributors: [Contributors.mauriceParker, Contributors.stuartBreckenridge]) +} diff --git a/iOS/Settings/AboutView.swift b/iOS/Settings/AboutView.swift new file mode 100644 index 000000000..78231051c --- /dev/null +++ b/iOS/Settings/AboutView.swift @@ -0,0 +1,74 @@ +// +// AboutView.swift +// NetNewsWire-iOS +// +// Created by Stuart Breckenridge on 15/09/2025. +// Copyright © 2025 Ranchero Software. All rights reserved. +// + +import SwiftUI + +struct AboutView: View { + var body: some View { + ScrollView(.vertical) { + VStack(alignment: .center, spacing: 12) { + Image("nnwFeedIcon") + .resizable() + .frame(width: 100, height: 100) + .clipShape(ConcentricRectangle(corners: .fixed(20))) + + Text(verbatim: "NetNewsWire") + .font(.largeTitle) + + Text(verbatim: "By Brent Simmons and the Ranchero Software Team") + .foregroundStyle(.secondary) + Text("[netnewswire.com](https://netnewswire.com)") + + + VStack(spacing: 6) { + Text(verbatim: "Credits") + .bold() + .foregroundStyle(.secondary) + .padding(.top, 16) + AboutCreditView(contributorType: "Contributing Developers", contributors: [Contributors.mauriceParker, Contributors.stuartBreckenridge]) + AboutCreditView(contributorType: "App Icon", contributors: [.bradEllis]) + AboutCreditView(contributorType: "Feedly Syncing", contributors: [.keilGillard]) + AboutCreditView(contributorType: "NewsBlur Synching", contributors: [.anhDo]) + AboutCreditView(contributorType: "Under-the-hood magic & CSS", contributors: [.nateWeaver]) + AboutCreditView(contributorType: "Newsfoot (JS footnote displayer)", contributors: [.andrewBrehaut]) + AboutCreditView(contributorType: "Help Book", contributors: [.ryanDotson]) + AboutCreditView(contributorType: "...and Featuring Additional Contributions from", contributors: [.danielJalkut, .joeHeck, .olofHellman, .rizwanMohamedIbrahim, .philViso, .others]) + } + + VStack(spacing: 6) { + Text(verbatim: "Thanks") + .bold() + .foregroundStyle(.secondary) + .padding(.top, 16) + Text("Thanks to Sheila and my family; thanks to my friends in Seattle and around the globe; thanks to the ever-patient and ever-awesome NetNewsWire beta testers.\n\nThanks to [Gus Mueller](https://shapeof.com/) for [FMDB](https://github.com/ccgus/fmdb) by [Flying Meat Software](http://flyingmeat.com/). Thanks to [GitHub](https://github.com) and [Discourse](https://discourse.com) for making open source collaboration easy and fun. Thanks to [Ben Ubois](https://benubois.com/) at [Feedbin](https://feedbin.com) for all the extra help with syncing and article rendering — and [for hosting the server for the Reader view](https://feedbin.com/blog/2019/03/11/the-future-of-full-content/).") + } + + VStack(spacing: 6) { + Text(verbatim: "Dedication") + .bold() + .foregroundStyle(.secondary) + .padding(.top, 16) + Text("NetNewsWire 7 is dedicated to everyone working to save democracy around the world.") + } + + + Text(verbatim: "Copyright © 2002-2025 Brent Simmons") + .font(.caption) + .foregroundStyle(.secondary) + } + .scenePadding(.horizontal) + } + .multilineTextAlignment(.center) + .background(Color(uiColor: .systemBackground)) + .navigationTitle(Text(verbatim: "About")) + } +} + +#Preview { + AboutView() +} diff --git a/iOS/Settings/AboutViewController.swift b/iOS/Settings/AboutViewController.swift deleted file mode 100644 index f6b7f3bd2..000000000 --- a/iOS/Settings/AboutViewController.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// AboutViewController.swift -// NetNewsWire-iOS -// -// Created by Maurice Parker on 4/25/19. -// Copyright © 2019 Ranchero Software. All rights reserved. -// - -import UIKit -import RSCore - -final class AboutViewController: UITableViewController { - - @IBOutlet var aboutTextView: UITextView! - @IBOutlet var creditsTextView: UITextView! - @IBOutlet var acknowledgmentsTextView: UITextView! - @IBOutlet var thanksTextView: UITextView! - @IBOutlet var dedicationTextView: UITextView! - - override func viewDidLoad() { - - super.viewDidLoad() - - configureCell(file: "About", textView: aboutTextView) - configureCell(file: "Credits", textView: creditsTextView) - configureCell(file: "Thanks", textView: thanksTextView) - configureCell(file: "Dedication", textView: dedicationTextView) - - let buildLabel = NonIntrinsicLabel(frame: CGRect(x: 32.0, y: 0.0, width: 0.0, height: 0.0)) - buildLabel.font = UIFont.systemFont(ofSize: 11.0) - buildLabel.textColor = UIColor.gray - buildLabel.text = NSLocalizedString("Copyright © 2002-2026 Brent Simmons", comment: "Copyright") - buildLabel.numberOfLines = 0 - buildLabel.sizeToFit() - buildLabel.translatesAutoresizingMaskIntoConstraints = false - - let wrapperView = UIView(frame: CGRect(x: 0, y: 0, width: buildLabel.frame.width, height: buildLabel.frame.height + 10.0)) - wrapperView.translatesAutoresizingMaskIntoConstraints = false - wrapperView.addSubview(buildLabel) - tableView.tableFooterView = wrapperView - } - - override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return UITableView.automaticDimension - } - -} - -private extension AboutViewController { - - func configureCell(file: String, textView: UITextView) { - let url = Bundle.main.url(forResource: file, withExtension: "rtf")! - let string = try! NSAttributedString(url: url, options: [NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.rtf], documentAttributes: nil) - textView.attributedText = string - textView.textColor = UIColor.label - textView.adjustsFontForContentSizeCategory = true - textView.font = .preferredFont(forTextStyle: .body) - } - -} diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index 39a87e808..8039d3a48 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -232,8 +232,8 @@ final class SettingsViewController: UITableViewController { openURL(HelpURL.bugTracker.rawValue) tableView.selectRow(at: nil, animated: true, scrollPosition: .none) case 3: - let timeline = UIStoryboard.settings.instantiateController(ofType: AboutViewController.self) - self.navigationController?.pushViewController(timeline, animated: true) + let hosting = UIHostingController(rootView: AboutView()) + self.navigationController?.pushViewController(hosting, animated: true) default: break } From 50fba2ae6b27a04e33a9153221482d8593aa7069 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 1 Jan 2026 19:52:05 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Mac=20credits=20to=20p?= =?UTF-8?q?oint=20to=20mastdon=20and=20not=20x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mac/Resources/Credits.rtf | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Mac/Resources/Credits.rtf b/Mac/Resources/Credits.rtf index 46022b180..c72062967 100644 --- a/Mac/Resources/Credits.rtf +++ b/Mac/Resources/Credits.rtf @@ -2,7 +2,7 @@ \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 SFPro-Bold;\f1\fnil\fcharset0 SFPro-Regular;} {\colortbl;\red255\green255\blue255;\red0\green0\blue0;} {\*\expandedcolortbl;;\cssrgb\c0\c0\c0\cname textColor;} -\margl1440\margr1440\vieww14060\viewh15660\viewkind0 +\paperw12240\paperh15840\margl1440\margr1440\vieww14060\viewh15660\viewkind0 \deftab720 \pard\pardeftab720\sa60\partightenfactor0 @@ -14,16 +14,16 @@ \cf2 Contributing Developers \ \pard\pardeftab720\sl168\slmult1\sa60\partightenfactor0 {\field{\*\fldinst{HYPERLINK "https://stuartbreckenridge.net/"}}{\fldrslt \cf2 Stuart Breckenridge}}, {\field{\*\fldinst{HYPERLINK "https://github.com/vincode-io"}}{\fldrslt Maurice Parker}}\ -\pard\pardeftab720\sl168\slmult1\sa60\partightenfactor0 -\cf2 \ +\ App Icon\ -{\field{\*\fldinst{HYPERLINK "https://twitter.com/BradEllis"}}{\fldrslt Brad Ellis}}\ +\pard\pardeftab720\sl168\slmult1\sa60\partightenfactor0 +{\field{\*\fldinst{HYPERLINK "https://hachyderm.io/@bradellis"}}{\fldrslt \cf2 Brad Ellis}}\ \ Feedly Syncing\ {\field{\*\fldinst{HYPERLINK "https://twitter.com/kielgillard"}}{\fldrslt Kiel Gillard}}\ \ NewsBlur Syncing\ -{\field{\*\fldinst{HYPERLINK "https://twitter.com/quanganhdo"}}{\fldrslt Anh Do}}\ +{\field{\*\fldinst{HYPERLINK "https://mastodon.social/@anhdo"}}{\fldrslt Anh Do}}\ \ Under-the-Hood Magic and CSS Stylin's\ {\field{\*\fldinst{HYPERLINK "https://github.com/wevah"}}{\fldrslt Nate Weaver}}\ @@ -31,8 +31,14 @@ Under-the-Hood Magic and CSS Stylin's\ Newsfoot (JS footnote displayer)\ {\field{\*\fldinst{HYPERLINK "https://github.com/brehaut/"}}{\fldrslt Andrew Brehaut}}\ \ +\pard\pardeftab720\sl168\slmult1\sa60\partightenfactor0 +\cf2 Help Book\ +{\field{\*\fldinst{HYPERLINK "https://github.com/nostodnayr"}}{\fldrslt Ryan Dotson}}\ +\pard\pardeftab720\sl168\slmult1\sa60\partightenfactor0 +\cf2 \ And featuring contributions from\ -{\field{\*\fldinst{HYPERLINK "https://github.com/danielpunkass"}}{\fldrslt Daniel Jalkut}}, {\field{\*\fldinst{HYPERLINK "https://rhonabwy.com/"}}{\fldrslt Joe Heck}}, {\field{\*\fldinst{HYPERLINK "https://github.com/olofhellman"}}{\fldrslt Olof Hellman}}, {\field{\*\fldinst{HYPERLINK "https://blog.rizwan.dev/"}}{\fldrslt Rizwan Mohamed Ibrahim}}, {\field{\*\fldinst{HYPERLINK "https://twitter.com/philviso"}}{\fldrslt Phil Viso}}, and {\field{\*\fldinst{HYPERLINK "https://github.com/Ranchero-Software/NetNewsWire/graphs/contributors"}}{\fldrslt many more}}!\ +\pard\pardeftab720\sl168\slmult1\sa60\partightenfactor0 +{\field{\*\fldinst{HYPERLINK "https://github.com/danielpunkass"}}{\fldrslt \cf2 Daniel Jalkut}}, {\field{\*\fldinst{HYPERLINK "https://rhonabwy.com/"}}{\fldrslt Joe Heck}}, {\field{\*\fldinst{HYPERLINK "https://github.com/olofhellman"}}{\fldrslt Olof Hellman}}, {\field{\*\fldinst{HYPERLINK "https://blog.rizwan.dev/"}}{\fldrslt Rizwan Mohamed Ibrahim}}, {\field{\*\fldinst{HYPERLINK "https://github.com/philviso"}}{\fldrslt Phil Viso}}, and {\field{\*\fldinst{HYPERLINK "https://github.com/Ranchero-Software/NetNewsWire/graphs/contributors"}}{\fldrslt many more}}!\ \pard\pardeftab720\li360\sa60\partightenfactor0 \cf2 \ \pard\pardeftab720\sa60\partightenfactor0 From 3128ac95222de6c3638a4cbc2a21fcea0429ed4f Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 1 Jan 2026 21:14:18 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E2=9C=A8=20Add=20Forum=20Link=20in=20iOS?= =?UTF-8?q?=20Settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Settings/Settings.storyboard | 67 ++++++++++++++--------- iOS/Settings/SettingsViewController.swift | 7 ++- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 0a83bf7c5..d8eb3a762 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -1,8 +1,8 @@ - + - + @@ -384,10 +384,10 @@ - + - + - + @@ -429,20 +429,20 @@ - + - +