Repository navigation
perf(web): render home rows without mounting every card up front - #2288
Conversation
Each home row now mounts the cards that fit the viewport and fills in the rest while the browser is idle, when they scroll into view, or when focus enters the row; placeholders keep the carousel's geometry. A card's menu mounts on first hover, focus, long-press, or context menu. Rows and cards are memoized, eager rows render in the commit their data arrives, and the first row's visible posters load eagerly at high priority. 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:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🔵 Low · up to This change makes Home rows faster by rendering only the cards near the viewport at first and loading card menus on demand. No concrete defect has been confirmed. However, cards that have not yet filled in are briefly missing from Find and from screen readers, and touch long-press has not been tested on a real device. These are acceptable to merge as long as the owner is aware of them. Pre-merge checks |
|
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. |
|
The timing table measures both PRs together, but does not show progressive card filling or the lazy menu's first-open and focus behavior. Please add before/after Home captures with the same data at desktop and phone widths (or show mobile is unaffected), plus a short recording of row filling and menu opening/focus return. Name the builds, including whether #2289 is applied. |
Screen readers and element.click() send only a click event, which the replacement menu trigger ignored. A click not preceded by a pointer press now toggles the menu, without toggling twice for mouse, Enter, or Space. 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:
|
Problem
Related issue: N/A
Validation tasks: changes #1142 C1, C3 (rows render the same items; not yet run)
The web Home page mounts every card in every row as soon as the row's data arrives, and each card mounts its full menu machinery: six mutation hooks, a Radix menu, profile queries, and two to four links with router hooks. With rows of 40–100 items this is thousands of DOM nodes and hundreds of milliseconds of main-thread work before the first row appears. Rows also re-render whenever another row's data arrives. This change makes a row cost roughly what is on screen.
Approach
SectionRowmount the cards that fit the viewport plus two. The others render as empty slides with the card's exact width, so the carousel's snaps and scroll width don't change. They fill in eight at a time while the browser is idle (a timer on Safari), immediately when they scroll within half a row of view, and all at once when focus enters the row. After about a second every card exists, so browser Find and screen readers still reach the whole row.DeferredHomeSection,SectionRow, and both card types are memoized; the scroll arrows appearing no longer re-renders every slide; spoiler preferences are read once per row.Validation
tsc -b,pnpm run lint(0 errors),pnpm run format:check,pnpm run build,pnpm run budget:check: pass.make test-web: 849 files, 7,425 tests pass. New tests cover windowing (placeholders, idle fill, scroll and focus fill, no re-render of unchanged slides), the lazy menu (opens on the first click, keyboard open focuses the first item, quick action before mount), and Home's eager rows.Evidence
Measured together with the companion loading PR (#2289) in headless Chromium, fresh tab, medians of 5 runs; this PR's share was not measured on its own:
The page looks the same once loaded; cards beyond the viewport fill in within about a second. Surface and build: web app, desktop, this branch with the loading PR.
Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code