Skip to content

Slide background changes on every monitor without a black flash - #17179

Merged
dhh merged 2 commits into
quattrofrom
worktree-bg-reveal-all-monitors
Oct 31, 2026
Merged

dhh merged 2 commits into
quattrofrom
worktree-bg-reveal-all-monitors

Conversation

@dhh

@dhh dhh commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Changing the background or switching themes only slid on one monitor, and the larger monitor flashed black when the slide ended.

  • Only one monitor slid: a monitor joined the reveal only if its incoming frame had decoded before the reveal started. The first monitor to decode started it, and the rest jumped at the end. The reveal now waits until every monitor has its incoming frame. A monitor that hasn't decoded within 250ms doesn't hold the others back; it joins the running slide once its frame is ready.
  • Black flash: the transition was torn down on every monitor as soon as the first monitor's base image was ready. A larger screen still decoding the same wallpaper (a 6K next to a laptop) went black until it caught up. Teardown now waits for the service's ready, which requires every monitor's base to have drawn the new wallpaper. The incoming layer's mask also stays on until then, instead of switching off as the slide ends.

Theme switches without an intro clip use the same reveal (background themeTransition), so they get both fixes. Switches with an intro clip use BackgroundIntro's cover, which every monitor already reveals together.

Tested on a 6K + laptop setup: both monitors slide together with no flash, for background changes and theme switches alike. The background-*, theme-background-memory, video-background and motion shell tests pass, and a Codex review found no issues.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking gap in timing coverage.

Findings

  1. P2 Wallpaper timing lacks regression coverage ▶

Summary

The PR coordinates wallpaper slides across monitors and keeps the incoming image visible until every monitor has drawn its replacement.

  • Wallpaper changes reveal together across every screen.
  • Each screen keeps its wallpaper until its new image is ready.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Incoming image becomes ready] --> B{Every monitor ready?}
  B -->|Yes| D[Start shared slide]
  B -->|No| C[Wait up to 250ms]
  C --> D
  D --> E[Late monitors join when ready]
  E --> F[Slide ends]
  F --> G[Keep incoming image over base]
  G --> H{Every base has drawn?}
  H -->|Yes| I[Remove transition images]
  H -->|No| G
Loading

Reviews (2) · Last reviewed commit: "Cover the multi-monitor background revea..." · Reviewed by Greptile

Comment on lines +186 to +192
for (var other of backgrounds.instances) {
if (!other.incomingReady()) {
revealGraceTimer.start()
return
}
}
beginReveal()

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.

P2 Wallpaper timing lacks regression coverage

The new multi-monitor timing and cleanup logic has no regression test. AGENTS.md requires: “A bug fix with logic in it gets the one test that fails on the base branch and passes with the fix.” Before merging, add focused coverage showing that staggered incoming frames share the reveal, the grace timer releases a slow screen, and cleanup waits for every base image.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Added in ab79506: a second fixture run in background-pending-theme-test.sh drives the real plugin on the live screens with 4000x2500 wallpapers, which decode at each screen's own size, so screens finish at different times. It checks:

  • once the slide ends, every screen has joined it, including one whose frame decoded after the slide started
  • when the transition comes down, every screen has already drawn its new base (backgroundReady)

On the base branch it fails with "screen 0 sat out the reveal" on a 6K + laptop desk. With the reveal-start check removed, it fails with "the transition ended before every screen drew its new background". The cleanup check fails on one screen too, because the old code cleared the transition before the base had drawn a frame. The 250ms grace for a screen that never decodes has no check: it would need a screen that never finishes decoding, which the fixture cannot make without a stub.

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.

Thanks—this addresses the regression-coverage concern. The fixture exercises the real plugin on live screens, covers staggered frame readiness and waits for every screen’s new base to be drawn before cleanup; the reported base-branch failures also demonstrate that the checks catch the original behavior.

The 250 ms never-decodes timeout remains untested, as you note, but that’s a separate edge case requiring a controllable decode stub. I’m withdrawing the request to block merging on additional coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants