mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 16:54:12 +00:00
Stop overriding UISplitViewController.show(_:) which causes issues with tapping timeline rows (and other issues).
This commit is contained in:
1 parent
056fa5ff76
commit
9256a6858a
4 files changed
+22
-24
No files matched your search
@@ -222,7 +222,7 @@ final class ArticleViewController: UIViewController {
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(true)
|
||||
super.viewDidAppear(animated)
|
||||
if #available(iOS 26, *) {
|
||||
navigationController?.navigationBar.topItem?.subtitle = nil
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ final class MainTimelineModernViewController: UIViewController, UndoableCommandR
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
Self.logger.debug("MainTimelineModernViewController: viewDidAppear")
|
||||
|
||||
super.viewDidAppear(true)
|
||||
super.viewDidAppear(animated)
|
||||
isTimelineViewControllerPending = false
|
||||
if navigationController?.navigationBar.alpha == 0 {
|
||||
UIView.animate(withDuration: 0.5) {
|
||||
|
||||
@@ -22,22 +22,20 @@ final class RootSplitViewController: UISplitViewController {
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
coordinator.resetFocus()
|
||||
}
|
||||
|
||||
override func show(_ column: UISplitViewController.Column) {
|
||||
show(column, bypassDisplayModeRestriction: false)
|
||||
}
|
||||
|
||||
/// Pass `bypassDisplayModeRestriction: true` for user-initiated keyboard navigation, so it can
|
||||
/// Show a column for programmatic navigation.
|
||||
/// Pass `bypassDisplayModeRestriction: true` for user-initiated navigation, so it can
|
||||
/// reveal a column the display-mode suppression below would otherwise keep hidden.
|
||||
/// <https://github.com/Ranchero-Software/NetNewsWire/issues/3138>
|
||||
func show(_ column: UISplitViewController.Column, bypassDisplayModeRestriction: Bool) {
|
||||
func showColumn(_ column: UISplitViewController.Column, bypassDisplayModeRestriction: Bool = false) {
|
||||
guard !coordinator.isNavigationDisabled else { return }
|
||||
|
||||
/// Always show the column on iPhone
|
||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||
super.show(column)
|
||||
show(column)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -46,18 +44,18 @@ final class RootSplitViewController: UISplitViewController {
|
||||
/// restoration of the feeds and timeline display modes.
|
||||
if !bypassDisplayModeRestriction {
|
||||
|
||||
/// Don't show primary when the preferred display mode is timeline + article or article only.
|
||||
if column == .primary && (preferredDisplayMode == .oneBesideSecondary || preferredDisplayMode == .secondaryOnly) {
|
||||
/// Don't show primary when the display mode is timeline + article or article only.
|
||||
if column == .primary && (displayMode == .oneBesideSecondary || displayMode == .secondaryOnly) {
|
||||
return
|
||||
}
|
||||
|
||||
/// Don't show the timeline when the preferred display mode is article only.
|
||||
if column == .supplementary && preferredDisplayMode == .secondaryOnly {
|
||||
/// Don't show the timeline when the display mode is article only.
|
||||
if column == .supplementary && displayMode == .secondaryOnly {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
super.show(column)
|
||||
show(column)
|
||||
}
|
||||
|
||||
// MARK: Keyboard Shortcuts
|
||||
|
||||
+10
-10
@@ -502,7 +502,7 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
|
||||
func showSearch() {
|
||||
selectSidebarItem(indexPath: nil) {
|
||||
self.rootSplitViewController.show(.supplementary)
|
||||
self.rootSplitViewController.showColumn(.supplementary)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
||||
self.mainTimelineViewController!.showSearchAll()
|
||||
}
|
||||
@@ -1008,7 +1008,7 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
guard tappedFeed !== timelineFeed as AnyObject? else {
|
||||
// Same feed — just make sure the timeline is showing.
|
||||
if indexPath != nil {
|
||||
rootSplitViewController.show(.supplementary)
|
||||
rootSplitViewController.showColumn(.supplementary)
|
||||
}
|
||||
completion?()
|
||||
return
|
||||
@@ -1024,7 +1024,7 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
if let ip = indexPath, let node = nodeFor(ip), let sidebarItem = node.representedObject as? SidebarItem {
|
||||
|
||||
self.activityManager.selecting(sidebarItem: sidebarItem)
|
||||
self.rootSplitViewController.show(.supplementary)
|
||||
self.rootSplitViewController.showColumn(.supplementary)
|
||||
setTimelineFeed(sidebarItem, animated: false) {
|
||||
if self.isReadFeedsFiltered {
|
||||
self.rebuildBackingStores()
|
||||
@@ -1040,7 +1040,7 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
self.rebuildBackingStores()
|
||||
}
|
||||
self.activityManager.invalidateSelecting()
|
||||
self.rootSplitViewController.show(.primary)
|
||||
self.rootSplitViewController.showColumn(.primary)
|
||||
AppDefaults.shared.selectedSidebarItem = nil
|
||||
completion?()
|
||||
}
|
||||
@@ -1092,12 +1092,12 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
|
||||
if article == nil {
|
||||
articleViewController?.article = nil
|
||||
rootSplitViewController.show(.supplementary)
|
||||
rootSplitViewController.showColumn(.supplementary)
|
||||
mainTimelineViewController?.updateArticleSelection(animations: animations)
|
||||
return
|
||||
}
|
||||
|
||||
rootSplitViewController.show(.secondary)
|
||||
rootSplitViewController.showColumn(.secondary)
|
||||
mainTimelineViewController?.didPushArticleViewController = true
|
||||
|
||||
// Mark article as read before navigating to it, so the read status does not flash unread/read on display
|
||||
@@ -1273,7 +1273,7 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
func markAsReadAndShowSidebar(_ articlesToMark: [Article], completion: (() -> Void)? = nil) {
|
||||
markAllAsRead(articlesToMark) {
|
||||
self.rootSplitViewController.preferredDisplayMode = .twoBesideSecondary
|
||||
self.rootSplitViewController.show(.primary)
|
||||
self.rootSplitViewController.showColumn(.primary, bypassDisplayModeRestriction: true)
|
||||
completion?()
|
||||
}
|
||||
}
|
||||
@@ -1572,7 +1572,7 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
func navigateToTimeline() {
|
||||
// Only auto-select the first article in three-pane mode, where it populates the
|
||||
// detail pane without hiding the timeline.
|
||||
let displayMode = rootSplitViewController.preferredDisplayMode
|
||||
let displayMode = rootSplitViewController.displayMode
|
||||
let isThreePane = !isRootSplitCollapsed && displayMode != .oneBesideSecondary && displayMode != .secondaryOnly
|
||||
if isThreePane && currentArticle == nil && articles.count > 0 {
|
||||
selectArticle(articles[0])
|
||||
@@ -1728,7 +1728,7 @@ private extension SceneCoordinator {
|
||||
if isRootSplitCollapsed {
|
||||
revealColumnInCollapsedMode(column, thenFocus: focus)
|
||||
} else {
|
||||
rootSplitViewController.show(column, bypassDisplayModeRestriction: true)
|
||||
rootSplitViewController.showColumn(column, bypassDisplayModeRestriction: true)
|
||||
// Defer focus so becomeFirstResponder targets the revealed column, not the outgoing one.
|
||||
Task { @MainActor in
|
||||
focus()
|
||||
@@ -1767,7 +1767,7 @@ private extension SceneCoordinator {
|
||||
focusWhenTransitionCompletes(in: navController, thenFocus: focus)
|
||||
} else {
|
||||
// Forward navigation — push the destination column onto the stack.
|
||||
rootSplitViewController.show(column)
|
||||
rootSplitViewController.showColumn(column, bypassDisplayModeRestriction: true)
|
||||
focusWhenTransitionCompletes(in: navController, thenFocus: focus)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user