Skip to content

fix(web): re-check a clamped overview's More button when its text reflows without a resize - #5054

Merged
Quick104 merged 3 commits into
mainfrom
fix/detail-overview-more-font-swap
Nov 21, 2026
Merged

Quick104 merged 3 commits into
mainfrom
fix/detail-overview-more-font-swap

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 (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 uses DetailOverview: 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 DetailOverview now also runs on document.fonts.ready and on loadingdone, the same pattern useOverflowsInline and DetailTitle already 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. DetailTitle already watches both attributes.

Validation

  • Reproduced with a local harness page that renders DetailOverview with 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.
  • Interface language: a probe with Japanese text switched the language to English. The content grew from 84 to 112 px in a box that stayed 84 px, and "More" appeared, in Chromium 153, Firefox 155 and WebKit 26.6.
  • Text weight: a Chromium probe of the real component at the widths where the default weight fits and the strong weight is cut. After switching to strong, the text was cut with no "More" at all 3 widths before this change, and "More" appeared at all 3 after it.
  • The existing DetailOverview tests, ESLint, Prettier, and tsc pass. 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

  • 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

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

Member Round 1 Round 2
Sol (gpt-6.2-sol, high) 9/10 9/10

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.ready and loadingdone fire 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, and useOverflowsInline and DetailTitle share the same limit. Watching each FontFace separately 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

Member Round 1
Sol (gpt-6.2-sol, high) better, 9/10

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, Codex (review), Playwright
  • Model(s): claude-opus-5-5 (implementation), claude-sonnet-5-5 (review subagents), gpt-6.2-sol (visual and background review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: code-review at medium (three finders and a validation check) found no defect in the diff. A suggestion to extract a shared font re-measure hook was declined to keep this change inside the one effect. The plan round was skipped because the fix is mechanical: a few lines that reuse an existing pattern and add nothing. A simplify pass made no changes. See Council review.

🤖 Generated with Claude Code

…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]>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@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 10 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: f915d2e7-eb16-4352-9171-d8e23b02f02b
Commits

Reviewing files that changed from the base of the PR and between 02a9d1d and dfc985d.

Files selected for processing: 1

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

@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-21T15:35:43.450713Z 80eb25d PR opened
🔒 Security Review ✅ Completed 2026-11-21T17:01:56.336907Z dfc985d 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.

@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 javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Nov 21, 2026
…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

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): show an item description's More button correctly after the web font loads fix(web): re-check a clamped overview's More button when the font or text weight changes Nov 21, 2026
…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

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): re-check a clamped overview's More button when the font or text weight changes fix(web): re-check a clamped overview's More button when its text reflows without a resize Nov 21, 2026
@Quick104
Quick104 merged commit 7baf271 into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/detail-overview-more-font-swap branch November 21, 2026 17:54
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/S 0–49 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant