Repository navigation
Settings: change page as one transition with the window frame - #197
Merged
Merged
Conversation
It looks the same, and lets a snapshot of the page match the window, whose background is tinted by the desktop.
Tabs, Mouse segments and an app's page (and Back) go through PaneTransition: the old page is snapshotted, the change is laid out and measured, and one animation group moves the frame while the snapshot fades out and the new page fades in. The tab view is pinned to the top while the frame moves, so nothing slides. In-pane growth moves the frame the same way, without a fade. A hidden window and Reduce Motion change at once. The tab controller's own cross-fade and window sizing are off, and fitWindow is gone.
…e sizes it lands on
mblauberg
marked this pull request as ready for review
November 4, 2026 04:23
This was referenced Nov 4, 2026
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
Settings now changes page the way System Settings does. Switching a tab, a Mouse segment, or an app's page (and Back) is one transition. The old page fades out and the new one fades in while the window frame moves to the new height. Both run in one
NSAnimationContextgroup with one duration and curve. The page stays against the top: the toolbar and strip hold still, and the window's bottom edge covers or uncovers the page.PaneTransition(new, owned bySettingsTabs) is the only code that moves the window frame. A page change first snapshots the page withcacheDisplay, leaving the window background clear. It then makes the change, lays out and measures once, and runs one group with three parts:window.animator().setFrame;The duration is
animationResizeTimeheld between 0.2 and 0.35 s, with ease-in-ease-out timing. During the flight the tab view is pinned to the top at the new height and its bottom constraints are released. Without that, it took the new height before the window did and the page slid with the frame.Tabs:
transitionOptions = [](the toolbar style is unchanged). A toolbar click goes throughtabView(_:willSelect:)/didSelect, and a request goes throughopen.preferredContentSizeDidChangeno longer calls super, so the tab controller doesn't size the window as well.fitWindowis gone;fittedFrame()measures exactly as before.Mouse segments go through
MouseTab.transition. An app's page, its segments and Back go throughSettingsContext.transition, and a request for an app's page is applied in the same transition as the tab.In-pane growth (
refit(),preferredContentSizeDidChange) callsfit(). It uses the same frame animation with no fade, and retargets a flight already under way.A hidden window and Reduce Motion change at once: no snapshot, no fade, and the frame is set directly.
PaneFormhides the grouped form's scroll background. It looks the same: light and dark captures of every pane are pixel-identical with and without it. Without it,cacheDisplaydrew that background lighter than the window's desktop-tinted one, so the first frame of a fade flashed.Closes #196
Acceptance criteria
window.frame != target). App open and Back differ by 6 pt, and they cross-fade over about 10 frames while the height moves 6 pt..instant: no snapshot, and the frame is set directly. This is unit-tested; the filmstrip doesn't cover it.showruns while the window is hidden, so it is instant. A hidden window never animates (unit-tested).PureMouseSettingsUIcallssetFrame(orsetContentSize(, uses.crossfade, or ifSettingsTabscallssuper.preferredContentSizeDidChange.measuredSize/LazyPane.maxHeight(on:)path and the same 600 pt cap. The existing sizing tests pass, and every final frame is pixel-identical to a fresh capture of that pane.Review fixes
The incoming page has an interactive model alpha during its fade; the snapshot ignores hit testing and accessibility.
Every in-flight refit rechecks visibility and Reduce Motion and lands immediately when needed, restoring pins and removing the snapshot. Closing also cleans up the flight.
A refit uses the remaining time on the original flight, so the frame ends with the fade; stale completion callbacks cannot land a newer flight.
Verified with
swift build && swift test --filter PureMouseSettingsTests(244 tests, Swift 6.4); deterministic tests cover retargeting, policy changes, stale completions, close cleanup, and snapshot input.Reentrant fitting now coalesces measurement requests before retargeting; a regression test confirms cancelled frame completions cannot release the pins early.
Follow-up review fixes (
c6b933d)alphaValue == 1for hit testing while its layer stays at opacity 0 during the swap. The final model opacity and explicit 0→1 fade are installed atomically, with backwards fill and a layer-local start time from the Core Animation clock. A commit during layout cannot expose the incoming page before its fade is attached.show(nil), empty requests, same-tab/segment requests and sheet-only requests on the current page skip the cross-fade. App requests transition only when the resolved app page changes, preserving the current segment when repeated. Navigation consumed during layout joins the original transition.swift build && swift test --filter PureMouseSettingsTestspassed: 249 tests in 27 suites, Swift 6.4.2 locally. Regression coverage includes input while visually hidden, a commit during the swap, frame-only cancellation before replacement completion, both fade/frame completion orders, no-op navigation and repeated app requests.git diff --checkpassed. Swift 6.3-compatible syntax retained; CI supplies the 6.3 check.Sources/PureMouseSettingsUI,Tests/PureMouseSettingsTestsanddocs/ui-design.md; pane sizes and the 600 pt cap unchanged. No Settings, menu or daemon executable launched. The earlier filmstrip evidence above predates this follow-up; the chair will verify these visuals on the spare Mac.How checked
swift build && swift test --filter PureMouseSettingsTestspassed: 238 tests in 27 suites, Swift 6.4 locally.PaneTransitionTestscover:.instant, and the duration is clamped;fitis ignored mid-change;SettingsTabs.openin a hidden window lands on each pane's height, and on the cap for a tall pane;Footprint
No daemon or menu bar app changes. Settings adds no polling or timers: one snapshot bitmap exists only for the length of a page change.
Docs
docs/ui-design.md:fittedFrame().docs/development.md: the filmstrip runs on a background thread, writesframes.txt, and takesPUREMOUSE_DEV_FILMSTRIP_SECONDS. It also notes how to read a frame caught between two sizes.Agent evidence
Before (main plus the hook):
After (final code, run
after11). Window height is in pixels at 2x. Frame 0 is before the change, and times are in ms from the start of the change on the main thread. "Fade" uses ink and difference measures against the first and last frames. In every scenario the fade's first frame is the frame's first moving frame (±1), and both settle on the same frame.PUREMOUSE_DEV_CAPTUREof the target pane: mean difference 0.000 in 5 of 6 scenarios. Back to Apps differs by a uniform 0.96 grey level with no pixel off by more than 16, and the before run shows the same, so it is the window background's tint at a different position.PaneForm's hidden scroll background;animator().alphaValuefrom a value set in the same pass ran from 1 to 1, so I switched to an explicitCABasicAnimationfrom 0;beginand kept there under a forwards-filled animation until it lands.