From 3d5486ad5f6b2cde282ab5e44e71b0ea28040afb Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 19 Jan 2026 09:41:06 -0800 Subject: [PATCH] Rename some instances of Feed and feed that should be SidebarItem and sidebarItem. --- .../MainFeedCollectionViewController.swift | 6 ++-- iOS/SceneCoordinator.swift | 34 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/iOS/MainFeed/MainFeedCollectionViewController.swift b/iOS/MainFeed/MainFeedCollectionViewController.swift index 4017b8c89..258cf9c8d 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController.swift @@ -103,7 +103,7 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab /// to false and this will allow selection. if traitCollection.userInterfaceIdiom == .phone { if collectionView.indexPathsForSelectedItems != nil { - coordinator.selectFeed(indexPath: nil, animations: [.select]) + coordinator.selectSidebarItem(indexPath: nil, animations: [.select]) DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: { self.isAnimating = false }) @@ -305,7 +305,7 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { becomeFirstResponder() - coordinator.selectFeed(indexPath: indexPath, animations: [.navigation, .select, .scroll]) + coordinator.selectSidebarItem(indexPath: indexPath, animations: [.navigation, .select, .scroll]) } // MARK: UICollectionViewDelegate @@ -1209,7 +1209,7 @@ extension MainFeedCollectionViewController { } if indexPath == coordinator.currentFeedIndexPath { - coordinator.selectFeed(indexPath: nil) + coordinator.selectSidebarItem(indexPath: nil) } pushUndoableCommand(deleteCommand) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 28ed8d7d9..3caf62345 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -386,7 +386,7 @@ struct SidebarItemNode: Hashable, Sendable { let indexPath = indexPathFor(sidebarItemNode) else { return } - selectFeed(indexPath: indexPath, animations: []) { + selectSidebarItem(indexPath: indexPath, animations: []) { self.restoreSelectedArticle(stateInfo) } } @@ -406,7 +406,7 @@ struct SidebarItemNode: Hashable, Sendable { } func handle(_ activity: NSUserActivity) { - selectFeed(indexPath: nil) { + selectSidebarItem(indexPath: nil) { guard let activityType = ActivityType(rawValue: activity.activityType) else { return } @@ -448,7 +448,7 @@ struct SidebarItemNode: Hashable, Sendable { } func showSearch() { - selectFeed(indexPath: nil) { + selectSidebarItem(indexPath: nil) { self.rootSplitViewController.show(.supplementary) DispatchQueue.main.asyncAfter(deadline: .now()) { self.mainTimelineViewController!.showSearchAll() @@ -906,11 +906,11 @@ struct SidebarItemNode: Hashable, Sendable { return nil } }() - selectFeed(indexPath: indexPath, animations: animations, deselectArticle: deselectArticle, completion: completion) + selectSidebarItem(indexPath: indexPath, animations: animations, deselectArticle: deselectArticle, completion: completion) updateNavigationBarSubtitles(nil) } - func selectFeed(indexPath: IndexPath?, animations: Animations = [], deselectArticle: Bool = true, completion: (() -> Void)? = nil) { + func selectSidebarItem(indexPath: IndexPath?, animations: Animations = [], deselectArticle: Bool = true, completion: (() -> Void)? = nil) { guard indexPath != currentFeedIndexPath else { completion?() return @@ -953,13 +953,13 @@ struct SidebarItemNode: Hashable, Sendable { func selectPrevFeed() { if let indexPath = prevFeedIndexPath { - selectFeed(indexPath: indexPath, animations: [.navigation, .scroll]) + selectSidebarItem(indexPath: indexPath, animations: [.navigation, .scroll]) } } func selectNextFeed() { if let indexPath = nextFeedIndexPath { - selectFeed(indexPath: indexPath, animations: [.navigation, .scroll]) + selectSidebarItem(indexPath: indexPath, animations: [.navigation, .scroll]) } } @@ -1889,7 +1889,7 @@ private extension SceneCoordinator { } if unreadCountProvider.unreadCount > 0 { - selectFeed(indexPath: prevIndexPath, animations: [.scroll, .navigation]) + selectSidebarItem(indexPath: prevIndexPath, animations: [.scroll, .navigation]) return true } @@ -2006,7 +2006,7 @@ private extension SceneCoordinator { } if unreadCountProvider.unreadCount > 0 { - selectFeed(indexPath: nextIndexPath, animations: [.scroll, .navigation], deselectArticle: false) { + selectSidebarItem(indexPath: nextIndexPath, animations: [.scroll, .navigation], deselectArticle: false) { self.currentArticle = nil completion(true) } @@ -2197,7 +2197,7 @@ private extension SceneCoordinator { rebuildBackingStores(initialLoad: true, completion: { self.treeControllerDelegate.resetFilterExceptions() if let indexPath = self.indexPathFor(smartFeed) { - self.selectFeed(indexPath: indexPath) { + self.selectSidebarItem(indexPath: indexPath) { self.mainFeedCollectionViewController.focus() } } @@ -2215,7 +2215,7 @@ private extension SceneCoordinator { self.treeControllerDelegate.resetFilterExceptions() if let folderNode = self.findFolderNode(folderName: folderName, beginningAt: accountNode), let indexPath = self.indexPathFor(folderNode) { - self.selectFeed(indexPath: indexPath) { + self.selectSidebarItem(indexPath: indexPath) { self.mainFeedCollectionViewController.focus() } } @@ -2279,14 +2279,14 @@ private extension SceneCoordinator { switch sidebarItemID { case .smartFeed, .folder: - let found = selectFeedAndArticle(sidebarItemID: sidebarItemID, articleID: articleID, isShowingExtractedArticle: isShowingExtractedArticle, articleWindowScrollY: articleWindowScrollY) + let found = selectSidebarItemAndArticle(sidebarItemID: sidebarItemID, articleID: articleID, isShowingExtractedArticle: isShowingExtractedArticle, articleWindowScrollY: articleWindowScrollY) if found { treeControllerDelegate.addFilterException(sidebarItemID) } return found case .feed: - let found = selectFeedAndArticle(sidebarItemID: sidebarItemID, articleID: articleID, isShowingExtractedArticle: isShowingExtractedArticle, articleWindowScrollY: articleWindowScrollY) + let found = selectSidebarItemAndArticle(sidebarItemID: sidebarItemID, articleID: articleID, isShowingExtractedArticle: isShowingExtractedArticle, articleWindowScrollY: articleWindowScrollY) if found { treeControllerDelegate.addFilterException(sidebarItemID) if let sidebarItemNode = nodeFor(sidebarItemID: sidebarItemID), let folder = sidebarItemNode.parent?.representedObject as? Folder, let folderSidebarItemID = folder.sidebarItemID { @@ -2324,10 +2324,12 @@ private extension SceneCoordinator { return nil } - func selectFeedAndArticle(sidebarItemID: SidebarItemIdentifier, articleID: String, isShowingExtractedArticle: Bool, articleWindowScrollY: Int) -> Bool { - guard let sidebarItemNode = nodeFor(sidebarItemID: sidebarItemID), let feedIndexPath = indexPathFor(sidebarItemNode) else { return false } + func selectSidebarItemAndArticle(sidebarItemID: SidebarItemIdentifier, articleID: String, isShowingExtractedArticle: Bool, articleWindowScrollY: Int) -> Bool { + guard let sidebarItemNode = nodeFor(sidebarItemID: sidebarItemID), let sidebarItemIndexPath = indexPathFor(sidebarItemNode) else { + return false + } - selectFeed(indexPath: feedIndexPath) { + selectSidebarItem(indexPath: sidebarItemIndexPath) { self.selectArticleInCurrentFeed(articleID, isShowingExtractedArticle: isShowingExtractedArticle, articleWindowScrollY: articleWindowScrollY) }