Skip to content

iPad/macOS polish: toolbar bottom padding, scene restoration depth, nav-bar shadow, end-of-thread frog#1238

Merged
nolanw merged 4 commits intomainfrom
minor-tweaks
Apr 14, 2026
Merged

iPad/macOS polish: toolbar bottom padding, scene restoration depth, nav-bar shadow, end-of-thread frog#1238
nolanw merged 4 commits intomainfrom
minor-tweaks

Conversation

@dfsm
Copy link
Copy Markdown
Contributor

@dfsm dfsm commented Apr 14, 2026

Summary

Four iPad/macOS and dark-theme fixes that together smooth out detail-pane layout and state restoration.

  • Bottom toolbar alignment (PostsPageView): enforce a minimum 28pt bottom inset on iPad so the toolbar stays aligned with the sidebar's RootTabBar in Catalyst / windowed multitasking contexts where the system safe-area inset is 0.

  • Scene restoration depth: the scene's restoration activity now captures (a) the selected sidebar tab and (b) the deepest mid-stack RestorableLocation on the primary nav (e.g. the specific forum's thread list the user had drilled into). On cold launch, replay selects the tab → rebuilds the mid-stack → pushes the detail route, so thread restoration lands the user back where they were instead of at the forums root.

  • Pre-render restoration staging: scroll-fraction and hidden-posts payloads are now threaded through AwfulURLRouter into the freshly-constructed PostsPageViewController / MessageViewController before loadPage returns, closing the iPad race where didFinishRenderingHTML could fire from the cached-render path before prepareForRestoration was called.

  • Extra fallback snapshot on sceneWillResignActive — catches the Xcode-Stop / iPad-Home paths that can skip sceneDidEnterBackground.

  • SpankyKongDark nav-bar hairline: in the iOS 26 appearance path, clear shadowColor / shadowImage AFTER configureWithOpaqueBackground / configureWithTransparentBackground (which reset them to system defaults), so the grey hairline no longer appears under the nav bar on scroll on dark themes.

  • End-of-thread frog (GetOutFrogRefreshSpinnerView): switch horizontal anchors to PostsPageView.layoutMarginsGuide` and pin the height to 110pt so the frog centers within the visible detail column on iPad/macOS (respecting the sidebar's safe-area inset) and has room to land at its intended size. iPhone layout is unchanged (postsView margins are 0).

dfsm added 4 commits April 14, 2026 21:54
…dd some bottom padding and more closely align with sidebar roottabbar.
Scene restoration was wired up for iPhone but never extended to iPad/macOS split-view, so relaunching dropped the sidebar back on Forums, lost any mid-stack forum thread list, and opened the restored thread at the top.

- Save the selected sidebar tab's root route (.forumList / .bookmarks / .messagesList / .settings) under a new userInfo key, and re-select it before opening the detail route on replay.
- Save the deepest non-root RestorableLocation on the selected tab's nav stack (e.g. .forum(id:) for a drilled-in thread list) and replay it between the tab selection and the detail route, so the mid-stack view is rebuilt before the leaf.
- Stage the scroll fraction / hiddenPosts through AwfulURLRouter so the freshly-constructed PostsPageViewController / MessageViewController receives prepareForRestoration(…) in the same run-loop turn as loadPage, closing the iPad race where a cached WKWebView render could fire didFinishRenderingHTML before SceneDelegate's post-open lookup staged the fraction.
- Also snapshot the UserDefaults fallback from sceneWillResignActive in addition to sceneDidEnterBackground, to narrow the window where Xcode's Stop arrives before the async background transition delivers.
On iOS 26+, scrolling a list (Bookmarks, ThreadList) caused a thin grey line to appear under the navigation bar. Most visible on dark themes with a pure-black nav bar (SpankyKongDark).

configureBackground(for:progress:) was clearing the shadow before calling configureWithOpaqueBackground() / configureWithTransparentBackground(), but those configureWith* methods reset shadow state back to system defaults — overwriting the explicit nil assignments. Move the shadow clear to after the configureWith* calls, and use .clear explicitly.
With the sidebar visible, the get-out frog that appears when pulling past the end of a thread was horizontally off-center (it centered within the full scroll-view width, ignoring the sidebar's safe-area inset) and had no explicit height.

- Add a 110pt height constraint so the animation has a consistent vertical footprint.
- Anchor horizontal edges to PostsPageView.layoutMarginsGuide instead of the refresh control container's layoutMarginsGuide. PostsPageViewController already syncs postsView.layoutMargins to view.safeAreaInsets, so this centers the frog within the visible detail column on iPad/macOS while leaving iPhone (where layoutMargins.left/right are 0) unchanged.
@nolanw nolanw merged commit 9f90556 into main Apr 14, 2026
1 check failed
@nolanw nolanw deleted the minor-tweaks branch April 14, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants