iPad/macOS polish: toolbar bottom padding, scene restoration depth, nav-bar shadow, end-of-thread frog#1238
Merged
iPad/macOS polish: toolbar bottom padding, scene restoration depth, nav-bar shadow, end-of-thread frog#1238
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RestorableLocationon 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
AwfulURLRouterinto the freshly-constructedPostsPageViewController/MessageViewControllerbeforeloadPagereturns, closing the iPad race wheredidFinishRenderingHTMLcould fire from the cached-render path beforeprepareForRestorationwas called.Extra fallback snapshot on
sceneWillResignActive— catches the Xcode-Stop / iPad-Home paths that can skipsceneDidEnterBackground.SpankyKongDark nav-bar hairline: in the iOS 26 appearance path, clear
shadowColor/shadowImageAFTERconfigureWithOpaqueBackground/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).