Repository navigation
Isolate and improve optional window animations - #1886
Conversation
744c634 to
8b373ee
Compare
|
|
||
| class AccessibilityElement { | ||
| fileprivate let wrappedElement: AXUIElement | ||
| var animationReads: WindowAnimationReadCache? |
There was a problem hiding this comment.
Let's move what we can out of AccessibilityElement to keep it simpler. Perhaps most of these additions, and animation logic can be in WindowAnimationElement?
There was a problem hiding this comment.
Let's separate out the classes of this file into separate files, and group the animation-related classes into a folder.
|
Thanks for the suggestions! Did the following fixes: (1) Moved animation-specific state, geometry caching, and write logic into |
|
Thanks again for your patience. Now that the dust has settled on v2.0, I finally had a bit more time to let this one sink in. I like to think of window animation as more of an additive feature, as opposed to one that permeates all of the app's functionality, since it is optional and currently not enabled by default. Is there any way we can make the animation logic a little less intrusive on existing infrastructure? I like keeping less surface area for risk where possible, especially in places that are used by all parts of the app already. Also, the animation code is kinda tough to parse quickly as a human without AI assistance, and I think it's still valuable to make code that is a bit more readily human-understandable. Although I like that it's broken up into separate files now, we don't have to strictly adhere to one class per file, and perhaps there are more centralized places we can put some of the static functionality. One example is that |
de71c4d to
be7e005
Compare
|
@rxhanson Thanks for the detailed suggestions as always! These practices are really helpful for me too. I’ve cleaned up the animation code, grouped related pieces together, and moved Let me know if this organization is closer to what you had in mind! |
|
Thanks! This is a good improvement and it's nice to keep the complexity of the animation pretty well contained. |
* Ignore keyboard shortcuts while Mission Control is active Mission Control does not change the frontmost application, so Rectangle's hotkeys kept firing and moved the last focused window behind the overview, stretching its thumbnail (#1739). ShortcutManager now takes a missionControlActiveProvider, defaulting to the detector that #1886 added for window animations, and drops requests whose source is .keyboardShortcut while it reports Mission Control, before anything downstream observes them. Mouse-button shortcuts and duplicate-shortcut cycles share that source and are covered; menu, URL, title-bar and drag-to-snap requests are unchanged, and a dropped request still runs its completion. Co-Authored-By: Claude Fable 5.1 <[email protected]> * Make the Mission Control shortcut guard opt-out Gate the #1739 guard behind a hidden default, ignoreShortcutsInMissionControl, defaulting to true (the current behavior). Users who prefer shortcuts to keep firing can opt out with: defaults write com.knollsoft.Rectangle ignoreShortcutsInMissionControl -bool false BoolDefault gains an optional defaultValue (matching DoubleDefault and the other Default types) so the toggle can default to true. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
This narrows #1886 to window animation. Animation remains off by default; when enabled, moves and resizes respond to the application's actual resize behavior, support a new destination while an animation is running, and check the final placement.
Behavior
Implementation
Animation state, geometry caching, and bounded Accessibility operations live in
WindowAnimationElementand the animation worker.AccessibilityElementdoes not own animation state. Related scheduling and execution code is grouped by responsibility, andcrossesDisplayslives inWindowDisplayTransition.Ordinary placement optimizations and snap-preview rendering changes have been extracted into #1899 and #1900 respectively. This PR contains neither Layout Helper preparation nor the experimental screenshot/parking animation.
Validation
The full branch XCTest suite passed (524 tests, including existing tests). Native window checks passed for ordinary and animated left/right placement, maximize/restore, rapid retargeting, and releasing a dragged window into a snap target. The same checks also passed in the combined build.
Physical cross-display transitions, older macOS versions, and the complete visual motion checklist remain to be checked. The current native checks establish window geometry and completion behavior, not a blanket claim of visually smooth animation on every application.