Repository navigation
perf(web): request artwork at the size each screen draws it - #3277
Conversation
Send per-slot widths from images/capabilities, from each slot's drawn CSS width times the device pixel ratio (capped at 3), with a small rung slack and a top-rung cap. Lazy-load grid cards, preload only the next hero slide and pause the hero while hidden, and skip the poster phone-width detail pages hide. Closes #2611 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Findings
|
| Layer / File(s) | Summary |
|---|---|
Capability loading and width calculation web/src/lib/artworkWidths.ts, web/src/lib/artworkWidths.test.ts, web/src/lib/uiCustomization.ts, web/src/utils/storage.ts, web/src/contexts/UICustomizationProvider.tsx, web/src/App.tsx, web/src/test/signedInBoot.test.tsx |
Adds capability storage and loading, width selection by surface and layout, and poster-size state updates. The app requests capabilities after critical content loads. Tests cover width selection and boot request timing. |
Artwork-aware catalog reads web/src/hooks/queries/catalog.ts, web/src/hooks/queries/catalog.test.tsx, web/src/hooks/queries/catalogRead.ts, web/src/hooks/queries/progress.ts, web/src/hooks/queries/recommendations.ts, web/src/player/hooks/useSeriesEpisodes.ts |
Catalog reads send artwork widths and retain page 0 widths for later pages. Detail, recommendation, and episode reads use widths for their respective surfaces. |
Featured and section artwork requests web/src/hooks/queries/sections.ts, web/src/pages/Home.tsx, web/src/pages/LibraryRecommended.tsx, web/src/pages/watchtogether/room/picker/usePickerData.ts |
Home layout requests include artwork widths. Section-item requests use featured status to select hero or row widths. |
Artwork loading and responsive display web/src/components/HeroBanner.tsx, web/src/components/HeroBanner.test.tsx, web/src/components/ItemCard.tsx, web/src/components/MediaCardArtwork.tsx, web/src/pages/ItemDetail/DetailHero.tsx, web/src/pages/ItemDetail/DetailHero.test.tsx |
Hero autoplay and next-slide loading depend on page and section visibility. Priority images omit asynchronous decoding. Viewport-bounded detail variants hide the poster below 64rem. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Sequence Diagram(s)
sequenceDiagram
participant AppShell
participant ArtworkCapabilityReader
participant ImageCapabilitiesAPI
participant Storage
AppShell->>ArtworkCapabilityReader: Mount after critical content loads
ArtworkCapabilityReader->>ImageCapabilitiesAPI: Request image capabilities
ImageCapabilitiesAPI-->>ArtworkCapabilityReader: Return capability ladders
ArtworkCapabilityReader->>Storage: Store available capabilities
Possibly related PRs
- Silo-Server/silo-server#3276: Both PRs change Home section reads and their request options and fallback paths.
- Silo-Server/silo-server#2628: This PR adds artwork query parameters to similar-item requests using the recommendation artwork-sizing contract.
- Silo-Server/silo-server#2626: This PR uses image ladders and capability widths to calculate client artwork sizes.
Suggested reviewers: rhainland, blurbery
Merge Risk: 
Low · up to 90e23
-
Off-screen heroes may download an unnecessary backdrop, and featured saved rows may request artwork at the wrong size. These bounded issues warrant follow-up but do not block merging.
Security architecture risk: 
Low · up to 90e23
-
The inspected changes affect artwork sizing and loading rather than access permissions. No new privilege increase or unauthorized data path was identified. Compatibility with older servers during replacement or rollback remains incompletely validated.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- observed — The shared sizing decision propagates across catalog, detail, Home/library sections, and recommendation reads. A stale capability decision therefore has cross-screen compatibility reach within the web client, rather than being isolated to one image component.
Trust Boundaries and Controls
- observed — The new capability request remains behind the app's authenticated-user gate and uses the existing session transport. The server capability operation retains its profile-scoped classification, and the request wrapper prevents callers from supplying session headers through ordinary header options.
Resilience and Maintainability Implications
- inferred — Sharing cached capability metadata between accounts is not, by itself, evidence of cross-account disclosure: the stored subset contains slot names and image-size ladders, and the inspected server constructs those values from shared backend configuration rather than account-owned content.
Hardening Proposals
- proposed — Consider expiry or explicit invalidation of cached width support when a server rejects width parameters, with recovery that preserves cursor-bound pagination consistency. This would strengthen compatibility during same-origin server replacement; it is not a verified security finding.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#2611is open and directly linked.artworkWidths.tscomputes per-slot widths from drawn CSS sizes and DPR capped at 3. It uses advertisedslot_width_params, applies rung selection, and returns no width parameters when capabilities are unavailable. Requests cover detail backdrops and logos, Home heroes, episode and Up Next stills, season artwork, catalog grids, rows, and On Deck. Catalog pagination reuses page 0 widths. The DetailHero fixtures replacew780URLs with slot-specificw500andw1920URLs. Tests cover width selection, capability fallback, pagination, hero loading, and updated fixtures.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within the artwork-loading performance scope of issue
#2611. Capability caching, cursor-width reuse, lazy card loading, asynchronous decoding, and hero visibility controls support correct or efficient image loading. The changed tests verify these behaviors. No unrelated product behavior is demonstrated.
Full details: Description check
-
Explanation
The pull request description clearly explains the artwork-sizing changes, related performance improvements, validation results, risks, and scope. It directly matches the files and objectives in the changeset.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 59.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 32 functions across 23 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
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:
|
Codex Review SummaryThis 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. |
|
Evidence is incomplete. The linked page is described as covering Home, a library grid, movie detail, and series detail, but it does not identify these changed surfaces or behaviors:
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc254a3423
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The server binds artwork widths into catalog cursors, so a page read with widths recomputed after a resize, or after the images capability loaded, failed with invalid_cursor. Later pages and collection reads now send the widths their first page was read with. 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:
|
|
The -Validation tasks: changes #1144 C1; reaches #1252 C1, C2, C8, C9, #1142 C1, #1146 C1
+Validation tasks: changes #1144 C1; reaches #199, #195 W1, #1181 C4, #1184 C1, C2, #1204 C1, #1252 C1, C2, C8, C9, #1256 C1, C2, #1142 C1, #1146 C1Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
The evidence page now has the captures you asked for:
Replied by Claude Code (claude-opus-5-5). |
The player's On Deck row reads each item through the item detail fetch, which now always asked for detail-page widths, so 175-255px cards downloaded full-screen backdrops. On Deck now asks for its own card widths and caches them under a longer key than the detail page's, so neither screen serves the other's artwork size. Invalidating an item's detail still reaches the On Deck copy. 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:
|
|
The Up Next regression the evidence page shows is fixed in 90e23f9. The On Deck row below Up Next read each item through The other The evidence page has not been re-captured with this commit. Replied by Claude Code (claude-opus-5-5). |
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
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:
7c17dd54-69ef-4ff2-b911-aa585076697b
Files selected for processing: 23-
web/src/App.tsxweb/src/components/HeroBanner.test.tsxweb/src/components/HeroBanner.tsxweb/src/components/ItemCard.tsxweb/src/components/MediaCardArtwork.tsxweb/src/contexts/UICustomizationProvider.tsxweb/src/hooks/queries/catalog.test.tsxweb/src/hooks/queries/catalog.tsweb/src/hooks/queries/catalogRead.tsweb/src/hooks/queries/progress.tsweb/src/hooks/queries/recommendations.tsweb/src/hooks/queries/sections.tsweb/src/lib/artworkWidths.test.tsweb/src/lib/artworkWidths.tsweb/src/lib/uiCustomization.tsweb/src/pages/Home.tsxweb/src/pages/ItemDetail/DetailHero.test.tsxweb/src/pages/ItemDetail/DetailHero.tsxweb/src/pages/LibraryRecommended.tsxweb/src/pages/watchtogether/room/picker/usePickerData.tsweb/src/player/hooks/useSeriesEpisodes.tsweb/src/test/signedInBoot.test.tsxweb/src/utils/storage.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
… screen The hero counted as on screen until IntersectionObserver first reported, so a hero mounted below the fold started downloading the next backdrop. It now starts unknown, and still counts as shown where the observer is unavailable. 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:
|
Resolve the overlap with the artwork-widths change (#3277): Home row reads, the completion read and the watch-together shelf send both the row's artwork widths and item_limit, and the layout's item_limit fallback keeps the widths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
Closes #2611
Related issue: N/A
Validation tasks: changes #1144 C1; reaches #1252 C1, C2, C8, C9, #1142 C1, #1146 C1
The web app took the server's default artwork sizes on almost every screen. Continue Watching drew 1280 px backdrops in cards about 300 px wide, grids and rows fetched one fixed poster size whatever the card size, and detail heroes drew a 1280 px backdrop across a high-density screen. Small screens downloaded more than they draw, and large heroes looked soft. This change makes the web ask for each image at the width its slot draws.
Approach
web/src/lib/artworkWidths.ts, turns a surface (row, hero, Home layout, grid, detail, seasons, episodes, Up Next, On Deck) into the v2 width parameters, from the slot's drawn CSS width at the current viewport and poster size, times the device pixel ratio capped at 3.images/capabilitieslistsslot_width_params, because the server rejects unknown query parameters; older nodes keep today's requests. The capability is read after the first content and stored, so it adds no request before Home.srcsetis not usable: each rung's URL carries its own content revision and signature, so the page cannot build other rungs' URLs. Widths are chosen when a request is built.invalid_cursor.Validation
make lint-changedandmake lint-router-recovery: pass.make test-go: pass, exceptTestRunStatsWithRealFFmpegandTestCopyRemuxSubtitleRenditionRealFFmpeg, which drive the local ffmpeg binary (6.1) and fail the same way onmain.pnpm run lint,format:check,build,budget:checkandmake test-web: pass.verify-*target in CONTRIBUTING,TestCommittedArtifactMatchesRouter): pass.verify-actionlintandverify-shellcheck(tools not installed); no workflow or shell script changed.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3277/
Detail and Home heroes are sharper on high-density screens; cards and rows look the same. The page pairs before and after screenshots for every screen and viewport.
Risks
MAX_ARTWORK_DPRis the one knob if 3x phones should trade sharpness for bytes.getPersontakes no width parameters.sections.tsandHome.tsx; whichever merges second needs a small rebase.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Request artwork at the size each web screen draws it
ArtworkCapabilityReaderloads image capabilities from the v2 capability document after critical content loads and persists ladders under a newIMAGE_CAPABILITIESstorage keyHeroBannerno longer auto-advances when the page is inactive or the hero is off screen, preloads only the next slide while shown, and non-priority artwork uses lazy loading and async decodingfetchCatalogItemscomputes widths once for all pagescontinue_watching,next_up); viewport-boundedDetailHerohides the poster below 64rem; home-layout 422 fallback dropsinclude_itemsand artwork-width parametersMacroscope summarized 311fc49.