Skip to content

feat(chrome-extension): streamline recording bar into compact draggable badge on recording start - #2210

Merged
richiemcilroy merged 8 commits into
CapSoftware:mainfrom
ManthanNimodiya:feat/extension-streamlined-bar-and-badge
Sep 3, 2026
Merged

feat(chrome-extension): streamline recording bar into compact draggable badge on recording start#2210
richiemcilroy merged 8 commits into
CapSoftware:mainfrom
ManthanNimodiya:feat/extension-streamlined-bar-and-badge

Conversation

@ManthanNimodiya

@ManthanNimodiya ManthanNimodiya commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR streamlines the Chrome Extension recording overlay by removing the redundant floating iframe panel from page injection and contracting the
bottom bar into a compact, draggable circular Cap badge with an in-badge countdown when recording starts.


Key Changes

  1. Removed Redundant Floating Iframe Window:
  • Removed RecorderPanelOverlay injection into web pages so only the sleek bottom "Ready to record" bar appears when opening the recorder.
  • Synchronized panel visibility directly via loadSharedUiState.
  1. In-Badge Animated Countdown:
  • When "Start recording" is clicked, the 3... 2... 1 countdown numbers render directly inside the circular logo badge with a glowing pulsating
    ring animation (overlay-countdown).
  1. Compact Draggable Badge:
  • Enlarged the collapsed badge to a prominent 48px circular badge with a 32px Cap logo and a glowing, pulsing red recording dot.
  • Fixed pointer capture bug where moving the mouse unintentionally dragged the bar around the screen (isPointerDownRef guard).

Testing Done

  • Verified Biome formatting: pnpm exec biome check --write <files>
  • Ran Chrome extension test suite: pnpm --filter=@cap/chrome-extension test (18/18 tests passing)
  • Built development bundle: vite build for all extension targets
  • Manual testing:
  • Verified clean injection of the bottom "Ready to record" bar.
  • Verified 3... 2... 1 countdown rendered inside the circular badge.
  • Verified smooth drag-and-drop movement and stationary behavior when not dragging.

Greptile Summary

The PR replaces the expanded Chrome recording rail with a compact draggable badge and moves the countdown into that badge.

  • Broadcasts countdown state across injectable tabs and reliably clears countdown timers when overlays hide.
  • Adds expandable recording controls for pause, blur, drawing, camera, and microphone.
  • Removes the redundant embedded recorder panel and updates camera-preview handling.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains from the previously reported countdown interval or build issues.

Important Files Changed

Filename Overview
apps/chrome-extension/src/content/recording-bar.tsx Implements the compact draggable badge and clears the countdown interval on hide, resolving the previous stale-timer finding.
apps/chrome-extension/src/content/overlay.tsx Removes recorder-panel iframe integration and correctly narrows the optional camera answer before WebRTC setup.
apps/chrome-extension/src/background/service-worker.ts Broadcasts badge countdown messages to injectable tabs and relays microphone mute changes.
apps/chrome-extension/src/offscreen/recorder.ts Adds live microphone muting and strengthens camera stream acquisition and reuse.
apps/chrome-extension/src/content/blur-overlay.tsx Adds page-element highlighting and blur toggling for the recording controls.

Reviews (7): Last reviewed commit: "feat(chrome-extension): harden camera st..." | Re-trigger Greptile

Comment on lines +248 to +256
const interval = window.setInterval(() => {
cur -= 1;
if (cur <= 0) {
window.clearInterval(interval);
setCountdownValue(null);
return;
}
setCountdownValue(cur);
}, perNum);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Hidden countdown interval survives

When overlay-hide arrives before the countdown finishes, it clears only countdownValue while this interval continues running; the next tick restores the badge, and a subsequent countdown can race with the stale timer and display incorrect values.

Knowledge Base Used: Mobile and browser capture clients

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/chrome-extension/src/content/recording-bar.tsx
Line: 248-256

Comment:
**Hidden countdown interval survives**

When `overlay-hide` arrives before the countdown finishes, it clears only `countdownValue` while this interval continues running; the next tick restores the badge, and a subsequent countdown can race with the stale timer and display incorrect values.

**Knowledge Base Used:** [Mobile and browser capture clients](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/mobile-and-browser-capture-clients.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@greptileai

@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@greptileai

@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@greptileai

…lt device and fix background service worker preview check
@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@greptileai

@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@greptileai

@richiemcilroy

Copy link
Copy Markdown
Member

hey @greptileai please re-review the pr

@richiemcilroy
richiemcilroy merged commit d9493a8 into CapSoftware:main Sep 3, 2026
16 of 17 checks 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.

2 participants