Repository navigation
fix(web): scale browse and detail text with the browser text size - #1806
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (40)
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. Comment |
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:
|
| description: "Semi-transparent dark pill with a white border. The default.", | ||
| badgeClass: | ||
| "rounded-full border border-white/15 px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase leading-none", | ||
| "rounded-full border border-white/15 px-2 py-0.5 text-[0.625rem] font-semibold tracking-wide uppercase leading-none", |
There was a problem hiding this comment.
Text-size regression in web/src/lib/overlays/presets.ts occurs because the rem preset classes no longer match the existing Large/Extra large !important font-size overrides in app.css, while CardOverlays.tsx:197 still supplies an inline pixel/container-unit font size. Changing the in-app text size therefore no longer enlarges overlay badges, and the inline size leaves the new rem utility ineffective on rendered cards.
Prompt for LLM
File web/src/lib/overlays/presets.ts:
Line 39:
Text-size regression in web/src/lib/overlays/presets.ts occurs because the rem preset classes no longer match the existing Large/Extra large !important font-size overrides in app.css, while CardOverlays.tsx:197 still supplies an inline pixel/container-unit font size. Changing the in-app text size therefore no longer enlarges overlay badges, and the inline size leaves the new rem utility ineffective on rendered cards.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Confirmed, and fixed in cdb240d. Before this PR, the !important html[data-text-scale] .text-[10px] rules beat the badge's inline font size, so Large and Extra large made badges bigger (a fixed 11.2px, losing card-width scaling). With rem preset classes those rules stopped matching and the inline size kept badges at their default size. The inline size is now multiplied by a new --ui-root-text-ratio (root font size over 16px, computed with CSS trigonometry, falling back to the in-app factor). Badges now grow with both the in-app setting and the browser text size and keep card-width scaling; default rendering is unchanged. A new test checks the badge size at default and at Large. No other converted file sets an inline font size.
There was a problem hiding this comment.
Thanks for confirming. Based on your description, cdb240d99 addresses the reported regression: multiplying the inline badge size by --ui-root-text-ratio restores browser and in-app text scaling while preserving card-width scaling and unchanged default rendering.
The default/Large test covers the in-app regression. A larger-browser-default test would also be useful to protect the browser-scaling path, particularly the distinction between the computed ratio and its fallback.
I haven’t independently inspected the commit, but the approach you describe resolves the original concern.
|
Suggested fix (PR description; no source diff): Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
The root font size was pinned to 16px, so a larger browser default font size never reached rem-based text, and labels on the core screens used fixed pixel sizes (`text-[15px]` and similar) that ignored any root change. On the series detail page the Resume and Mark Series Watched buttons, genres and tagline stayed the same size while headings grew. The root font size is now 100% (112.5% and 125% for the in-app Large and Extra large text settings), so it follows the browser default. Fixed pixel font sizes on the home, library browse, search/catalog and item detail screens, their shared cards and badges, and the app sidebar are converted to the equal rem value. At the default 16px root every size renders as before; arbitrary rem values are used instead of Tailwind scale classes because those also set a line height. A source test keeps the converted files free of pixel font sizes and the root font size relative. Closes Silo-Server#1796
Card overlay badges set their font size inline (container units on posters, pixels on wide cards). Before the rem conversion, the in-app Large and Extra large settings still enlarged them because the `html[data-text-scale] .text-[10px]` rules use `!important`, which beats the inline style. The preset classes are rem now, so those rules no longer match and the inline size kept badges at their default size. The inline size is now multiplied by `--ui-root-text-ratio`, the root font size over 16px. It follows both the browser default font size and the in-app setting, and keeps the card-width scaling that the old override discarded. Browsers without CSS trigonometry fall back to the in-app scale factor. At the default text size the result is unchanged.
5a295e5 to
cdb240d
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
Closes #1796
Related issue: #1252
Validation tasks: changes #1252 C7; changes #1256 C7
The web app ignored the browser's text-size setting.
app.csspinned the root font size to 16px, which cancels the browser default font size, and core screens also used fixed pixel sizes (for exampletext-[15px]on the Resume button). The 1.0 criteria require core browse and detail screens to follow the system text size.The root font size is now relative (
100%, with the in-app Large and Extra large settings at112.5%and125%), and the fixed sizes on the core browse and detail screens are converted to the equivalent rem values. At a 16px browser default everything renders at the same size as before; a larger browser setting now enlarges these screens.Approach
99 sizes in 35 files are converted to exact rem equivalents rather than Tailwind scale classes, because the scale classes also set line height and would change default rendering. Scope: item detail (movie, series, season, episode), season and episode lists, cast and crew, home and library cards, search and the catalog filter bar, watchlist and collection cards, poster badges and the sidebar. Admin pages, the player, settings, the setup wizard and the Books beta screens keep pixel sizes for now. A new test fails if the root size goes back to pixels or a converted file regains a pixel font size.
Validation
src/pages/ItemDetail, Home, LibraryBrowse, the overlay presets and the root CSS pass.make test-go. Its failures also occur on unmodifiedmainon this macOS host (hardware-acceleration probe tests whose fake ffmpeg is killed, andTestAdminResourceCapabilitiesAndScope); threejellycompattranscode-session tests that failed once under full-suite load pass in isolation on both. Linux CI is the authority for those.Risks
Users whose browser default font size is not 16px will see these screens at their chosen size for the first time; that is the intent. About 646 pixel font sizes remain outside the scope above. With a larger browser font, Tailwind's
lg:breakpoint (rem-based) and the fixed 1024px--app-sidebar-offsetswitch can disagree between those widths; that predates this change.Checklist
AI Disclosure
main: that every converted size equals its pixel value at a 16px root, and the interaction with the in-app text scale. No findings.Note
Scale browse and detail text with browser text size via root rem typography
--ui-root-text-ratio(root-rem-to-16px ratio via CSS trigonometry, with--ui-text-scale-factorfallback) so overlay badges can scale with the root text;BadgeStackbadge font sizes and allOVERLAY_PRESETSbadge classes now multiply by this ratioMacroscope summarized cdb240d.