Host the bottom bar in a navigation stack - #86
Merged
Merged
Conversation
contentview sits bare in the windowgroup, so bottombar items were bridged onto the window root and board mutations tore them down — the bar blanked and returned on every stock draw. it also left `.toolbar(_:for: .bottomBar)` inert, so picker visibility was faked by emptying the item list. wrap the board in a navigation stack that only hosts, and drive picker visibility through the real visibility api. the stack adds a subtree measured before layout that reports a frame with a real origin but no size, e.g. (148, 0, 0 x 0). the single-frame preference keys rejected only `.zero`, so that candidate passed the guard and clobbered the live stock and waste frames, sending every card flight from the top of the screen. guard on size instead.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
What Changed
NavigationStackthat only ever hosts — it never pushes, and its own navigation bar is hidden so the board keeps the full screen..toolbar(_:for: .bottomBar)instead of conditionally emptying the toolbar's item list.StockFrameKey/WasteFrameKeyreducers to reject sizeless candidates (!next.isEmpty) rather than only the exact.zerorect.macOS is unaffected:
toolbarHostreturns the view unchanged off iOS.Why
The bottom toolbar items disappeared completely for a moment on every stock draw.
ContentViewsits bare in theWindowGroupwith no navigation container, so.bottomBaritems were bridged onto the window root, where board mutations tore the bar down and rebuilt it. The same missing host made.toolbar(.hidden, for: .bottomBar)inert, which is why hiding the bar behind the picker had to be faked by removing every item — the workaround the old comment described.Hosting the bar in a navigation stack fixes both, but it exposed a latent bug in the frame preference keys. The stack adds a subtree that is measured before layout and reports a frame with a real origin but no size, e.g.
(148, 0, 0 x 0). The reducers guarded withnext != .zero, which that rect clears, so it overwrote the live stock and waste frames and every card flight launched from the top of the screen instead of the pile. Guarding on size is what the check meant all along; the existing comment shows the same class of bug already occurred once on macOS, and the guard was simply too narrow to catch this variant.Validation
xcodebuild ... -destination 'generic/platform=macOS' buildsucceeds.xcodebuild ... -destination 'platform=macOS' test: 594 tests, 10 skipped, 0 failures.iOS simulator build succeeds.
GameModePickerUITests.testTapOutsideDismissesGamePickerpasses: the bar leaves while the picker is open and returns on dismiss, now through the supported visibility API.Flight-planner inputs are unchanged with the stack in place, logged on both builds:
(12, 114.667, 47 x 68.15)(12, 114.667, 47 x 68.15)(67, 114.667, 63.92 x 68.15)(67, 114.667, 63.92 x 68.15)Screen recording of stock draws confirms cards fly from the stock pile to the waste, not from the top of the screen.
Toolbar flicker confirmed resolved on device.
UI Changes