Skip to content

fix(web): switch admin tables to cards later at a larger text size - #5474

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
rangoDJ:fix/5071-admin-tables-text-scale
Nov 28, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
rangoDJ:fix/5071-admin-tables-text-scale

Conversation

@rangoDJ

@rangoDJ rangoDJ commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Depends on: none. Merge order: none.

Problem

Closes #5071
Related issue: #5063
Validation tasks: none

Other clients: none. Web admin only.

With Settings › Accessibility › Text size at Large or Extra Large, admin tables were wider than their page and scrolled sideways, hiding their last columns. The web picks a table or a card layout from the window width in browser rem: useLibrariesTableLayout uses (min-width: 64rem) and useWideTableLayout uses (min-width: 80rem), both in web/src/components/admin/libraries/diagnosticsListState.ts. A media query's rem doesn't follow the app's text size (html[data-text-scale="x-large"] sets font-size: 125%), so the tables grew with the text but the switch point didn't.

Approach

  • Both hooks multiply their breakpoint by the active text scale's factor: 1, 1.125 or 1.25, the --ui-text-scale-factor that app.css sets for each data-text-scale. At Extra Large the switch moves to 80rem (1280 px at a 16 px default) for the regular tables and 100rem for the wide ones. This is the first fix the issue suggests.
  • TEXT_SCALE_FACTOR (themePreferences.ts) names those factors once. useTextScaleFactor (useTheme.tsx) reads the active scale from the theme provider, or 1 without one, so component tests that render these tables without the provider are unchanged.
  • The Users search row takes its direction from the same switch as the table (showTable) instead of the xl breakpoint, so at a larger text size it stays stacked while the page shows cards. At Default text that's the same 80rem switch.
  • This covers every caller of the two hooks: the Libraries list, the diagnostics sections, Users, Invitations and Invite codes. Other useMediaQuery width breakpoints in the app have the same gap, as the issue notes, and aren't changed here.

Validation

  • New test diagnosticsListState.textScale.test.tsx: under ThemeProvider at Default, Large and Extra Large, the hooks ask for (min-width: 64rem)/(min-width: 80rem), 72rem/90rem and 80rem/100rem. The Large and Extra Large cases fail on main, which always asks for 64rem and 80rem, and pass with this change.
  • pnpm exec vitest run src/components/admin/libraries src/pages/AdminUsers src/pages/AdminLibraries src/pages/admin-settings src/hooks: 113 files, 924 tests passed. tsc -b --noEmit, eslint and prettier on the changed files: clean.
  • In headless Edge at 1024×768 with Extra Large text, Admin › Libraries: on main, the library table's container overflows by 249 px; with this change the page shows cards. Screenshots are below.
  • Not tested: the French measurements in the issue, and other admin tables one by one (they use the same two hooks).

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-5474/ (before/after screenshots)

Admin › Libraries, Extra Large text, 1024×768, sidebar open

Before (main): the library table is wider than its section and scrolls sideways; Last Scanned is cut off.

After: below the scaled breakpoint the page shows the card layout, with nothing hidden.

Risks

  • At Large and Extra Large text, windows between the old and new breakpoints now get cards instead of tables. That's the intended change; at Default nothing changes.
  • No API, schema or config change.

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.

AI Disclosure

  • Harness: Claude Code in the Claude desktop app
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, not yet human verified
  • Adversarial review: n/a

🤖 Generated with Claude Code

Note

Scale admin table card breakpoints by text size factor

Admin tables switch from table to card layout later when users pick a larger text size. The 64rem (useLibrariesTableLayout) and 80rem (useWideTableLayout) breakpoints are now multiplied by the active text-scale factor via a new useTextScaledMinWidth helper in diagnosticsListState.ts.

  • Adds TEXT_SCALE_FACTOR (1, 1.125, 1.25) in themePreferences.ts and a useTextScaleFactor hook in useTheme.tsx, which returns 1 outside ThemeProvider.
  • The users toolbar in AdminUsers.tsx now picks its flex direction from showTable instead of the fixed xl breakpoint.
  • Adds tests asserting the scaled media queries for each text scale.
  • Behavioral Change: all admin tables using these layout hooks switch layouts at larger viewport widths when text scale is set to large or x-large.

Macroscope summarized 6fc2e23.

With Settings › Accessibility › Text size at Large or Extra Large, admin
tables were wider than their page and scrolled sideways, hiding their
last columns. The table/card switch is a width media query in rem
(64rem, and 80rem for the wide tables), and a media query's rem is the
browser's default font size, not the app's scaled root, so the tables
grew with the text and the switch point didn't.

useLibrariesTableLayout and useWideTableLayout now multiply their
breakpoint by the active text scale's factor (1, 1.125 or 1.25, as
app.css sets --ui-text-scale-factor). useTextScaleFactor reads it from the
theme provider without requiring one, so components rendered without it
keep the default.

Closes Silo-Server#5071

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 15 minutes.

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: 02a56f95-44e4-443e-a76c-cb8b798a6480
Commits

Reviewing files that changed from the base of the PR and between 0a631fb and 6fc2e23.

Files selected for processing: 6

  • web/src/components/admin/libraries/diagnosticsListState.textScale.test.tsx
  • web/src/components/admin/libraries/diagnosticsListState.ts
  • web/src/hooks/themePreferences.ts
  • web/src/hooks/useTheme.tsx
  • web/src/pages/AdminUsers.tsx
  • web/src/pages/admin-settings/InviteCodeList.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 27, 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 javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 27, 2026
At Large and Extra Large text, the Users list now shows cards past the xl
breakpoint, but the search row still switched to one line at xl. Search,
the group filter and Sort then shared one row and the search box was cut
short. The row now follows the same switch as the table.

Also note the later switch in the comments that named a fixed breakpoint,
and drop the executable bit from the new text-scale test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Claude Code (claude-opus-5-5)

Review of 529e9d1. The fix works: on a sandbox at Extra Large text and 1024 px, Admin › Libraries shows the table cut off on main and cards with this branch, and Default text is unchanged. I found one layout gap on the Users page and one file-mode nit. I'm fixing both in a commit on this branch, so there's no need to change them yourself. The summary comment follows.

Minor: the Users search row still switches at xl (web/src/pages/AdminUsers.tsx:328, outside this diff). The row mb-4 flex flex-col gap-2 xl:flex-row goes to one line at 80rem, but useWideTableLayout now keeps the cards until 90rem at Large and 100rem at Extra Large. Between those widths the page shows cards, so the Sort control appears, and search, the group filter and Sort all share one row. On a sandbox at Extra Large and 1350 px, the search box shrinks to about a third of the row and its placeholder is cut off. Repair: take the direction from showTable (showTable ? "flex-row" : "flex-col"). At Default text that's the same switch as xl, because showTable flips at 80rem.

@silo-kody

silo-kody Bot commented Nov 28, 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

🤖 Claude Code (claude-opus-5-5)

Review summary

Reviewed head: 6fc2e23 (529e9d1 plus one review commit).

Fit: 9/10 · Readiness: 9/10 — ready

At Large and Extra Large text, the admin tables now switch to cards when they would no longer fit. Default text behaves as before. The fix sits in the two hooks every one of these tables already uses, and it's the first approach #5071 suggests.

What I checked

  • Live, on one sandbox rebuilt per build, with the text size set through Settings › Accessibility:
    • main (2355e1a), Extra Large, 1024 px: the Libraries table overflows its section and the Actions column is cut off.
    • This branch (529e9d1): cards at the same size.
    • Default text at 1100 and 1300 px: Libraries and Users show their tables with no overflow on every build.
    • The browser console showed no errors on any build.
  • Test: diagnosticsListState.textScale.test.tsx fails on main for the reported reason: Large and Extra Large still ask for 64rem/80rem. It passes on this branch.
  • Suites and typecheck: the admin libraries, Users, admin-settings and hooks suites pass, and so does tsc -b.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-5474-review/

Fixed on this branch (6fc2e23)

  • Users search row. Users now shows cards past xl at larger text, but its search row still went to one line at xl. At Extra Large and 1350 px, search, the group filter and Sort shared one row and the search box was cut short. The row now takes its direction from showTable, which flips at the same 80rem as xl at Default text. Verified on the sandbox at Extra Large 1350 and 1500 px, Large 1400 px, and Default 1300 px.
  • Stale comments. Updated the comments that named a fixed breakpoint in diagnosticsListState.ts, InviteCodeList.tsx and AdminUsers.tsx.
  • File mode. Removed the executable bit from the new test.

Left for the maintainers

Nothing blocks this PR. Three items sit outside it:

  • Theme context can lag the page. For a signed-in profile with a stored text size, picking a new one updates the page right away. useTheme().textScale keeps the old value until the save and the settings re-read finish. If a save might have stored the value and the re-read then fails, the lag lasts until a later read succeeds. During that window the breakpoint uses the old scale, which is no worse than main. The Settings text-size buttons read the same value, so this predates the PR.
  • Autoscan Activity layout switch. The Active Scans, Scan History and Poll History lists switch between table and cards with CSS lg: classes, not these hooks, so they keep the unscaled breakpoint. I haven't checked whether they overflow. The PR body already says other breakpoints are out of scope.
  • Two more comments. AdminUsers.tsx:132 and InvitationList.tsx:172 still describe the Default-text breakpoints. They don't affect behavior.

Validated features

The only passed cases this could reach are #1197 Web admin C1–C2 (create accounts and invitations, accept an invitation). Default text is unchanged, and at larger text the card layouts offer the same actions. No regression. Validation tasks: none.

Other checks

  • User manual: unaffected. The manual doesn't describe how admin tables lay out at each text size.
  • Other clients: N/A. Only the web has these admin tables, and jellycompat is untouched.
  • Translations: no interface text changed.

Council review

Rounds: 2, last reviewed 6fc2e23

Member Round 1 (529e9d1) Round 2 (6fc2e23)
Sol (gpt-6.2-sol, medium) 8/10 9/10
Opus (claude-opus-5-5, medium) 8/10 8.5/10
Gemini (gemini-4-neon, medium) 7/10 9/10

Fixed: the Users search row, the stale comments, and the file mode. Answered: the theme-context lag predates this PR, and Autoscan Activity is out of scope.

@Quick104
Quick104 merged commit b3fa9fe into Silo-Server:main Nov 28, 2026
19 checks passed
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 javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Admin tables ignore the text size setting and scroll sideways at Extra Large text

2 participants