You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): restart the hero progress rail when the hero comes back into view - #5121
Closes#4925
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A, Android N/A (both show featured content as a media row, not a hero); Roku N/A (the fix is in web-only hero code)
On Home, the Featured hero stops its 8-second slide timer while it is scrolled out of view or the browser tab is hidden, but its progress rail kept filling. When the hero came back into view, the timer started a fresh cycle while the rail was already full, so the rail sat full for about 8 seconds before the slide changed. Now the rail stops with the timer and starts again from empty when the timer restarts.
Approach
HeroBanner already restarts the rail animation by remounting it whenever the slideshow starts running again (a hold ends or Play is pressed). That logic only looked at the Pause choice and the hover and focus holds, not at whether the hero is shown. It now follows the same condition as the timer, so the rail pauses while the hero is out of view or the tab is hidden, and restarts when the timer does. The rail on the Library Recommended tab uses the same component and gets the same fix.
Validation
Web: lint, format check, production build with type check, bundle budget, and the full web test suite pass.
A new case in the hero's existing test file scrolls the hero out of view and back. It fails on main and passes with the fix.
Local build with a synthetic movie library and a featured home row, in headless Chromium: before and after the fix, scrolled the hero out of view for 10 seconds and back, then sampled the rail every second (excerpt below). Pause still freezes the rail, and the slide still advances 8 seconds after the hero returns.
before (main): back in view rail=1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 -> next slide at 8s, rail=0.08
after (fix): back in view rail=0.08 0.20 0.32 0.45 0.57 0.70 0.83 0.95 -> next slide at 8s, rail=0.08
Surface and build: web Home, Featured hero, at 1440 px and 390 px. The rail is hidden below the sm breakpoint, so the phone captures show that width is unaffected.
Risks
None identified. The change is limited to when the rail animation pauses and restarts.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code (via T3 Code); Codex CLI for code review
Tool(s): Claude Code, Codex CLI, Playwright (headless Chromium), Vitest
Adversarial review: two independent reviews of the full diff (gpt-6.2-sol via Codex CLI and claude-opus-5-5), each covering correctness, repository standards and the issue. Neither found a correctness or spec problem. Both asked to add the new test to the existing hero test file instead of a new file, and one found a comment that no longer listed every restart cause; both were fixed. One review suggested not asserting that the rail element is replaced; kept, because that replacement is what restarts the CSS animation and jsdom cannot run the animation itself (the browser check covers it). A follow-up review of those fixes found nothing.
Note
Fix HeroBanner progress rail restart when hero re-enters view
Adds an advancing state to HeroBanner.tsx that combines autoplay, hold, page, and intersection visibility. The progress rail and its interval effect now use advancing as the single guard: when the hero leaves view the rail pauses, and when it returns the rail remounts via a playCycle key and restarts with a fresh 8-second timer.
Adds tests in HeroBanner.hold.test.tsx that stub IntersectionObserver and verify pause, remount, and slide advancement after the restarted interval
…o view
The Featured hero stops its slide timer while it is out of view or the tab
is hidden, but the progress rail kept filling. On return the timer started
a fresh 8 s cycle while the rail sat full. The rail now pauses while the
hero is not shown and restarts with the timer when it is shown again.
ClosesSilo-Server#4925
HeroBanner now pauses slideshow advancement and its progress rail when the hero is not visible. When advancement resumes, the progress rail starts a fresh cycle. Tests cover leaving and returning to the viewport.
advancing now requires autoplay to be active and the hero to be shown. The slide interval runs only while advancing is true.
Progress rail pause and restart web/src/components/HeroBanner.tsx, web/src/components/HeroBanner.hold.test.tsx
The progress rail now follows advancing. Each transition into advancement increments playCycle. Tests verify that the rail pauses off-screen, the slide stays unchanged during a 20-second wait, and progression resumes after the hero returns to view.
Silo-Server/silo-server#5076: This PR changes the hover and focus hold state for the same hero slideshow and progress rail. Both changes affect when the rail pauses and resumes.
Suggested reviewers:quick104
Merge Risk: Minimal · up to 7699a
The web hero progress rail now pauses when the hero is out of view and restarts in step with the slide timer on return. The change is confined to the web UI, tests cover the behavior, and no merge-blocking risk remains.
Security architecture risk: Minimal · up to 7699a
The progress bar now pauses when the slideshow pauses and starts over when the timer restarts. The change is limited to the hero display.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the hero progress rail restarts when the hero comes back into view. The changeset matches this. The HeroBanner now gates the rail on the same visibility condition as t…
Description check
The description states the problem (the Featured hero's progress rail kept filling while the timer was paused off-screen or with the tab hidden), the approach (the rail restart condition now follows t…
Linked Issues check
Directly linked issue #4925 requires the web Featured hero progress rail to match the 8-second slide timer. The rail must stop while the hero is out of view or the tab is hidden, and restart from empt…
Out of Scope Changes check
The whole-PR change set (merge base c90e406 to head 7699a6f) touches two files: web/src/components/HeroBanner.tsx and web/src/components/HeroBanner.hold.test.tsx. Both are tied to issue #4925. The …
Full details: Title check
Explanation
The title names the main change: the hero progress rail restarts when the hero comes back into view. The changeset matches this. The HeroBanner now gates the rail on the same visibility condition as the timer, and the rail restarts when the timer restarts. The title uses the conventional fix(web) prefix and is 75 characters long.
Full details: Description check
Explanation
The description states the problem (the Featured hero's progress rail kept filling while the timer was paused off-screen or with the tab hidden), the approach (the rail restart condition now follows the timer's condition), validation steps, and evidence links. It relates directly to the changes in HeroBanner.tsx and the new test in HeroBanner.hold.test.tsx.
Full details: Linked Issues check
Explanation
Directly linked issue #4925 requires the web Featured hero progress rail to match the 8-second slide timer. The rail must stop while the hero is out of view or the tab is hidden, and restart from empty when the timer restarts.
At head 7699a6f, web/src/components/HeroBanner.tsx defines advancing = autoplaying && shown, where shown = pageVisible && onScreen. The slide interval effect now depends on advancing, so the timer stops when the hero is hidden. The render-time check railRunning !== advancing increments playCycle when advancing becomes true. The rail key uses playCycle, so the CSS animation remounts and restarts from empty when the timer resumes. This matches the issue's technical notes.
The PR description, the new test in HeroBanner.hold.test.tsx (reported to fail on main and pass on this branch), and the headless Chromium evidence (rail from about 0.08 after return, slide advancing at 8 s) support the behavior. Pause still freezes the rail through autoplaying. The rail markup itself was in the truncated portion of the file read, so the data-paused wiring was confirmed only through the PR summary and test evidence, not by direct code read.
The Library Recommended tab uses the same HeroBanner component, so it receives the same behavior. No non-coding requirement applies to this issue.
Full details: Out of Scope Changes check
Explanation
The whole-PR change set (merge base c90e406 to head 7699a6f) touches two files: web/src/components/HeroBanner.tsx and web/src/components/HeroBanner.hold.test.tsx. Both are tied to issue #4925. The HeroBanner.tsx change limits the timer and rail to the shown condition, and comment updates describe that condition. The test file adds a regression case for the off-screen and return behavior, plus a file comment update.
The PR summary notes that the rail change also applies to the Library Recommended tab. That follows from the shared component and is not separate scope. The summary also mentions follow-up #5167 (slide count changes mid-cycle). The PR does not include that fix, and the reviewer reports the behavior exists on main. No unrelated change was found in the summarized diff.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
One nit, in a comment. The fix itself holds up: the new test fails on main and passes here, and no reviewer found a correctness problem. The summary comment has the rest.
Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
Reviewed head: 7699a6f (the author's c5dacbd plus one comment-only commit from this review).
The fix ties the rail to the same condition as the timer, so the rail stops while the hero is off screen or the tab is hidden and starts again from empty when the timer restarts. It reuses the existing playCycle key and the data-paused attribute and adds no new state or effects. It also removes a small mismatch on first load: the rail used to start before the hero was known to be on screen, while the timer waited for that.
Verification
The new test, "freezes the rail out of view and restarts it with the timer on return", fails on main at the reported point (data-paused stays "false" while the hero is out of view) and passes on this branch. All 17 hero tests pass.
I didn't reproduce it live in a browser. The author's before/after browser check and evidence page cover that, and this review's push changes only comments, so the evidence still matches.
Addressed in this review
Comment nit (see the resolved thread). One edited comment line ran past the 100-column width, and the new comment above advancing repeated the out-of-view wording. Rewrapped and trimmed in 7699a6f. No behavior change.
Follow-up
[bug] Web Featured hero progress rail sits full after the slide count changes mid-cycle #5167: when a visible hero's slide count changes partway through a cycle, the timer restarts but the rail doesn't, so the rail sits full for a few seconds. The same lines behave this way on main, so it stays out of this PR. A component test confirmed it. The fix touches the rail-key comment this PR edits, so it waits for this merge.
Checked and not changed
A suggestion to tighten the new test's timing assertions: the test already fails on main for the reported reason, so I left it as is.
autoplaying is now only an input to advancing. Keeping both names separates "the user and holds allow it" from "it is running", so I left them.
Validated features: none affected. No passed v1.0 case covers the hero's timer or rail. The web Recommendations cases cover the rows on Home, not the hero. Validation tasks: none is correct.
User manual: unaffected. The Home sections page explains how to choose the hero banner but doesn't describe its timer or progress rail.
Other clients: agree with the PR's line. The manual notes that the apps show the hero row as a regular row, so Apple and Android have no rail. The fix is web-only.
Council (one round, on c5dacbd): Sol (gpt-6.2-sol, medium) 8/10, Opus (claude-opus-5-5, medium) 9/10, Gemini (gemini-4-neon, medium) 10/10. Nobody found a correctness problem in the change. The comment nit, the slide-count follow-up, and the test-timing suggestion above came from this round.
Check that the slide does not advance before the restarted deadline.
The test hides the hero before any timer time elapses. It then checks only the result after 8.1 seconds. These assertions do not distinguish a fresh countdown from an early advance.
Advance five seconds before hiding. After returning, assert "Slide 1" at 7,999 milliseconds, then assert "Slide 2" after one more millisecond. This checks the timer restart required by the linked issue.
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: 34bba28a-ee0b-4a73-987e-6dd8f178d59d
Commits
Reviewing files that changed from the base of the PR and between c90e406 and 7699a6f.
Files selected for processing: 2
web/src/components/HeroBanner.hold.test.tsx
web/src/components/HeroBanner.tsx
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingimpact: polishAnnoyance, cosmetic, or nice-to-havepriority: P2Limited scope, workaround exists, or polishsize/M50–199 added + deleted lines (all files); change volume, not priority.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #4925
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A, Android N/A (both show featured content as a media row, not a hero); Roku N/A (the fix is in web-only hero code)
On Home, the Featured hero stops its 8-second slide timer while it is scrolled out of view or the browser tab is hidden, but its progress rail kept filling. When the hero came back into view, the timer started a fresh cycle while the rail was already full, so the rail sat full for about 8 seconds before the slide changed. Now the rail stops with the timer and starts again from empty when the timer restarts.
Approach
HeroBanneralready restarts the rail animation by remounting it whenever the slideshow starts running again (a hold ends or Play is pressed). That logic only looked at the Pause choice and the hover and focus holds, not at whether the hero is shown. It now follows the same condition as the timer, so the rail pauses while the hero is out of view or the tab is hidden, and restarts when the timer does. The rail on the Library Recommended tab uses the same component and gets the same fix.Validation
mainand passes with the fix.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5121/
Surface and build: web Home, Featured hero, at 1440 px and 390 px. The rail is hidden below the
smbreakpoint, so the phone captures show that width is unaffected.Risks
None identified. The change is limited to when the rail animation pauses and restarts.
Checklist
AI Disclosure
Note
Fix HeroBanner progress rail restart when hero re-enters view
Adds an
advancingstate to HeroBanner.tsx that combines autoplay, hold, page, and intersection visibility. The progress rail and its interval effect now useadvancingas the single guard: when the hero leaves view the rail pauses, and when it returns the rail remounts via aplayCyclekey and restarts with a fresh 8-second timer.Macroscope summarized 7699a6f.