Repository navigation
fix(sections): include poster URLs in admin row previews - #1891
Conversation
The v2 admin preview copied card fields and thumbhashes but never set poster_url, so Home rows peeks and the Add row live preview could only show blurred placeholders. The service now presigns each preview item's poster at the variant a saved row serves, and the v2 handler fills the existing poster_url field. The frozen /api/v1 preview body is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The admin preview handed the image signer an unordered list that could repeat a shared poster and include empty paths. It now skips empty paths and collects each poster once in item order, as live rows already do, so the plugin resolver does no duplicate work. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The comment on PreviewResponse poster_path still said the admin preview sends no poster URLs. The field now carries the presigned v2 poster_url. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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. |
|
Web admin task #1141 C1 is affected: the Add/Edit row workflow now displays poster artwork in the draft preview. Its Results row is still Please replace the current
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
…ix/sections-preview-posters
|
Updated the |
Problem
Related issue: #1137
Validation tasks: changes #1141 C1 (the Add row and Edit row previews now show poster artwork; saved row configuration and reordering are unchanged; C1 has no recorded result yet)
Stacked on #1889, so this targets
feat/home-rows-more-menu(#1889 sits on #1885, #1884, #1883 and #1882). It retargets tofeat/collections-revamponce those merge.The preview in the Admin > Home rows Add row and Edit row dialogs shows blurred placeholder tiles with titles instead of posters.
POST /api/v2/admin/sections/previewnever fillsposter_urlon its items, so the web has only each item's thumbhash to draw. This PR fillsposter_urlwith the same presigned URL the saved row will serve, so an admin sees the real posters before saving, as the approved design draws them. This is the server step of the Home rows redesign that the preview depends on.Approach
The v2 preview signs each item's poster at the size and image variant a saved row uses by default (
w500,featured). It signs each distinct poster once, in one batch call to the catalog detail service's existing signer, and leavesposter_urlout for items without a poster. Storage keys are still never serialized, and the thumbhash comes back as before. If a server has no image signer configured, the preview still answers, without posters.The frozen
/api/v1/admin/sections/previewkeeps its old body. Both versions share the preview code, which still returns the v1 response; only the v2 entry point adds poster URLs.poster_urlalready exists onCatalogItemand is documented as presigned and short-lived, so the OpenAPI document, generated web types and fixtures don't change. Nodocs/*-api.mdfile covers this route, so the note on preview posters went into the admin section definitions part ofdocs/architecture/api-contract.md. The web needs no code change because the preview strip already loadsposter_urlwhen it is present; a web comment that said the preview never sends poster URLs is corrected.Admin row peeks don't use the preview yet, so they keep their current look until the peeks PR switches them to it.
Difference from the plan, for sign-off: the plan asked for apiv2 tests without a database. This PR also adds one database test, because it is the only test that compares the preview's poster with the one the saved row serves through the real fetcher.
Validation
go build ./...,gofmt,go veton the two changed packages, andmake lint-changedagainst the base branch (0 issues) pass.poster_urlis served, the thumbhash is kept and no storage key appears. A database test runs the real fetcher and checks that the preview's poster URL matches whatGET /api/v2/library/{id}/sections/{section_id}/itemsserves for the same item. Removing theposter_urlassignment, or returning no poster URLs from the service, makes these tests fail.TestCatalogTransferPersistsJobsAndSignedLinkandTestAdminSubtitleListPageDB; both fail the same way on the base branch in this local setup, compare timestamps across time zones, and don't involve sections.make verify-apiv2-openapi,verify-apiv2-fixtures,verify-apiv2-web-types,verify-apiv2-contract(base and branch identical),verify-route-inventoryandTestCommittedArtifactMatchesRouterpass.make test-web(774 files, 7106 tests passed),pnpm run lint(0 errors, no warnings in changed files),format:check,tsc -b,buildandbudget:checkpass.make verify-local-pathspasses.make test-goandgo vet ./..., since only two Go packages changed, and a browser check of the dialog's preview with real artwork. Curated home sections — Web admin #1141 C1 has not been walked on a running build.Risks
Each preview request now also signs up to 50 poster URLs in one batch call, through the signer saved rows already use. The route is admin-only, the URLs cover only items the preview already returns under the admin's own access filter, and they expire like every other catalog poster URL.
The
/api/v2change is additive: an existing optional field is now filled./api/v1is unchanged. No stored data,section_type, recipe ID, preset key, gating or hero behavior changes. silo-apple, silo-android and jellycompat don't call this route and need no change. The user manual needs no update.Checklist
AI Disclosure
/api/v1is unchanged. It reran the tests on its own database, then removed theposter_urlassignment and the service's poster URLs in turn to confirm tests fail. It approved with one minor finding and one nit, both fixed. The web comment on the preview's poster field still said the preview sends no poster URLs; it now describes the field. The preview passed empty and duplicate poster paths to the signer, which saved rows skip; it now skips empty paths and signs each poster once, with a test. The reviewer also corrected an earlier claim that admin row peeks would show posters: they don't use the preview until a later PR.🤖 Generated with Claude Code
Note
Include presigned poster URLs in admin section preview rows
AdminSectionPreviewResultin admin_sections_service.go that carries preview items, total count, and poster URLs keyed by content ID.SectionHandler.previewPosterURLsresolver batch-signs poster paths in first-seen order with the featured variant at the default size, skipping items without posters and passing duplicates to the signer once.PreviewResponsefield is still namedposter_pathin recipes.ts.Macroscope summarized 41691f3.