Repository navigation
fix(web): switch admin tables to cards later at a larger text size - #5474
Conversation
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>
|
Warning Review limit reachedThis 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. 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:
|
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
left a comment
There was a problem hiding this comment.
🤖 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 — 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:
|
|
🤖 Claude Code (claude-opus-5-5) Review summaryReviewed 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
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5474-review/ Fixed on this branch (6fc2e23)
Left for the maintainersNothing blocks this PR. Three items sit outside it:
Validated featuresThe 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
Council reviewRounds: 2, last reviewed 6fc2e23
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. |
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:useLibrariesTableLayoutuses(min-width: 64rem)anduseWideTableLayoutuses(min-width: 80rem), both inweb/src/components/admin/libraries/diagnosticsListState.ts. A media query'sremdoesn't follow the app's text size (html[data-text-scale="x-large"]setsfont-size: 125%), so the tables grew with the text but the switch point didn't.Approach
--ui-text-scale-factorthatapp.csssets for eachdata-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.showTable) instead of thexlbreakpoint, so at a larger text size it stays stacked while the page shows cards. At Default text that's the same 80rem switch.useMediaQuerywidth breakpoints in the app have the same gap, as the issue notes, and aren't changed here.Validation
diagnosticsListState.textScale.test.tsx: underThemeProviderat Default, Large and Extra Large, the hooks ask for(min-width: 64rem)/(min-width: 80rem),72rem/90remand80rem/100rem. The Large and Extra Large cases fail onmain, 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.main, the library table's container overflows by 249 px; with this change the page shows cards. Screenshots are below.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
Checklist
AI Disclosure
🤖 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 newuseTextScaledMinWidthhelper in diagnosticsListState.ts.TEXT_SCALE_FACTOR(1, 1.125, 1.25) in themePreferences.ts and auseTextScaleFactorhook in useTheme.tsx, which returns 1 outsideThemeProvider.showTableinstead of the fixedxlbreakpoint.Macroscope summarized 6fc2e23.