Skip to content

feat(capture): on-page notice while screenshotting#13

Merged
DCCA merged 1 commit into
mainfrom
feat/on-page-capture-notice
Jun 27, 2026
Merged

feat(capture): on-page notice while screenshotting#13
DCCA merged 1 commit into
mainfrom
feat/on-page-capture-notice

Conversation

@DCCA

@DCCA DCCA commented Jun 27, 2026

Copy link
Copy Markdown
Owner

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, captureVisibleTab grabs 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:

Capturing full page… Please don't switch tabs or scroll until it finishes

Lifecycle (driven by captureFullPage):

  • SB_CAPTURE_BEGIN → show the notice; a 450ms pause lets the user read it.
  • Per segment: SB_SCROLL_TO re-shows it, then SB_SET_OVERLAY {visible:false} hides it (display:none, painted via rAF) before captureVisibleTab so 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 (notify swallows 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 the chrome.* boundary), npm run format:check, npm run build green.
  • Confirmed the notice strings + SB_CAPTURE_BEGIN are in the built dist/content.js.
  • Visual confirmation (notice appears during capture, absent from the saved screenshot) to be done by @DCCA after reload — no runner exists for the live extension; this is the repo's standard manual-QA path for capture UI.

🤖 Generated with Claude Code

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>
@DCCA
DCCA merged commit 2db41b4 into main Jun 27, 2026
2 checks passed
@DCCA
DCCA deleted the feat/on-page-capture-notice branch June 27, 2026 21:07
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