Skip to content

feat(web): show poster peeks on Home rows - #1893

Merged
Quick104 merged 4 commits into
feat/collections-revampfrom
feat/home-rows-poster-peeks
Oct 4, 2026
Merged

Quick104 merged 4 commits into
feat/collections-revampfrom
feat/home-rows-poster-peeks

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1137
Validation tasks: reaches #1141 C1 (the Home rows list now shows posters on each row that is on; building, reordering and saved configuration are unchanged); changes none

Stacked on #1891, so this targets fix/sections-preview-posters (#1891 sits on #1889, #1885, #1884, #1883 and #1882). It retargets to feat/collections-revamp once those merge.

In Admin > Home rows, every row starts with an icon for its kind, so an admin can't see what a row currently shows without opening Home or the row's Edit dialog. The approved design starts each row with a poster peek: a small fan of the row's first posters. This PR adds them. Each row that is on shows the posters of its first three titles, or two on phones. Rows that are off keep their collapsed look. This is the poster peek step of the Home rows redesign. It depends on #1891, which makes the admin preview return poster URLs.

Approach

A peek calls POST /api/v2/admin/sections/preview with item_limit 3 and the row's stored type, config and library page. It doesn't use the viewer item endpoints, because those resolve the admin's own profile layout, which can carry that profile's overrides. The page edits the server row, so the peek shows the server row.

Peeks load only when needed and share a request budget:

  • A peek starts loading when its row comes within 200 px of the screen. Rows that are off, and rows never scrolled to, send nothing.
  • At most 4 peeks load at once in a browser tab; the rest wait in order. A waiting peek whose row unmounts leaves the queue without running.
  • Each peek has its own query key (page, row ID, type and config), outside sectionKeys. The list refetch after every row write doesn't reload the peeks, and editing a row's config gives it a new key and a fresh peek.
  • A peek stays fresh for 5 minutes and is kept for 30. A row that comes back after 5 minutes shows its cached posters and reloads them once it is on screen. Window focus doesn't refetch.

The row keeps its icon while the peek loads, and when the request fails, the row has no titles, or the server doesn't report the preview capability. In that last case no request is sent. A title without a poster, or whose poster fails to load, shows its blurred thumbhash. The Add row and Edit row preview strip now uses the same poster component and fetch, so it gets the same fallback, and its request is cancelled when the query is dropped. Poster rings take the row's hover and selected colour, as in the mockup.

The admin adapter decides whether rows get peeks, from capabilities.preview; the components read no account role. Settings > Home Screen isn't built from these components yet and is unchanged.

Differences from the approved design and plan, for sign-off:

  • Peek posters carry no title text. The plan's tests asked for thumbhash tiles with titles, which was the fallback if the preview had no poster URLs; with fix(sections): include poster URLs in admin row previews #1891 it has them. The mockup draws peeks without titles, the posters are 27 to 32 px wide, and the peek is hidden from screen readers because the row name sits next to it. The preview strip keeps its titles.
  • The plan named an adapter hook usePeek(row). The adapter instead returns the peek's query key and fetch from peek(row), and one shared hook handles lazy start, the request limit and caching. The profile adapter can implement the same member when Settings > Home Screen moves to these components.
  • Peeks start 200 px before the row is on screen, and window focus doesn't refetch them.
  • The two-poster phone layout switches at 640 px, the breakpoint the row's peek column already uses, not 1024 px. Every peek still asks for 3 titles.

Not in this PR: the plan has Edit row show the row's peek posters while its 7-title preview loads. Neither #1883 nor this PR builds that; it stays a follow-up.

Validation

  • Web: make test-web (776 files, 7124 tests passed), pnpm run lint (0 errors, no warnings in changed files), format:check, build, tsc -b and budget:check pass.
  • Tests: unit tests cover the peek query key and the request limiter. Page tests run the real Admin > Home rows page with a mocked v2 client and a stand-in IntersectionObserver. They check one 3-title preview per row that is on and on screen, none for rows that are off or off screen, the library ID on library pages, no more than 4 in flight, no reload after the list refetches, a reload after a config edit, fresh and stale peeks on return, no request without the preview capability, the icon after an error or an empty result, the thumbhash after a failed poster, and the Add row strip's posters. Raising the request limit, moving the key under sectionKeys, dropping config from the key, or setting the fresh time to 0 each makes a test fail.
  • jsdom has no media queries, so no test covers phones showing two posters.
  • Hygiene: make verify-local-paths passes.
  • Not run: the Go gate and contract verify targets, because this diff changes no Go, contract or generated input. No browser check: the peek sizes follow the mockup's CSS, but the page hasn't been compared with the mockups on a running build. Curated home sections — Web admin #1141 C1 has not been walked on a running build.

Risks

Opening the page sends one 3-title preview per row that is on and on screen, 4 at a time. Reopening it within 5 minutes sends none. Rows that don't depend on the viewer use the server's shared section cache; personalized rows such as Continue watching, Recommended for you, Because you watched and personal collections run their query on each request. The 4-request limit applies per browser tab, not per admin.

No API, stored data, section_type, recipe ID, preset key, layout export/import or gating change, and hero behavior is unchanged. silo-apple, silo-android and jellycompat need no change.

The user manual doesn't mention row posters. A siloserver.org issue covering them, along with the rest of the Home rows changes, is drafted and not filed yet.

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 and the mockup CSS, and confirmed that rows get peeks only through the adapter's preview capability, with no API or stored-data change. It found one real bug: a row that remounted with its peek already cached never refetched, because the screen observer was attached only to the icon. A stale peek could show old titles for the whole session, and the 5-minute fresh time was untested. The observer now sits on an element that renders in both states. New tests cover fresh and stale returns, and setting the fresh time to 0 now fails them. Two layout nits were fixed: the icon is now as tall as the posters on phones, and poster rings follow the row's hover and selected colour. The reviewer also asked that the Edit row poster placeholder stay listed as a follow-up rather than as done here.

🤖 Generated with Claude Code

Note

Add poster peeks to admin Home rows

  • Admin Home rows can now show up to three poster artworks when previewing is available; rows without a peek request or returned items keep the section icon fallback.
  • A row's peek query starts only after its art container nears the viewport, and all peeks share one limiter with a four-task in-flight budget. Results are cached for five minutes with no retries.
  • New PosterArt composes a thumbhash background with a lazy-loaded poster image and falls back to the background when the image fails to load.
  • Shared peek logic (request building, cache keys, limiter, fetch helper) lives in peek.ts; adapters expose peeks through an optional HomeRowsAdapter callback, wired in useAdminHomeRows.ts.
  • previewSection now accepts an AbortSignal, and the admin section preview POST is classified as read-only so it gets the default read timeout.

Macroscope summarized 8cffaee.

Quick104 and others added 2 commits October 4, 2026 04:02
Each shown row in the Home rows list now shows its first three titles'
posters (two on phones), from the admin preview of the row's own
definition. Peeks load only once their row nears the screen, stay fresh
for five minutes under their own cache key so list refreshes after a
write don't refetch them, and share a budget of four requests in flight.
Off rows, errors, empty rows and servers without previews keep the
group icon tile.

The Add row and Edit row strip shares the same preview fetch, and both
fall back to the blurred thumbhash when a poster fails to load.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The on-screen observer was attached only to the icon tile, so a row that
remounted with its peek already cached never reported reaching the
screen and never refetched, which made the five-minute freshness window
dead code. The observer now wraps both the icon tile and the posters, so
a stale peek reloads once its row is back on screen. New tests cover a
fresh peek (no reload) and a stale one after turning a row off and on or
leaving the page.

Also match the mockup: the icon tile is 42px tall on phones like the
poster stack, and the poster ring takes the row's hover and selected
colour.

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: 78f8d5f0-d3d6-45b3-8126-5cd76ecb387a

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:43:19.227701Z 8cffaee 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f313966320

ℹ️ 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".

Comment on lines +402 to +403
fetch: async (signal) =>
(await fetchRowPreview(row, page, PEEK_ITEM_LIMIT, signal)).items,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Give preview reads a deadline

When the preview endpoint accepts a connection but stops responding, this fetch has no deadline: web/src/api/v2/request.ts only applies the read timeout to GET/HEAD and POST /api/v2/catalog/query, while all other POST requests wait indefinitely. Because usePeek sends these calls through a shared four-slot limiter, four stalled visible-row previews permanently occupy every slot and prevent later rows from loading until the page unmounts. Classify the preview operation as a read-only POST or pass an explicit timeout so failed requests release their slots.

AGENTS.md reference: AGENTS.md:L73-L75

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed and fixed in 8cffaee. POST /api/v2/admin/sections/preview is now in readOnlyPostOperations, so it gets the same read deadline as a GET; a stalled preview fails with V2TimeoutError and releases its peek slot. Added a test in request.deadline.test.ts that hangs the preview and expects the timeout; it fails without the change.

Quick104 and others added 2 commits October 4, 2026 08:39
The admin row preview is a read sent as POST, so it had no deadline.
Poster peeks share four request slots; four previews stuck on a server
that went quiet held every slot until the page unmounted, and no other
row's peek could load.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

Minor change — #1141 C1 (Web admin). Enabled-row artwork in the Home rows list changes from a kind icon to poster peeks; the add, reorder, and saved-configuration flows remain unchanged. C1 is currently Not run, so no recorded pass/build can be invalidated; include the changed list presentation when the case is first run. The linked Server, Web, iOS/tvOS, Android, and Android TV task paths are unaffected, and no failed or blocked case is available to unblock.

The Validation tasks: line is ambiguous (reaches ...; changes none). Please use:
Validation tasks: changes #1141 C1

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

Posted via Macroscope — v1 validation impact

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

Minor change — silo-server#1141 C1 (Web admin). The Home rows list can now replace kind icons with lazy poster peeks for rows that are on, changing the layout seen while building and reordering. The build, reorder, and saved-configuration steps remain unchanged; C1 is currently Not run, so no recorded result is invalidated, but account for the changed layout when running it.

Suggested line: Validation tasks: changes #1141 C1

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

Posted via Macroscope — v1 validation impact

Base automatically changed from fix/sections-preview-posters to feat/collections-revamp October 4, 2026 14:31
@Quick104
Quick104 merged commit 686b447 into feat/collections-revamp Oct 4, 2026
16 checks passed
@Quick104
Quick104 deleted the feat/home-rows-poster-peeks 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