diff --git a/Appcasts/netnewswire-beta.xml b/Appcasts/netnewswire-beta.xml index 128306774..3b4272bc4 100644 --- a/Appcasts/netnewswire-beta.xml +++ b/Appcasts/netnewswire-beta.xml @@ -6,6 +6,23 @@ Most recent NetNewsWire changes with links to updates. en + + NetNewsWire 7.3b8 + +
  • Added Gray theme — inspired by newsprint design but not meant to be a literal copy +
  • Added Plum theme — uses the same layout as the Gray theme but with color +
  • Added an optional grayscaleIcon key to theme Info.plist files — when true, the feed icon or author avatar in the article view is grayscale. The Gray theme uses this new feature +
  • Fixed a crash in the timeline (too many layout passes) caused by row-height measurement mixing up same articles from different accounts +
  • Fixed bug where deleting a feed could remove the wrong row (usually the next row) from the sidebar +
  • Fixed bug where restoring with no article selected, then clicking an article, would auto-scroll the article view + + ]]> + Wed, 11 Nov 2026 17:30:00 -0800 + + 15.0 + + NetNewsWire 7.3b7 Most recent NetNewsWire changes with links to updates. en + + NetNewsWire 7.3b8 + +
  • Added Gray theme — inspired by newsprint design but not meant to be a literal copy +
  • Added Plum theme — uses the same layout as the Gray theme but with color +
  • Added an optional grayscaleIcon key to theme Info.plist files — when true, the feed icon or author avatar in the article view is grayscale. The Gray theme uses this new feature +
  • Fixed a crash in the timeline (too many layout passes) caused by row-height measurement mixing up same articles from different accounts +
  • Fixed bug where deleting a feed could remove the wrong row (usually the next row) from the sidebar +
  • Fixed bug where restoring with no article selected, then clicking an article, would auto-scroll the article view + + ]]> + Wed, 11 Nov 2026 17:30:00 -0800 + + 15.0 + + NetNewsWire 7.3b7 Hello world.

    ")) } + @Test func xhtmlTitleWithCDATA() throws { + // + let xml = """ + + + turn:t + + urn:t:1 + <![CDATA[Wheels within (mouse) wheels]]> + 2020-05-01T00:00:00Z + Body. + + + """ + let d = ParserData(url: "http://example.com/", data: Data(xml.utf8)) + let feed = try #require(try FeedParser.parse(d)) + let item = try #require(feed.items.first) + #expect(item.title == "Wheels within (mouse) wheels") + } + @Test func contentTypeDefault() throws { // No `type` attribute — RFC 4287 specifies default is "text". The // parser treats it as plain text (same path as `type="text"`). diff --git a/Shared/AppNotifications.swift b/Shared/AppNotifications.swift index 647a3c4fe..2d281a8c1 100644 --- a/Shared/AppNotifications.swift +++ b/Shared/AppNotifications.swift @@ -14,6 +14,7 @@ extension Notification.Name { static let UserDidAddFeed = Notification.Name("UserDidAddFeedNotification") static let WebInspectorEnabledDidChange = Notification.Name("WebInspectorEnabledDidChange") static let sidebarShowsIconsDidChange = Notification.Name("SidebarShowsIconsDidChangeNotification") + static let articleSwipeNavigationEnabledDidChange = Notification.Name("ArticleSwipeNavigationEnabledDidChangeNotification") static let grayscaleIconsDidChange = Notification.Name("GrayscaleIconsDidChangeNotification") static let sidebarSmartFeedsVisibilityDidChange = Notification.Name("SidebarSmartFeedsVisibilityDidChangeNotification") static let timelineIconSizeDidChange = Notification.Name("TimelineIconSizeDidChangeNotification") diff --git a/Shared/Localizable.xcstrings b/Shared/Localizable.xcstrings index 566273dfb..d378f3f35 100644 --- a/Shared/Localizable.xcstrings +++ b/Shared/Localizable.xcstrings @@ -1157,6 +1157,12 @@ "Scanning iCloud storage" : { "comment" : "Scan status text while fetching" }, + "Scroll Down" : { + "comment" : "Scroll Down" + }, + "Scroll Up" : { + "comment" : "Scroll Up" + }, "Search" : { "comment" : "Search" }, diff --git a/Technotes/ReleaseNotes-Mac.markdown b/Technotes/ReleaseNotes-Mac.markdown index 5d66f2ebe..c03e61ddb 100644 --- a/Technotes/ReleaseNotes-Mac.markdown +++ b/Technotes/ReleaseNotes-Mac.markdown @@ -1,5 +1,14 @@ # Mac Release Notes +### 7.3b8 7235 11 Nov 2026 - branch: main tag: mac-7.3b8 + +Added Gray theme — inspired by newsprint design but not meant to be a literal copy +Added Plum theme — uses the same layout as the Gray theme but with color +Added an optional grayscaleIcon key to theme Info.plist files — when true, the feed icon or author avatar in the article view is grayscale. The Gray theme uses this new feature +Fixed a crash in the timeline (too many layout passes) caused by row-height measurement mixing up same articles from different accounts +Fixed bug where deleting a feed could remove the wrong row (usually the next row) from the sidebar +Fixed bug where restoring with no article selected, then clicking an article, would auto-scroll the article view + ### 7.3b7 7234 9 Nov 2026 - branch: main tag: mac-7.3b7 Make image cache eviction less aggressive, which should fix a loop where images get evicted, re-cached, evicted, re-cached, etc. (See this Discourse forum post .) diff --git a/Technotes/ReleaseNotes-iOS.markdown b/Technotes/ReleaseNotes-iOS.markdown index 4fd61f82d..973786ac5 100644 --- a/Technotes/ReleaseNotes-iOS.markdown +++ b/Technotes/ReleaseNotes-iOS.markdown @@ -1,5 +1,13 @@ # iOS Release Notes +### 7.3 build 7236 12 Nov 2026 - branch: main tag: iOS-7.3-7236 + +Added Gray theme — inspired by newsprint design but not meant to be a literal copy +Added Plum theme — uses the same layout as the Gray theme but with color +Added an optional grayscaleIcon key to theme Info.plist files — when true, the feed icon or author avatar in the article view is grayscale. The Gray theme uses this new feature +Fixed bug where folder icons weren’t grayscale when Grayscale Feed Icons is on +Added an entry to the Errors Log when a tap in the timeline is ignored + ### 7.3 build 7233 9 Nov 2026 - branch: main tag: iOS-7.3-7233 Added Show Today, Show All Unread, and Show Starred settings, to hide smart feeds diff --git a/Technotes/Status.md b/Technotes/Status.md index 520a11a2c..1125fc953 100644 --- a/Technotes/Status.md +++ b/Technotes/Status.md @@ -16,5 +16,5 @@ https://github.com/Ranchero-Software/NetNewsWire/releases/tag/iOS-7.3-7233 Mac shipping: 7.2.1 https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.2.1 -Mac beta: 7.3b7 -https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.3b7 +Mac beta: 7.3b8 +https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.3b8 diff --git a/iOS/AppDefaults+iOS.swift b/iOS/AppDefaults+iOS.swift index c1bc02e2c..8a7b66bb1 100644 --- a/iOS/AppDefaults+iOS.swift +++ b/iOS/AppDefaults+iOS.swift @@ -19,6 +19,7 @@ extension AppDefaults.Key { static let articleFullscreenEnabled = "articleFullscreenEnabled" static let confirmMarkAllAsRead = "confirmMarkAllAsRead" static let showPreviewInTimelineContextMenu = "showPreviewInTimelineContextMenu" + static let articleSwipeNavigationEnabled = "articleSwipeNavigationEnabled" static let lastRefresh = "lastRefresh" static let useSystemBrowser = "useSystemBrowser" static let hideReadFeeds = "hideReadFeeds" @@ -120,6 +121,16 @@ extension AppDefaults { } } + static var articleSwipeNavigationEnabled: Bool { + get { + UserDefaults.standard.bool(forKey: Key.articleSwipeNavigationEnabled) + } + set { + UserDefaults.standard.set(newValue, forKey: Key.articleSwipeNavigationEnabled) + NotificationCenter.default.post(name: .articleSwipeNavigationEnabledDidChange, object: nil) + } + } + static var splitViewPreferredDisplayMode: Int { get { UserDefaults.standard.integer(forKey: Key.splitViewPreferredDisplayMode) @@ -298,6 +309,7 @@ extension AppDefaults { Key.articleFullscreenEnabled: false, Key.confirmMarkAllAsRead: true, Key.showPreviewInTimelineContextMenu: false, + Key.articleSwipeNavigationEnabled: true, Key.splitViewPreferredDisplayMode: UISplitViewController.DisplayMode.oneBesideSecondary.rawValue ] diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index b4405e858..e00246afc 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -71,6 +71,7 @@ import Images let isFirstRun = AppDefaults.isFirstRun if isFirstRun { Self.logger.info("Is first run.") + AppDefaults.articleSwipeNavigationEnabled = false } if isFirstRun && !AccountManager.shared.anyAccountHasAtLeastOneFeed() { diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index 888086cda..87c19db59 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -120,6 +120,9 @@ final class ArticleViewController: UIViewController { override var keyCommands: [UIKeyCommand]? { return keyboardManager.keyCommands } + override var canBecomeFirstResponder: Bool { + true + } override func viewDidLoad() { super.viewDidLoad() @@ -127,6 +130,7 @@ final class ArticleViewController: UIViewController { NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(statusesDidChange(_:)), name: .StatusesDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange(_:)), name: UIContentSizeCategory.didChangeNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(handleArticleSwipeNavigationEnabledDidChange(_:)), name: .articleSwipeNavigationEnabledDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil) let appearance = UINavigationBarAppearance() @@ -182,7 +186,7 @@ final class ArticleViewController: UIViewController { pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:]) pageViewController.delegate = self - pageViewController.dataSource = self + updatePageViewControllerDataSource() // This code is to disallow paging if we scroll from the left edge. If this code is removed // PoppableGestureRecognizerDelegate will allow us to both navigate back and page back at the @@ -347,6 +351,15 @@ final class ArticleViewController: UIViewController { currentWebViewController?.fullReload() } + @objc func handleArticleSwipeNavigationEnabledDidChange(_ notification: Notification) { + updatePageViewControllerDataSource() + } + + /// A nil data source turns off swipe paging. `setViewControllers` still works. + func updatePageViewControllerDataSource() { + pageViewController.dataSource = AppDefaults.articleSwipeNavigationEnabled ? self : nil + } + @objc func willEnterForeground(_ note: Notification) { // The toolbar will come back on you if you don't hide it again if AppDefaults.logicalArticleFullscreenEnabled { @@ -402,10 +415,19 @@ final class ArticleViewController: UIViewController { coordinator.navigateToTimeline() } + @objc func scrollLineDown(_ sender: Any?) { + currentWebViewController?.scrollLineDown() + } + + @objc func scrollLineUp(_ sender: Any?) { + currentWebViewController?.scrollLineUp() + } + // MARK: API + // Focus this view controller rather than the web view, since the web view is replaced on each article change. func focus() { - currentWebViewController?.focus() + becomeFirstResponder() } func canScrollDown() -> Bool { diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 48ca738ee..39f4a0a5d 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -22,6 +22,8 @@ import Images final class WebViewController: UIViewController { + private static let arrowKeyScrollDistance: CGFloat = 60 + private struct MessageName { static let imageWasClicked = "imageWasClicked" static let imageWasShown = "imageWasShown" @@ -222,10 +224,6 @@ final class WebViewController: UIViewController { } } - func focus() { - webView?.becomeFirstResponder() - } - func canScrollDown() -> Bool { guard let webView = webView else { return false } return webView.scrollView.contentOffset.y < finalScrollPosition(scrollingUp: false) @@ -242,8 +240,16 @@ final class WebViewController: UIViewController { } let overlap = 2 * UIFont.systemFont(ofSize: UIFont.systemFontSize).lineHeight * windowScene.screen.scale + let scrollDistance = webView.scrollView.layoutMarginsGuide.layoutFrame.height - overlap + scroll(up: scrollingUp, distance: scrollDistance) + } + + private func scroll(up scrollingUp: Bool, distance scrollDistance: CGFloat) { + guard let webView else { + return + } + let scrollToY: CGFloat = { - let scrollDistance = webView.scrollView.layoutMarginsGuide.layoutFrame.height - overlap let fullScroll = webView.scrollView.contentOffset.y + (scrollingUp ? -scrollDistance : scrollDistance) let final = finalScrollPosition(scrollingUp: scrollingUp) return (scrollingUp ? fullScroll > final : fullScroll < final) ? fullScroll : final @@ -262,6 +268,14 @@ final class WebViewController: UIViewController { scrollPage(up: true) } + func scrollLineDown() { + scroll(up: false, distance: Self.arrowKeyScrollDistance) + } + + func scrollLineUp() { + scroll(up: true, distance: Self.arrowKeyScrollDistance) + } + func hideClickedImage() { webView?.evaluateJavaScript("hideClickedImage();") } diff --git a/iOS/KeyboardManager.swift b/iOS/KeyboardManager.swift index 669abca29..206fb7fee 100644 --- a/iOS/KeyboardManager.swift +++ b/iOS/KeyboardManager.swift @@ -29,8 +29,11 @@ enum KeyboardType: String, Sendable { switch type { case .sidebar: _keyCommands.append(contentsOf: KeyboardManager.hardcodeFeedKeyCommands()) - case .timeline, .detail: + case .timeline: _keyCommands.append(contentsOf: KeyboardManager.hardcodeArticleKeyCommands()) + case .detail: + _keyCommands.append(contentsOf: KeyboardManager.hardcodeArticleKeyCommands()) + _keyCommands.append(contentsOf: KeyboardManager.hardcodeDetailKeyCommands()) default: break } @@ -215,4 +218,16 @@ private extension KeyboardManager { return keys } + static func hardcodeDetailKeyCommands() -> [UIKeyCommand] { + var keys = [UIKeyCommand]() + + let scrollDownTitle = NSLocalizedString("Scroll Down", comment: "Scroll Down") + keys.append(KeyboardManager.createKeyCommand(title: scrollDownTitle, action: "scrollLineDown:", input: UIKeyCommand.inputDownArrow, modifiers: [])) + + let scrollUpTitle = NSLocalizedString("Scroll Up", comment: "Scroll Up") + keys.append(KeyboardManager.createKeyCommand(title: scrollUpTitle, action: "scrollLineUp:", input: UIKeyCommand.inputUpArrow, modifiers: [])) + + return keys + } + } diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index ba4404cb3..9e86e5455 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -1255,7 +1255,7 @@ private extension MainTimelineViewController { guard thumbnailMode != nil, ThumbnailDownloader.shared.networkAllowsDownloads else { return } - // Thumbnails that couldn’t download while offline or in Low Data Mode try again. + // Thumbnails that couldn’t download while offline try again. reloadVisibleCells() } diff --git a/iOS/RootSplitViewController.swift b/iOS/RootSplitViewController.swift index 52a425ebd..08ec5ff1b 100644 --- a/iOS/RootSplitViewController.swift +++ b/iOS/RootSplitViewController.swift @@ -13,6 +13,9 @@ final class RootSplitViewController: UISplitViewController { var coordinator: SceneCoordinator! + /// True during rotation, window resizes, and background snapshots, when UIKit changes the display mode on its own. + private(set) var isTransitioningSize = false + override var prefersStatusBarHidden: Bool { return coordinator.prefersStatusBarHidden } @@ -26,6 +29,14 @@ final class RootSplitViewController: UISplitViewController { coordinator.resetFocus() } + override func viewWillTransition(to size: CGSize, with transitionCoordinator: UIViewControllerTransitionCoordinator) { + isTransitioningSize = true + super.viewWillTransition(to: size, with: transitionCoordinator) + transitionCoordinator.animate(alongsideTransition: nil) { [weak self] _ in + self?.isTransitioningSize = false + } + } + /// Show a column for programmatic navigation. /// Pass `bypassDisplayModeRestriction: true` for user-initiated navigation, so it can /// reveal a column the display-mode suppression below would otherwise keep hidden. diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 3794e6e87..110a7a8ab 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -95,7 +95,6 @@ struct SidebarItemNode: Hashable, Sendable { var isTimelineViewControllerPending = false var isArticleViewControllerPending = false - private var hasReportedIgnoredTap = false /// `Bool` to track whether a refresh is scheduled. private var isNavigationBarSubtitleRefreshScheduled: Bool = false @@ -1242,13 +1241,11 @@ struct SidebarItemNode: Hashable, Sendable { } /// Selecting the current article while the article view isn’t showing does nothing, which is never expected. - /// Log it once per launch to the Errors log. /// private func reportIgnoredSelection(of article: Article?) { - guard let article, !hasReportedIgnoredTap, isRootSplitCollapsed, !isArticleViewControllerShowing else { + guard let article, isRootSplitCollapsed, !isArticleViewControllerShowing else { return } - hasReportedIgnoredTap = true let selectedItemCount = mainTimelineViewController?.collectionView?.indexPathsForSelectedItems?.count ?? 0 let navigationStackDepth = mainTimelineViewController?.navigationController?.viewControllers.count ?? 0 @@ -1846,7 +1843,13 @@ extension SceneCoordinator: UISplitViewControllerDelegate { } func splitViewController(_ svc: UISplitViewController, willChangeTo displayMode: UISplitViewController.DisplayMode) { - AppDefaults.splitViewPreferredDisplayMode = displayMode.rawValue + // Save only user-initiated changes. UIKit also changes the display mode during + // rotation, window resizes, and background snapshots, and those must not be saved. + // + let isSceneActive = svc.view.window?.windowScene?.activationState == .foregroundActive + if isSceneActive && !svc.isCollapsed && !rootSplitViewController.isTransitioningSize { + AppDefaults.splitViewPreferredDisplayMode = displayMode.rawValue + } mainTimelineViewController?.updateToolbarProgressView(for: displayMode) } diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 406a9b913..99603c5dc 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -552,6 +552,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -875,6 +909,7 @@ + diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index 604d55e74..f34d57136 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -56,7 +56,8 @@ final class SettingsViewController: UITableViewController { case theme = 0 case openLinksInNetNewsWire = 1 case enableJavaScript = 2 - case enableFullScreenArticles = 3 + case swipeToNextPreviousArticle = 3 + case enableFullScreenArticles = 4 } private enum HelpRow: Int { @@ -80,6 +81,7 @@ final class SettingsViewController: UITableViewController { @IBOutlet var unreadCountDisplayCell: UITableViewCell? @IBOutlet var openLinksInNetNewsWire: UISwitch! @IBOutlet var enableJavaScriptSwitch: UISwitch! + @IBOutlet var swipeToNextPreviousArticleSwitch: UISwitch? @IBOutlet var sidebarShowsIconsSwitch: UISwitch? @IBOutlet var grayscaleIconsSwitch: UISwitch? @IBOutlet var showTodayFeedSwitch: UISwitch? @@ -151,6 +153,7 @@ final class SettingsViewController: UITableViewController { } showPreviewInTimelineContextMenuSwitch?.isOn = AppDefaults.showPreviewInTimelineContextMenu + swipeToNextPreviousArticleSwitch?.isOn = AppDefaults.articleSwipeNavigationEnabled if AppDefaults.articleFullscreenAvailable { showFullscreenArticlesSwitch.isOn = true @@ -448,6 +451,10 @@ final class SettingsViewController: UITableViewController { } } + @IBAction func switchSwipeToNextPreviousArticle(_ sender: UISwitch) { + AppDefaults.articleSwipeNavigationEnabled = sender.isOn + } + @IBAction func switchJavaScriptPreference(_ sender: Any) { AppDefaults.isArticleContentJavascriptEnabled = enableJavaScriptSwitch.isOn } diff --git a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig index ec242a57b..a45f8051a 100644 --- a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig +++ b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig @@ -1,7 +1,7 @@ #include "./NetNewsWire_version.xcconfig" // High Level Settings common to both the Mac application and any extensions we bundle with it -MARKETING_VERSION = 7.3b7 +MARKETING_VERSION = 7.3b8 APP_GROUP_ID = group.$(ORGANIZATION_IDENTIFIER).NetNewsWire-Evergreen$(APP_GROUP_SUFFIX) diff --git a/xcconfig/common/NetNewsWire_version.xcconfig b/xcconfig/common/NetNewsWire_version.xcconfig index 4d5612376..321294776 100644 --- a/xcconfig/common/NetNewsWire_version.xcconfig +++ b/xcconfig/common/NetNewsWire_version.xcconfig @@ -1 +1 @@ -CURRENT_PROJECT_VERSION = 7234 +CURRENT_PROJECT_VERSION = 7236