Skip to content

fix(web): keep a keyboard-focused Devices row clear of its group header in Firefox - #4889

Merged
Quick104 merged 7 commits into
mainfrom
fix/admin-devices-focused-row-scroll
Nov 21, 2026
Merged

Quick104 merged 7 commits into
mainfrom
fix/admin-devices-focused-row-scroll

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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-list so the row can find it. Two rules keep it from moving anything else:

  • Pointer presses are skipped. A mouse press focuses the link on mousedown and a tap focuses it on release, and moving the row then would land the release elsewhere and lose the click. The row records when a press started and when it was released, and skips focus that arrives within a second of either, so a long touch that focuses on release is covered too. That covers both. A press that never focuses the row, such as a right-click, just ages out instead of blocking the next keyboard focus. It doesn't rely on :focus-visible, because a mouse press matches that when the browser always shows focus rings.
  • Rows the header doesn't cover stay put. Scrolling by the measured overlap also covers a header taller than the row's 40px margin, as with a large minimum font size.

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:

  • Shift+Tab onto a row 0–80px under the group header (160px list, and at 812×375): before, 50 of 50px visible in Chromium and 26 of 50 in Firefox. After, 50 of 50 in both.
  • Firefox with a minimum font size of 24 or 32px (header 57 or 69px tall): the worst Shift+Tab case shows the whole row, 86/86 and 110/110px.
  • Clicks and taps:
    • Mouse clicks on rows near the top of a scrolled list open the device at 390, 900 and 1440px, in both engines.
    • With Firefox's always-show-focus-rings setting, clicks on a partly covered row open it too.
    • In Chromium touch emulation, taps and 1.5s holds on partly covered rows open the device.
    • Nothing moves in any of these.
  • A row already clear of the header (390×500 and 390×844, with a stand-in playback bar): the list and page don't move.
  • The checks from fix(web): keep Devices page labels, checkboxes and anomaly badges readable #4845 still pass in both engines:
    • tabbing onto a stuck group header's own controls doesn't move the list;
    • on short screens, the focused first row is fully visible at default and x-large text.
  • prettier, eslint and tsc pass.

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

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

Background review of this PR:

Member Round 1 (7c110c6) Round 2 (9d922bc) Round 3 (7aa50a8)
Sol (gpt-6.2-sol, xhigh) 6/10 7/10 7/10
Opus (claude-opus-5-5, high) 6/10 8/10 9/10
Gemini (gemini-4-neon, xhigh) unavailable (provider quota) unavailable (provider quota) unavailable (provider quota)

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 isKeyboardFocus helper. 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-visible let 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 the isKeyboardFocus export 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 main before #4845 rows had no margin at all, so the 40px margin isn't a regression.

AI Disclosure

  • Harness: Claude Code, run inside T3 Code
  • Tool(s): Claude Code; playwright-core with headless Chromium and Firefox for the focus and click measurements
  • Model(s): claude-opus-5-5 (implementation); gpt-6.2-sol and claude-opus-5-5 (reviews)
  • Involvement: Fully AI-generated; a maintainer reviews it before merge
  • Adversarial review: see Council review above.

🤖 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 revealRowUnderHeader helper measures the overlap and decreases the list's scrollTop to reveal the row.

  • The device-list container in AdminDevices.tsx now carries a data-device-list attribute so the helper can locate it.
  • The row records pointer-down and pointer-up timestamps and skips the scroll adjustment when focus follows a pointer interaction within 1000 ms.

Macroscope summarized 318b3ef.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T05:37:13.684399Z 318b3ef New commits
🔒 Security Review ✅ Completed 2026-11-21T05:38:39.254443Z 318b3ef New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5bf5ba81-d2ca-4a87-b196-f42b029ff643
Commits

Reviewing files that changed from the base of the PR and between 8a49180 and 318b3ef.

Files selected for processing: 1

  • web/src/pages/AdminDevices.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 21, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread web/src/pages/AdminDevices.tsx Resolved
@Quick104
Quick104 force-pushed the fix/admin-devices-focused-row-scroll branch from 7c110c6 to 9d922bc Compare November 21, 2026 04:52
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

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.

  • S1 (medium): clicking a device row near the top of the list didn't open it. A mouse press focuses the link, the focus handler scrolled the row away from the pointer, and the click went to the list instead. It reproduced at 390px in Chromium, Firefox and WebKit, and also near the sticky group header at desktop width. This is the same bug as Opus's O1, fixed in 9d922bc: the row scrolls itself only when focus matches :focus-visible. Safari on a real device and touch on a phone are still untested.

AI disclosure: summary written by claude-opus-5-5 (Claude Code) from the automated review's output.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread web/src/pages/AdminDevices.tsx Resolved
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 force-pushed the fix/admin-devices-focused-row-scroll branch from 0103f9b to 7aa50a8 Compare November 21, 2026 05:08
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104 Quick104 changed the title fix(web): keep a focused Devices row clear of the sticky headers in Firefox and on phones fix(web): keep a keyboard-focused Devices row clear of its group header in Firefox Nov 21, 2026
@Quick104

Copy link
Copy Markdown
Contributor Author

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.

  • S2 (P2): below lg, Shift+Tab onto a row that was already clear of its group header still scrolled the list. The 96px margin pushed the row down, and scrollIntoView counts the area behind the fixed playback bar as visible, so in a 390×500 fixture the focused row ended up fully hidden in all three engines. Fixed in 7aa50a8: the row's margin is back to 40px, and the focus handler scrolls only when the group header covers the row. With a stand-in playback bar at 390×500 and 390×844, a clear row no longer moves in Chromium or Firefox. The handler alone had still moved it 18–48px, because the browser's own focus scroll applied the 96px margin. Focus restoration after Back in the full app, and Safari on Apple hardware, are still untested.

AI disclosure: summary written by claude-opus-5-5 (Claude Code) from the automated review's output.

@Quick104
Quick104 force-pushed the fix/admin-devices-focused-row-scroll branch from 7aa50a8 to 25bcb01 Compare November 21, 2026 05:18
@Quick104

Copy link
Copy Markdown
Contributor Author

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.

  • S3 (medium): in Firefox with browser.display.show_focus_rings on, a mouse press matches :focus-visible. Clicking the first visible pixels of a row the header partly covered moved the row 10–22px, and the click was lost.
  • S4 (low): with a large minimum font size in Firefox, the group header grows taller than the row's 40px margin (57px at a 24px minimum). Scrolling to the margin left part of the name covered.

Both fixed in 25bcb01. The row now skips focus that comes from a pointer press: a flag set on pointerdown and cleared by the next focus, by blur, or on pointercancel, so a touch tap is covered too. Instead of using :focus-visible and scrollIntoView, it scrolls the list by exactly how far the header covers the row. Measured in Firefox with the same settings:

  • Clicks with always-shown focus rings: every click opens, where 7aa50a8 lost those on a partly covered row.
  • Worst Shift+Tab visibility at a 24px minimum font: 86/86px (7aa50a8: 69/86).
  • At a 32px minimum font: 110/110px (7aa50a8: 81/110).

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 isKeyboardFocus export from round 2 is no longer needed and is reverted, so O2 no longer applies.

AI disclosure: summary written by claude-opus-5-5 (Claude Code) from the automated review's output.

@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread web/src/pages/AdminDevices.tsx Resolved
@Quick104
Quick104 force-pushed the fix/admin-devices-focused-row-scroll branch from 25bcb01 to 9ac88d2 Compare November 21, 2026 05:28
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 5 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility
  • Retain distributed firing claims through their own validity windows

Comment thread web/src/pages/AdminDevices.tsx Resolved
Quick104 and others added 5 commits November 21, 2026 00:35
… 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>
Quick104 and others added 2 commits November 21, 2026 00:35
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>
@Quick104
Quick104 force-pushed the fix/admin-devices-focused-row-scroll branch from 9ac88d2 to 318b3ef Compare November 21, 2026 05:35
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit eea8cce into main Nov 21, 2026
26 checks passed
@Quick104
Quick104 deleted the fix/admin-devices-focused-row-scroll branch November 21, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant