Skip to content

fix(web): restart the hero progress rail when the hero comes back into view - #5121

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/4925-hero-progress-rail
Nov 23, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/4925-hero-progress-rail

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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

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

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 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
  • Model(s): claude-opus-5-5; gpt-6.2-sol (code review)
  • Involvement: Fully AI-generated, human verified
  • 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

Macroscope summarized 7699a6f.

…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.

Closes Silo-Server#4925
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

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.

Changes: Hero banner timing

Layer / File(s) Summary
Visibility-aware slideshow advancement
web/src/components/HeroBanner.tsx
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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • 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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 22, 2026
@silo-kody

silo-kody Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 22, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

🤖 Claude Code (claude-opus-5-5)

Comment thread web/src/components/HeroBanner.tsx Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor

Review summary

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

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.

🤖 Claude Code (claude-opus-5-5)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick comments: 1

web/src/components/HeroBanner.hold.test.tsx: 1

324-325: Trivial · Maintainability & Code Quality · Quick win

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.

@Quick104
Quick104 merged commit 9ff11a8 into Silo-Server:main Nov 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Web Featured hero progress rail sits full after the hero is scrolled back into view

2 participants