fix(frontend): keyboard focus in the zone rail, and the day readout's anchor - #2444
Conversation
The rail opens its labels on focus as well as on hover, but the pointer leave handler closed it unconditionally. A pointer crossing the rail on its way elsewhere therefore collapsed it under a focused button, putting a keyboard user back on an unlabelled icon with no way to reveal it again. Leave now closes only when focus is not contained; blur is what ends a keyboard visit, as it already did. Also records why the suite's fake timers advance with real time: without it every pointer interaction in this file hangs until the runner's timeout, because userEvent awaits a real promise between events. Signed-off-by: Alexey Panfilov <Alexey.Panfilov@constructor.tech>
The hover readout grows away from the nearer end of the strip so it cannot run off it, but both directions were anchored to the hovered day's left boundary. A readout growing leftwards therefore ended where its day begins, sitting a full day to the left of the day under the pointer, and the last day was left with an empty strip beside it. Which boundary to hang from now follows the direction it grows in. Signed-off-by: Alexey Panfilov <Alexey.Panfilov@constructor.tech>
|
Warning Review limit reached
Next review available in: 38 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Follow-up to #2441. Its automated review landed after the merge, so two
real defects it caught are on main. Both are in code that PR introduced.
The rail collapses under a focused button
The rail reveals its labels on focus as well as on hover — eight
identical icons are not navigable by a sighted keyboard user otherwise.
But
onPointerLeaveclosed it unconditionally, so any pointer crossingthe rail on its way somewhere else collapsed the labels while focus was
still inside, leaving that user on an unlabelled icon with no way to
reveal it again without a pointer.
Leave now closes only when focus is not contained, matching what
onBlurCapturealready did. Blur remains what ends a keyboard visit.The day readout hangs off the wrong edge
The hover readout grows away from the nearer end of the strip so it can
never run off it, but both directions were anchored to the hovered day's
left boundary. A readout growing leftwards therefore ended where its
own day begins — one full day to the left of the day under the pointer —
and the last day was left with an empty strip beside it. Which boundary
it hangs from now follows the direction it grows in.
Not changed
The review also proposed dropping
shouldAdvanceTimefrom the railsuite's fake timers. That option turns out to be load-bearing: without
it, eight of the nine tests hang until the runner's timeout, because
userEventawaits a real promise between events and the clock nevermoves to resolve it. The mid-test expiry it allows is harmless — the
next action either wanted the rail open anyway, or is a leave, and a
leave cancels the pending timer as it closes. Kept, with that recorded
where the option is set.
A fourth comment asked for the denominator's own unit in the strip
caption rather than a bare
per day. The caption is accurate as itstands — the figure is a per-day denominator — but it does not say what
the denominator counts, and the API does not currently supply that. Left
alone.
Verification
New regression tests for both fixes: the rail keeps its labels through a
pointer crossing while focus is inside and drops them on blur, and the
readout is pinned to each end of the strip. Both fail on main. Full unit
suite green (1083), typecheck and lint clean.