Skip to content

Refresh tile previews on every overlay show#10

Merged
peterp merged 1 commit intomainfrom
live-preview-refresh
Apr 29, 2026
Merged

Refresh tile previews on every overlay show#10
peterp merged 1 commit intomainfrom
live-preview-refresh

Conversation

@peterp
Copy link
Copy Markdown
Owner

@peterp peterp commented Apr 29, 2026

Summary

  • Drop the hasRenderedFrame=true short-circuit so snapshot() always captures a fresh image instead of leaving the cached CGImage on screen.
  • Kick off snapshot + live stream in parallel with the show animation (was deferred 210ms behind it).
  • Stop gating the display path on the 0.5% dirty-rect threshold; the tile now updates on every .complete frame the system delivers. The threshold is kept only for the idle-dot signal.

Test plan

  • Open cmdcmd; the grid shows current window state, not the frame from the previous close.
  • Open cmdcmd over a window that's actively changing (terminal output, video) — the tile keeps updating.
  • Leave a window idle for >2.5s with cmdcmd open — the idle dot fades in.
  • Pick a window, switch to it, type into it, reopen cmdcmd — the tile reflects the new content.

The cached CGImage from the previous close was being painted as
hasRenderedFrame=true, which short-circuited snapshot() on the next
show — so the user saw a stale frame until the live stream's first
significant-change frame arrived (or forever, for idle windows). Drop
the short-circuit so snapshot() always captures a fresh image, kick
off snapshot+stream in parallel with the show animation instead of
waiting 210ms, and stop gating the display path on the dirty-rect
threshold (keep it only for the idle-dot signal) so the tile keeps
tracking the source as frames arrive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@peterp peterp merged commit 5a0d01a into main Apr 29, 2026
1 check passed
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