Repository navigation
fix(web): keep a keyboard-focused Devices row clear of its group header in Firefox - #4889
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 27 seconds. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 7c110c6)
One finding, on the onFocus line. The margin change and the Firefox keyboard fix look right. DeviceRow has no other caller, and with 13px row text a 96px margin plus a 58px row fits inside the 10rem list floor.
AI disclosure: written by claude-opus-5-5 (Claude Code) acting as an automated reviewer.
7c110c6 to
9d922bc
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Adversarial review (gpt-6.2-sol, reviewed 7c110c6). The reviewer couldn't post its own review, so its finding is recorded here. Score: 6/10.
AI disclosure: summary written by claude-opus-5-5 (Claude Code) from the automated review's output. |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 9d922bc)
O1 from round 1 (a mouse press focusing the row and scrolling it out from under the pointer) is resolved. The :focus-visible gate behaves as intended in Firefox and Chromium: a mouse click reports false, Tab after an earlier mouse click reports true, programmatic focus after keyboard use reports true, and a touch tap reports false. I couldn't run WebKit here, so Safari is unverified.
The JS scroll is needed. In a minimal sticky-header list, Firefox leaves a partly hidden row where it is on Shift+Tab even with scroll-padding-top on the container or scroll-margin-top on the row, while Chromium honours both. A CSS-only version would not fix Firefox.
Other checks: nothing else renders DeviceRow. The app sets no global scroll-behavior, so the call without behavior scrolls instantly under any motion setting, which suits a focus scroll. scroll-mt-24 matches the convention AdminLayout documents below lg. One nit is inline.
AI disclosure: written by claude-opus-5-5 (Claude Code).
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
0103f9b to
7aa50a8
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Adversarial review round 2 (gpt-6.2-sol, reviewed 9d922bc). The reviewer couldn't post its own review, so its findings are recorded here. Score: 7/10. It marks O1/S1 resolved: mouse clicks and taps opened the row without moving the list in Chromium, Firefox and WebKit.
AI disclosure: summary written by claude-opus-5-5 (Claude Code) from the automated review's output. |
7aa50a8 to
25bcb01
Compare
|
Adversarial review round 3 (gpt-6.2-sol, reviewed 7aa50a8). The reviewer couldn't post its own review, so its findings are recorded here. Score: 7/10. It marks O2 and S2 resolved.
Both fixed in 25bcb01. The row now skips focus that comes from a pointer press: a flag set on
Chromium touch taps on partly covered rows open the device. The earlier checks still pass in both engines: Shift+Tab under the header, a clear row not moving, clicks, the stuck header's controls, short screens and x-large text. The AI disclosure: summary written by claude-opus-5-5 (Claude Code) from the automated review's output. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
25bcb01 to
9ac88d2
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
… and on phones Firefox doesn't scroll a partly visible link into view on focus, so a row reached with Shift+Tab kept its name under the sticky group header. Below lg the row's scroll margin also has to clear the pinned admin header, which the layout documents as scroll-mt-24. Scroll the focused row to the nearest clear position and use the layout's margins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mouse press focuses the row's link on mousedown. Scrolling it then moved the row out from under the pointer below lg, so the mouseup landed elsewhere and the click never opened the device. Only keyboard focus (:focus-visible) needs the scroll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useIntentPrefetch already checks :focus-visible behind a try/catch for engines without the selector. Export it and use it in the device row instead of a second, unguarded copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 96px margin below lg made the browser move a focused row that was already clear of its 36px group header, which could push it under the playback bar. Keep the 40px margin, and have the Firefox focus scroll run only when the group header actually covers the row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scrolling to the row's margin left part of it covered when a larger minimum font made the group header taller than the margin, and the :focus-visible check let a mouse press through when the browser always shows focus rings, losing the click. Skip focus that comes from a pointer press, and scroll the list by exactly how far the header covers the row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A press that never focused the row (a right-click, a press on the already-focused row) left the flag set, so the next keyboard focus on that row skipped the header correction. Record when the press happened and skip only focus that arrives within a second of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A touch held longer than the one-second window focuses the row just after release, outside the window, so the header correction could move the row before the click. Also skip focus within a second of the row's last pointer release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9ac88d2 to
318b3ef
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (the admin Devices page exists only in the web app)
In Firefox, moving keyboard focus up the device list on the admin Devices page can leave the focused row's name hidden behind its group's sticky header. #4845 made that header opaque and gave each row a scroll margin to reserve room for it. Firefox doesn't scroll a partly visible link into view on focus, so the margin never applies there: Shift+Tab onto a row partly under the header leaves 24 of its 50px, including the name, hidden.
Approach
When keyboard focus lands on a row its group header covers, the row scrolls the list by exactly the overlap. The list's scroll container is marked
data-device-listso the row can find it. Two rules keep it from moving anything else::focus-visible, because a mouse press matches that when the browser always shows focus rings.Chromium already scrolls a partly covered row itself using the margin, so the handler only steps in when something is still covered.
Validation
All measured in headless Chromium and Firefox against a page harness that renders the real Devices page with seeded data:
prettier,eslintandtscpass.Evidence: https://evidence.siloserver.org/r/silo-server/admin-devices-focused-row-scroll/
Risks
None identified. The handler runs only when focus on a device row didn't come from a pointer press, and scrolls only by the amount the row's group header covers it.
Checklist
Council review
Background review of this PR:
Fixed:
Round 1, Sol S1 and Opus O1: scrolling on mouse focus lost the click. Fixed in 9d922bc with the keyboard-only check.
Round 2, Opus O2: reuse the guarded
isKeyboardFocushelper. Done in 0103f9b.Round 2, Sol S2: a 96px margin below
lg, added here to clear the phone admin header, made the browser move rows that were already clear of the group header, and could push them under the playback bar. 7aa50a8 drops that margin and scrolls only rows the header covers.Round 3, Sol S3 and S4: with always-shown focus rings in Firefox,
:focus-visiblelet a mouse press through and lost the click. A large minimum font made the header taller than the margin. 25bcb01 replaces the check with a pointer-press flag and scrolls by the measured overlap. Kody then pointed out that a press that never focused the row left the flag set (9ac88d2 lets it age out after a second), and that a touch held past that second could still move the row (318b3ef also times from the release). That made theisKeyboardFocusexport from O2 unnecessary, so it's reverted.That 96px margin was the fix for #4845 round-3's S4, a focused row landing under the phone admin header. With it gone, S4 is no longer fixed here. It didn't reproduce in the harness, and on
mainbefore #4845 rows had no margin at all, so the 40px margin isn't a regression.AI Disclosure
🤖 Generated with Claude Code
Note
Fix keyboard-focused Devices row hidden under its group header in Firefox
When a device row gains keyboard focus in Firefox, it can sit beneath its sticky section header and be obscured. The new
revealRowUnderHeaderhelper measures the overlap and decreases the list'sscrollTopto reveal the row.data-device-listattribute so the helper can locate it.Macroscope summarized 318b3ef.