Repository navigation
fix: slide Quick Access cards toward anchored edge - #373
Conversation
lzhgus
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
c4f9a2f to
334ba71
Compare
|
Thanks @sivyrn! π I built this and recorded the dismissal frame by frame next to |
What changed
Validation