Skip to content

fix(sections): include poster URLs in admin row previews - #1891

Merged
Quick104 merged 4 commits into
feat/collections-revampfrom
fix/sections-preview-posters
Oct 4, 2026
Merged

Quick104 merged 4 commits into
feat/collections-revampfrom
fix/sections-preview-posters

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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 to feat/collections-revamp once 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/preview never fills poster_url on its items, so the web has only each item's thumbhash to draw. This PR fills poster_url with 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 leaves poster_url out 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/preview keeps its old body. Both versions share the preview code, which still returns the v1 response; only the v2 entry point adds poster URLs.

poster_url already exists on CatalogItem and is documented as presigned and short-lived, so the OpenAPI document, generated web types and fixtures don't change. No docs/*-api.md file covers this route, so the note on preview posters went into the admin section definitions part of docs/architecture/api-contract.md. The web needs no code change because the preview strip already loads poster_url when 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: go build ./..., gofmt, go vet on the two changed packages, and make lint-changed against the base branch (0 issues) pass.
  • Tests: handler tests check that the v2 preview signs posters the way a saved row does, signs each poster once in one batch, leaves out items without a poster, still answers without a signer, and keeps the v1 body unchanged. apiv2 tests check that poster_url is 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 what GET /api/v2/library/{id}/sections/{section_id}/items serves for the same item. Removing the poster_url assignment, or returning no poster URLs from the service, makes these tests fail.
  • With a migrated PostgreSQL database, the apiv2 and contractspec packages pass. In the handlers package everything passes except TestCatalogTransferPersistsJobsAndSignedLink and TestAdminSubtitleListPageDB; both fail the same way on the base branch in this local setup, compare timestamps across time zones, and don't involve sections.
  • Contracts: make verify-apiv2-openapi, verify-apiv2-fixtures, verify-apiv2-web-types, verify-apiv2-contract (base and branch identical), verify-route-inventory and TestCommittedArtifactMatchesRouter pass.
  • Web: make test-web (774 files, 7106 tests passed), pnpm run lint (0 errors, no warnings in changed files), format:check, tsc -b, build and budget:check pass.
  • Hygiene: make verify-local-paths passes.
  • Not run: the full make test-go and go 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/v2 change is additive: an existing optional field is now filled. /api/v1 is 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

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent checked the diff against the planned scope. It confirmed that posters are signed the same way as saved rows, that production wiring gives the v2 route's handler an image signer, and that /api/v1 is unchanged. It reran the tests on its own database, then removed the poster_url assignment 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

  • Adds a dedicated AdminSectionPreviewResult in admin_sections_service.go that carries preview items, total count, and poster URLs keyed by content ID.
  • The SectionHandler.previewPosterURLs resolver 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.
  • The v2 adapter in admin_sections_extras.go serializes the resolved URL per item; the URL stays absent when no poster exists, and the internal storage path is never exposed.
  • Behavior Change: the legacy v1 preview endpoint is unchanged and still returns only items and total count; admin previews return poster URLs but the frontend PreviewResponse field is still named poster_path in recipes.ts.

Macroscope summarized 41691f3.

Quick104 and others added 3 commits October 4, 2026 03:37
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]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b658324a-4a81-4ad5-bf95-086b33021670

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T12:41:10.824772Z 41691f3 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.

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

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 Not run, so no recorded build result is invalidated; the builder walkthrough will see different artwork while saved configuration and reordering remain unchanged.

Please replace the current Validation tasks: line with:

Validation tasks: changes #1141 C1 (Add/Edit previews now show poster artwork; saved row configuration and reordering are unchanged)

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@Quick104

Quick104 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Updated the Validation tasks: line to changes #1141 C1, since the Add row and Edit row previews now show poster artwork; saved row configuration and reordering are unchanged, and C1 has no recorded result yet.

Base automatically changed from feat/home-rows-more-menu to feat/collections-revamp October 4, 2026 14:15
@Quick104
Quick104 merged commit 1161558 into feat/collections-revamp Oct 4, 2026
14 checks passed
@Quick104
Quick104 deleted the fix/sections-preview-posters branch October 4, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant