Merge branch 'main' into main

This commit is contained in:
Brent Simmons authored and GitHub committed 2026-10-21 21:18:37 -07:00
commit bdc0c02553
119 files changed
+1843 -1213

No files matched your search

+4 -4
View File
@@ -39,8 +39,8 @@ jobs:
- name: Generate Secrets Sources
run: PROJECT_DIR="$GITHUB_WORKSPACE" ./buildscripts/updateSecrets.sh
- name: Select Xcode 26.3
run: sudo xcode-select -s /Applications/Xcode_26.3.app/Contents/Developer
- name: Select Xcode 26.6
run: sudo xcode-select -s /Applications/Xcode_26.6.app/Contents/Developer
- name: Run macOS Test Plan
shell: bash
@@ -84,8 +84,8 @@ jobs:
- name: Generate Secrets Sources
run: PROJECT_DIR="$GITHUB_WORKSPACE" ./buildscripts/updateSecrets.sh
- name: Select Xcode 26.3
run: sudo xcode-select -s /Applications/Xcode_26.3.app/Contents/Developer
- name: Select Xcode 26.6
run: sudo xcode-select -s /Applications/Xcode_26.6.app/Contents/Developer
- name: Run iOS Test Plan
shell: bash
+83
View File
@@ -6,6 +6,89 @@
<description>Most recent NetNewsWire changes with links to updates.</description>
<language>en</language>
<item>
<title>NetNewsWire 7.3b1</title>
<description><![CDATA[
<ul>
<li>Restored the status bar from NetNewsWire of Yore (NetNewsWire 1-3). Show and hide it via the View menu
</ul>
]]></description>
<pubDate>Tue, 20 Oct 2026 11:35:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.3b1/NetNewsWire7.3b1.zip" sparkle:version="7225" sparkle:shortVersionString="7.3b1" length="10048664" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2.1</title>
<description><![CDATA[
Changes since 7.2:
<ul>
<li>Fixed bug where navigated-to row, in column layout, might appear under column headers
<li>Fixed bug where scroller hiding/showing could mess up sidebar layout
<li>Added magnet as an allowed link scheme
</ul>
]]></description>
<pubDate>Tue, 20 Oct 2026 10:00:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2.1/NetNewsWire7.2.1.zip" sparkle:version="7224" sparkle:shortVersionString="7.2.1" length="10002485" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2.1b1</title>
<description><![CDATA[
<ul>
<li>Fixed bug where navigated-to row, in column layout, might appear under column headers
<li>Fixed bug where scroller hiding/showing could mess up sidebar layout
<li>Added magnet as an allowed link scheme
</ul>
]]></description>
<pubDate>Sun, 18 Oct 2026 11:40:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2.1b1/NetNewsWire7.2.1b1.zip" sparkle:version="7223" sparkle:shortVersionString="7.2.1b1" length="10002414" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2</title>
<description><![CDATA[
In case you missed 7.2b1 — note the new <code>View > Use Column Layout</code> menu item. Also note the new setting for unread counts at the top of the General (first) settings tab.
<p>
Changes since 7.2b4:
<ul>
<li>Fixed column view bug where next-unread could scroll to a row that’s hidden under the column headers
</ul>
Changes since 7.1.5:
<ul>
<li>Added unread count display setting — show the count, show a dot, or hide it — which applies to the Dock icon badge, window title, and sidebar
<li>Added column layout for the timeline — choose View > Use Column Layout
<li>Expanded View > Sort Articles By with more options (works with standard and column layouts)
<li>Made timeline sorting per window instead of one setting for the whole app
<li>Made the Add Feed sheet start with the folder or account selected in the sidebar
<li>Changed the message for adding a feed that’s already added to include the name of the folder (or folders)
<li>Fixed bug where YouTube embeds in articles showed an error instead of playing
<li>Fixed bug where embedded videos with no set height — such as Inoreader’s YouTube player — collapsed to a short strip
<li>Fixed extra whitespace at the end of Slashdot articles and paragraphs running together
<li>Fixed parsing of RSS feed titles when a feed contains a textinput section (Slashdot, for instance)
<li>Added support for the instapaper_ignore class — elements marked with it are now removed from articles
<li>Changed tabs in pre and code elements in articles to display as four spaces
<li>Improved finding feeds in a page by skipping links to PDFs, movies, and other files that can’t be feeds
<li>Changed finding a feed to use the redirected-to URL
<li>Sped up Today and unread count queries
<li>Added up to 500 characters of the HTTP error response body to Error Log entries
<li>Fixed bug where the sidebar could reopen with no width when it had been collapsed in 7.1.x
<li>Fixed a memory leak when closing a main window
<li>Fixed a possible crash when the sidebar or timeline had no visible rows
<li>Changed sorting by title and by feed to sort numbers by value — “Episode 2” comes before “Episode 10”
<li>Added support for Substack-style footnotes
<li>Improved CJK text rendering in the article view by adding text-autospace
<li>Fixed horizontal overflow of WordPress Math blocks and SVGs in the Tiqoe Dark theme
<li>Improved font sizing and fixed superscript orphans in table cells in the Tiqoe Dark theme`
</ul>
]]></description>
<pubDate>Wed, 14 Oct 2026 08:20:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2/NetNewsWire7.2.zip" sparkle:version="7222" sparkle:shortVersionString="7.2" length="10000415" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2b4</title>
<description><![CDATA[
+51
View File
@@ -6,6 +6,57 @@
<description>Most recent NetNewsWire releases (not test builds).</description>
<language>en</language>
<item>
<title>NetNewsWire 7.2.1</title>
<description><![CDATA[
Changes since 7.2:
<ul>
<li>Fixed bug where navigated-to row, in column layout, might appear under column headers
<li>Fixed bug where scroller hiding/showing could mess up sidebar layout
<li>Added magnet as an allowed link scheme
</ul>
]]></description>
<pubDate>Tue, 20 Oct 2026 10:00:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2.1/NetNewsWire7.2.1.zip" sparkle:version="7224" sparkle:shortVersionString="7.2.1" length="10002485" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2</title>
<description><![CDATA[
Changes since 7.1.5:
<ul>
<li>Added unread count display setting — show the count, show a dot, or hide it — which applies to the Dock icon badge, window title, and sidebar
<li>Added column layout for the timeline — choose View > Use Column Layout
<li>Expanded View > Sort Articles By with more options (works with standard and column layouts)
<li>Made timeline sorting per window instead of one setting for the whole app
<li>Made the Add Feed sheet start with the folder or account selected in the sidebar
<li>Changed the message for adding a feed that’s already added to include the name of the folder (or folders)
<li>Fixed bug where YouTube embeds in articles showed an error instead of playing
<li>Fixed bug where embedded videos with no set height — such as Inoreader’s YouTube player — collapsed to a short strip
<li>Fixed extra whitespace at the end of Slashdot articles and paragraphs running together
<li>Fixed parsing of RSS feed titles when a feed contains a textinput section (Slashdot, for instance)
<li>Added support for the instapaper_ignore class — elements marked with it are now removed from articles
<li>Changed tabs in pre and code elements in articles to display as four spaces
<li>Improved finding feeds in a page by skipping links to PDFs, movies, and other files that can’t be feeds
<li>Changed finding a feed to use the redirected-to URL
<li>Sped up Today and unread count queries
<li>Added up to 500 characters of the HTTP error response body to Error Log entries
<li>Fixed bug where the sidebar could reopen with no width when it had been collapsed in 7.1.x
<li>Fixed a memory leak when closing a main window
<li>Fixed a possible crash when the sidebar or timeline had no visible rows
<li>Changed sorting by title and by feed to sort numbers by value — “Episode 2” comes before “Episode 10”
<li>Added support for Substack-style footnotes
<li>Improved CJK text rendering in the article view by adding text-autospace
<li>Fixed horizontal overflow of WordPress Math blocks and SVGs in the Tiqoe Dark theme
<li>Improved font sizing and fixed superscript orphans in table cells in the Tiqoe Dark theme
</ul>
]]></description>
<pubDate>Wed, 14 Oct 2026 08:20:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2/NetNewsWire7.2.zip" sparkle:version="7222" sparkle:shortVersionString="7.2" length="10000415" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.1.5</title>
<description><![CDATA[
+41
View File
@@ -6,6 +6,47 @@
<description>Most recent NetNewsWire changes with links to updates.</description>
<language>en</language>
<item>
<title>NetNewsWire 7.3b1</title>
<description><![CDATA[
<ul>
<li>Restored the status bar from NetNewsWire of Yore (NetNewsWire 1-3). Show and hide it via the View menu
</ul>
]]></description>
<pubDate>Tue, 20 Oct 2026 11:35:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.3b1/NetNewsWire7.3b1.zip" sparkle:version="7225" sparkle:shortVersionString="7.3b1" length="10048664" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2.1</title>
<description><![CDATA[
Changes since 7.2:
<ul>
<li>Fixed bug where navigated-to row, in column layout, might appear under column headers
<li>Fixed bug where scroller hiding/showing could mess up sidebar layout
<li>Added magnet as an allowed link scheme
</ul>
]]></description>
<pubDate>Tue, 20 Oct 2026 10:00:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2.1/NetNewsWire7.2.1.zip" sparkle:version="7224" sparkle:shortVersionString="7.2.1" length="10002485" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2.1b1</title>
<description><![CDATA[
<ul>
<li>Fixed bug where navigated-to row, in column layout, might appear under column headers
<li>Fixed bug where scroller hiding/showing could mess up sidebar layout
<li>Added magnet as an allowed link scheme
</ul>
]]></description>
<pubDate>Sun, 18 Oct 2026 11:40:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-7.2.1b1/NetNewsWire7.2.1b1.zip" sparkle:version="7223" sparkle:shortVersionString="7.2.1b1" length="10002414" type="application/zip" />
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 7.2b2</title>
<description><![CDATA[
+64
View File
@@ -15,6 +15,25 @@ enum FontSize: Int {
case veryLarge = 3
}
/// What the status bar’s count text shows. Clicking the text cycles through them.
enum StatusBarCountMode: Int {
case unreadCount = 0
case foldersAndFeeds = 1
case lastRefresh = 2
/// The mode after this one when clicking. Skips the unread count when unread counts are hidden.
func next(includingUnreadCount: Bool) -> StatusBarCountMode {
switch self {
case .lastRefresh:
includingUnreadCount ? .unreadCount : .foldersAndFeeds
case .unreadCount:
.foldersAndFeeds
case .foldersAndFeeds:
.lastRefresh
}
}
}
final class AppDefaults: Sendable {
static let defaultThemeName = "Default"
@@ -31,6 +50,9 @@ final class AppDefaults: Sendable {
static let timelineSortDirection = "timelineSortDirection"
static let timelineGroupByFeed = "timelineGroupByFeed"
static let useColumnLayout = "useColumnLayout"
static let showStatusBar = "showStatusBar"
static let showStatusBarThemeMenu = "showStatusBarThemeMenu"
static let statusBarCountMode = "statusBarCountMode"
static let detailFontSize = "detailFontSize"
static let openInBrowserInBackground = "openInBrowserInBackground"
static let subscribeToFeedsInDefaultBrowser = "subscribeToFeedsInDefaultBrowser"
@@ -286,6 +308,45 @@ final class AppDefaults: Sendable {
}
}
/// The main window status bar. Applies to all windows.
var showStatusBar: Bool {
get {
AppDefaults.bool(for: Key.showStatusBar)
}
set {
AppDefaults.setBool(for: Key.showStatusBar, newValue)
}
}
/// The status bar is off by default on macOS 26 and on by default everywhere else.
private static var showStatusBarDefault: Bool {
if #available(macOS 27.0, *) {
return true
}
if #available(macOS 26.0, *) {
return false
}
return true
}
var showStatusBarThemeMenu: Bool {
get {
AppDefaults.bool(for: Key.showStatusBarThemeMenu)
}
set {
AppDefaults.setBool(for: Key.showStatusBarThemeMenu, newValue)
}
}
var statusBarCountMode: StatusBarCountMode {
get {
StatusBarCountMode(rawValue: AppDefaults.int(for: Key.statusBarCountMode)) ?? .lastRefresh
}
set {
AppDefaults.setInt(for: Key.statusBarCountMode, newValue.rawValue)
}
}
var timelineShowsSeparators: Bool {
return AppDefaults.bool(for: Key.timelineShowsSeparators)
}
@@ -344,6 +405,9 @@ final class AppDefaults: Sendable {
Key.timelineSortDirection: ComparisonResult.orderedDescending.rawValue,
Key.timelineGroupByFeed: false,
Key.useColumnLayout: false,
Key.showStatusBar: Self.showStatusBarDefault,
Key.showStatusBarThemeMenu: true,
Key.statusBarCountMode: StatusBarCountMode.lastRefresh.rawValue,
"NSScrollViewShouldScrollUnderTitlebar": false,
Key.refreshInterval: RefreshInterval.every2Hours.rawValue,
Key.showDebugMenu: showDebugMenu,
+30 -1
View File
@@ -53,6 +53,8 @@ let appName = "NetNewsWire"
@IBOutlet var debugMenuItem: NSMenuItem!
@IBOutlet var useColumnLayoutMenuItem: NSMenuItem?
@IBOutlet var showStatusBarMenuItem: NSMenuItem?
@IBOutlet var showStatusBarThemeMenuMenuItem: NSMenuItem?
@IBOutlet var checkForUpdatesMenuItem: NSMenuItem!
var unreadCount = 0 {
@@ -204,6 +206,7 @@ let appName = "NetNewsWire"
}
updateColumnLayoutMenuItem()
updateStatusBarMenuItems()
if mainWindowController == nil {
let mainWindowController = createAndShowMainWindow()
@@ -399,6 +402,7 @@ let appName = "NetNewsWire"
func userDefaultsDidChange() {
updateColumnLayoutMenuItem()
updateStatusBarMenuItems()
if lastRefreshInterval != AppDefaults.shared.refreshInterval {
refreshTimer?.update()
@@ -482,7 +486,7 @@ let appName = "NetNewsWire"
let isDisplayingSheet = mainWindowController?.isDisplayingSheet ?? false
if item.action == #selector(refreshAll(_:)) {
return !AccountManager.shared.refreshInProgress && !AccountManager.shared.activeAccounts.isEmpty
return AccountManager.shared.canRefresh
}
if item.action == #selector(importOPMLFromFile(_:)) {
@@ -501,6 +505,10 @@ let appName = "NetNewsWire"
return AccountManager.shared.hasiCloudAccount
}
if item.action == #selector(toggleStatusBarThemeMenu(_:)) {
return AppDefaults.shared.showStatusBar
}
if item.action == #selector(toggleWebInspectorEnabled(_:)) {
(item as! NSMenuItem).state = AppDefaults.shared.webInspectorEnabled ? .on : .off
}
@@ -765,6 +773,14 @@ let appName = "NetNewsWire"
AppDefaults.shared.useColumnLayout.toggle()
}
@IBAction func toggleStatusBar(_ sender: Any?) {
AppDefaults.shared.showStatusBar.toggle()
}
@IBAction func toggleStatusBarThemeMenu(_ sender: Any?) {
AppDefaults.shared.showStatusBarThemeMenu.toggle()
}
@IBAction func checkForUpdates(_ sender: Any?) {
softwareUpdater?.checkForUpdates()
}
@@ -884,6 +900,19 @@ extension AppDelegate {
useColumnLayoutMenuItem?.state = AppDefaults.shared.useColumnLayout ? .on : .off
}
@MainActor func updateStatusBarMenuItems() {
if AppDefaults.shared.showStatusBar {
showStatusBarMenuItem?.title = NSLocalizedString("Hide Status Bar", comment: "Command")
} else {
showStatusBarMenuItem?.title = NSLocalizedString("Show Status Bar", comment: "Command")
}
if AppDefaults.shared.showStatusBarThemeMenu {
showStatusBarThemeMenuMenuItem?.title = NSLocalizedString("Hide Theme Menu in Status Bar", comment: "Command")
} else {
showStatusBarThemeMenuMenuItem?.title = NSLocalizedString("Show Theme Menu in Status Bar", comment: "Command")
}
}
func importTheme(url: URL) {
guard let window = mainWindowController?.window else { return }
+6
View File
@@ -46,6 +46,12 @@ import RSWeb
static func open(_ urlString: String, inBackground: Bool) {
guard let url = URL(string: urlString), let preparedURL = url.preparedForOpeningInBrowser() else { return }
// Non-web links (mailto, magnet) go to the system handler, not a browser.
guard preparedURL.isHTTPOrHTTPSURL() else {
NSWorkspace.shared.open(preparedURL)
return
}
let configuration = NSWorkspace.OpenConfiguration()
configuration.requiresUniversalLinks = true
configuration.promptsUserIfNeeded = false
+14
View File
@@ -17,6 +17,8 @@
<outlet property="checkForUpdatesMenuItem" destination="1nF-7O-aKU" id="JmT-jc-DJ8"/>
<outlet property="debugMenuItem" destination="UqE-mp-gtV" id="OnR-lr-Zlt"/>
<outlet property="useColumnLayoutMenuItem" destination="ucL-ay-0ut" id="ucL-ou-tl1"/>
<outlet property="showStatusBarMenuItem" destination="stB-ar-mI1" id="stB-ar-oU1"/>
<outlet property="showStatusBarThemeMenuMenuItem" destination="stT-hm-mI1" id="stT-hm-oU1"/>
</connections>
</customObject>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
@@ -438,6 +440,18 @@
<action selector="toggleColumnLayout:" target="Voe-Tx-rLC" id="ucL-ac-t0n"/>
</connections>
</menuItem>
<menuItem title="Show Status Bar" id="stB-ar-mI1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleStatusBar:" target="Voe-Tx-rLC" id="stB-ar-aC1"/>
</connections>
</menuItem>
<menuItem title="Show Theme Menu in Status Bar" id="stT-hm-mI1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleStatusBarThemeMenu:" target="Voe-Tx-rLC" id="stT-hm-aC1"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="jKG-b2-ZWf"/>
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+24
View File
@@ -1963,6 +1963,30 @@
}
}
},
"stB-ar-mI1.title" : {
"comment" : "Class = \"NSMenuItem\"; title = \"Show Status Bar\"; ObjectID = \"stB-ar-mI1\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Show Status Bar"
}
}
}
},
"stT-hm-mI1.title" : {
"comment" : "Class = \"NSMenuItem\"; title = \"Show Theme Menu in Status Bar\"; ObjectID = \"stT-hm-mI1\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Show Theme Menu in Status Bar"
}
}
}
},
"Td7-aD-5lo.title" : {
"comment" : "Class = \"NSMenu\"; title = \"Window\"; ObjectID = \"Td7-aD-5lo\";",
"extractionState" : "extracted_with_value",
@@ -0,0 +1,33 @@
//
// ArticleThemesManager+Menu.swift
// NetNewsWire
//
// Created by Brent Simmons on 10/13/26.
// Copyright © 2026 Ranchero Software. All rights reserved.
//
import AppKit
extension ArticleThemesManager {
/// The default theme, a separator, then the other themes. The current theme is checked.
@MainActor func makeArticleThemeMenu() -> NSMenu {
let articleThemeMenu = NSMenu()
func addThemeItem(_ themeName: String) {
let themeItem = NSMenuItem()
themeItem.title = themeName
themeItem.action = #selector(MainWindowController.selectArticleTheme(_:))
themeItem.state = themeName == currentThemeName ? .on : .off
articleThemeMenu.addItem(themeItem)
}
addThemeItem(ArticleTheme.defaultTheme.name)
articleThemeMenu.addItem(NSMenuItem.separator())
for themeName in themeNames {
addThemeItem(themeName)
}
return articleThemeMenu
}
}
@@ -8,7 +8,7 @@
<customObject id="-2" userLabel="File's Owner" customClass="DetailViewController" customModule="NetNewsWire" customModuleProvider="target">
<connections>
<outlet property="containerView" destination="cJ9-6s-66u" id="gXc-Pz-9sQ"/>
<outlet property="statusBarView" destination="xI5-lx-RD8" id="meP-4g-U63"/>
<outlet property="linkOverlayView" destination="xI5-lx-RD8" id="meP-4g-U63"/>
<outlet property="view" destination="cJ9-6s-66u" id="Rk4-Pz-1uD"/>
</connections>
</customObject>
@@ -18,7 +18,7 @@
<rect key="frame" x="0.0" y="0.0" width="730" height="300"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<customView hidden="YES" alphaValue="0.90000000000000002" translatesAutoresizingMaskIntoConstraints="NO" id="xI5-lx-RD8" customClass="DetailStatusBarView" customModule="NetNewsWire" customModuleProvider="target">
<customView hidden="YES" alphaValue="0.90000000000000002" translatesAutoresizingMaskIntoConstraints="NO" id="xI5-lx-RD8" customClass="DetailLinkOverlayView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="6" y="2" width="12" height="20"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="850" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="Dim-ed-Dcz" userLabel="URL Label">
@@ -48,7 +48,7 @@
<constraint firstAttribute="bottom" secondItem="xI5-lx-RD8" secondAttribute="bottom" constant="2" id="zsv-B0-ChW"/>
</constraints>
<connections>
<outlet property="detailStatusBarView" destination="xI5-lx-RD8" id="yIZ-aP-fKF"/>
<outlet property="linkOverlayView" destination="xI5-lx-RD8" id="yIZ-aP-fKF"/>
</connections>
</customView>
</objects>
@@ -10,7 +10,7 @@ import AppKit
final class DetailContainerView: NSView {
@IBOutlet var detailStatusBarView: DetailStatusBarView!
@IBOutlet var linkOverlayView: DetailLinkOverlayView!
var contentViewConstraints: [NSLayoutConstraint]?
@@ -28,7 +28,7 @@ final class DetailContainerView: NSView {
if let contentView = contentView {
contentView.translatesAutoresizingMaskIntoConstraints = false
addSubview(contentView, positioned: .below, relativeTo: detailStatusBarView)
addSubview(contentView, positioned: .below, relativeTo: linkOverlayView)
// Leading and trailing follow the safe area so the article view doesn’t extend under the sidebar
// in column layout on macOS 26. Top stays at the edge: the web view handles the toolbar itself.
let constraints = [
@@ -1,5 +1,5 @@
//
// DetailStatusBarView.swift
// DetailLinkOverlayView.swift
// NetNewsWire
//
// Created by Brent Simmons on 12/16/17.
@@ -9,7 +9,7 @@
import AppKit
import Articles
final class DetailStatusBarView: NSView {
final class DetailLinkOverlayView: NSView {
@IBOutlet var urlLabel: NSTextField!
@@ -55,14 +55,14 @@ final class DetailStatusBarView: NSView {
didConfigureLayerRadius = true
}
let color = self.effectiveAppearance.isDarkMode ? NSColor.textBackgroundColor : NSColor(named: "DetailStatusBarBackground")!
let color = self.effectiveAppearance.isDarkMode ? NSColor.textBackgroundColor : NSColor(named: "DetailLinkOverlayBackground")!
layer.backgroundColor = color.cgColor
}
}
// MARK: - Private
private extension DetailStatusBarView {
private extension DetailLinkOverlayView {
func updateLinkForDisplay() {
if let mouseoverLink = mouseoverLink, !mouseoverLink.isEmpty {
@@ -20,10 +20,25 @@ enum DetailState: Equatable {
case extracted(Article, ExtractedArticle, CGFloat?)
}
@MainActor protocol DetailViewControllerDelegate: AnyObject {
func detailViewController(_ detailViewController: DetailViewController, mouseoverLinkDidChange link: String?)
}
final class DetailViewController: NSViewController, WKUIDelegate {
@IBOutlet var containerView: DetailContainerView!
@IBOutlet var statusBarView: DetailStatusBarView!
@IBOutlet var linkOverlayView: DetailLinkOverlayView!
weak var delegate: DetailViewControllerDelegate?
/// Whether the hovered link shows in the floating overlay. The delegate gets the hovered link either way.
var showsMouseoverLinkOverlay = true {
didSet {
if showsMouseoverLinkOverlay != oldValue {
updateMouseoverLinkOverlay()
}
}
}
private lazy var regularWebViewController = createWebViewController()
private var searchWebViewController: DetailWebViewController?
@@ -38,11 +53,21 @@ final class DetailViewController: NSViewController, WKUIDelegate {
if containerView.contentView === webview {
return
}
statusBarView.mouseoverLink = nil
mouseoverLink = nil
containerView.contentView = webview
}
}
private var mouseoverLink: String? {
didSet {
guard mouseoverLink != oldValue else {
return
}
updateMouseoverLinkOverlay()
delegate?.detailViewController(self, mouseoverLinkDidChange: mouseoverLink)
}
}
private var currentSourceMode: TimelineSourceMode = .regular {
didSet {
currentWebViewController = webViewController(for: currentSourceMode)
@@ -67,6 +92,7 @@ final class DetailViewController: NSViewController, WKUIDelegate {
override func viewDidLoad() {
currentWebViewController = regularWebViewController
updateMouseoverLinkOverlay()
}
// MARK: - API
@@ -126,14 +152,14 @@ extension DetailViewController: DetailWebViewControllerDelegate {
guard !link.isEmpty, detailWebViewController === currentWebViewController else {
return
}
statusBarView.mouseoverLink = link
mouseoverLink = link
}
func mouseDidExit(_ detailWebViewController: DetailWebViewController) {
guard detailWebViewController === currentWebViewController else {
return
}
statusBarView.mouseoverLink = nil
mouseoverLink = nil
}
}
@@ -141,6 +167,13 @@ extension DetailViewController: DetailWebViewControllerDelegate {
private extension DetailViewController {
func updateMouseoverLinkOverlay() {
guard isViewLoaded else {
return
}
linkOverlayView.mouseoverLink = showsMouseoverLinkOverlay ? mouseoverLink : nil
}
func createWebViewController() -> DetailWebViewController {
let controller = DetailWebViewController()
controller.delegate = self
+107 -19
View File
@@ -67,10 +67,18 @@ final class MainWindowController: NSWindowController, NSUserInterfaceValidations
didSet {
timelineContainerViewController?.showTimeline(for: timelineSourceMode)
detailViewController?.showDetail(for: timelineSourceMode)
updateStatusBarLink()
}
}
private var searchSmartFeed: SmartFeed?
private var restoreArticleWindowScrollY: CGFloat?
// Holds the split view controller and the status bar.
private let mainWindowContentViewController = MainWindowContentViewController()
private var mouseoverLink: String? {
didSet {
updateStatusBarLink()
}
}
// MARK: - NSWindowController
@@ -99,7 +107,12 @@ final class MainWindowController: NSWindowController, NSUserInterfaceValidations
timelineContainerViewController.delegate = self
self.timelineContainerViewController = timelineContainerViewController
detailViewController = DetailViewController()
let detailViewController = DetailViewController()
detailViewController.delegate = self
self.detailViewController = detailViewController
mainWindowContentViewController.statusBarView.delegate = self
updateStatusBarVisibility()
installSplitViewController(for: timelineLayout)
@@ -189,6 +202,7 @@ final class MainWindowController: NSWindowController, NSUserInterfaceValidations
if layout != timelineLayout {
installSplitViewController(for: layout)
}
updateStatusBarVisibility()
}
@objc func refreshProgressDidChange(_ note: Notification) {
@@ -732,6 +746,7 @@ extension MainWindowController: TimelineContainerViewControllerDelegate {
}
detailViewController?.setState(detailState, mode: mode)
updateStatusBarLink()
}
func timelineRequestedFeedSelection(_: TimelineContainerViewController, feed: Feed) {
@@ -855,6 +870,48 @@ extension MainWindowController: ScriptingMainWindowController {
}
}
// MARK: - DetailViewControllerDelegate
extension MainWindowController: DetailViewControllerDelegate {
func detailViewController(_ detailViewController: DetailViewController, mouseoverLinkDidChange link: String?) {
mouseoverLink = link
}
}
// MARK: - MainWindowStatusBarViewDelegate
extension MainWindowController: MainWindowStatusBarViewDelegate {
func statusBarViewGearMenu(_ statusBarView: MainWindowStatusBarView) -> NSMenu? {
guard let menu = sidebarViewController?.statusBarMenu() else {
return nil
}
var index = 0
if AccountManager.shared.canRefresh {
menu.insertItem(withTitle: NSLocalizedString("Refresh", comment: "Refresh"), action: #selector(AppDelegate.refreshAll(_:)), keyEquivalent: "", at: index)
index += 1
}
let isSidebarHidden = sidebarSplitViewItem?.isCollapsed ?? false
let sidebarTitle = isSidebarHidden ? NSLocalizedString("Show Sidebar", comment: "Command") : NSLocalizedString("Hide Sidebar", comment: "Command")
menu.insertItem(withTitle: sidebarTitle, action: #selector(NSSplitViewController.toggleSidebar(_:)), keyEquivalent: "", at: index)
menu.insertItem(NSMenuItem.separator(), at: index + 1)
return menu
}
func statusBarView(_ statusBarView: MainWindowStatusBarView, moveSidebarDividerTo position: CGFloat) {
guard let splitView = splitViewController?.splitView else {
return
}
let positionInWindow = statusBarView.convert(NSPoint(x: position, y: 0), to: nil)
let positionInSplitView = splitView.convert(positionInWindow, from: nil)
splitView.setPosition(positionInSplitView.x, ofDividerAt: 0)
}
}
// MARK: - NSToolbarDelegate
extension NSToolbarItem.Identifier {
@@ -958,7 +1015,7 @@ extension MainWindowController: NSToolbarDelegate {
let description = NSLocalizedString("Article Theme", comment: "Article Theme")
toolbarItem.toolTip = description
toolbarItem.label = description
toolbarItem.menu = makeArticleThemeMenu()
toolbarItem.menu = ArticleThemesManager.shared.makeArticleThemeMenu()
return toolbarItem
case .search:
@@ -1093,7 +1150,10 @@ private extension MainWindowController {
}
splitViewController = newSplitViewController
timelineLayout = layout
window.contentViewController = newSplitViewController
if window.contentViewController !== mainWindowContentViewController {
window.contentViewController = mainWindowContentViewController
}
mainWindowContentViewController.splitViewController = newSplitViewController
if window.frame != savedFrame && !window.styleMask.contains(.fullScreen) {
window.setFrame(savedFrame, display: false)
}
@@ -1117,6 +1177,7 @@ private extension MainWindowController {
currentTimelineViewController?.focus()
}
window.recalculateKeyViewLoop()
observeSplitViewForStatusBar()
invalidateRestorableState()
}
@@ -1787,28 +1848,55 @@ private extension MainWindowController {
guard let toolbarItem = window?.toolbar?.existingItem(withIdentifier: .articleThemeMenu) as? NSMenuToolbarItem else {
return
}
toolbarItem.menu = makeArticleThemeMenu()
toolbarItem.menu = ArticleThemesManager.shared.makeArticleThemeMenu()
}
func makeArticleThemeMenu() -> NSMenu {
let articleThemeMenu = NSMenu()
// MARK: - Status Bar
let defaultThemeItem = NSMenuItem()
defaultThemeItem.title = ArticleTheme.defaultTheme.name
defaultThemeItem.action = #selector(selectArticleTheme(_:))
defaultThemeItem.state = defaultThemeItem.title == ArticleThemesManager.shared.currentThemeName ? .on : .off
articleThemeMenu.addItem(defaultThemeItem)
/// The status bar, when showing, takes the place of the detail view’s floating link overlay and the sidebar’s progress view.
func updateStatusBarVisibility() {
let showStatusBar = AppDefaults.shared.showStatusBar
mainWindowContentViewController.isStatusBarHidden = !showStatusBar
detailViewController?.showsMouseoverLinkOverlay = !showStatusBar
sidebarViewController?.showsProgressView = !showStatusBar
}
articleThemeMenu.addItem(NSMenuItem.separator())
func updateStatusBarLink() {
mainWindowContentViewController.statusBarView.link = mouseoverLink ?? currentLink
}
for themeName in ArticleThemesManager.shared.themeNames {
let themeItem = NSMenuItem()
themeItem.title = themeName
themeItem.action = #selector(selectArticleTheme(_:))
themeItem.state = themeItem.title == ArticleThemesManager.shared.currentThemeName ? .on : .off
articleThemeMenu.addItem(themeItem)
/// Tracks the sidebar divider in the status bar. Call after the split view controller is replaced.
func observeSplitViewForStatusBar() {
NotificationCenter.default.removeObserver(self, name: NSSplitView.didResizeSubviewsNotification, object: nil)
if let splitView = splitViewController?.splitView {
NotificationCenter.default.addObserver(self, selector: #selector(handleSplitViewDidResizeSubviews(_:)), name: NSSplitView.didResizeSubviewsNotification, object: splitView)
}
updateStatusBarSidebarDivider()
}
return articleThemeMenu
@objc func handleSplitViewDidResizeSubviews(_ notification: Notification) {
updateStatusBarSidebarDivider()
}
func updateStatusBarSidebarDivider() {
let statusBarView = mainWindowContentViewController.statusBarView
guard let sidebarSplitViewItem, !sidebarSplitViewItem.isCollapsed, let splitView = splitViewController?.splitView, let sidebarPane = splitView.arrangedSubviews.first else {
statusBarView.sidebarDividerPosition = nil
return
}
// Use the split view’s sidebar pane, not the sidebar view: while the sidebar slides in,
// the sidebar view’s position lags a step behind the pane and isn’t updated after the last resize.
let dividerPositionInStatusBar = statusBarView.convert(NSPoint(x: sidebarPane.frame.maxX, y: 0), from: splitView)
// Starting with macOS 26, the content beside the sidebar extends under it, and the divider is a hairline
// at the sidebar’s trailing edge. Before that, the divider follows the sidebar.
let arrangedSubviews = splitView.arrangedSubviews
if arrangedSubviews.count > 1 {
let contentExtendsUnderSidebar = arrangedSubviews[1].frame.minX < sidebarPane.frame.maxX
let hairline = 1 / (window?.backingScaleFactor ?? 1)
statusBarView.sidebarDividerLineOffset = contentExtendsUnderSidebar ? -hairline : 0
statusBarView.sidebarDividerLineWidth = contentExtendsUnderSidebar ? hairline : splitView.dividerThickness
}
statusBarView.sidebarDividerPosition = dividerPositionInStatusBar.x
}
}
@@ -8,6 +8,7 @@
<customObject id="-2" userLabel="File's Owner" customClass="SidebarViewController" customModule="NetNewsWire" customModuleProvider="target">
<connections>
<outlet property="outlineView" destination="cnV-kg-Dn2" id="FVf-OT-E3h"/>
<outlet property="progressView" destination="HZs-Zf-G8s" id="sSb-Vw-oT1"/>
<outlet property="view" destination="bJZ-bH-vgc" id="aQe-8r-Wm3"/>
</connections>
</customObject>
@@ -88,7 +89,7 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="HZs-Zf-G8s" customClass="SidebarStatusBarView" customModule="NetNewsWire" customModuleProvider="target">
<customView translatesAutoresizingMaskIntoConstraints="NO" id="HZs-Zf-G8s" customClass="SidebarProgressView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="-28" width="240" height="28"/>
<subviews>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="agw-l1-HkL">
+1 -19
View File
@@ -107,7 +107,7 @@ final class SidebarCell: NSTableCellView {
guard let cellAppearance = cellAppearance else {
return
}
let layout = SidebarCellLayout(appearance: cellAppearance, cellSize: bounds.size, trailingEdge: trailingEdge(), shouldShowImage: shouldShowImage, textField: titleView, unreadCountView: unreadCountView)
let layout = SidebarCellLayout(appearance: cellAppearance, cellSize: bounds.size, shouldShowImage: shouldShowImage, textField: titleView, unreadCountView: unreadCountView)
layoutWith(layout)
}
@@ -139,24 +139,6 @@ private extension SidebarCell {
view.translatesAutoresizingMaskIntoConstraints = false
}
// Ask the outline view for the cell frame instead of trusting
// the cell's own width, which can be stale while the outline view is tiling.
func trailingEdge() -> CGFloat {
var view = superview
while let currentView = view {
if let outlineView = currentView as? NSOutlineView {
let row = outlineView.row(for: self)
if row < 0 {
return bounds.maxX
}
let cellFrame = outlineView.frameOfCell(atColumn: 0, row: row)
return convert(NSPoint(x: cellFrame.maxX, y: 0), from: outlineView).x
}
view = currentView.superview
}
return bounds.maxX
}
func layoutWith(_ layout: SidebarCellLayout) {
faviconImageView.setFrameIfNotEqual(layout.faviconRect)
titleView.setFrameIfNotEqual(layout.titleRect)
@@ -16,9 +16,8 @@ import RSCore
let titleRect: CGRect
let unreadCountRect: CGRect
init(appearance: SidebarCellAppearance, cellSize: NSSize, trailingEdge: CGFloat, shouldShowImage: Bool, textField: NSTextField, unreadCountView: UnreadCountView) {
init(appearance: SidebarCellAppearance, cellSize: NSSize, shouldShowImage: Bool, textField: NSTextField, unreadCountView: UnreadCountView) {
let bounds = NSRect(x: 0.0, y: 0.0, width: floor(cellSize.width), height: floor(cellSize.height))
let maxX = floor(trailingEdge)
var rFavicon = NSRect.zero
if shouldShowImage {
@@ -41,7 +40,7 @@ import RSCore
var rUnread = NSRect.zero
if !unreadCountIsHidden {
rUnread.size = unreadCountSize
rUnread.origin.x = maxX - unreadCountSize.width
rUnread.origin.x = bounds.maxX - unreadCountSize.width
rUnread = rUnread.centeredVertically(in: bounds)
let textFieldMaxX = rUnread.minX - appearance.unreadCountMarginLeft
if rTextField.maxX > textFieldMaxX {
@@ -50,8 +49,8 @@ import RSCore
}
self.unreadCountRect = rUnread
if rTextField.maxX > maxX {
rTextField.size.width = maxX - rTextField.minX
if rTextField.maxX > bounds.maxX {
rTextField.size.width = bounds.maxX - rTextField.minX
}
self.titleRect = rTextField
}
@@ -1,5 +1,5 @@
//
// SidebarStatusBarView.swift
// SidebarProgressView.swift
// NetNewsWire
//
// Created by Brent Simmons on 9/17/16.
@@ -12,12 +12,24 @@ import Articles
import RSWeb
import Account
final class SidebarStatusBarView: NSView {
final class SidebarProgressView: NSView {
@IBOutlet var progressIndicator: NSProgressIndicator!
@IBOutlet var progressLabel: NSTextField!
@IBOutlet var bottomConstraint: NSLayoutConstraint!
@IBOutlet var heightConstraint: NSLayoutConstraint!
/// When true, the view stays hidden and shows no progress.
/// When collapsed, this view sits just below the sidebar, unclipped — where the main window status bar is.
/// Its separator would double the status bar’s top line, so it’s hidden while suppressed.
var isSuppressed = false {
didSet {
if isSuppressed != oldValue {
isHidden = isSuppressed
updateUI()
}
}
}
private var isAnimatingProgress = false
nonisolated override var isFlipped: Bool {
@@ -50,7 +62,7 @@ final class SidebarStatusBarView: NSView {
}
}
private extension SidebarStatusBarView {
private extension SidebarProgressView {
// MARK: Progress
@@ -69,7 +81,7 @@ private extension SidebarStatusBarView {
superview?.layoutSubtreeIfNeeded()
NSAnimationContext.runAnimationGroup { context in
context.duration = SidebarStatusBarView.animationDuration
context.duration = SidebarProgressView.animationDuration
context.allowsImplicitAnimation = true
bottomConstraint.constant = -(heightConstraint.constant)
superview?.layoutSubtreeIfNeeded()
@@ -89,7 +101,7 @@ private extension SidebarStatusBarView {
superview?.layoutSubtreeIfNeeded()
NSAnimationContext.runAnimationGroup { context in
context.duration = SidebarStatusBarView.animationDuration
context.duration = SidebarProgressView.animationDuration
context.allowsImplicitAnimation = true
bottomConstraint.constant = 0
superview?.layoutSubtreeIfNeeded()
@@ -100,7 +112,7 @@ private extension SidebarStatusBarView {
let progressInfo = CombinedRefreshProgress.shared.progressInfo
if progressInfo.isComplete {
if progressInfo.isComplete || isSuppressed {
stopProgressIfNeeded()
return
}
@@ -41,6 +41,27 @@ extension SidebarViewController {
return nil
}
}
/// The status bar gear menu: New Feed and New Folder, then the contextual menu for the selection —
/// under a disabled item naming the selection, with its commands indented.
func statusBarMenu() -> NSMenu {
let statusBarMenu = menuForNoSelection()
let objects = selectedObjects
guard !objects.isEmpty, let selectionMenu = menu(for: objects), selectionMenu.numberOfItems > 0 else {
return statusBarMenu
}
statusBarMenu.addItem(NSMenuItem.separator())
let headerItem = NSMenuItem(title: statusBarMenuHeaderTitle(for: objects), action: nil, keyEquivalent: "")
headerItem.isEnabled = false
statusBarMenu.addItem(headerItem)
for item in selectionMenu.items {
item.indentationLevel = Self.statusBarMenuIndentationLevel
}
statusBarMenu.takeItems(from: selectionMenu)
return statusBarMenu
}
}
// MARK: Contextual Menu Actions
@@ -193,6 +214,25 @@ extension SidebarViewController: RenameWindowControllerDelegate {
private extension SidebarViewController {
static let statusBarMenuIndentationLevel = 1
/// The name of the one selected item, or a description of a multiple selection.
func statusBarMenuHeaderTitle(for objects: [AnyObject]) -> String {
if objects.count == 1, let displayNameProvider = objects.first as? DisplayNameProvider {
return displayNameProvider.nameForDisplay
}
if objects.allSatisfy({ $0 is Feed }) {
return NSLocalizedString("Multiple feeds", comment: "Status bar gear menu: header for a selection of several feeds")
}
if objects.allSatisfy({ $0 is Folder }) {
return NSLocalizedString("Multiple folders", comment: "Status bar gear menu: header for a selection of several folders")
}
if objects.allSatisfy({ $0 is PseudoFeed }) {
return NSLocalizedString("Multiple smart feeds", comment: "Status bar gear menu: header for a selection of several smart feeds")
}
return NSLocalizedString("Multiple selection", comment: "Status bar gear menu: header for a selection of different kinds of items")
}
func menuForNoSelection() -> NSMenu {
let menu = NSMenu(title: "")
@@ -26,9 +26,17 @@ extension Notification.Name {
@objc final class SidebarViewController: NSViewController, NSOutlineViewDelegate, NSMenuDelegate, UndoableCommandRunner {
@IBOutlet var outlineView: SidebarOutlineView!
@IBOutlet var progressView: SidebarProgressView?
weak var delegate: SidebarDelegate?
/// False when the main window status bar takes over refresh progress.
var showsProgressView = true {
didSet {
progressView?.isSuppressed = !showsProgressView
}
}
weak var splitViewItem: NSSplitViewItem?
var windowState: SidebarWindowState {
@@ -84,6 +92,7 @@ extension Notification.Name {
}
override func viewDidLoad() {
progressView?.isSuppressed = !showsProgressView
outlineView.keyboardDelegate = keyboardDelegate
outlineView.dataSource = dataSource
outlineView.doubleAction = #selector(doubleClickedSidebar(_:))
@@ -105,6 +114,11 @@ extension Notification.Name {
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil)
DistributedNotificationCenter.default().addObserver(self, selector: #selector(appleSideBarDefaultIconSizeChanged(_:)), name: .appleSideBarDefaultIconSizeChanged, object: nil)
if let clipView = outlineView.enclosingScrollView?.contentView {
clipView.postsFrameChangedNotifications = true
NotificationCenter.default.addObserver(self, selector: #selector(handleClipViewFrameDidChange(_:)), name: NSView.frameDidChangeNotification, object: clipView)
}
outlineView.reloadData()
// Expand top level items by default. If there is state to restore, overlay this.
@@ -232,6 +246,10 @@ extension Notification.Name {
}
}
@objc func handleClipViewFrameDidChange(_ notification: Notification) {
fitOutlineViewToVisibleWidth()
}
@objc func containerChildrenDidChange(_ note: Notification) {
rebuildTreeAndRestoreSelection()
}
@@ -572,6 +590,22 @@ extension SidebarViewController: NSUserInterfaceValidations {
private extension SidebarViewController {
/// The outline view doesn’t resize its rows when the scroller appears or disappears,
/// which leaves the selection highlight at a stale width.
/// <https://github.com/Ranchero-Software/NetNewsWire/issues/5487>
func fitOutlineViewToVisibleWidth() {
guard let scrollView = outlineView.enclosingScrollView else {
return
}
let contentInsets = scrollView.contentInsets
let visibleWidth = scrollView.contentView.bounds.width - contentInsets.left - contentInsets.right
guard visibleWidth > 0, outlineView.frame.width != visibleWidth else {
return
}
outlineView.setFrameSize(NSSize(width: visibleWidth, height: outlineView.frame.height))
outlineView.sizeLastColumnToFit()
}
var accountNodes: [Account] {
return treeController.rootNode.childNodes.compactMap { $0.representedObject as? Account }
}
@@ -0,0 +1,88 @@
//
// MainWindowContentViewController.swift
// NetNewsWire
//
// Created by Brent Simmons on 10/11/26.
// Copyright © 2026 Ranchero Software. All rights reserved.
//
import AppKit
/// The main window’s content where the status bar is available: the split view controller above the status bar.
/// The split view controller is swapped when the timeline layout changes. The status bar stays.
final class MainWindowContentViewController: NSViewController {
let statusBarView = MainWindowStatusBarView()
var splitViewController: NSSplitViewController? {
didSet {
if splitViewController !== oldValue {
replaceSplitViewController(oldValue)
}
}
}
var isStatusBarHidden = false {
didSet {
if isStatusBarHidden != oldValue {
updateStatusBarVisibility()
}
}
}
private var splitViewBottomToStatusBarConstraint: NSLayoutConstraint?
private var splitViewBottomToEdgeConstraint: NSLayoutConstraint?
override func loadView() {
view = NSView()
statusBarView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(statusBarView)
NSLayoutConstraint.activate([
statusBarView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
statusBarView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
statusBarView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
])
}
}
// MARK: - Private
private extension MainWindowContentViewController {
func replaceSplitViewController(_ oldSplitViewController: NSSplitViewController?) {
if let oldSplitViewController {
oldSplitViewController.view.removeFromSuperview()
oldSplitViewController.removeFromParent()
}
splitViewBottomToStatusBarConstraint = nil
splitViewBottomToEdgeConstraint = nil
guard let splitViewController else {
return
}
addChild(splitViewController)
let splitView = splitViewController.view
splitView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(splitView, positioned: .below, relativeTo: statusBarView)
splitViewBottomToStatusBarConstraint = splitView.bottomAnchor.constraint(equalTo: statusBarView.topAnchor)
splitViewBottomToEdgeConstraint = splitView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
NSLayoutConstraint.activate([
splitView.topAnchor.constraint(equalTo: view.topAnchor),
splitView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
splitView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
updateStatusBarVisibility()
}
func updateStatusBarVisibility() {
statusBarView.isHidden = isStatusBarHidden
// Deactivate before activating so the two bottom constraints never conflict.
splitViewBottomToStatusBarConstraint?.isActive = false
splitViewBottomToEdgeConstraint?.isActive = false
let activeConstraint = isStatusBarHidden ? splitViewBottomToEdgeConstraint : splitViewBottomToStatusBarConstraint
activeConstraint?.isActive = true
}
}
@@ -0,0 +1,526 @@
//
// MainWindowStatusBarView.swift
// NetNewsWire
//
// Created by Brent Simmons on 10/11/26.
// Copyright © 2026 Ranchero Software. All rights reserved.
//
import AppKit
import Account
import RSCore
@MainActor protocol MainWindowStatusBarViewDelegate: AnyObject {
func statusBarViewGearMenu(_ statusBarView: MainWindowStatusBarView) -> NSMenu?
/// `position` is in the status bar’s coordinates.
func statusBarView(_ statusBarView: MainWindowStatusBarView, moveSidebarDividerTo position: CGFloat)
}
/// The bar along the bottom of the main window: gear menu, count, sidebar grip, article link, theme menu.
/// The left section lines up with the sidebar, and the sidebar divider continues down through the bar. Dragging at the divider moves it.
/// Subviews are laid out manually in `layout()`.
final class MainWindowStatusBarView: NSView {
weak var delegate: MainWindowStatusBarViewDelegate?
/// The link to show — the hovered link or the selected article’s link.
var link: String? {
didSet {
if link != oldValue {
updateLinkLabel()
}
}
}
/// Where the split view draws the divider line, relative to `sidebarDividerPosition`, and how wide.
/// The line through the bar uses these so it lines up with the divider above it.
var sidebarDividerLineOffset: CGFloat = 0 {
didSet {
needsDisplay = true
}
}
var sidebarDividerLineWidth: CGFloat = 1 {
didSet {
needsDisplay = true
}
}
/// The sidebar divider’s x position in this view’s coordinates, or nil when the sidebar is collapsed.
var sidebarDividerPosition: CGFloat? {
didSet {
if sidebarDividerPosition != oldValue {
// With the sidebar collapsed, the left section is just the gear and progress.
splitHandleView.isHidden = sidebarDividerPosition == nil
countLabel.isHidden = sidebarDividerPosition == nil
needsLayout = true
needsDisplay = true
}
}
}
// Measured from the mockup: 32 points including the top line.
static let height: CGFloat = 32
private let gearButton = StatusBarGearButton()
private let progressIndicator = NSProgressIndicator()
private let countLabel = NSTextField(labelWithString: "")
private let splitHandleView = StatusBarSplitHandleView()
private let linkLabel = NSTextField(labelWithString: "")
private let themePopUpButton = NSPopUpButton(frame: .zero, pullsDown: false)
private var dragStartDividerPosition: CGFloat?
private static let fontSize: CGFloat = 12
private static let topLineThickness: CGFloat = 1
private static let leadingMargin: CGFloat = 15
// The standard window-edge margin, applied to the theme pop-up button’s alignment rect. It keeps the
// button clear of the window’s bottom-right resize area.
private static let trailingMargin: CGFloat = 20
private static let spacingAfterGear: CGFloat = 12
// The count’s clickable area ends this far before the sidebar’s edge.
private static let countClickAreaTrailingInset: CGFloat = 20
// With the sidebar collapsed, the left section ends this far after its last item.
private static let leftSectionTrailingInsetWithoutSidebar: CGFloat = 6
private static let progressSpacing: CGFloat = 6
// The text field has its own inset, so the link’s text starts 13 points after the divider.
private static let spacingAfterDivider: CGFloat = 12.5
private static let spacingBeforeThemeMenu: CGFloat = 8
private static let progressIndicatorWidth: CGFloat = 40
private static let topLineColor = dynamicColor(lightWhite: 224 / 255, darkWhite: 0.1)
// Lighter than the grip, close to the system’s sidebar divider above the bar.
private static let dividerColor = dynamicColor(lightWhite: 204 / 255, darkWhite: 0.28)
private static let gripColor = dynamicColor(lightWhite: 180 / 255, darkWhite: 0.35)
// The ||| grip: three hairlines, the last one 6.5 points before the divider.
private static let gripLineCount = 3
private static let gripLineInterval: CGFloat = 5
private static let gripLineHeight: CGFloat = 12
private static let gripTrailingInset: CGFloat = 6.5
// The drag area covers the grip and extends past the divider.
private static let dragAreaReachBeforeDivider: CGFloat = 17
private static let dragAreaReachAfterDivider: CGFloat = 6
private static let textColor = dynamicColor(lightWhite: 44 / 255, darkWhite: 0.85)
private static let gradient = NSGradient(starting: dynamicColor(lightWhite: 217 / 255, darkWhite: 0.17), ending: dynamicColor(lightWhite: 242 / 255, darkWhite: 0.22))
// Bottom to top, so the gradient starts with the darker color at the bottom.
private static let gradientAngle: CGFloat = 90
/// The etched look: a light line just below the text and icons. In dark mode, a dark line.
static let etchedShadow: NSShadow = {
let shadow = NSShadow()
shadow.shadowOffset = NSSize(width: 0, height: -1)
shadow.shadowBlurRadius = 0
shadow.shadowColor = NSColor(name: nil) { appearance in
isDark(appearance) ? NSColor(white: 0, alpha: 0.5) : NSColor(white: 1, alpha: 0.65)
}
return shadow
}()
override init(frame frameRect: NSRect) {
super.init(frame: frameRect)
commonInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
override var isOpaque: Bool {
true
}
override func layout() {
super.layout()
// The content area is everything below the top line.
let contentHeight = bounds.height - Self.topLineThickness
gearButton.frame = NSRect(x: Self.leadingMargin, y: 0, width: gearButton.intrinsicContentSize.width, height: contentHeight)
var leftContentMaxX = gearButton.frame.maxX
var x = leftContentMaxX + Self.spacingAfterGear
if !progressIndicator.isHidden {
leftContentMaxX = place(progressIndicator, x: x, width: Self.progressIndicatorWidth, contentHeight: contentHeight).maxX
x = leftContentMaxX + Self.progressSpacing
}
// The count shows only with the sidebar. It fills the space up to the grip, so all of it is clickable.
if let sidebarDividerPosition {
let countMaxX = sidebarDividerPosition - Self.countClickAreaTrailingInset
place(countLabel, x: x, width: countMaxX - x, contentHeight: contentHeight)
}
let leftSectionMaxX = sidebarDividerPosition ?? leftContentMaxX + Self.leftSectionTrailingInsetWithoutSidebar
splitHandleView.frame = NSRect(x: leftSectionMaxX - Self.dragAreaReachBeforeDivider, y: 0, width: Self.dragAreaReachBeforeDivider + Self.dragAreaReachAfterDivider, height: contentHeight)
var linkMaxX = bounds.maxX - Self.trailingMargin
if !themePopUpButton.isHidden {
let themeWidth = themePopUpButton.intrinsicContentSize.width
linkMaxX = place(themePopUpButton, x: bounds.maxX - Self.trailingMargin - themeWidth, width: themeWidth, contentHeight: contentHeight).minX - Self.spacingBeforeThemeMenu
}
let linkX = leftSectionMaxX + Self.spacingAfterDivider
place(linkLabel, x: linkX, width: linkMaxX - linkX, contentHeight: contentHeight)
}
override func draw(_ dirtyRect: NSRect) {
// Draw within bounds only: views don’t clip to bounds by default, and dirtyRect can extend past them.
if let gradient = Self.gradient {
gradient.draw(in: bounds, angle: Self.gradientAngle)
}
Self.topLineColor.setFill()
NSRect(x: bounds.minX, y: bounds.maxY - Self.topLineThickness, width: bounds.width, height: Self.topLineThickness).fill()
// The sidebar divider continues through the bar as a hairline, with the ||| grip just before it.
guard let sidebarDividerPosition else {
return
}
Self.dividerColor.setFill()
let hairline = 1 / (window?.backingScaleFactor ?? 1)
let dividerX = sidebarDividerPosition + sidebarDividerLineOffset
let contentHeight = bounds.height - Self.topLineThickness
NSRect(x: dividerX, y: bounds.minY, width: sidebarDividerLineWidth, height: contentHeight).fill()
Self.gripColor.setFill()
let gripY = floor((contentHeight - Self.gripLineHeight) / 2)
for index in 0..<Self.gripLineCount {
let distanceFromLastLine = CGFloat(Self.gripLineCount - 1 - index) * Self.gripLineInterval
let x = dividerX - Self.gripTrailingInset - distanceFromLastLine
NSRect(x: x, y: gripY, width: hairline, height: Self.gripLineHeight).fill()
}
}
override func viewDidChangeEffectiveAppearance() {
super.viewDidChangeEffectiveAppearance()
updateThemePopUpButtonShadow()
}
// MARK: - Notifications
@objc func handleUnreadCountDidChange(_ notification: Notification) {
CoalescingQueue.standard.add(self, #selector(updateCountLabel))
}
@objc func handleUnreadCountDisplaySettingDidChange(_ notification: Notification) {
updateCountLabel()
}
@objc func handleAccountChildrenDidChange(_ notification: Notification) {
CoalescingQueue.standard.add(self, #selector(updateCountLabel))
}
@objc func handleProgressInfoDidChange(_ notification: Notification) {
CoalescingQueue.standard.add(self, #selector(updateCountLabel))
}
// The last refresh time shows the date only when it’s not today, so it changes at midnight.
@objc func handleCalendarDayChanged(_ notification: Notification) {
updateCountLabel()
}
@objc func handleCurrentLocaleDidChange(_ notification: Notification) {
updateCountLabel()
}
@objc func handleSystemTimeZoneDidChange(_ notification: Notification) {
updateCountLabel()
}
@objc func handleArticleThemeNamesDidChange(_ notification: Notification) {
updateThemePopUpButton()
}
@objc func handleCurrentArticleThemeDidChange(_ notification: Notification) {
updateThemePopUpButton()
}
@objc nonisolated func handleUserDefaultsDidChange(_ notification: Notification) {
Task { @MainActor in
CoalescingQueue.standard.add(self, #selector(self.updateCountLabel))
self.updateThemePopUpButtonVisibility()
}
}
// MARK: - Actions
@objc func copyLink(_ sender: Any?) {
guard let link, !link.isEmpty else {
return
}
URLPasteboardWriter.write(urlStrings: [link], to: .general)
}
/// While refreshing, the label shows progress, and a click opens the Current Activity window. Otherwise a click toggles the count mode.
@objc func countLabelClicked(_ sender: Any?) {
if CombinedRefreshProgress.shared.progressInfo.isComplete {
AppDefaults.shared.statusBarCountMode = effectiveCountMode.next(includingUnreadCount: Self.showsUnreadCounts)
} else {
showActivityWindow(sender)
}
}
@objc func showActivityWindow(_ sender: Any?) {
NSApp.sendAction(#selector(AppDelegate.showActivityWindow(_:)), to: nil, from: self)
}
}
// MARK: - NSMenuItemValidation
extension MainWindowStatusBarView: NSMenuItemValidation {
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
guard menuItem.action == #selector(copyLink(_:)) else {
return true
}
guard let link else {
return false
}
return !link.isEmpty
}
}
// MARK: - StatusBarGearButtonDelegate
extension MainWindowStatusBarView: StatusBarGearButtonDelegate {
func gearButtonMenu(_ gearButton: StatusBarGearButton) -> NSMenu? {
delegate?.statusBarViewGearMenu(self)
}
}
// MARK: - StatusBarSplitHandleViewDelegate
extension MainWindowStatusBarView: StatusBarSplitHandleViewDelegate {
func splitHandleViewDidBeginDragging(_ splitHandleView: StatusBarSplitHandleView) {
dragStartDividerPosition = sidebarDividerPosition
}
func splitHandleView(_ splitHandleView: StatusBarSplitHandleView, didDragBy distance: CGFloat) {
guard let dragStartDividerPosition else {
return
}
delegate?.statusBarView(self, moveSidebarDividerTo: dragStartDividerPosition + distance)
}
}
// MARK: - Private
private extension MainWindowStatusBarView {
func commonInit() {
heightAnchor.constraint(equalToConstant: Self.height).isActive = true
// A labeled group, so VoiceOver can find the bar and move through its controls.
setAccessibilityElement(true)
setAccessibilityRole(.group)
setAccessibilityLabel(NSLocalizedString("Status Bar", comment: "Main window status bar accessibility label"))
gearButton.delegate = self
progressIndicator.style = .bar
progressIndicator.controlSize = .small
progressIndicator.isIndeterminate = false
progressIndicator.isHidden = true
countLabel.isHidden = true
progressIndicator.addGestureRecognizer(NSClickGestureRecognizer(target: self, action: #selector(showActivityWindow(_:))))
countLabel.addGestureRecognizer(NSClickGestureRecognizer(target: self, action: #selector(countLabelClicked(_:))))
linkLabel.menu = makeLinkMenu()
splitHandleView.delegate = self
splitHandleView.isHidden = true
themePopUpButton.isBordered = false
themePopUpButton.controlSize = .small
themePopUpButton.font = NSFont.systemFont(ofSize: Self.fontSize)
let themeDescription = NSLocalizedString("Article Theme", comment: "Article Theme")
themePopUpButton.setAccessibilityLabel(themeDescription)
themePopUpButton.toolTip = themeDescription
updateThemePopUpButtonShadow()
// The split handle is added last so it’s on top: it straddles the left section’s edge.
for view in [gearButton, progressIndicator, countLabel, linkLabel, themePopUpButton, splitHandleView] {
addSubview(view)
}
addObservers()
updateCountLabel()
updateLinkLabel()
updateThemePopUpButton()
}
func addObservers() {
NotificationCenter.default.addObserver(self, selector: #selector(handleUnreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleUnreadCountDidChange(_:)), name: .UnreadCountDidInitialize, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleUnreadCountDisplaySettingDidChange(_:)), name: .unreadCountDisplaySettingDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleAccountChildrenDidChange(_:)), name: .ChildrenDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleAccountChildrenDidChange(_:)), name: .BatchUpdateDidPerform, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleAccountChildrenDidChange(_:)), name: .UserDidAddAccount, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleAccountChildrenDidChange(_:)), name: .UserDidDeleteAccount, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleAccountChildrenDidChange(_:)), name: .AccountStateDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleProgressInfoDidChange(_:)), name: .progressInfoDidChange, object: CombinedRefreshProgress.shared)
NotificationCenter.default.addObserver(self, selector: #selector(handleCalendarDayChanged(_:)), name: .NSCalendarDayChanged, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleCurrentLocaleDidChange(_:)), name: NSLocale.currentLocaleDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleSystemTimeZoneDidChange(_:)), name: .NSSystemTimeZoneDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleArticleThemeNamesDidChange(_:)), name: .ArticleThemeNamesDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleCurrentArticleThemeDidChange(_:)), name: .CurrentArticleThemeDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleUserDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
}
static func isDark(_ appearance: NSAppearance) -> Bool {
appearance.bestMatch(from: [.aqua, .darkAqua]) == .darkAqua
}
static func dynamicColor(lightWhite: CGFloat, darkWhite: CGFloat) -> NSColor {
NSColor(name: nil) { appearance in
let white = isDark(appearance) ? darkWhite : lightWhite
return NSColor(srgbRed: white, green: white, blue: white, alpha: 1)
}
}
/// Etched text, as in the count and the link.
static func etchedString(_ string: String, font: NSFont, lineBreakMode: NSLineBreakMode) -> NSAttributedString {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineBreakMode = lineBreakMode
let attributes: [NSAttributedString.Key: Any] = [
.font: font,
.foregroundColor: textColor,
.shadow: etchedShadow,
.paragraphStyle: paragraphStyle
]
return NSAttributedString(string: string, attributes: attributes)
}
/// Positions a view by its alignment rect — as Auto Layout would, so text fields’ built-in insets aren’t counted —
/// vertically centered in the content area and aligned to device pixels. Returns the alignment rect.
@discardableResult
func place(_ view: NSView, x: CGFloat, width: CGFloat, contentHeight: CGFloat) -> NSRect {
let height = view.intrinsicContentSize.height
let alignmentRect = NSRect(x: x, y: (contentHeight - height) / 2, width: max(width, 0), height: height)
view.frame = backingAlignedRect(view.frame(forAlignmentRect: alignmentRect), options: .alignAllEdgesNearest)
return alignmentRect
}
// MARK: - Count
@objc func updateCountLabel() {
let progressInfo = CombinedRefreshProgress.shared.progressInfo
progressIndicator.isHidden = progressInfo.isComplete
if progressInfo.isComplete {
setCountText(countText())
} else {
progressIndicator.maxValue = Double(progressInfo.numberOfTasks)
progressIndicator.doubleValue = Double(progressInfo.numberCompleted)
let formatString = NSLocalizedString("%@ of %@", comment: "Status bar progress")
setCountText(String(format: formatString, NSNumber(value: progressInfo.numberCompleted), NSNumber(value: progressInfo.numberOfTasks)))
}
needsLayout = true
}
func setCountText(_ text: String) {
let font = NSFont.monospacedDigitSystemFont(ofSize: Self.fontSize, weight: .regular)
countLabel.attributedStringValue = Self.etchedString(text, font: font, lineBreakMode: .byTruncatingTail)
}
static var showsUnreadCounts: Bool {
AppDefaults.shared.unreadCountDisplay == .count
}
/// The saved mode, except that the unread count becomes the last refresh time when unread counts are hidden (hidden or a dot).
var effectiveCountMode: StatusBarCountMode {
let mode = AppDefaults.shared.statusBarCountMode
if mode == .unreadCount && !Self.showsUnreadCounts {
return .lastRefresh
}
return mode
}
func countText() -> String {
switch effectiveCountMode {
case .lastRefresh:
guard let lastRefreshDate = AccountManager.shared.lastRefreshCompletedDate else {
return NSLocalizedString("Not updated yet", comment: "Status bar: no refresh has completed yet")
}
let formatString = NSLocalizedString("Updated %@", comment: "Updated")
return String(format: formatString, Self.lastRefreshDateString(lastRefreshDate))
case .unreadCount:
let formatString = NSLocalizedString("%d unread", comment: "Unread")
return String.localizedStringWithFormat(formatString, AccountManager.shared.unreadCount)
case .foldersAndFeeds:
let accounts = AccountManager.shared.activeAccounts
let folderCount = accounts.reduce(0) { $0 + ($1.folders?.count ?? 0) }
let feedCount = accounts.reduce(0) { $0 + $1.flattenedFeeds().count }
let attributedString = AttributedString(localized: "^[\(folderCount) folder](inflect: true), ^[\(feedCount) feed](inflect: true)", comment: "Status bar: number of folders and feeds")
return String(attributedString.characters)
}
}
/// Just the time when it’s today, otherwise the date and time — in the user’s locale.
static func lastRefreshDateString(_ date: Date) -> String {
if Calendar.current.isDateInToday(date) {
return date.formatted(date: .omitted, time: .shortened)
}
return date.formatted(date: .numeric, time: .shortened)
}
// MARK: - Link
/// The link’s contextual menu. Copy copies the whole link, with its scheme.
func makeLinkMenu() -> NSMenu {
let menu = NSMenu()
let copyItem = NSMenuItem(title: NSLocalizedString("Copy", comment: "Command"), action: #selector(copyLink(_:)), keyEquivalent: "")
copyItem.target = self
menu.addItem(copyItem)
return menu
}
func updateLinkLabel() {
guard let link, !link.isEmpty else {
linkLabel.stringValue = ""
linkLabel.toolTip = nil
return
}
let font = NSFont.systemFont(ofSize: Self.fontSize)
linkLabel.attributedStringValue = Self.etchedString(link.strippingHTTPOrHTTPSScheme, font: font, lineBreakMode: .byTruncatingMiddle)
linkLabel.toolTip = link
}
// MARK: - Theme
func updateThemePopUpButton() {
themePopUpButton.menu = ArticleThemesManager.shared.makeArticleThemeMenu()
themePopUpButton.selectItem(withTitle: ArticleThemesManager.shared.currentThemeName)
updateThemePopUpButtonVisibility()
}
/// Etches the pop-up button’s title and arrows. A view’s shadow doesn’t follow appearance changes, so it’s resolved here.
func updateThemePopUpButtonShadow() {
let shadow = NSShadow()
// A view’s shadow offset is in its own coordinates, and the pop-up button is flipped.
let offset = Self.etchedShadow.shadowOffset
shadow.shadowOffset = NSSize(width: offset.width, height: themePopUpButton.isFlipped ? -offset.height : offset.height)
shadow.shadowBlurRadius = Self.etchedShadow.shadowBlurRadius
effectiveAppearance.performAsCurrentDrawingAppearance {
if let cgColor = Self.etchedShadow.shadowColor?.cgColor {
shadow.shadowColor = NSColor(cgColor: cgColor)
}
}
themePopUpButton.shadow = shadow
}
func updateThemePopUpButtonVisibility() {
let isHidden = !AppDefaults.shared.showStatusBarThemeMenu
guard themePopUpButton.isHidden != isHidden else {
return
}
themePopUpButton.isHidden = isHidden
needsLayout = true
}
}
@@ -0,0 +1,100 @@
//
// StatusBarGearButton.swift
// NetNewsWire
//
// Created by Brent Simmons on 10/12/26.
// Copyright © 2026 Ranchero Software. All rights reserved.
//
import AppKit
@MainActor protocol StatusBarGearButtonDelegate: AnyObject {
func gearButtonMenu(_ gearButton: StatusBarGearButton) -> NSMenu?
}
/// The gear-and-chevron button in the status bar. Clicking it pops up the delegate’s menu.
final class StatusBarGearButton: NSView {
weak var delegate: StatusBarGearButtonDelegate?
private static let gearSymbolName = "gearshape.fill"
private static let chevronSymbolName = "chevron.down"
private static let gearPointSize: CGFloat = 12
private static let chevronPointSize: CGFloat = 7
private static let chevronSpacing: CGFloat = 2.5
private static let lightGray: CGFloat = 0.4
private static let darkGray: CGFloat = 0.65
private static let color = NSColor(name: nil) { appearance in
let isDark = appearance.bestMatch(from: [.aqua, .darkAqua]) == .darkAqua
let white = isDark ? darkGray : lightGray
return NSColor(srgbRed: white, green: white, blue: white, alpha: 1)
}
private static let gearImage = symbolImage(gearSymbolName, pointSize: gearPointSize, weight: .regular)
private static let chevronImage = symbolImage(chevronSymbolName, pointSize: chevronPointSize, weight: .semibold)
override init(frame frameRect: NSRect) {
super.init(frame: frameRect)
commonInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
override var intrinsicContentSize: NSSize {
let gearWidth = Self.gearImage?.size.width ?? 0
let chevronWidth = Self.chevronImage?.size.width ?? 0
return NSSize(width: ceil(gearWidth + Self.chevronSpacing + chevronWidth), height: NSView.noIntrinsicMetric)
}
override func draw(_ dirtyRect: NSRect) {
guard let gearImage = Self.gearImage, let chevronImage = Self.chevronImage else {
return
}
NSGraphicsContext.saveGraphicsState()
defer {
NSGraphicsContext.restoreGraphicsState()
}
MainWindowStatusBarView.etchedShadow.set()
let gearRect = NSRect(x: bounds.minX, y: floor(bounds.midY - gearImage.size.height / 2), width: gearImage.size.width, height: gearImage.size.height)
gearImage.draw(in: gearRect)
let chevronRect = NSRect(x: gearRect.maxX + Self.chevronSpacing, y: floor(bounds.midY - chevronImage.size.height / 2), width: chevronImage.size.width, height: chevronImage.size.height)
chevronImage.draw(in: chevronRect)
}
override func mouseDown(with event: NSEvent) {
popUpMenu()
}
override func accessibilityPerformPress() -> Bool {
popUpMenu()
}
}
private extension StatusBarGearButton {
func commonInit() {
let description = NSLocalizedString("Actions", comment: "Status bar gear menu accessibility label")
setAccessibilityElement(true)
setAccessibilityRole(.popUpButton)
setAccessibilityLabel(description)
toolTip = description
}
@discardableResult
func popUpMenu() -> Bool {
guard let menu = delegate?.gearButtonMenu(self) else {
return false
}
menu.popUp(positioning: nil, at: NSPoint(x: bounds.minX, y: bounds.minY), in: self)
return true
}
static func symbolImage(_ name: String, pointSize: CGFloat, weight: NSFont.Weight) -> NSImage? {
let configuration = NSImage.SymbolConfiguration(pointSize: pointSize, weight: weight).applying(NSImage.SymbolConfiguration(paletteColors: [color]))
return NSImage(systemSymbolName: name, accessibilityDescription: nil)?.withSymbolConfiguration(configuration)
}
}
@@ -0,0 +1,35 @@
//
// StatusBarSplitHandleView.swift
// NetNewsWire
//
// Created by Brent Simmons on 10/11/26.
// Copyright © 2026 Ranchero Software. All rights reserved.
//
import AppKit
@MainActor protocol StatusBarSplitHandleViewDelegate: AnyObject {
func splitHandleView(_ splitHandleView: StatusBarSplitHandleView, didDragBy distance: CGFloat)
func splitHandleViewDidBeginDragging(_ splitHandleView: StatusBarSplitHandleView)
}
/// An invisible area in the status bar covering the ||| grip and the sidebar divider. Dragging it moves the divider.
final class StatusBarSplitHandleView: NSView {
weak var delegate: StatusBarSplitHandleViewDelegate?
private var dragStartX: CGFloat = 0
override func resetCursorRects() {
addCursorRect(bounds, cursor: .columnResize)
}
override func mouseDown(with event: NSEvent) {
dragStartX = event.locationInWindow.x
delegate?.splitHandleViewDidBeginDragging(self)
}
override func mouseDragged(with event: NSEvent) {
delegate?.splitHandleView(self, didDragBy: event.locationInWindow.x - dragStartX)
}
}
@@ -279,6 +279,11 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
sharingServiceDelegate = SharingServiceDelegate(self.view.window)
}
override func viewDidLayout() {
super.viewDidLayout()
fitTableViewToVisibleWidthInStandardLayout()
}
// MARK: - API
func markAllAsRead(completion: (() -> Void)? = nil) {
@@ -459,13 +464,11 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
tableView.selectRow(nextRowIndex)
let followingRowIndex = nextRowIndex - 1
if followingRowIndex < 0 {
if scrollToRowIfNotFullyVisible(nextRowIndex) {
return
}
tableView.scrollToRowIfNotVisible(followingRowIndex)
scrollToRowIfNotFullyVisible(nextRowIndex - 1)
}
@IBAction func selectNextDown(_ sender: Any?) {
@@ -481,13 +484,11 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
tableView.selectRow(nextRowIndex)
let followingRowIndex = nextRowIndex + 1
if followingRowIndex > tableMaxIndex {
if scrollToRowIfNotFullyVisible(nextRowIndex) {
return
}
tableView.scrollToRowIfNotVisible(followingRowIndex)
scrollToRowIfNotFullyVisible(nextRowIndex + 1)
}
func toggleReadStatusForSelectedArticles() {
@@ -1079,6 +1080,31 @@ extension TimelineViewController: NSTableViewDelegate {
private extension TimelineViewController {
/// The table doesn’t shrink by itself when the pane narrows after leaving column layout.
func fitTableViewToVisibleWidthInStandardLayout() {
guard layout == .standard, let scrollView = tableView.enclosingScrollView else {
return
}
let contentInsets = scrollView.contentInsets
let visibleWidth = scrollView.contentView.bounds.width - contentInsets.left - contentInsets.right
guard visibleWidth > 0, tableView.frame.width != visibleWidth else {
return
}
tableView.setFrameSize(NSSize(width: visibleWidth, height: tableView.frame.height))
tableView.sizeLastColumnToFit()
}
/// Returns true if it scrolled. Callers should skip further scrolling then,
/// since the animation hasn’t updated the visible rect yet.
/// <https://github.com/Ranchero-Software/NetNewsWire/issues/5486>
@discardableResult func scrollToRowIfNotFullyVisible(_ row: Int) -> Bool {
guard (0..<tableView.numberOfRows).contains(row), !tableView.isRowFullyVisible(row) else {
return false
}
tableView.scrollRowFullyIntoView(row)
return true
}
func fetchAndReplacePreservingSelection() {
if let article = oneSelectedArticle, let account = article.account {
exceptionArticleFetcher = SingleArticleFetcher(account: account, articleID: article.articleID)
@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.800",
"green" : "0.600",
"red" : "0.200"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.761",
"green" : "0.561",
"red" : "0.169"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.698",
"green" : "0.682",
"red" : "0.682"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.400",
"green" : "0.388",
"red" : "0.388"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.808",
"green" : "0.369",
"red" : "0.027"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.753",
"green" : "0.271",
"red" : "0.027"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.298",
"green" : "0.694",
"red" : "0.169"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.220",
"green" : "0.616",
"red" : "0.090"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.741",
"green" : "0.384",
"red" : "0.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.663",
"green" : "0.306",
"red" : "0.004"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.780",
"green" : "0.482",
"red" : "0.004"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.702",
"green" : "0.404",
"red" : "0.004"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.478",
"red" : "0.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.518",
"red" : "0.039"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.584",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.039",
"green" : "0.624",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.145",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.067",
"red" : "0.882"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "markAllRead.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "markAllRead@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

@@ -1,12 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"filename" : "preferencesToolbarExtensions.svg",
"idiom" : "universal"
}
]
}
@@ -1,161 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generator: Apple Native CoreSVG 149-->
<!DOCTYPE svg
PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="3300" height="2200">
<!--glyph: "uni100AEE.medium", point size: 100.000000, font version: "Version 16.0d18e1", template writer version: "8"-->
<g id="Notes">
<rect height="2200" id="artboard" style="fill:white;opacity:1" width="3300" x="0" y="0"/>
<line id="" style="fill:none;stroke:black;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="292" y2="292"/>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;font-weight:bold;" transform="matrix(1 0 0 1 263 322)">Weight/Scale Variations</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 559.711 322)">Ultralight</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 856.422 322)">Thin</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 1153.13 322)">Light</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 1449.84 322)">Regular</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 1746.56 322)">Medium</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 2043.27 322)">Semibold</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 2339.98 322)">Bold</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 2636.69 322)">Heavy</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:middle;" transform="matrix(1 0 0 1 2933.4 322)">Black</text>
<line id="" style="fill:none;stroke:black;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="1903" y2="1903"/>
<g id="" transform="matrix(1 0 0 1 263 1933)">
<path d="M9.24805 0.830078C13.5547 0.830078 17.1387-2.74414 17.1387-7.05078C17.1387-11.3574 13.5449-14.9316 9.23828-14.9316C4.94141-14.9316 1.36719-11.3574 1.36719-7.05078C1.36719-2.74414 4.95117 0.830078 9.24805 0.830078ZM9.24805-0.654297C5.70312-0.654297 2.87109-3.49609 2.87109-7.05078C2.87109-10.6055 5.69336-13.4473 9.23828-13.4473C12.793-13.4473 15.6348-10.6055 15.6445-7.05078C15.6543-3.49609 12.8027-0.654297 9.24805-0.654297ZM6.39648-6.31836L8.50586-6.31836L8.50586-4.19922C8.50586-3.75977 8.79883-3.45703 9.22852-3.45703C9.67773-3.45703 9.9707-3.75977 9.9707-4.19922L9.9707-6.31836L12.0996-6.31836C12.5391-6.31836 12.8418-6.61133 12.8418-7.04102C12.8418-7.48047 12.5391-7.7832 12.0996-7.7832L9.9707-7.7832L9.9707-9.89258C9.9707-10.3418 9.67773-10.6445 9.22852-10.6445C8.79883-10.6445 8.50586-10.3418 8.50586-9.89258L8.50586-7.7832L6.39648-7.7832C5.94727-7.7832 5.64453-7.48047 5.64453-7.04102C5.64453-6.61133 5.94727-6.31836 6.39648-6.31836Z"/>
</g>
<g id="" transform="matrix(1 0 0 1 281.506 1933)">
<path d="M11.709 2.91016C17.1582 2.91016 21.6699-1.61133 21.6699-7.05078C21.6699-12.5 17.1484-17.0117 11.6992-17.0117C6.25977-17.0117 1.74805-12.5 1.74805-7.05078C1.74805-1.61133 6.26953 2.91016 11.709 2.91016ZM11.709 1.25C7.09961 1.25 3.41797-2.44141 3.41797-7.05078C3.41797-11.6602 7.08984-15.3516 11.6992-15.3516C16.3086-15.3516 20-11.6602 20.0098-7.05078C20.0195-2.44141 16.3184 1.25 11.709 1.25ZM7.98828-6.23047L10.8789-6.23047L10.8789-3.32031C10.8789-2.83203 11.2109-2.5 11.6895-2.5C12.1777-2.5 12.5195-2.83203 12.5195-3.32031L12.5195-6.23047L15.4297-6.23047C15.918-6.23047 16.25-6.5625 16.25-7.04102C16.25-7.5293 15.918-7.87109 15.4297-7.87109L12.5195-7.87109L12.5195-10.7617C12.5195-11.2695 12.1777-11.6016 11.6895-11.6016C11.2109-11.6016 10.8789-11.2598 10.8789-10.7617L10.8789-7.87109L7.98828-7.87109C7.48047-7.87109 7.14844-7.5293 7.14844-7.04102C7.14844-6.5625 7.49023-6.23047 7.98828-6.23047Z"/>
</g>
<g id="" transform="matrix(1 0 0 1 304.924 1933)">
<path d="M14.9707 5.66406C21.9336 5.66406 27.6953-0.0976562 27.6953-7.05078C27.6953-14.0137 21.9238-19.7754 14.9609-19.7754C8.00781-19.7754 2.25586-14.0137 2.25586-7.05078C2.25586-0.0976562 8.01758 5.66406 14.9707 5.66406ZM14.9707 3.84766C8.93555 3.84766 4.08203-1.01562 4.08203-7.05078C4.08203-13.0957 8.92578-17.9492 14.9609-17.9492C21.0059-17.9492 25.8594-13.0957 25.8691-7.05078C25.8789-1.01562 21.0156 3.84766 14.9707 3.84766ZM10.0586-6.14258L14.0625-6.14258L14.0625-2.12891C14.0625-1.5918 14.4336-1.2207 14.9512-1.2207C15.4883-1.2207 15.8594-1.5918 15.8594-2.12891L15.8594-6.14258L19.8828-6.14258C20.4102-6.14258 20.791-6.51367 20.791-7.03125C20.791-7.56836 20.4199-7.94922 19.8828-7.94922L15.8594-7.94922L15.8594-11.9531C15.8594-12.5098 15.4883-12.8809 14.9512-12.8809C14.4336-12.8809 14.0625-12.5 14.0625-11.9531L14.0625-7.94922L10.0586-7.94922C9.50195-7.94922 9.13086-7.56836 9.13086-7.03125C9.13086-6.51367 9.51172-6.14258 10.0586-6.14258Z"/>
</g>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;font-weight:bold;" transform="matrix(1 0 0 1 263 1953)">Design Variations</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 263 1971)">Symbols are supported in up to nine weights and three scales.</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 263 1989)">For optimal layout with text and other symbols, vertically align</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 263 2007)">symbols with the adjacent text.</text>
<line id="" style="fill:none;stroke:#00AEEF;stroke-width:0.5;opacity:1.0;" x1="776" x2="776" y1="1919" y2="1933"/>
<g id="" transform="matrix(1 0 0 1 776 1933)">
<path d="M3.31055 0.126953C3.82812 0.126953 4.08203-0.0683594 4.26758-0.605469L5.52734-4.0625L11.2891-4.0625L12.5488-0.605469C12.7344-0.0683594 12.9883 0.126953 13.4961 0.126953C14.0137 0.126953 14.3457-0.185547 14.3457-0.673828C14.3457-0.839844 14.3164-0.986328 14.2383-1.20117L9.6582-13.3887C9.43359-13.9941 9.0332-14.2871 8.4082-14.2871C7.80273-14.2871 7.39258-13.9941 7.17773-13.3984L2.59766-1.19141C2.51953-0.976562 2.49023-0.830078 2.49023-0.664062C2.49023-0.175781 2.80273 0.126953 3.31055 0.126953ZM6.00586-5.53711L8.37891-12.1094L8.42773-12.1094L10.8008-5.53711Z"/>
</g>
<line id="" style="fill:none;stroke:#00AEEF;stroke-width:0.5;opacity:1.0;" x1="792.836" x2="792.836" y1="1919" y2="1933"/>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;font-weight:bold;" transform="matrix(1 0 0 1 776 1953)">Margins</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 776 1971)">Leading and trailing margins on the left and right side of each symbol</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 776 1989)">can be adjusted by modifying the x-location of the margin guidelines.</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 776 2007)">Modifications are automatically applied proportionally to all</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 776 2025)">scales and weights.</text>
<g id="" transform="matrix(1 0 0 1 1289 1933)">
<path d="M2.8418 1.86523L4.54102 3.57422C5.40039 4.44336 6.38672 4.38477 7.31445 3.35938L17.4902-7.85156C17.7539-7.76367 18.0273-7.7832 18.3398-7.8418L19.4043-8.03711L20.0684-7.36328L20.0293-6.80664C19.9902-6.30859 20.1172-5.92773 20.6055-5.44922L21.3672-4.70703C21.8457-4.22852 22.4609-4.19922 22.9297-4.66797L25.8398-7.58789C26.3086-8.05664 26.2891-8.65234 25.8105-9.13086L25.0391-9.89258C24.5605-10.3711 24.1895-10.5273 23.7109-10.4883L23.1348-10.4395L22.4902-11.0742L22.7344-12.1973C22.8613-12.7637 22.7051-13.2031 22.1191-13.7891L19.9219-15.9766C16.582-19.2969 12.1484-19.2188 9.25781-16.3281C8.83789-15.918 8.80859-15.3418 9.04297-14.9512C9.27734-14.5898 9.73633-14.3555 10.3809-14.5215C11.8457-14.8633 13.3691-14.9219 14.7949-13.9844L14.209-12.5293C14.0137-12.0508 13.9844-11.6504 14.1113-11.2891L3.04688-0.898438C2.06055 0.0195312 1.98242 0.996094 2.8418 1.86523ZM10.752-15.957C13.1836-17.7344 16.4746-17.4316 18.7012-15.2051L21.1328-12.793C21.3672-12.5586 21.4062-12.373 21.3379-12.0312L21.0156-10.5469L22.5195-9.0625L23.5059-9.12109C23.7598-9.13086 23.8379-9.11133 24.0332-8.91602L24.6094-8.33984L22.168-5.89844L21.5918-6.47461C21.3965-6.66992 21.3672-6.74805 21.377-7.01172L21.4453-7.98828L19.9512-9.47266L18.4277-9.21875C18.1055-9.15039 17.959-9.17969 17.7148-9.41406L15.7129-11.416C15.459-11.6504 15.4297-11.8164 15.5859-12.1875L16.4648-14.2773C14.9023-15.7324 12.8711-16.3574 10.8398-15.7617C10.6836-15.7227 10.625-15.8496 10.752-15.957ZM5.27344 2.30469L4.10156 1.14258C3.63281 0.683594 3.74023 0.341797 4.14062-0.0195312L14.9512-10.1953L16.416-8.71094L6.42578 2.27539C6.07422 2.67578 5.74219 2.77344 5.27344 2.30469Z"/>
</g>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;font-weight:bold;" transform="matrix(1 0 0 1 1289 1953)">Exporting</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 1289 1971)">Symbols should be outlined when exporting to ensure the</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 1289 1989)">design is preserved when submitting to Xcode.</text>
<text id="template-version" style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:end;" transform="matrix(1 0 0 1 3036 1933)">Template v.2.0</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:end;" transform="matrix(1 0 0 1 3036 1951)">Requires Xcode 12 or greater</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:end;" transform="matrix(1 0 0 1 3036 1969)">Generated from bolt.fill.batteryblock</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;text-anchor:end;" transform="matrix(1 0 0 1 3036 1987)">Typeset at 100 points</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 263 726)">Small</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 263 1156)">Medium</text>
<text style="stroke:none;fill:black;font-family:-apple-system,&quot;SF Pro Display&quot;,&quot;SF Pro Text&quot;,Helvetica,sans-serif;" transform="matrix(1 0 0 1 263 1586)">Large</text>
</g>
<g id="Guides">
<g id="H-reference" style="fill:#27AAE1;stroke:none;" transform="matrix(1 0 0 1 339 696)">
<path d="M0.976562 0L3.66211 0L12.9883-24.4629L45.752-24.4629L55.127 0L57.7637 0L30.6152-70.459L28.125-70.459ZM29.3457-67.1387L29.4434-67.1387L44.873-26.709L13.8672-26.709Z"/>
</g>
<line id="Baseline-S" style="fill:none;stroke:#27AAE1;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="696" y2="696"/>
<line id="Capline-S" style="fill:none;stroke:#27AAE1;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="625.541" y2="625.541"/>
<g id="H-reference" style="fill:#27AAE1;stroke:none;" transform="matrix(1 0 0 1 339 1126)">
<path d="M0.976562 0L3.66211 0L12.9883-24.4629L45.752-24.4629L55.127 0L57.7637 0L30.6152-70.459L28.125-70.459ZM29.3457-67.1387L29.4434-67.1387L44.873-26.709L13.8672-26.709Z"/>
</g>
<line id="Baseline-M" style="fill:none;stroke:#27AAE1;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="1126" y2="1126"/>
<line id="Capline-M" style="fill:none;stroke:#27AAE1;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="1055.54" y2="1055.54"/>
<g id="H-reference" style="fill:#27AAE1;stroke:none;" transform="matrix(1 0 0 1 339 1556)">
<path d="M0.976562 0L3.66211 0L12.9883-24.4629L45.752-24.4629L55.127 0L57.7637 0L30.6152-70.459L28.125-70.459ZM29.3457-67.1387L29.4434-67.1387L44.873-26.709L13.8672-26.709Z"/>
</g>
<line id="Baseline-L" style="fill:none;stroke:#27AAE1;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="1556" y2="1556"/>
<line id="Capline-L" style="fill:none;stroke:#27AAE1;opacity:1;stroke-width:0.5;" x1="263" x2="3036" y1="1485.54" y2="1485.54"/>
<line id="left-margin" style="fill:none;stroke:#00AEEF;stroke-width:0.5;opacity:1.0;" x1="1379.82" x2="1379.82" y1="1030.79" y2="1150.12"/>
<line id="right-margin" style="fill:none;stroke:#00AEEF;stroke-width:0.5;opacity:1.0;" x1="1519.86" x2="1519.86" y1="1030.79" y2="1150.12"/>
</g>
<g id="Symbols">
<g id="Black-L" transform="matrix(1 0 0 1 2841.51 1556)">
<path d="M39.9902 26.5137L143.799 26.5137C159.082 26.5137 167.725 17.8711 167.725 2.68555L167.725-55.2246C167.725-70.459 159.082-79.0527 143.799-79.0527L138.086-79.0527L138.086-85.2051C138.086-92.5781 133.838-96.875 126.514-96.875L112.354-96.875C105.078-96.875 100.781-92.5781 100.781-85.2051L100.781-79.0527L82.9102-79.0527L82.9102-85.2051C82.9102-92.5781 78.6621-96.875 71.3867-96.875L57.1777-96.875C49.9023-96.875 45.6543-92.5781 45.6543-85.2051L45.6543-79.0527L39.9902-79.0527C24.7559-79.0527 16.0645-70.459 16.0645-55.2246L16.0645 2.68555C16.0645 17.8711 24.7559 26.5137 39.9902 26.5137ZM42.6758 6.29883C38.4766 6.29883 36.3281 4.39453 36.3281-0.146484L36.3281-52.3926C36.3281-56.9336 38.4766-58.8379 42.6758-58.8379L141.064-58.8379C145.312-58.8379 147.461-56.9336 147.461-52.3926L147.461-0.146484C147.461 4.39453 145.312 6.29883 141.064 6.29883Z"/>
</g>
<g id="Heavy-L" transform="matrix(1 0 0 1 2545.23 1556)">
<path d="M38.8184 25.4883L144.092 25.4883C158.74 25.4883 166.846 17.4316 166.846 2.88086L166.846-55.8105C166.846-70.3613 158.74-78.4668 144.092-78.4668L137.793-78.4668L137.793-85.2051C137.793-91.8945 133.936-95.8496 127.246-95.8496L111.865-95.8496C105.225-95.8496 101.318-91.8945 101.318-85.2051L101.318-78.4668L81.4941-78.4668L81.4941-85.2051C81.4941-91.8945 77.6367-95.8496 70.9473-95.8496L55.5664-95.8496C48.9258-95.8496 45.0195-91.8945 45.0195-85.2051L45.0195-78.4668L38.8184-78.4668C24.2188-78.4668 16.0645-70.3613 16.0645-55.8105L16.0645 2.88086C16.0645 17.4316 24.2188 25.4883 38.8184 25.4883ZM40.918 8.00781C36.084 8.00781 33.5938 5.71289 33.5938 0.585938L33.5938-53.5156C33.5938-58.6426 36.084-60.9375 40.918-60.9375L141.943-60.9375C146.777-60.9375 149.316-58.6426 149.316-53.5156L149.316 0.585938C149.316 5.71289 146.777 8.00781 141.943 8.00781Z"/>
</g>
<g id="Bold-L" transform="matrix(1 0 0 1 2249.01 1556)">
<path d="M37.5 24.3652L144.385 24.3652C158.35 24.3652 165.869 16.8945 165.869 3.07617L165.869-56.4453C165.869-70.2637 158.35-77.7832 144.385-77.7832L137.5-77.7832L137.5-85.2539C137.5-91.2109 134.033-94.7266 128.076-94.7266L111.377-94.7266C105.371-94.7266 101.953-91.2109 101.953-85.2539L101.953-77.7832L79.8828-77.7832L79.8828-85.2539C79.8828-91.2109 76.4648-94.7266 70.459-94.7266L53.7598-94.7266C47.8027-94.7266 44.3359-91.2109 44.3359-85.2539L44.3359-77.7832L37.5-77.7832C23.6328-77.7832 16.0645-70.3125 16.0645-56.4453L16.0645 3.07617C16.0645 16.8945 23.6328 24.3652 37.5 24.3652ZM38.9648 9.91211C33.4473 9.91211 30.5176 7.17773 30.5176 1.41602L30.5176-54.7852C30.5176-60.5469 33.4473-63.3301 38.9648-63.3301L142.969-63.3301C148.389-63.3301 151.416-60.5469 151.416-54.7852L151.416 1.41602C151.416 7.17773 148.389 9.91211 142.969 9.91211Z"/>
</g>
<g id="Semibold-L" transform="matrix(1 0 0 1 1952.64 1556)">
<path d="M36.6211 23.584L144.629 23.584C158.057 23.584 165.186 16.5039 165.186 3.17383L165.186-56.8848C165.186-70.2148 158.057-77.2949 144.629-77.2949L137.256-77.2949L137.256-85.2539C137.256-90.7227 134.131-93.9453 128.662-93.9453L110.986-93.9453C105.518-93.9453 102.393-90.7227 102.393-85.2539L102.393-77.2949L78.7598-77.2949L78.7598-85.2539C78.7598-90.7227 75.6348-93.9453 70.166-93.9453L52.5391-93.9453C47.0215-93.9453 43.8965-90.7227 43.8965-85.2539L43.8965-77.2949L36.6211-77.2949C23.1934-77.2949 16.0645-70.2148 16.0645-56.8848L16.0645 3.17383C16.0645 16.5527 23.1934 23.584 36.6211 23.584ZM37.5977 11.2793C31.6406 11.2793 28.418 8.20312 28.418 1.95312L28.418-55.6641C28.418-61.8652 31.6406-64.9414 37.5977-64.9414L143.652-64.9414C149.512-64.9414 152.832-61.8652 152.832-55.6641L152.832 1.95312C152.832 8.20312 149.512 11.2793 143.652 11.2793Z"/>
</g>
<g id="Medium-L" transform="matrix(1 0 0 1 1656.2 1556)">
<path d="M35.9375 22.998L144.775 22.998C157.861 22.998 164.648 16.2109 164.648 3.27148L164.648-57.2266C164.648-70.166 157.861-76.9531 144.775-76.9531L137.109-76.9531L137.109-85.2539C137.109-90.332 134.18-93.3105 129.053-93.3105L110.742-93.3105C105.615-93.3105 102.686-90.332 102.686-85.2539L102.686-76.9531L77.9297-76.9531L77.9297-85.2539C77.9297-90.332 75.0488-93.3105 69.9219-93.3105L51.5625-93.3105C46.4355-93.3105 43.5547-90.332 43.5547-85.2539L43.5547-76.9531L35.9375-76.9531C22.9004-76.9531 16.0645-70.2148 16.0645-57.2266L16.0645 3.27148C16.0645 16.2598 22.9004 22.998 35.9375 22.998ZM36.5723 12.2559C30.2246 12.2559 26.8066 8.98438 26.8066 2.39258L26.8066-56.3477C26.8066-62.8906 30.2246-66.2109 36.5723-66.2109L144.141-66.2109C150.391-66.2109 153.906-62.8906 153.906-56.3477L153.906 2.39258C153.906 8.98438 150.391 12.2559 144.141 12.2559Z"/>
</g>
<g id="Regular-L" transform="matrix(1 0 0 1 1359.81 1556)">
<path d="M35.0586 22.2168L144.971 22.2168C157.617 22.2168 164.014 15.8691 164.014 3.41797L164.014-57.666C164.014-70.0684 157.617-76.4648 144.971-76.4648L136.914-76.4648L136.914-85.2539C136.914-89.8438 134.277-92.5293 129.639-92.5293L110.4-92.5293C105.713-92.5293 103.125-89.8438 103.125-85.2539L103.125-76.4648L76.8555-76.4648L76.8555-85.2539C76.8555-89.8438 74.2188-92.5293 69.5801-92.5293L50.3418-92.5293C45.6543-92.5293 43.0664-89.8438 43.0664-85.2539L43.0664-76.4648L35.0586-76.4648C22.4609-76.4648 16.0645-70.166 16.0645-57.666L16.0645 3.41797C16.0645 15.918 22.4609 22.2168 35.0586 22.2168ZM35.2539 13.5742C28.418 13.5742 24.707 9.96094 24.707 2.97852L24.707-57.1777C24.707-64.209 28.418-67.8223 35.2539-67.8223L144.824-67.8223C151.514-67.8223 155.322-64.209 155.322-57.1777L155.322 2.97852C155.322 9.96094 151.514 13.5742 144.824 13.5742Z"/>
</g>
<g id="Light-L" transform="matrix(1 0 0 1 1063.56 1556)">
<path d="M34.0332 21.4355L145.117 21.4355C157.031 21.4355 163.086 15.2344 163.086 3.56445L163.086-57.7637C163.086-69.4336 157.031-75.6348 145.117-75.6348L137.061-75.6348L137.061-84.9609C137.061-89.209 134.668-91.6992 130.273-91.6992L110.107-91.6992C105.664-91.6992 103.271-89.209 103.271-84.9609L103.271-75.6348L75.8301-75.6348L75.8301-84.9609C75.8301-89.209 73.4375-91.6992 69.043-91.6992L48.877-91.6992C44.4336-91.6992 42.041-89.209 42.041-84.9609L42.041-75.6348L34.0332-75.6348C22.168-75.6348 16.0645-69.5312 16.0645-57.7637L16.0645 3.56445C16.0645 15.3809 22.168 21.4355 34.0332 21.4355ZM34.1797 14.7949C26.709 14.7949 22.7051 10.8398 22.7051 3.22266L22.7051-57.4219C22.7051-65.0391 26.709-68.9941 34.1797-68.9941L144.971-68.9941C152.295-68.9941 156.494-65.0391 156.494-57.4219L156.494 3.22266C156.494 10.8398 152.295 14.7949 144.971 14.7949Z"/>
</g>
<g id="Thin-L" transform="matrix(1 0 0 1 767.433 1556)">
<path d="M32.666 20.3613L145.312 20.3613C156.201 20.3613 161.914 14.4531 161.914 3.75977L161.914-57.9102C161.914-68.6035 156.201-74.5117 145.312-74.5117L137.256-74.5117L137.256-84.5703C137.256-88.3301 135.205-90.5762 131.104-90.5762L109.717-90.5762C105.615-90.5762 103.516-88.3301 103.516-84.5703L103.516-74.5117L74.4629-74.5117L74.4629-84.5703C74.4629-88.3301 72.4121-90.5762 68.3105-90.5762L46.9238-90.5762C42.7734-90.5762 40.7227-88.3301 40.7227-84.5703L40.7227-74.5117L32.666-74.5117C21.7773-74.5117 16.0645-68.75 16.0645-57.9102L16.0645 3.75977C16.0645 14.6484 21.7773 20.3613 32.666 20.3613ZM32.8125 16.4062C24.4141 16.4062 19.9707 12.0117 19.9707 3.56445L19.9707-57.7148C19.9707-66.1621 24.4141-70.5566 32.8125-70.5566L145.166-70.5566C153.32-70.5566 158.008-66.1621 158.008-57.7148L158.008 3.56445C158.008 12.0117 153.32 16.4062 145.166 16.4062Z"/>
</g>
<g id="Ultralight-L" transform="matrix(1 0 0 1 471.015 1556)">
<path d="M31.9824 19.7754L145.41 19.7754C155.811 19.7754 161.328 14.0625 161.328 3.85742L161.328-58.0078C161.328-68.2129 155.811-73.9258 145.41-73.9258L137.402-73.9258L137.402-84.375C137.402-87.8906 135.449-89.9902 131.494-89.9902L109.473-89.9902C105.566-89.9902 103.613-87.8906 103.613-84.375L103.613-73.9258L73.7793-73.9258L73.7793-84.375C73.7793-87.8906 71.875-89.9902 67.9199-89.9902L45.8984-89.9902C41.9434-89.9902 40.0391-87.8906 40.0391-84.375L40.0391-73.9258L31.9824-73.9258C21.582-73.9258 16.0645-68.3594 16.0645-58.0078L16.0645 3.85742C16.0645 14.2578 21.582 19.7754 31.9824 19.7754ZM32.1289 17.2363C23.1934 17.2363 18.6035 12.6465 18.6035 3.75977L18.6035-57.8613C18.6035-66.748 23.1934-71.3867 32.1289-71.3867L145.264-71.3867C153.857-71.3867 158.789-66.748 158.789-57.8613L158.789 3.75977C158.789 12.6465 153.857 17.2363 145.264 17.2363Z"/>
</g>
<g id="Black-M" transform="matrix(1 0 0 1 2861.84 1126)">
<path d="M31.9824 13.5742L111.133 13.5742C123.389 13.5742 130.664 6.29883 130.664-5.95703L130.664-50.0488C130.664-62.3047 123.389-69.5801 111.133-69.5801L107.471-69.5801L107.471-73.7793C107.471-80.1758 103.76-83.9355 97.4121-83.9355L87.5488-83.9355C81.1523-83.9355 77.4414-80.1758 77.4414-73.7793L77.4414-69.5801L65.6738-69.5801L65.6738-73.7793C65.6738-80.1758 61.9629-83.9355 55.6152-83.9355L45.7031-83.9355C39.3555-83.9355 35.6445-80.1758 35.6445-73.7793L35.6445-69.5801L31.9824-69.5801C19.7266-69.5801 12.4512-62.3047 12.4512-50.0488L12.4512-5.95703C12.4512 6.29883 19.7266 13.5742 31.9824 13.5742ZM34.9121-4.73633C32.0801-4.73633 30.7617-5.81055 30.7617-8.88672L30.7617-47.1191C30.7617-50.1953 32.0801-51.2695 34.9121-51.2695L108.203-51.2695C111.035-51.2695 112.402-50.1953 112.402-47.1191L112.402-8.88672C112.402-5.81055 111.035-4.73633 108.203-4.73633Z"/>
</g>
<g id="Heavy-M" transform="matrix(1 0 0 1 2565.5 1126)">
<path d="M31.0059 12.6465L111.426 12.6465C123.193 12.6465 129.932 5.9082 129.932-5.81055L129.932-50.6348C129.932-62.3535 123.193-69.1406 111.426-69.1406L107.129-69.1406L107.129-73.877C107.129-79.6387 103.76-83.0566 98.0469-83.0566L87.1094-83.0566C81.3477-83.0566 78.0273-79.6387 78.0273-73.877L78.0273-69.1406L64.3555-69.1406L64.3555-73.877C64.3555-79.6387 61.0352-83.0566 55.2734-83.0566L44.3359-83.0566C38.5742-83.0566 35.2539-79.6387 35.2539-73.877L35.2539-69.1406L31.0059-69.1406C19.2383-69.1406 12.4512-62.3535 12.4512-50.6348L12.4512-5.81055C12.4512 5.9082 19.2383 12.6465 31.0059 12.6465ZM33.252-3.17383C29.9316-3.17383 28.2715-4.63867 28.2715-8.1543L28.2715-48.291C28.2715-51.8555 29.9316-53.2715 33.252-53.2715L109.131-53.2715C112.451-53.2715 114.111-51.8555 114.111-48.291L114.111-8.1543C114.111-4.63867 112.451-3.17383 109.131-3.17383Z"/>
</g>
<g id="Bold-M" transform="matrix(1 0 0 1 2269.18 1126)">
<path d="M29.8828 11.6699L111.719 11.6699C122.949 11.6699 129.15 5.46875 129.15-5.66406L129.15-51.2695C129.15-62.4512 122.949-68.6035 111.719-68.6035L106.738-68.6035L106.738-73.9746C106.738-79.0527 103.809-82.0312 98.7793-82.0312L86.6211-82.0312C81.5918-82.0312 78.6621-79.0527 78.6621-73.9746L78.6621-68.6035L62.8906-68.6035L62.8906-73.9746C62.8906-79.0527 59.9609-82.0312 54.9316-82.0312L42.7734-82.0312C37.7441-82.0312 34.8145-79.0527 34.8145-73.9746L34.8145-68.6035L29.8828-68.6035C18.6523-68.6035 12.4512-62.4512 12.4512-51.2695L12.4512-5.66406C12.4512 5.51758 18.6523 11.6699 29.8828 11.6699ZM31.3965-1.41602C27.5391-1.41602 25.5371-3.27148 25.5371-7.32422L25.5371-49.6094C25.5371-53.7109 27.5391-55.5664 31.3965-55.5664L110.205-55.5664C114.014-55.5664 116.064-53.7109 116.064-49.6094L116.064-7.32422C116.064-3.27148 114.014-1.41602 110.205-1.41602Z"/>
</g>
<g id="Semibold-M" transform="matrix(1 0 0 1 1972.76 1126)">
<path d="M29.1016 10.9863L111.914 10.9863C122.803 10.9863 128.564 5.17578 128.564-5.56641L128.564-51.7578C128.564-62.5 122.803-68.2617 111.914-68.2617L106.445-68.2617L106.445-74.0723C106.445-78.6133 103.809-81.3477 99.2676-81.3477L86.2793-81.3477C81.6895-81.3477 79.0527-78.6133 79.0527-74.0723L79.0527-68.2617L61.9141-68.2617L61.9141-74.0723C61.9141-78.6133 59.2285-81.3477 54.6875-81.3477L41.6992-81.3477C37.1582-81.3477 34.5215-78.6133 34.5215-74.0723L34.5215-68.2617L29.1016-68.2617C18.2617-68.2617 12.4512-62.5 12.4512-51.7578L12.4512-5.56641C12.4512 5.22461 18.2617 10.9863 29.1016 10.9863ZM30.127-0.195312C25.8789-0.195312 23.6328-2.34375 23.6328-6.78711L23.6328-50.5371C23.6328-54.9805 25.8789-57.0801 30.127-57.0801L110.889-57.0801C115.088-57.0801 117.383-54.9805 117.383-50.5371L117.383-6.78711C117.383-2.34375 115.088-0.195312 110.889-0.195312Z"/>
</g>
<g id="Medium-M" transform="matrix(1 0 0 1 1676.24 1126)">
<path d="M28.5156 10.4492L112.061 10.4492C122.656 10.4492 128.174 4.98047 128.174-5.46875L128.174-52.0996C128.174-62.5488 122.656-68.0176 112.061-68.0176L106.25-68.0176L106.25-74.1211C106.25-78.3203 103.857-80.8105 99.6094-80.8105L86.0352-80.8105C81.8359-80.8105 79.3945-78.3203 79.3945-74.1211L79.3945-68.0176L61.1328-68.0176L61.1328-74.1211C61.1328-78.3203 58.6914-80.8105 54.4922-80.8105L40.918-80.8105C36.6699-80.8105 34.2773-78.3203 34.2773-74.1211L34.2773-68.0176L28.5156-68.0176C17.9688-68.0176 12.4512-62.5488 12.4512-52.0996L12.4512-5.46875C12.4512 4.98047 17.9688 10.4492 28.5156 10.4492ZM29.1504 0.732422C24.6582 0.732422 22.168-1.61133 22.168-6.34766L22.168-51.2207C22.168-55.957 24.6582-58.252 29.1504-58.252L111.426-58.252C115.918-58.252 118.408-55.957 118.408-51.2207L118.408-6.34766C118.408-1.61133 115.918 0.732422 111.426 0.732422Z"/>
</g>
<g id="Regular-M" transform="matrix(1 0 0 1 1379.82 1126)">
<path d="M27.7832 9.76562L112.256 9.76562C122.51 9.76562 127.588 4.6875 127.588-5.37109L127.588-52.5391C127.588-62.5977 122.51-67.6758 112.256-67.6758L106.006-67.6758L106.006-74.1699C106.006-77.9297 103.857-80.127 100.098-80.127L85.6934-80.127C81.9824-80.127 79.834-77.9297 79.834-74.1699L79.834-67.6758L60.1562-67.6758L60.1562-74.1699C60.1562-77.9297 58.0078-80.127 54.248-80.127L39.8438-80.127C36.084-80.127 33.9355-77.9297 33.9355-74.1699L33.9355-67.6758L27.7832-67.6758C17.5781-67.6758 12.4512-62.6465 12.4512-52.5391L12.4512-5.37109C12.4512 4.73633 17.5781 9.76562 27.7832 9.76562ZM27.8809 1.9043C22.998 1.9043 20.3125-0.683594 20.3125-5.76172L20.3125-52.1484C20.3125-57.1777 22.998-59.8145 27.8809-59.8145L112.158-59.8145C116.992-59.8145 119.727-57.1777 119.727-52.1484L119.727-5.76172C119.727-0.683594 116.992 1.9043 112.158 1.9043Z"/>
</g>
<g id="Light-M" transform="matrix(1 0 0 1 1083.5 1126)">
<path d="M26.8555 9.0332L112.402 9.0332C121.973 9.0332 126.807 4.15039 126.807-5.22461L126.807-52.6367C126.807-62.0117 121.973-66.8945 112.402-66.8945L106.152-66.8945L106.152-73.9258C106.152-77.3438 104.199-79.3945 100.684-79.3945L85.4492-79.3945C81.9336-79.3945 79.9805-77.3438 79.9805-73.9258L79.9805-66.8945L59.2285-66.8945L59.2285-73.9258C59.2285-77.3438 57.2754-79.3945 53.7598-79.3945L38.5254-79.3945C35.0098-79.3945 33.0566-77.3438 33.0566-73.9258L33.0566-66.8945L26.8555-66.8945C17.334-66.8945 12.4512-62.1094 12.4512-52.6367L12.4512-5.22461C12.4512 4.19922 17.334 9.0332 26.8555 9.0332ZM26.9531 2.97852C21.4844 2.97852 18.5059 0.0976562 18.5059-5.56641L18.5059-52.3438C18.5059-57.959 21.4844-60.8887 26.9531-60.8887L112.305-60.8887C117.676-60.8887 120.752-57.959 120.752-52.3438L120.752-5.56641C120.752 0.0976562 117.676 2.97852 112.305 2.97852Z"/>
</g>
<g id="Thin-M" transform="matrix(1 0 0 1 787.33 1126)">
<path d="M25.6348 8.05664L112.598 8.05664C121.24 8.05664 125.732 3.4668 125.732-5.0293L125.732-52.7832C125.732-61.2793 121.24-65.918 112.598-65.918L106.348-65.918L106.348-73.584C106.348-76.5625 104.639-78.3691 101.416-78.3691L85.1074-78.3691C81.8359-78.3691 80.1758-76.5625 80.1758-73.584L80.1758-65.918L58.0078-65.918L58.0078-73.584C58.0078-76.5625 56.3477-78.3691 53.0762-78.3691L36.7676-78.3691C33.5449-78.3691 31.8359-76.5625 31.8359-73.584L31.8359-65.918L25.6348-65.918C16.9922-65.918 12.4512-61.377 12.4512-52.7832L12.4512-5.0293C12.4512 3.56445 16.9922 8.05664 25.6348 8.05664ZM25.7324 4.44336C19.3848 4.44336 16.0645 1.12305 16.0645-5.22461L16.0645-52.5879C16.0645-58.9844 19.3848-62.2559 25.7324-62.2559L112.451-62.2559C118.604-62.2559 122.119-58.9844 122.119-52.5879L122.119-5.22461C122.119 1.12305 118.604 4.44336 112.451 4.44336Z"/>
</g>
<g id="Ultralight-M" transform="matrix(1 0 0 1 490.888 1126)">
<path d="M25 7.56836L112.695 7.56836C120.85 7.56836 125.195 3.125 125.195-4.98047L125.195-52.832C125.195-60.8887 120.85-65.3809 112.695-65.3809L106.445-65.3809L106.445-73.3887C106.445-76.1719 104.883-77.832 101.807-77.832L84.9121-77.832C81.8359-77.832 80.2734-76.1719 80.2734-73.3887L80.2734-65.3809L57.4219-65.3809L57.4219-73.3887C57.4219-76.1719 55.8594-77.832 52.7344-77.832L35.8887-77.832C32.7637-77.832 31.2012-76.1719 31.2012-73.3887L31.2012-65.3809L25-65.3809C16.7969-65.3809 12.4512-61.0352 12.4512-52.832L12.4512-4.98047C12.4512 3.22266 16.7969 7.56836 25 7.56836ZM25.0977 5.17578C18.3594 5.17578 14.8438 1.66016 14.8438-5.07812L14.8438-52.7344C14.8438-59.4727 18.3594-62.9883 25.0977-62.9883L112.549-62.9883C119.043-62.9883 122.803-59.4727 122.803-52.7344L122.803-5.07812C122.803 1.66016 119.043 5.17578 112.549 5.17578Z"/>
</g>
<g id="Black-S" transform="matrix(1 0 0 1 2877.35 696)">
<path d="M25 2.92969L87.1094 2.92969C96.6797 2.92969 102.344-2.73438 102.344-12.3047L102.344-46.875C102.344-56.4453 96.6797-62.1094 87.1094-62.1094L84.1797-62.1094L84.1797-65.4297C84.1797-70.4102 81.2988-73.3398 76.3672-73.3398L68.5547-73.3398C63.623-73.3398 60.7422-70.4102 60.7422-65.4297L60.7422-62.1094L51.3672-62.1094L51.3672-65.4297C51.3672-70.4102 48.4863-73.3398 43.5547-73.3398L35.7422-73.3398C30.8105-73.3398 27.9297-70.4102 27.9297-65.4297L27.9297-62.1094L25-62.1094C15.4297-62.1094 9.76562-56.4453 9.76562-46.875L9.76562-12.3047C9.76562-2.73438 15.4297 2.92969 25 2.92969ZM27.2461-11.2305C25-11.2305 23.9258-12.1094 23.9258-14.5508L23.9258-44.6289C23.9258-47.0703 25-47.9492 27.2461-47.9492L84.8633-47.9492C87.1094-47.9492 88.1836-47.0703 88.1836-44.6289L88.1836-14.5508C88.1836-12.1094 87.1094-11.2305 84.8633-11.2305Z"/>
</g>
<g id="Heavy-S" transform="matrix(1 0 0 1 2580.88 696)">
<path d="M24.3652 2.34375L87.3047 2.34375C96.582 2.34375 101.855-2.97852 101.855-12.207L101.855-47.3145C101.855-56.543 96.582-61.8652 87.3047-61.8652L83.8867-61.8652L83.8867-65.5273C83.8867-70.0684 81.2988-72.7539 76.8066-72.7539L68.2617-72.7539C63.7695-72.7539 61.1328-70.0684 61.1328-65.5273L61.1328-61.8652L50.4883-61.8652L50.4883-65.5273C50.4883-70.0684 47.8516-72.7539 43.3594-72.7539L34.8145-72.7539C30.3223-72.7539 27.7344-70.0684 27.7344-65.5273L27.7344-61.8652L24.3652-61.8652C15.0879-61.8652 9.76562-56.543 9.76562-47.3145L9.76562-12.207C9.76562-2.97852 15.0879 2.34375 24.3652 2.34375ZM26.0742-10.1562C23.5352-10.1562 22.2656-11.2793 22.2656-14.0137L22.2656-45.5078C22.2656-48.2422 23.5352-49.3652 26.0742-49.3652L85.5469-49.3652C88.0859-49.3652 89.4043-48.2422 89.4043-45.5078L89.4043-14.0137C89.4043-11.2793 88.0859-10.1562 85.5469-10.1562Z"/>
</g>
<g id="Bold-S" transform="matrix(1 0 0 1 2284.41 696)">
<path d="M23.6328 1.66016L87.5 1.66016C96.4844 1.66016 101.367-3.22266 101.367-12.1094L101.367-47.8027C101.367-56.6895 96.4844-61.5723 87.5-61.5723L83.5938-61.5723L83.5938-65.6738C83.5938-69.6777 81.25-72.0703 77.2461-72.0703L67.9199-72.0703C63.916-72.0703 61.6211-69.6777 61.6211-65.6738L61.6211-61.5723L49.4629-61.5723L49.4629-65.6738C49.4629-69.6777 47.1191-72.0703 43.1641-72.0703L33.7891-72.0703C29.834-72.0703 27.4902-69.6777 27.4902-65.6738L27.4902-61.5723L23.6328-61.5723C14.6973-61.5723 9.76562-56.6895 9.76562-47.8027L9.76562-12.1094C9.76562-3.22266 14.6973 1.66016 23.6328 1.66016ZM24.8047-8.93555C21.9238-8.93555 20.3613-10.3516 20.3613-13.4277L20.3613-46.4844C20.3613-49.5605 21.9238-50.9766 24.8047-50.9766L86.3281-50.9766C89.209-50.9766 90.7715-49.5605 90.7715-46.4844L90.7715-13.4277C90.7715-10.3516 89.209-8.93555 86.3281-8.93555Z"/>
</g>
<g id="Semibold-S" transform="matrix(1 0 0 1 1987.9 696)">
<path d="M23.0957 1.17188L87.6465 1.17188C96.3867 1.17188 100.977-3.36914 100.977-12.0117L100.977-48.1445C100.977-56.7871 96.3867-61.377 87.6465-61.377L83.3496-61.377L83.3496-65.7227C83.3496-69.4336 81.25-71.582 77.5879-71.582L67.6758-71.582C64.0625-71.582 61.9141-69.4336 61.9141-65.7227L61.9141-61.377L48.7793-61.377L48.7793-65.7227C48.7793-69.4336 46.6309-71.582 43.0176-71.582L33.1055-71.582C29.4434-71.582 27.3438-69.4336 27.3438-65.7227L27.3438-61.377L23.0957-61.377C14.4043-61.377 9.76562-56.7871 9.76562-48.1445L9.76562-12.0117C9.76562-3.36914 14.4043 1.17188 23.0957 1.17188ZM23.877-8.10547C20.752-8.10547 19.0918-9.7168 19.0918-12.9883L19.0918-47.168C19.0918-50.4883 20.752-52.0508 23.877-52.0508L86.8652-52.0508C89.9902-52.0508 91.6992-50.4883 91.6992-47.168L91.6992-12.9883C91.6992-9.7168 89.9902-8.10547 86.8652-8.10547Z"/>
</g>
<g id="Medium-S" transform="matrix(1 0 0 1 1691.31 696)">
<path d="M22.7051 0.830078L87.7441 0.830078C96.3379 0.830078 100.732-3.51562 100.732-11.9629L100.732-48.3887C100.732-56.8359 96.3379-61.2305 87.7441-61.2305L83.2031-61.2305L83.2031-65.8203C83.2031-69.2383 81.2012-71.2402 77.832-71.2402L67.5293-71.2402C64.1602-71.2402 62.1582-69.2383 62.1582-65.8203L62.1582-61.2305L48.2422-61.2305L48.2422-65.8203C48.2422-69.2383 46.2891-71.2402 42.8711-71.2402L32.5684-71.2402C29.1992-71.2402 27.1973-69.2383 27.1973-65.8203L27.1973-61.2305L22.7051-61.2305C14.209-61.2305 9.76562-56.8359 9.76562-48.3887L9.76562-11.9629C9.76562-3.51562 14.209 0.830078 22.7051 0.830078ZM23.1934-7.4707C19.9219-7.4707 18.0664-9.22852 18.0664-12.6953L18.0664-47.7051C18.0664-51.1719 19.9219-52.8809 23.1934-52.8809L87.3047-52.8809C90.5762-52.8809 92.3828-51.1719 92.3828-47.7051L92.3828-12.6953C92.3828-9.22852 90.5762-7.4707 87.3047-7.4707Z"/>
</g>
<g id="Regular-S" transform="matrix(1 0 0 1 1394.79 696)">
<path d="M22.2168 0.390625L87.8906 0.390625C96.2402 0.390625 100.342-3.71094 100.342-11.9141L100.342-48.7305C100.342-56.9336 96.2402-61.0352 87.8906-61.0352L82.959-61.0352L82.959-65.8691C82.959-68.9453 81.2012-70.8008 78.1738-70.8008L67.2852-70.8008C64.2578-70.8008 62.4512-68.9453 62.4512-65.8691L62.4512-61.0352L47.5586-61.0352L47.5586-65.8691C47.5586-68.9453 45.8008-70.8008 42.7246-70.8008L31.8848-70.8008C28.8086-70.8008 27.0508-68.9453 27.0508-65.8691L27.0508-61.0352L22.2168-61.0352C13.916-61.0352 9.76562-56.9336 9.76562-48.7305L9.76562-11.9141C9.76562-3.71094 13.916 0.390625 22.2168 0.390625ZM22.3145-6.68945C18.7988-6.68945 16.7969-8.54492 16.7969-12.2559L16.7969-48.3887C16.7969-52.0508 18.7988-53.9551 22.3145-53.9551L87.793-53.9551C91.3086-53.9551 93.3105-52.0508 93.3105-48.3887L93.3105-12.2559C93.3105-8.54492 91.3086-6.68945 87.793-6.68945Z"/>
</g>
<g id="Light-S" transform="matrix(1 0 0 1 1098.42 696)">
<path d="M21.3867-0.292969L88.0371-0.292969C95.752-0.292969 99.6582-4.15039 99.6582-11.7676L99.6582-48.8281C99.6582-56.4453 95.752-60.3516 88.0371-60.3516L83.1055-60.3516L83.1055-65.625C83.1055-68.457 81.4941-70.1172 78.6621-70.1172L67.041-70.1172C64.209-70.1172 62.5977-68.457 62.5977-65.625L62.5977-60.3516L46.7773-60.3516L46.7773-65.625C46.7773-68.457 45.166-70.1172 42.2852-70.1172L30.7129-70.1172C27.832-70.1172 26.2695-68.457 26.2695-65.625L26.2695-60.3516L21.3867-60.3516C13.6719-60.3516 9.76562-56.4941 9.76562-48.8281L9.76562-11.7676C9.76562-4.15039 13.6719-0.292969 21.3867-0.292969ZM21.4844-5.71289C17.4316-5.71289 15.1855-7.86133 15.1855-12.0605L15.1855-48.5352C15.1855-52.7344 17.4316-54.9316 21.4844-54.9316L87.9395-54.9316C91.9434-54.9316 94.2383-52.7344 94.2383-48.5352L94.2383-12.0605C94.2383-7.86133 91.9434-5.71289 87.9395-5.71289Z"/>
</g>
<g id="Thin-S" transform="matrix(1 0 0 1 802.174 696)">
<path d="M20.3125-1.12305L88.1836-1.12305C95.1172-1.12305 98.7305-4.78516 98.7305-11.6211L98.7305-48.9258C98.7305-55.8105 95.1172-59.4727 88.1836-59.4727L83.3008-59.4727L83.3008-65.332C83.3008-67.7734 81.9336-69.2383 79.2969-69.2383L66.748-69.2383C64.1602-69.2383 62.793-67.7734 62.793-65.332L62.793-59.4727L45.7031-59.4727L45.7031-65.332C45.7031-67.7734 44.3359-69.2383 41.748-69.2383L29.1504-69.2383C26.5625-69.2383 25.1953-67.7734 25.1953-65.332L25.1953-59.4727L20.3125-59.4727C13.3789-59.4727 9.76562-55.8594 9.76562-48.9258L9.76562-11.6211C9.76562-4.6875 13.3789-1.12305 20.3125-1.12305ZM20.4102-4.44336C15.625-4.44336 13.0859-6.93359 13.0859-11.8164L13.0859-48.7793C13.0859-53.6133 15.625-56.1523 20.4102-56.1523L88.0859-56.1523C92.7246-56.1523 95.4102-53.6133 95.4102-48.7793L95.4102-11.8164C95.4102-6.93359 92.7246-4.44336 88.0859-4.44336Z"/>
</g>
<g id="Ultralight-S" transform="matrix(1 0 0 1 505.707 696)">
<path d="M19.7754-1.5625L88.2812-1.5625C94.8242-1.5625 98.2422-5.12695 98.2422-11.5234L98.2422-49.0234C98.2422-55.4688 94.8242-58.9844 88.2812-58.9844L83.3984-58.9844L83.3984-65.1855C83.3984-67.4316 82.1289-68.75 79.6387-68.75L66.6016-68.75C64.1113-68.75 62.8906-67.4316 62.8906-65.1855L62.8906-58.9844L45.166-58.9844L45.166-65.1855C45.166-67.4316 43.8965-68.75 41.4062-68.75L28.3691-68.75C25.8789-68.75 24.6582-67.4316 24.6582-65.1855L24.6582-58.9844L19.7754-58.9844C13.2324-58.9844 9.76562-55.5176 9.76562-49.0234L9.76562-11.5234C9.76562-5.0293 13.2324-1.5625 19.7754-1.5625ZM19.873-3.75977C14.6484-3.75977 11.9629-6.44531 11.9629-11.6699L11.9629-48.877C11.9629-54.1016 14.6484-56.7871 19.873-56.7871L88.1836-56.7871C93.1641-56.7871 96.0449-54.1016 96.0449-48.877L96.0449-11.6699C96.0449-6.44531 93.1641-3.75977 88.1836-3.75977Z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 39 KiB

+2 -2
View File
@@ -8,7 +8,7 @@
import AppKit
import UniformTypeIdentifiers
import os
import Synchronization
final class ShareViewController: NSViewController {
@IBOutlet var nameTextField: NSTextField!
@@ -17,7 +17,7 @@ final class ShareViewController: NSViewController {
private struct State: Sendable {
var url: URL?
}
private let state = OSAllocatedUnfairLock(initialState: State())
private let state = Mutex(State())
nonisolated private var url: URL? {
get {
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "Account",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "Account",
@@ -132,6 +132,10 @@ import ActivityLog
return false
}
public var canRefresh: Bool {
!refreshInProgress && !activeAccounts.isEmpty
}
private var isActive = false
public init() {
@@ -82,6 +82,7 @@ public enum FeedbinAccountDelegateError: String, Error, Sendable {
try await account.logActivity(kind: .refreshAll) {
try await refreshAccount(account)
try await refreshArticlesAndStatuses(account)
accountSettings?.lastRefreshCompletedDate = Date()
}
} catch {
refreshProgress.reset()
@@ -948,7 +949,6 @@ private extension FeedbinAccountDelegate {
guard let page else {
if let lastArticleFetch = updateFetchDate {
accountSettings?.lastArticleFetchStartTime = lastArticleFetch
accountSettings?.lastRefreshCompletedDate = Date()
}
return
}
@@ -9,6 +9,7 @@
import Foundation
@preconcurrency import AuthenticationServices
import os
import Synchronization
import ActivityLog
import RSCore
@@ -48,7 +49,7 @@ struct UnableToStartASWebAuthenticationSessionError: LocalizedError, Sendable {
private struct State: @unchecked Sendable {
var presentationAnchor: ASPresentationAnchor?
}
private let state = OSAllocatedUnfairLock(initialState: State())
private let state = Mutex(State())
var presentationAnchor: ASPresentationAnchor? {
get {
@@ -84,7 +85,7 @@ public final class OAuthAccountAuthorizationOperation: MainThreadOperation, @unc
private struct SessionState: @unchecked Sendable {
var session: ASWebAuthenticationSession?
}
private let sessionState = OSAllocatedUnfairLock(initialState: SessionState())
private let sessionState = Mutex(SessionState())
private let accountType: AccountType
private let oauthClient: OAuthAuthorizationClient
private let anchorProvider = PresentationAnchorProvider()
@@ -237,7 +237,6 @@ import os
guard let hashes = hashes, !hashes.isEmpty else {
if let lastArticleFetch = updateFetchDate {
self.accountSettings?.lastArticleFetchStartTime = lastArticleFetch
self.accountSettings?.lastRefreshCompletedDate = Date()
}
return
}
@@ -152,6 +152,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate {
await refreshMissingArticles(account)
refreshProgress.reset()
accountSettings?.lastRefreshCompletedDate = Date()
}
} catch where rateLimiter.isRateLimitError(error) {
refreshProgress.reset()
@@ -518,7 +518,6 @@ struct ReaderAPIUsageLimits {
guard let continuation else {
if type == .allForAccount {
self.accountSettings?.lastArticleFetchStartTime = dateInfo?.date
self.accountSettings?.lastRefreshCompletedDate = Date()
}
return itemIDs
}
+1 -1
View File
@@ -4,7 +4,7 @@ import PackageDescription
let package = Package(
name: "ActivityLog",
defaultLocalization: "en",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "ActivityLog",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "Articles",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "Articles",
@@ -7,7 +7,7 @@
//
import Foundation
import os
import Synchronization
public final class ArticleStatus: Hashable, Sendable {
@@ -27,7 +27,7 @@ public final class ArticleStatus: Hashable, Sendable {
var starred: Bool
}
private let state: OSAllocatedUnfairLock<State>
private let state: Mutex<State>
public var read: Bool {
get {
@@ -49,7 +49,7 @@ public final class ArticleStatus: Hashable, Sendable {
public init(articleID: String, read: Bool, starred: Bool, dateArrived: Date) {
self.articleID = articleID
self.state = OSAllocatedUnfairLock(initialState: State(read: read, starred: starred))
self.state = Mutex(State(read: read, starred: starred))
self.dateArrived = dateArrived
}
@@ -6,7 +6,7 @@
//
import Foundation
import os
import Synchronization
import RSCore
/// Caches `Author` values by `authorID` so articles by the same author share
@@ -15,7 +15,7 @@ public final class AuthorCache: Sendable {
public static let shared = AuthorCache()
private let cache = OSAllocatedUnfairLock<[String: Author]>(initialState: [:])
private let cache = Mutex<[String: Author]>([:])
init() {
if !Platform.isRunningUnitTests {
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "ArticlesDatabase",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "ArticlesDatabase",
@@ -12,6 +12,7 @@ import RSCore
import RSDatabase
import RSDatabaseObjC
import RSParser
import Synchronization
import Articles
final class ArticlesTable: DatabaseTable, Sendable {
@@ -22,7 +23,7 @@ final class ArticlesTable: DatabaseTable, Sendable {
private let statusesTable: StatusesTable
private let searchTable: SearchTable
private let retentionStyle: ArticlesDatabase.RetentionStyle
private let articlesCache = OSAllocatedUnfairLock(initialState: [String: Article]())
private let articlesCache = Mutex([String: Article]())
private static let logger = Logger(subsystem: Logger.nnwSubsystem, category: "ArticlesTable")
private static let signposter = OSSignposter(subsystem: Logger.nnwSubsystem, category: .pointsOfInterest)
@@ -11,6 +11,7 @@ import os
import RSCore
import RSDatabase
import RSDatabaseObjC
import Synchronization
import Articles
// Article->ArticleStatus is a to-one relationship.
@@ -325,7 +326,7 @@ private final class StatusCache: Sendable {
var dictionary = [String: ArticleStatus]()
}
private let state = OSAllocatedUnfairLock(initialState: State())
private let state = Mutex(State())
func addStatusIfNotCached(_ status: ArticleStatus) {
addIfNotCached(Set([status]))
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "CloudKitSync",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "CloudKitSync",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "ErrorLog",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "ErrorLog",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "FeedFinder",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "FeedFinder",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "HTMLMetadata",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "HTMLMetadata",
@@ -11,6 +11,7 @@ import os
import RSCore
import RSParser
import RSWeb
import Synchronization
import ActivityLog
nonisolated public final class HTMLMetadataDownloader: Sendable {
@@ -21,10 +22,10 @@ nonisolated public final class HTMLMetadataDownloader: Sendable {
private static let hoursBetweenAttempts = 3
private let attemptDates = OSAllocatedUnfairLock(initialState: [String: Date]())
private let attemptDates = Mutex([String: Date]())
/// In-memory mirror so `cachedMetadata(for:)` can answer synchronously.
private let cache = OSAllocatedUnfairLock(initialState: [String: HTMLMetadataRecord]())
private let cache = Mutex([String: HTMLMetadataRecord]())
init() {
NotificationCenter.default.addObserver(self, selector: #selector(handleAppDidGoToBackground(_:)), name: .appDidGoToBackground, object: nil)
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "Images",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "Images",
@@ -11,7 +11,7 @@ import AppKit
#else
import UIKit
#endif
import os
import Synchronization
import RSCore
extension RSImage {
@@ -24,7 +24,7 @@ public final class IconImage: @unchecked Sendable {
public let isBackgroundSuppressed: Bool
public let preferredColor: RSColor?
private let cachedLuminanceType = OSAllocatedUnfairLock<ImageLuminanceType?>(initialState: nil)
private let cachedLuminanceType = Mutex<ImageLuminanceType?>(nil)
private static let luminanceQueue = DispatchQueue(label: "com.ranchero.NetNewsWire.IconImage.luminance", qos: .utility, attributes: .concurrent)
public var isDark: Bool {
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "NewsBlur",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "NewsBlur",
@@ -7,7 +7,7 @@
//
import Foundation
import os
import Synchronization
import RSWeb
import Secrets
@@ -17,13 +17,13 @@ public final class NewsBlurAPICaller: Sendable {
let baseURL = URL(string: "https://www.newsblur.com/")!
let session = URLSession.makeWebserviceSession()
private let suspendedLock = OSAllocatedUnfairLock(initialState: false)
private let suspendedLock = Mutex(false)
var suspended: Bool {
get { suspendedLock.withLock { $0 }}
set { suspendedLock.withLock { $0 = newValue }}
}
private let credentialsLock = OSAllocatedUnfairLock<Credentials?>(initialState: nil)
private let credentialsLock = Mutex<Credentials?>(nil)
public var credentials: Credentials? {
get { credentialsLock.withLock { $0 }}
set { credentialsLock.withLock { $0 = newValue }}
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "RSCore",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(name: "RSCore", type: .dynamic, targets: ["RSCore"]),
.library(name: "RSCoreObjC", type: .dynamic, targets: ["RSCoreObjC"]),
@@ -34,14 +34,32 @@ public extension NSTableView {
}
/// The part of the document the user can actually see. documentVisibleRect includes
/// the area under the toolbar, and under the sidebar on macOS 26.
/// the area under the toolbar, under the sidebar on macOS 26, and under the header view.
private var unobscuredDocumentRect: NSRect? {
guard let scrollView = self.enclosingScrollView else {
return nil
}
let contentInsets = scrollView.contentInsets
let documentVisibleRect = scrollView.documentVisibleRect
return NSRect(x: documentVisibleRect.minX + contentInsets.left, y: documentVisibleRect.minY + contentInsets.top, width: documentVisibleRect.width - contentInsets.left - contentInsets.right, height: documentVisibleRect.height - contentInsets.top - contentInsets.bottom)
var rect = NSRect(x: documentVisibleRect.minX + contentInsets.left, y: documentVisibleRect.minY + contentInsets.top, width: documentVisibleRect.width - contentInsets.left - contentInsets.right, height: documentVisibleRect.height - contentInsets.top - contentInsets.bottom)
// The header floats over the clip view but isn’t part of contentInsets.
if let headerView, headerView.window != nil {
let headerBottom = convert(headerView.bounds, from: headerView).maxY
if headerBottom > rect.minY {
rect.size.height = max(0, rect.maxY - headerBottom)
rect.origin.y = headerBottom
}
}
return rect
}
func isRowFullyVisible(_ row: Int) -> Bool {
guard let unobscuredDocumentRect else {
return false
}
return unobscuredDocumentRect.contains(rect(ofRow: row))
}
func scrollTo(row: Int, extraHeight: Int = 150) {
@@ -49,15 +67,19 @@ public extension NSTableView {
return
}
let r = rect(ofRow: row)
if unobscuredDocumentRect.contains(r) {
if isRowFullyVisible(row) {
return
}
// Center the row in the unobscured area, which starts contentInsets.top below the clip view’s origin.
let r = rect(ofRow: row)
// Center the row in the unobscured area, which starts obscuredTop below the clip view’s origin.
let obscuredTop = unobscuredDocumentRect.minY - scrollView.documentVisibleRect.minY
let rMidY = r.midY
// extraHeight shifts the row up from center — cap it so the row stays below the header in short tables.
let maximumExtraHeight = max(0, floor((unobscuredDocumentRect.size.height - r.height) / 2.0))
let clampedExtraHeight = min(CGFloat(extraHeight), maximumExtraHeight)
var scrollPoint = NSPoint.zero
scrollPoint.y = floor(rMidY - (unobscuredDocumentRect.size.height / 2.0) - scrollView.contentInsets.top) + CGFloat(extraHeight)
scrollPoint.y = floor(rMidY - (unobscuredDocumentRect.size.height / 2.0) - obscuredTop) + clampedExtraHeight
let clipView = scrollView.contentView
@@ -67,14 +89,26 @@ public extension NSTableView {
clipView.animator().bounds = clipView.constrainBoundsRect(rClipView)
}
func scrollToRowIfNotVisible(_ row: Int) {
if let followingRow = rowView(atRow: row, makeIfNecessary: false) {
if !(visibleRowViews()?.contains(followingRow) ?? false) {
scrollTo(row: row, extraHeight: 0)
}
} else {
scrollTo(row: row, extraHeight: 0)
/// A row above the visible area scrolls down just far enough to show it.
/// A row below the visible area is centered, so the rows after it show too.
func scrollRowFullyIntoView(_ row: Int) {
guard let scrollView = self.enclosingScrollView, let unobscuredDocumentRect else {
return
}
let r = rect(ofRow: row)
if r.maxY > unobscuredDocumentRect.maxY {
scrollTo(row: row, extraHeight: 0)
return
}
guard r.minY < unobscuredDocumentRect.minY else {
return
}
let clipView = scrollView.contentView
var bounds = clipView.bounds
bounds.origin.y += r.minY - unobscuredDocumentRect.minY
clipView.animator().bounds = clipView.constrainBoundsRect(bounds)
}
func visibleRowViews() -> [NSTableRowView]? {
@@ -7,11 +7,11 @@
//
import Foundation
import os
import Synchronization
nonisolated public final class BinaryDiskCache: Sendable {
public let folder: String
private let mutex = OSAllocatedUnfairLock(initialState: ())
private let mutex = Mutex(())
public init(folder: String) {
self.folder = folder
+2 -2
View File
@@ -6,7 +6,7 @@
//
import Foundation
import os
import Synchronization
public protocol CacheRecord: Sendable {
var dateCreated: Date { get }
@@ -21,7 +21,7 @@ public final class Cache<T: CacheRecord>: Sendable {
var lastCleanupDate = Date()
var cache = [String: T]()
}
private let stateLock = OSAllocatedUnfairLock(initialState: State())
private let stateLock = Mutex(State())
public init(timeToLive: TimeInterval, timeBetweenCleanups: TimeInterval) {
self.timeToLive = timeToLive
@@ -7,7 +7,7 @@
//
import Foundation
import os
import Synchronization
/// Code to be run by MainThreadOperationQueue on @MainActor.
///
@@ -31,7 +31,7 @@ import os
private struct State: Sendable {
var isCanceled = false
}
private let state = OSAllocatedUnfairLock(initialState: State())
private let state = Mutex(State())
// Check this at appropriate times in case the operation has been canceled.
nonisolated public var isCanceled: Bool {
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "RSDatabase",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "RSDatabase",
@@ -13,16 +13,8 @@ import RSDatabaseObjC
/// Manage a serial queue and a SQLite database.
public final class DatabaseQueue: Sendable {
private struct State: @unchecked Sendable {
var isCallingDatabase = false
let database: FMDatabase
init(_ database: FMDatabase) {
self.database = database
}
}
private let state: OSAllocatedUnfairLock<State>
nonisolated(unsafe) private let database: FMDatabase // Used on serial dispatch queue only
private let databasePath: String
private let serialDispatchQueue: DispatchQueue
@@ -34,10 +26,9 @@ public final class DatabaseQueue: Sendable {
self.serialDispatchQueue = DispatchQueue(label: "DatabaseQueue (Serial) - \(databasePath)")
self.databasePath = databasePath
let database = FMDatabase(path: databasePath)!
self.state = OSAllocatedUnfairLock(initialState: State(database))
self.database = FMDatabase(path: databasePath)!
self.state.withLock { openDatabase($0.database) }
openDatabase(database)
}
// MARK: - Make Database Calls
@@ -48,18 +39,14 @@ public final class DatabaseQueue: Sendable {
/// scheduled on the queue. Use sparingly — prefer async versions.
public func runInDatabaseSync(_ databaseBlock: DatabaseBlock) {
serialDispatchQueue.sync {
self.state.withLock { state in
self._runInDatabase(&state, databaseBlock, false)
}
self._runInDatabase(databaseBlock, false)
}
}
/// Run a DatabaseBlock asynchronously.
public func runInDatabase(_ databaseBlock: @escaping DatabaseBlock) {
serialDispatchQueue.async {
self.state.withLock { state in
self._runInDatabase(&state, databaseBlock, false)
}
self._runInDatabase(databaseBlock, false)
}
}
@@ -69,9 +56,7 @@ public final class DatabaseQueue: Sendable {
/// prefer the async `runInTransaction` instead.
public func runInTransactionSync(_ databaseBlock: @escaping DatabaseBlock) {
serialDispatchQueue.sync {
self.state.withLock { state in
self._runInDatabase(&state, databaseBlock, true)
}
self._runInDatabase(databaseBlock, true)
}
}
@@ -79,9 +64,7 @@ public final class DatabaseQueue: Sendable {
/// Transactions help performance significantly when updating the database.
public func runInTransaction(_ databaseBlock: @escaping DatabaseBlock) {
serialDispatchQueue.async {
self.state.withLock { state in
self._runInDatabase(&state, databaseBlock, true)
}
self._runInDatabase(databaseBlock, true)
}
}
@@ -116,21 +99,16 @@ public final class DatabaseQueue: Sendable {
private extension DatabaseQueue {
private func _runInDatabase(_ state: inout State, _ databaseBlock: DatabaseBlock, _ useTransaction: Bool) {
precondition(!state.isCallingDatabase)
state.isCallingDatabase = true
defer {
state.isCallingDatabase = false
}
private func _runInDatabase(_ databaseBlock: DatabaseBlock, _ useTransaction: Bool) {
dispatchPrecondition(condition: .onQueue(serialDispatchQueue))
autoreleasepool {
if useTransaction {
state.database.beginTransaction()
database.beginTransaction()
}
databaseBlock(state.database)
databaseBlock(database)
if useTransaction {
state.database.commit()
database.commit()
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "RSParser",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "RSParser",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "RSTree",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "RSTree",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "RSWeb",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "RSWeb",
@@ -7,7 +7,7 @@
import Foundation
import Network
import os
import Synchronization
nonisolated public final class NetworkMonitor: Sendable {
public static let shared = NetworkMonitor()
@@ -22,7 +22,7 @@ nonisolated public final class NetworkMonitor: Sendable {
var isConstrained = false
}
private let state = OSAllocatedUnfairLock<State>(initialState: State())
private let state = Mutex(State())
/// `true` until `NWPathMonitor` delivers its first path, so callers attempt
/// network work rather than skip it on an answer we don't have yet.
+6 -1
View File
@@ -14,7 +14,12 @@ private struct URLConstants {
static let schemeMailto = "mailto"
static let prefixHTTP = "http://"
static let prefixHTTPS = "https://"
#if os(macOS)
static let schemeMagnet = "magnet"
static let allowedSchemesForOpening: Set<String> = [schemeHTTP, schemeHTTPS, schemeMailto, schemeMagnet]
#else
static let allowedSchemesForOpening: Set<String> = [schemeHTTP, schemeHTTPS, schemeMailto]
#endif
}
public extension URL {
@@ -60,7 +65,7 @@ public extension URL {
}
func preparedForOpeningInBrowser() -> URL? {
// Open http, https, and mailto links only.
// Open http, https, and mailto links only, plus magnet on macOS.
guard let scheme = scheme?.lowercased(with: localeForLowercasing),
URLConstants.allowedSchemesForOpening.contains(scheme) else {
return nil
@@ -6,7 +6,7 @@
//
import Foundation
import os
import Synchronization
public final class TestingURLProtocol: URLProtocol {
@@ -49,7 +49,7 @@ public final class TestingURLProtocol: URLProtocol {
/// Maps a test ID to its state. Requests from a session built outside a
/// `currentTestID` scope use `sharedTestID`.
private static let testStates = OSAllocatedUnfairLock<[String: TestState]>(initialState: [:])
private static let testStates = Mutex<[String: TestState]>([:])
private static let sharedTestID = "shared"
@@ -17,6 +17,17 @@ struct URLPreparedForOpeningTests {
#expect(try url("mailto:me@example.com").preparedForOpeningInBrowser() != nil)
}
#if os(macOS)
@Test func allowsMagnetScheme() throws {
#expect(try url("magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a&dn=example").preparedForOpeningInBrowser() != nil)
#expect(try url("Magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a").preparedForOpeningInBrowser() != nil)
}
#else
@Test func blocksMagnetScheme() throws {
#expect(try url("magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a&dn=example").preparedForOpeningInBrowser() == nil)
}
#endif
@Test func blocksOtherSchemes() throws {
#expect(try url("smb://server/share").preparedForOpeningInBrowser() == nil)
#expect(try url("file:///etc/passwd").preparedForOpeningInBrowser() == nil)
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "Secrets",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "Secrets",
+1 -1
View File
@@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "SyncDatabase",
platforms: [.macOS(.v15), .iOS(.v17)],
platforms: [.macOS(.v15), .iOS(.v18)],
products: [
.library(
name: "SyncDatabase",
@@ -117,8 +117,12 @@ import Account
self.body = ArticleRenderingSpecialCases.extractBodyFragmentIfNeeded(content)
self.baseURL = extractedArticle?.url
} else {
let articleBody = ArticleRenderingSpecialCases.extractBodyFragmentIfNeeded(article?.body ?? "")
self.body = ArticleRenderingSpecialCases.insertParagraphTagsIfNeeded(articleBody, feedURL: article?.feed?.url, homePageURL: article?.feed?.homePageURL)
let feedURL = article?.feed?.url
let homePageURL = article?.feed?.homePageURL
var articleBody = ArticleRenderingSpecialCases.extractBodyFragmentIfNeeded(article?.body ?? "")
articleBody = ArticleRenderingSpecialCases.insertParagraphTagsIfNeeded(articleBody, feedURL: feedURL, homePageURL: homePageURL)
articleBody = ArticleRenderingSpecialCases.removeStrayLineBreaksIfNeeded(articleBody, feedURL: feedURL, homePageURL: homePageURL)
self.body = articleBody
self.baseURL = article?.baseURL?.absoluteString
}
}
@@ -42,6 +42,32 @@ struct ArticleRenderingSpecialCases {
return consecutiveReturnsRegex.stringByReplacingMatches(in: html, range: range, withTemplate: "<p>")
}
private static let feedDomainsWithStrayLineBreaks = ["macrumors.com"]
// One or more <br>s right after a tag where a <br> can't appear — between list items,
// table rows, or table cells. Not after an opening <li>, <td>, or <th>: a <br> there is content.
private static let strayLineBreaksRegex = try? NSRegularExpression(
pattern: "(<(?:ul|ol|table|thead|tbody|tfoot|tr)\\b[^>]*>|</(?:li|tr|td|th|thead|tbody|tfoot)>)(?:\\s*<br\\s*/?>)+",
options: [.caseInsensitive]
)
/// MacRumors puts a <br/> after every line of its feed HTML, including inside lists and tables.
/// In lists each one renders as a blank line. In tables the HTML parser moves them all
/// to just before the table, leaving a huge gap above it. Remove them before parsing,
/// while they’re still recognizable.
/// <https://github.com/Ranchero-Software/NetNewsWire/issues/5498>
static func removeStrayLineBreaksIfNeeded(_ html: String, feedURL: String?, homePageURL: String?) -> String {
guard anyURLStringMatchesAnyDomain([feedURL, homePageURL], feedDomainsWithStrayLineBreaks) else {
return html
}
guard html.range(of: "<br", options: .caseInsensitive) != nil, let strayLineBreaksRegex else {
return html
}
let range = NSRange(html.startIndex..., in: html)
return strayLineBreaksRegex.stringByReplacingMatches(in: html, range: range, withTemplate: "$1")
}
static func filterHTMLIfNeeded(baseURL: String, html: String) -> String {
var filteredHTML = removeLocationHrefRedirectScripts(html)
@@ -7,7 +7,7 @@
//
import Foundation
import os
import Synchronization
import RSCore
public extension Notification.Name {
@@ -87,7 +87,7 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Sendable {
var currentTheme = ArticleTheme.defaultTheme
var themeNames = [AppDefaults.defaultThemeName]
}
private let state = OSAllocatedUnfairLock(initialState: State())
private let state = Mutex(State())
@MainActor private var didStart = false
+3 -21
View File
@@ -42,27 +42,9 @@ struct Assets {
nonisolated static var nnwFeedIcon: RSImage { RSImage(named: "nnwFeedIcon")! }
static var faviconTemplate: RSImage { RSImage(named: "faviconTemplateImage")! }
static let articleExtractorOff: RSImage = {
if #available(iOS 18, macOS 15, *) {
return RSImage(symbol: "text.page")!
} else {
return RSImage(symbol: "doc.plaintext")!
}
}()
static let articleExtractorOn: RSImage = {
if #available(iOS 18, macOS 15, *) {
return RSImage(symbol: "text.page.fill")!
} else {
return RSImage(symbol: "doc.plaintext.fill")!
}
}()
static let articleExtractorError: RSImage = {
if #available(iOS 18, macOS 15, *) {
return RSImage(symbol: "text.page.slash")!
} else {
return RSImage(symbol: "exclamationmark.triangle")!
}
}()
static let articleExtractorOff: RSImage = RSImage(symbol: "text.page")!
static let articleExtractorOn: RSImage = RSImage(symbol: "text.page.fill")!
static let articleExtractorError: RSImage = RSImage(symbol: "text.page.slash")!
static let share = RSImage(symbol: "square.and.arrow.up")!
static let folder = RSImage(symbol: "folder")!
static let starredFeed = IconImage(starClosed, isSymbol: true, isBackgroundSuppressed: true, preferredColor: Assets.Colors.star)
+66 -21
View File
@@ -45,27 +45,8 @@
"%lld months" : {
"comment" : "Dinosaur staleness threshold in months"
},
"Are you sure you want to delete the account “%@”? This cannot be undone." : {
"comment" : "Delete account alert message",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "¿Seguro que quieres eliminar la cuenta «%@»? Esta acción no se puede deshacer."
}
}
}
},
"Delete “%@”?" : {
"comment" : "Delete account alert title",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "¿Eliminar «%@»?"
}
}
}
"^[%lld folder](inflect: true), ^[%lld feed](inflect: true)" : {
"comment" : "Status bar: number of folders and feeds"
},
"🦖 Dinosaurs" : {
"comment" : "The title of the Dinosaurs screen.",
@@ -116,6 +97,9 @@
}
}
},
"Actions" : {
"comment" : "Status bar gear menu accessibility label"
},
"Active" : {
"localizations" : {
"es" : {
@@ -218,6 +202,17 @@
"Are you sure you want to delete the %d selected items?" : {
"comment" : "Items delete text"
},
"Are you sure you want to delete the account “%@”? This cannot be undone." : {
"comment" : "Delete account alert message",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "¿Seguro que quieres eliminar la cuenta «%@»? Esta acción no se puede deshacer."
}
}
}
},
"Are you sure you want to delete the feed “%@”?" : {
"comment" : "Delete feed alert message"
},
@@ -371,6 +366,9 @@
}
}
},
"Copy" : {
"comment" : "Command"
},
"Copy Article URL" : {
"comment" : "Command"
},
@@ -449,6 +447,17 @@
}
}
},
"Delete “%@”?" : {
"comment" : "Delete account alert title",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "¿Eliminar «%@»?"
}
}
}
},
"Delete Feed" : {
"comment" : "Delete Feed"
},
@@ -695,6 +704,15 @@
"Hide Read Feeds" : {
"comment" : "Command"
},
"Hide Sidebar" : {
"comment" : "Command"
},
"Hide Status Bar" : {
"comment" : "Command"
},
"Hide Theme Menu in Status Bar" : {
"comment" : "Command"
},
"How to Optimize iCloud Syncing" : {
"comment" : "Help link"
},
@@ -865,6 +883,18 @@
"Multiple" : {
"comment" : "Multiple"
},
"Multiple feeds" : {
"comment" : "Status bar gear menu: header for a selection of several feeds"
},
"Multiple folders" : {
"comment" : "Status bar gear menu: header for a selection of several folders"
},
"Multiple selection" : {
"comment" : "Status bar gear menu: header for a selection of different kinds of items"
},
"Multiple smart feeds" : {
"comment" : "Status bar gear menu: header for a selection of several smart feeds"
},
"Name" : {
"comment" : "Name field placeholder"
},
@@ -944,6 +974,9 @@
"No results" : {
"comment" : "No results"
},
"Not updated yet" : {
"comment" : "Status bar: no refresh has completed yet"
},
"Notifications" : {
"comment" : "Notifications"
},
@@ -1185,6 +1218,15 @@
"Show Reader View" : {
"comment" : "Show Reader View"
},
"Show Sidebar" : {
"comment" : "Command"
},
"Show Status Bar" : {
"comment" : "Command"
},
"Show Theme Menu in Status Bar" : {
"comment" : "Command"
},
"Show Website" : {
"comment" : "Show Website"
},
@@ -1248,6 +1290,9 @@
"Starred" : {
"comment" : "Starred"
},
"Status Bar" : {
"comment" : "Main window status bar accessibility label"
},
"Status Records" : {
"comment" : "Status records section header"
},
@@ -9,6 +9,7 @@
import Foundation
import RSCore
import os
import Synchronization
import Account
final class ExtensionFeedAddRequestFile: NSObject, NSFilePresenter, Sendable {
@@ -36,7 +37,7 @@ final class ExtensionFeedAddRequestFile: NSObject, NSFilePresenter, Sendable {
operationQueue
}
private let didStart = OSAllocatedUnfairLock(initialState: false)
private let didStart = Mutex(false)
func start() {
let alreadyStarted = didStart.withLock { didStart -> Bool in
+53
View File
@@ -1,5 +1,58 @@
# Mac Release Notes
### 7.3b1 7225 20 Oct 2026 - branch: main tag: mac-7.3b1
Restored the status bar from NetNewsWire of Yore (NetNewsWire 1-3). Show and hide it via the View menu
### 7.2.1 7224 19 Oct 2026 - branch: main tag: mac-7.2.1
Same as 7.2.1b1 — just bumped the version.
Changes since 7.2:
Fixed bug where navigated-to row, in column layout, might appear under column headers
Fixed bug where scroller hiding/showing could mess up sidebar layout
Added magnet as an allowed link scheme
### 7.2.1b1 7223 18 Oct 2026 - branch: main tag: mac-7.2.1b1
Fixed bug where navigated-to row, in column layout, might appear under column headers
Fixed bug where scroller hiding/showing could mess up sidebar layout
Added magnet as an allowed link scheme
### 7.2 7222 14 Oct 2026 - branch: main tag: mac-7.2
Changes since 7.2b4:
Fixed column view bug where next-unread could scroll to a row that’s hidden under the column headers
Changes since 7.1.5:
Added unread count display setting — show the count, show a dot, or hide it — which applies to the Dock icon badge, window title, and sidebar
Added column layout for the timeline — choose View > Use Column Layout
Expanded View > Sort Articles By with more options (works with standard and column layouts)
Made timeline sorting per window instead of one setting for the whole app
Made the Add Feed sheet start with the folder or account selected in the sidebar
Changed the message for adding a feed that’s already added to include the name of the folder (or folders)
Fixed bug where YouTube embeds in articles showed an error instead of playing
Fixed bug where embedded videos with no set height — such as Inoreader’s YouTube player — collapsed to a short strip
Fixed extra whitespace at the end of Slashdot articles and paragraphs running together
Fixed parsing of RSS feed titles when a feed contains a textinput section (Slashdot, for instance)
Added support for the instapaper_ignore class — elements marked with it are now removed from articles
Changed tabs in pre and code elements in articles to display as four spaces
Improved finding feeds in a page by skipping links to PDFs, movies, and other files that can’t be feeds
Changed finding a feed to use the redirected-to URL
Sped up Today and unread count queries
Added up to 500 characters of the HTTP error response body to Error Log entries
Fixed bug where the sidebar could reopen with no width when it had been collapsed in 7.1.x
Fixed a memory leak when closing a main window
Fixed a possible crash when the sidebar or timeline had no visible rows
Changed sorting by title and by feed to sort numbers by value — “Episode 2” comes before “Episode 10”
Added support for Substack-style footnotes
Improved CJK text rendering in the article view by adding text-autospace
Fixed horizontal overflow of WordPress Math blocks and SVGs in the Tiqoe Dark theme
Improved font sizing and fixed superscript orphans in table cells in the Tiqoe Dark theme
### 7.2b4 7221 11 Oct 2026 - branch: main tag: mac-7.2b4
Fixed bug where embedded videos with no set height — such as Inoreader’s YouTube player — collapsed to a short strip
+34
View File
@@ -2,6 +2,40 @@
### 7.2 build 7221 11 Oct 2026 - branch: main tag: iOS-7.2-7221
Submitted to App Store 15 Oct. 2026. Originally a TestFlight release.
Changes since 7.1.4:
Added unread count display setting — show the count, show a dot, or hide it — which applies to the app icon badge, feeds list, and widgets
Sped up Today and unread count queries
Fixed bug where the timeline selection was cleared when using the left arrow or shift-tab to go back to the feeds list (when multiple columns are showing)
Changed the selection color in the feeds list to blue when it has keyboard focus and multiple columns are showing
Fixed timeline text sometimes showing white on the gray selection background
Stopped the scroll animation when restoring the selection in the feeds list and timeline
Changed sort-by-feed to sort feed names with numbers by value — “Episode 2” comes before “Episode 10”
Fixed bug where YouTube embeds in articles showed an error instead of playing
Fixed extra whitespace at the end of Slashdot articles and paragraphs running together
Added support for the instapaper_ignore class — elements marked with it are now removed from articles
Added support for Substack-style footnotes
Improved CJK text rendering in the article view by adding text-autospace
Changed tabs in pre and code elements in articles to display as four spaces
Improved font sizing and fixed superscript orphans in table cells in the Tiqoe Dark theme
Fixed horizontal overflow of WordPress Math blocks and SVGs in the Tiqoe Dark theme
Fixed parsing of RSS feed titles when a feed contains a textinput section (Slashdot, for instance)
Fixed Slashdot feed detection (for Slashdot special cases) when the feed comes through a proxy such as FeedBurner
Improved finding feeds in a page by skipping links to PDFs, movies, and other files that can’t be feeds
Improved finding feeds in a page by skipping links to X, Twitter, Facebook, and Instagram
Changed finding a feed to use the redirected-to URL
Fixed bug where some sites with “youtube” in their names were treated as YouTube
Offered Update Credentials in the account error alert for all username and password accounts, not just Feedbin
Filled in the API URL when editing a FreshRSS account’s credentials
Removed a newly added account when its credentials can’t be saved to the keychain
Stopped account sheets from being swiped away while they’re working
Added up to 500 characters of the HTTP error response body to Error Log entries
Trimmed spaces from folder names when adding a folder
Changes since 7.2 (7220):
Fixed bug on iPad where fullscreen YouTube videos were black with audio only
Fixed bug where embedded videos with no set height — such as Inoreader’s YouTube player — collapsed to a short strip
+6 -6
View File
@@ -5,16 +5,16 @@ https://github.com/Ranchero-Software/NetNewsWire/milestone/74
## iOS
iOS shipping: 7.1.4 (7213)
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/iOS-7.1.3-7206
iOS shipping: 7.2 (7221)
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/iOS-7.2-7221
iOS beta: 7.2 (7221)
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/iOS-7.2-7221
## Mac
Mac shipping: 7.1.5
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.1.5
Mac shipping: 7.2.1
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.2.1
Mac beta: 7.2b4
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.2b4
Mac beta: 7.3b1
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-7.3b1
@@ -104,6 +104,31 @@ import Testing
#expect(result == html)
}
// MARK: - MacRumors stray line breaks
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5498>
// From the MacRumors feed on 2026-10-19, cut to one list item.
@Test func macRumorsListLosesStrayLineBreaks() {
let html = "GM said the rollout will occur as follows.\n<br/>\n\n<br/>\n<p><h2>September–October 2026</h2></p>\n<br/>\n<ul>\n<br/>\n <li>Cadillac Vistiq (2027)</li>\n<br/>\n</ul>GM said customers will see a notification."
let expected = "GM said the rollout will occur as follows.\n<br/>\n\n<br/>\n<p><h2>September–October 2026</h2></p>\n<br/>\n<ul>\n <li>Cadillac Vistiq (2027)</li>\n</ul>GM said customers will see a notification."
let result = ArticleRenderingSpecialCases.removeStrayLineBreaksIfNeeded(html, feedURL: "https://feeds.macrumors.com/MacRumors-All", homePageURL: nil)
#expect(result == expected)
}
@Test func macRumorsTableLosesStrayLineBreaksButKeepsCellLineBreaks() {
let html = "<table class=\"specs\">\n<br/>\n<tr>\n<br/>\n<th>Height</th>\n<br/>\n<td>5.91 inches</td>\n<br/>\n<td>closed<br/>open</td>\n<br/>\n</tr>\n<br/>\n</table>\n<br/>\nAfter."
let expected = "<table class=\"specs\">\n<tr>\n<th>Height</th>\n<td>5.91 inches</td>\n<td>closed<br/>open</td>\n</tr>\n</table>\n<br/>\nAfter."
let result = ArticleRenderingSpecialCases.removeStrayLineBreaksIfNeeded(html, feedURL: nil, homePageURL: "https://www.macrumors.com/")
#expect(result == expected)
}
@Test func otherFeedsKeepLineBreaksInListsAndTables() {
let html = "<ul>\n<br/>\n<li>Item</li>\n<br/>\n</ul><table>\n<br/>\n<tr><td>Cell</td></tr></table>"
let result = ArticleRenderingSpecialCases.removeStrayLineBreaksIfNeeded(html, feedURL: "https://example.com/feed.xml", homePageURL: "https://example.com/")
#expect(result == html)
}
// MARK: - Base URL for YouTube articles
// <https://github.com/Ranchero-Software/NetNewsWire/issues/4860>
@@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "Icon_1024x1024.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 969 KiB

@@ -1,38 +0,0 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.130",
"green" : "0.130",
"red" : "0.130"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
+2 -1
View File
@@ -9,6 +9,7 @@
import UIKit
@preconcurrency import BackgroundTasks
import os
import Synchronization
import WidgetKit
import RSCore
import RSWeb
@@ -424,7 +425,7 @@ private extension AppDelegate {
Self.logger.info("Performing background refresh.")
let refreshTaskIsCompleted = OSAllocatedUnfairLock(initialState: false)
let refreshTaskIsCompleted = Mutex(false)
enum RefreshOutcome {
case completed
-1
View File
@@ -343,7 +343,6 @@ extension ImageScrollView: UIScrollViewDelegate {
return false
}
@available(iOS 11.0, *)
public func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) {
imageScrollViewDelegate?.scrollViewDidChangeAdjustedContentInset?(scrollView)
}
+2 -6
View File
@@ -48,9 +48,7 @@ enum KeyboardType: String, Sendable {
static func createKeyCommand(title: String, action: String, input: String, modifiers: UIKeyModifierFlags) -> UIKeyCommand {
let selector = NSSelectorFromString(action)
let keyCommand = UIKeyCommand(title: title, image: nil, action: selector, input: input, modifierFlags: modifiers, propertyList: nil, alternates: [], discoverabilityTitle: nil, attributes: [], state: .on)
if #available(iOS 15.0, *) {
keyCommand.wantsPriorityOverSystemBehavior = true
}
keyCommand.wantsPriorityOverSystemBehavior = true
return keyCommand
}
}
@@ -66,9 +64,7 @@ private extension KeyboardManager {
return KeyboardManager.createKeyCommand(title: title, action: action, input: input, modifiers: modifiers)
} else {
let keyCommand = UIKeyCommand(input: input, modifierFlags: modifiers, action: NSSelectorFromString(action))
if #available(iOS 15.0, *) {
keyCommand.wantsPriorityOverSystemBehavior = true
}
keyCommand.wantsPriorityOverSystemBehavior = true
return keyCommand
}
}
@@ -78,14 +78,7 @@ final class MainFeedCollectionViewCell: UICollectionViewCell {
}
override func updateConfiguration(using state: UICellConfigurationState) {
var backgroundConfig: UIBackgroundConfiguration
if #available(iOS 18, *) {
backgroundConfig = UIBackgroundConfiguration.listCell().updated(for: state)
} else if traitCollection.userInterfaceIdiom == .pad {
backgroundConfig = UIBackgroundConfiguration.listSidebarCell().updated(for: state)
} else {
backgroundConfig = UIBackgroundConfiguration.listGroupedCell().updated(for: state)
}
var backgroundConfig = UIBackgroundConfiguration.listCell().updated(for: state)
// Matches the timeline: accent background and white text when the feeds list is first responder,
// and no highlight while a row is pressed, so the row goes straight to the selected style.
@@ -138,14 +138,7 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
}
override func updateConfiguration(using state: UICellConfigurationState) {
var backgroundConfig: UIBackgroundConfiguration
if #available(iOS 18, *) {
backgroundConfig = UIBackgroundConfiguration.listCell().updated(for: state)
} else if traitCollection.userInterfaceIdiom == .pad {
backgroundConfig = UIBackgroundConfiguration.listSidebarCell().updated(for: state)
} else {
backgroundConfig = UIBackgroundConfiguration.listGroupedCell().updated(for: state)
}
var backgroundConfig = UIBackgroundConfiguration.listCell().updated(for: state)
// Matches the timeline: accent background and white text when the feeds list is first responder,
// and no highlight while a row is pressed, so the row goes straight to the selected style.
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff. Show more