Repository navigation
fix: keep a deck card that is flying off out of the focus order - #6607
Conversation
A card an answer sends off stays in the DOM, before the card that came up, until its motion ends. The new card takes focus once it settles (250 ms), and on a slow machine the leaving card's motion can outlast that wait, so Shift+Tab from the new card landed in the leaving card, which was then hidden, leaving focus nowhere. The leaving card is now inert while it moves, so Shift+Tab reaches the bar's Later as it does once the motion has ended. A card Back covers is inert while it waits beneath for the same reason. New test: with animations slowed to a tenth, Shift+Tab right after an answer reaches Later. It fails before the change (focus inside the leaving card) and passes after. This is the race behind the macOS-only failure of test_by_keyboard_the_forward_control_hands_over_to_the_step_back_in. Closes #6603
|
@leaf-agent The runtime change handles both animation completion and interruption, but the regression test still races the exit animation. At 0.1 playback speed, the 200 ms animation ends after two seconds: a stall before the leaving-attribute check can fail fixed code, while a stall between that check and Shift+Tab can pass unfixed code. Please use the existing
|
The flying-off test slowed the motion with CDP playback rate and raced it: a stall before the leaving check could fail fixed code, and one between that check and Shift+Tab could pass unfixed code. It now holds every motion at its first frame (HOLD_MOTION) through the focus assertion, then finishes them and checks the card is put away and no longer inert. Without the runtime's inert lines the test fails at the Shift+Tab focus assertion.
|
Done in 65c599a. The test no longer slows playback. It installs I ran it locally: it passes with the fix, and with the two |
A card an answer sends off stays in the DOM before the card that came up until its motion ends. The new card takes focus once it has settled (
SETTLE_MS, 250 ms). On a slow machine the leaving card's motion outlasts that wait, so Shift+Tab from the new card went into the card still flying off. That card was then hidden, which left focus nowhere. This is whytest_by_keyboard_the_forward_control_hands_over_to_the_step_back_infailed on CI's Mac, where Later readinactivefor the full timeout. The leaving card is nowinertfrom the moment it starts to move untilputAwaylets go of it, so Shift+Tab reaches the bar's Later, as it already did once the motion had ended. The change also covers the card Back covers: it comes after the arriving card, so Tab from the new card could have gone into it the same way.Verification.
test_a_card_still_flying_off_takes_no_focusholds the exit motion at its first frame (HOLD_MOTION) and presses Shift+Tab after an answer. It checks that focus reaches Later while the old card is still leaving, and that the old card dropsinertonce the motion finishes. An earlier version of the test slowed the animations to a tenth through CDP instead. That version failed without the fix, with focus inside the leaving#beta-ask, and passed with it.--workers 1 --load 4), the original test passed all 54 copies in dispatch 44771816811. For comparison, dispatch 44762687613 failed 3 of 18 copies on main.The race has been in the deck since its focus handoff landed in #6016. No recent change introduced it. Recent macOS runs only made the runner slow enough to hit it.
Closes #6603 — automated triage