Skip to content

Keep snap-preview material and geometry in sync - #1900

Merged
rxhanson merged 1 commit into
rxhanson:mainfrom
kiteretsu903:fix/review-snap-preview
Oct 13, 2026
Merged

rxhanson merged 1 commit into
rxhanson:mainfrom
kiteretsu903:fix/review-snap-preview

Conversation

@kiteretsu903

@kiteretsu903 kiteretsu903 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

This keeps the snap target preview visually aligned while dragging a window toward a screen edge or switching between snap targets. The blur should fill the preview shape throughout the transition, with its border and shadow moving together, rather than appearing to slide into place separately.

The underlying problem is that the preview's host window and its material can animate on different timelines, especially on first appearance. In the combined Liquid Glass build, this showed up as the glass surface appearing to float down from above on the first preview. This change keeps the host stationary and advances the preview surface, material, outline, and shadow together; the separate Glass PR supplies the material.

This concerns the target preview, not the movement of the actual application window. It therefore also improves preview rendering when window animation is disabled.

Behavior

  • First appearance and subsequent target changes use the same geometry transition. Changing targets replaces the pending transition rather than allowing older geometry to arrive later.
  • Dismissal, closing, and accessibility changes invalidate pending preview work.
  • The rendering change applies with window animation disabled. When a blurred preview accompanies an animated placement, it stays behind the moving window until placement completes, with cancellation ending the handoff.
  • Existing opacity and Reduce Transparency behavior are preserved. This change does not add a new material or a user-facing setting.

Implementation and dependency

PreviewTransition groups related transition state and timing. The preview owns its rendering lifecycle; window placement only supplies completion and cancellation signals.

The prepared implementation builds on the isolated animation change for those handoff signals. Liquid Glass is a separate follow-up that reuses this geometry path, so material-specific fixes do not need a second preview animation implementation.

Validation

The full branch XCTest suite passed (526 tests, including existing tests). The dependent Glass and combined builds also passed their automated suites.

A complete visual pass over first/repeated appearance, rapid retargeting, dismissal, and no-blur/standard-blur/Glass combinations remains pending. Automated lifecycle and geometry checks do not replace that visual inspection.

@rxhanson rxhanson left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I appreciate that you had turned this into its own pull request. Just one comment to address (and, unfortunately some merge conflicts).

Comment thread Rectangle/ShortcutManager.swift Outdated

private func execute(_ originalParameters: ExecutionParameters) {
var parameters = originalParameters
var completionForwarded = false

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The completionForwarded logic isn't very self-explanatory and there isn't any context in this function that provides it. If possible I prefer self-documenting code to comments, but in this case I think we need at least some kind of comment to explain context. The shortcut manager is a central piece of logic and providing the context up front makes it easier to make changes to it in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got cha! Fixed and resolved conflicts

@kiteretsu903
kiteretsu903 force-pushed the fix/review-snap-preview branch from 700f855 to b4c668a Compare October 13, 2026 01:31
@rxhanson
rxhanson merged commit fb602f4 into rxhanson:main Oct 13, 2026
1 check passed
@kiteretsu903
kiteretsu903 deleted the fix/review-snap-preview branch October 13, 2026 20:02
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