Skip to content

fix(frontend): keyboard focus in the zone rail, and the day readout's anchor - #2444

Merged
dzarlax merged 2 commits into
constructorfabric:mainfrom
dzarlax:fix/rail-focus-and-readout-anchor
Aug 11, 2026
Merged

fix(frontend): keyboard focus in the zone rail, and the day readout's anchor#2444
dzarlax merged 2 commits into
constructorfabric:mainfrom
dzarlax:fix/rail-focus-and-readout-anchor

Conversation

@dzarlax

@dzarlax dzarlax commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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 onPointerLeave closed it unconditionally, so any pointer crossing
the 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
onBlurCapture already 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 shouldAdvanceTime from the rail
suite'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
userEvent awaits a real promise between events and the clock never
moves 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 it
stands — 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.

Alexey Panfilov added 2 commits August 11, 2026 20:03
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>
@dzarlax
dzarlax requested a review from a team as a code owner August 11, 2026 18:03
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@dzarlax, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c42d585-dce3-4eea-9ec1-40d5fdcfb744

📥 Commits

Reviewing files that changed from the base of the PR and between 4ab0bc8 and 4ed7201.

📒 Files selected for processing (4)
  • src/frontend/src/components/portal/lens-rail.test.tsx
  • src/frontend/src/components/portal/lens-rail.tsx
  • src/frontend/src/components/widgets/metric-views/metric-activity.test.tsx
  • src/frontend/src/components/widgets/metric-views/metric-activity.tsx

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dzarlax
dzarlax added this pull request to the merge queue Aug 11, 2026
Merged via the queue into constructorfabric:main with commit cc486e6 Aug 11, 2026
53 checks passed
@dzarlax
dzarlax deleted the fix/rail-focus-and-readout-anchor branch August 11, 2026 18:40
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