Skip to content

fix: slide Quick Access cards toward anchored edge - #373

Merged
lzhgus merged 3 commits into
lzhgus:mainfrom
sivyrn:fix/quick-access-directional-dismissal
Oct 27, 2026
Merged

lzhgus merged 3 commits into
lzhgus:mainfrom
sivyrn:fix/quick-access-directional-dismissal

Conversation

@sivyrn

@sivyrn sivyrn commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Slide bottom-left Quick Access cards off the left edge, bottom-right cards off the right edge, and centered cards downward when dismissed.
  • Keep the card at its original size during the transition and close immediately if it is already hidden.
  • Add regression coverage for all three positions.

Validation

  • Focused QuickAccessWindowPresentationTests: 12 passed using unsigned local test build.
  • The new test failed against the previous shrink-and-fade behavior before the fix.
  • git diff --check passed.

@lzhgus lzhgus 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.

Hi @sivyrn, thanks for this one too! πŸ™ Sliding toward the anchored edge reads nicely, and closing an already hidden card immediately is a good catch. I built the branch and the Quick Access tests pass (12/12). One thing before we merge:

Multi-monitor: the card slides onto the neighbouring display
The end frame sits fully past screenFrame.maxX (or minX / minY). With a second display to the right of a bottom-right card (or to the left / below for the other positions), the card crosses onto that display while it is still mostly opaque, so it shows up briefly on the other screen. Could you keep the end frame on the card's own screen, e.g. slide it by a shorter distance toward the edge while it fades, so it is fully transparent before it reaches the boundary? A test that checks the end frame stays within targetScreen.frame would cover it.

Small note: #374 adds a test at the same spot in QuickAccessWindowPresentationTests.swift, so whichever lands second will need a quick rebase.

Thanks!

@lzhgus lzhgus 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.

Thanks for the update! Keeping the dismissal on the target screen is exactly what I had in mind, and the shrink toward the anchored edge reads nicely.

The new tests pass on my Mac, but build-and-test fails on CI (log):

testCloseReturnsDraggedCardEntirelyToTargetScreen: XCTAssertLessThanOrEqual failed: ("1044.0") is greater than ("1024.0")
testCloseShrinksTowardAnchoredEdgeWithoutLeavingTargetScreen: XCTAssertLessThan failed: ("200.0") is not less than ("200.0")
testCloseShrinksTowardAnchoredEdgeWithoutLeavingTargetScreen: XCTAssertLessThanOrEqual failed: ("1076.0") is greater than ("1024.0")

The frame is completely unchanged after close() (the width is still 200, and the dragged frame is still off-screen). That suggests the CI runner took the guard isVisible, alphaValue > 0 else { finishCloseAnimation() } early return, or the animation hadn't finished within the 0.5 s settle on the slower VM. Either way, the tests depend on timing and on the runner's display. Could you make them deterministic, for example by asserting on the computed end frame (a small static helper you can test directly) instead of the window's frame after the animation? Once CI is green I'll give it a final check in the app.

@sivyrn
sivyrn force-pushed the fix/quick-access-directional-dismissal branch from c4f9a2f to 334ba71 Compare October 23, 2026 05:40
@lzhgus

lzhgus commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks @sivyrn! πŸ™ I built this and recorded the dismissal frame by frame next to main. On main the frame shrinks while the content stays full size, so the last few frames show a cropped, offset preview. With this PR the whole card scales and fades toward its edge cleanly. Merging.

@lzhgus
lzhgus merged commit ebf5641 into lzhgus:main Oct 27, 2026
2 checks passed
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