feat(capture): on-page notice while screenshotting#13
Merged
Conversation
During capture the editor activates and scrolls the target tab, so the user is looking at the page — not the editor's "Capturing N/M" text. If they switch tabs or scroll, captureVisibleTab grabs the wrong frame. Inject a fixed, top-of-viewport notice on the page via the content script: "Capturing full page… Please don't switch tabs or scroll until it finishes." The orchestrator shows it (SB_CAPTURE_BEGIN), hides it for each captureVisibleTab frame (SB_SET_OVERLAY) so it never lands in the screenshot, re-shows it on each SB_SCROLL_TO, and removes it on SB_RESTORE_SCROLL / SB_CAPTURE_END. Overlay messages are best-effort and never abort a capture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
During full-page capture the editor activates and scrolls the target tab, so the user is looking at the page — not the editor's "Capturing N/M" progress text. If they switch tabs or scroll mid-capture,
captureVisibleTabgrabs the wrong frame and the stitched screenshot breaks. There was no on-page signal telling them to hold still.What
The content script injects a fixed, top-of-viewport notice on the page being captured:
Lifecycle (driven by
captureFullPage):SB_CAPTURE_BEGIN→ show the notice; a 450ms pause lets the user read it.SB_SCROLL_TOre-shows it, thenSB_SET_OVERLAY {visible:false}hides it (display:none, painted via rAF) beforecaptureVisibleTabso it's never baked into a frame.SB_RESTORE_SCROLL/SB_CAPTURE_END→ remove it.The notice is
position:fixed, max z-index,pointer-events:none, self-contained inline styles (no dependence on page CSS). All overlay messages are best-effort (notifyswallows errors) so a missing/old content script can never abort a capture.Verification
npm run typecheck,npm run lint,npm run test(54 pass, unchanged — additive DOM/messaging at thechrome.*boundary),npm run format:check,npm run buildgreen.SB_CAPTURE_BEGINare in the builtdist/content.js.🤖 Generated with Claude Code