Repository navigation
fix(web): re-check a clamped overview's More button when its text reflows without a resize - #5054
Conversation
…oads A web font that loads after the overview is measured can change how many lines the text needs while the clamped box keeps its height, so the resize observer never fires and More stays shown with nothing hidden, or stays missing while text is cut. Measure again on document.fonts ready and loadingdone, as useOverflowsInline does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 10 minutes. View limit details
|
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. |
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:
|
…ght changes The text weight preference changes how many lines an overview needs while the clamped box keeps its height, so, as with a late web font, the resize observer never fires and More could stay hidden over cut text (or show over text that fits). Watch data-text-weight on the document element, as DetailTitle does. Found in the review of #5067, whose Chrome alignment fix reads the same measurement. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
…e language changes The interface language changes how text such as Japanese breaks into lines, which can add or remove a line while the clamped box keeps its height. Watch lang on the document element along with data-text-weight, as DetailTitle does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 (web only: the stale state comes from the browser loading the web font after the first measurement; the native clients use platform fonts and don't share this code)
On a cold load, an item's description can show "More" when nothing is hidden, or cut the text with "…" and show no "More" at all. The description decides whether to show "More" by measuring the clamped text when it mounts and again when its box resizes. The app font loads with
font-display: swap, so it can arrive after that measurement and change how many lines the text needs. The clamped box keeps its height, so no resize fires and the button state stays wrong until something else re-renders it. This affects every page that usesDetailOverview: movie, series, and collection descriptions, plus the beta book pages.This change measures again once the page's fonts finish loading.
Approach
The measuring effect in
DetailOverviewnow also runs ondocument.fonts.readyand onloadingdone, the same patternuseOverflowsInlineandDetailTitlealready use. The change stays inside that effect. It also runs when the text weight preference (data-text-weight) or the interface language (lang) changes on the document element. Both reflow the text the same way while the box keeps its height: the language changes how text such as Japanese breaks into lines. Review of #5067 found the weight case and this PR's second review round the language case.DetailTitlealready watches both attributes.Validation
DetailOverviewwith the app's CSS (four fixture descriptions at 167 column widths each), with Playwright holding the font files for 2.5 s. On the base, 21 instances ended with the wrong "More" state in Chromium, WebKit, and Firefox: 7 showed "More" with nothing hidden, and 14 cut text with no "More". With this change, none did in any of the three.DetailOverviewtests, ESLint, Prettier, andtscpass. jsdom has no layout, so a unit test can't observe this; the browser run is the proof.Evidence
Before and after captures of both cases (221 px and 326 px columns), with the per-engine counts.
Evidence: https://evidence.siloserver.org/r/silo-server/detail-overview-more-font-swap/
Risks
None identified. Each page renders at most one
DetailOverview, and a re-measure that finds the same answer doesn't re-render.Checklist
Council review
This ran as a follow-up of another /silo run, with one reviewer per round.
Background review: round 1 reviewed 80eb25d; round 2 reviewed 458cf37 (the text-weight re-measure added from the review of #5067).
Fixed in round 2: switching the interface language could leave a cut overview with no "More", because the language changes line breaking while the box keeps its height (dfc985d). The reviewer couldn't post its round-2 review (GitHub returned 401), so the finding is recorded here.
Answered: S1 (low).
fonts.readyandloadingdonefire only once every pending font load in the document settles, so if another font on the page stalls, the re-measure waits until that load succeeds or fails. The fonts are same-origin build assets, the state corrects itself when the stalled load ends, anduseOverflowsInlineandDetailTitleshare the same limit. Watching eachFontFaceseparately would belong in a shared change across all three, so this PR keeps the existing pattern. The reviewer could not post its review on the PR (a GitHub authentication error), so the finding is recorded here.Visual review: 1 round, captures from 80eb25d
AI Disclosure
🤖 Generated with Claude Code