Skip to content

fix(capture): keep the capture notice out of the screenshot#14

Merged
DCCA merged 1 commit into
mainfrom
fix/capture-notice-paint-race
Jun 27, 2026
Merged

fix(capture): keep the capture notice out of the screenshot#14
DCCA merged 1 commit into
mainfrom
fix/capture-notice-paint-race

Conversation

@DCCA

@DCCA DCCA commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Symptom

With the on-page capture notice (#13), the notice pill leaked into the saved screenshot.

Root cause

SB_SET_OVERLAY {visible:false} set display:none then called sendResponse inside a single requestAnimationFrame. rAF callbacks run before that frame is painted, so the orchestrator could receive the "hidden" ack and fire captureVisibleTab before the browser had actually painted the overlay away.

Fix

  • Content script: respond to SB_SET_OVERLAY after the next paint (afterPaint = double requestAnimationFrame), so the hide is guaranteed on screen before the orchestrator proceeds.
  • captureFullPage: add a short wait(60) after the hide ack, before captureVisibleTab, to cover compositor commit lag.

Verification

  • npm run typecheck, npm run lint, npm run test (54 pass), npm run format:check, npm run build green.
  • Built dist/content.js contains the double-rAF.
  • Visual confirmation (notice visible while scrolling, absent from the stitched PNG) to be done by @DCCA after reload.

🤖 Generated with Claude Code

The on-page notice leaked into captured frames: SB_SET_OVERLAY responded
inside a single requestAnimationFrame, which runs *before* that frame's
paint, so captureVisibleTab could fire before the overlay was actually
painted hidden.

Wait for the next paint (double-rAF) before responding to SB_SET_OVERLAY,
and add a short settle (60ms) after the hide before capturing to cover
compositor lag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@DCCA
DCCA merged commit 75b3064 into main Jun 27, 2026
2 checks passed
@DCCA
DCCA deleted the fix/capture-notice-paint-race branch June 27, 2026 21:11
DCCA added a commit that referenced this pull request Jun 27, 2026
- CLAUDE.md: content.ts message set (SB_CAPTURE_*), capture.ts retry
  helpers/guards (activateTab, sendToContentScript, isTabsBusyError,
  isNoReceiverError), the on-page notice flow, and wslPath/feedback helpers.
- README: one-click capture, capture notice, and Copy for Claude Code in
  the feature list.
- todo: drop the removed popup from the manual QA list; add one-click +
  notice QA items.
- Add .docs/done/2026-06-27-one-click-capture-reliability/ change record
  (PRs #11-#14).

Co-authored-by: Claude Opus 4.8 (1M context) <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.

1 participant