Skip to content

perf(chrome-extension): hide overlays once per phase transition instead of every upload tick - #4881

Open
AksharP5 wants to merge 1 commit into
CapSoftware:mainfrom
AksharP5:extension-upload-ipc
Open

AksharP5 wants to merge 1 commit into
CapSoftware:mainfrom
AksharP5:extension-upload-ipc

Conversation

@AksharP5

@AksharP5 AksharP5 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4879

Every upload progress broadcast from the Chrome extension offscreen document re-wrote webcamPreviewDismissed to session storage, checked offscreen contexts to disconnect camera previews, queried all open tabs, and broadcast overlay-hide to every tab. User-initiated stops also ran a second overlapping hide alongside the uploading broadcast.

Share one coalesced ensureNonCaptureOverlaysHidden() path across both stop-recording and status broadcasts so non-capture cleanup runs once per transition out of a capture phase. Keep separate retry tracking for tab dismissal, camera preview disconnect, and any webcam preview that reopens while an earlier hide is in flight.

Before / After

Measured with 20 open browser tabs and 10 "uploading" progress broadcasts after "recording":

Metric Before After
overlay-hide tab IPC messages sent 200 20 (90% reduction)
chrome.storage.session.set dismissal writes 10 1
Offscreen context lookups (getContexts) 10 1
User-initiated Stop + overlapping uploading broadcast (2 tabs) 4 tab hides, 2 dismissal writes 2 tab hides, 1 dismissal write

Verification

  • bun run tsc-rs -b apps/chrome-extension/tsconfig.json
  • bun run --cwd apps/chrome-extension vitest run src/background/service-worker.test.ts (26/26 passed, covering phase transitions, in-flight coalescing, storage failure retry, worker restart, stop+broadcast overlap, failed camera disconnect retry, and preview reopened mid-hide)
  • bun run biome check on touched files and node scripts/test-lint/run.mjs

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge.

Summary

Shares overlay cleanup between stop requests and recording-status broadcasts.

  • Upload progress ticks share one overlay cleanup.

No actionable issues found. Tests were inspected but not run.

Reviews (1) · Last reviewed commit: "perf(chrome-extension): hide overlays on..." · Reviewed by Greptile

@vercel

vercel Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Dec 4, 2026 5:15pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 4, 2026 17:15 Inactive

This branch was previously deployed

1 inactive deployment
Preview – cap-status — e7b953e7 Deployed Dec 4, 2026 by vercel[bot]
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.

Chrome extension broadcasts overlay-hide to every open tab and writes session storage on every upload progress tick

1 participant