Skip to content

Let candidates record webcam or screen, not both - #30

Merged
mrevanzak merged 3 commits into
mainfrom
cursor/add-screen-recording-input-bc73
Aug 18, 2026
Merged

Let candidates record webcam or screen, not both#30
mrevanzak merged 3 commits into
mainfrom
cursor/add-screen-recording-input-bc73

Conversation

@mrevanzak

@mrevanzak mrevanzak commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Candidates now choose one capture input before recording: webcam or screen share. They cannot run both at the same time.

Setup panel with camera and screen choices

What changed

  • Setup offers two actions: Enable camera and microphone, or Share your screen
  • Choosing one replaces the other if they switch before Start
  • Screen capture also attaches microphone audio when available
  • If the browser ends screen sharing, capture stops and they can pick an input again
  • The existing single-session upload/finalize/playback pipeline is unchanged

Testing

  • Unit tests: pnpm test (154 passed)
  • Playwright: 18 e2e tests passed, including a screen-only path that never shows a camera preview
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 17, 2026 13:58
Record one input at a time. Setup offers camera or screen sharing,
switching before start replaces the other stream, and playback still
uses the existing single-session pipeline.
@mrevanzak
mrevanzak marked this pull request as ready for review August 18, 2026 05:16
@access-time-code-pr-reviewer

access-time-code-pr-reviewer Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Summary

This PR adds a mutually exclusive webcam-or-screen recording flow, including microphone attachment for screen capture, source-specific previews and messaging, and recovery when screen sharing ends. The existing upload and finalization pipeline remains in use, but the unauthenticated upload path can persist orphaned R2 objects before session ownership is validated.

Key Changes:

  • Adds webcam and screen-share capture selection with switching before recording starts.
  • Attaches microphone audio to screen recordings when available and handles screen-track termination.
  • Updates recording previews, delivery messaging, recovery states, and automated coverage for both capture modes.
  • Retains the existing segment upload and finalization pipeline.

Confidence Score: 5/5

Recommendation: Review findings before merge.

Rationale: The changed client flow and the upload/acknowledgement ordering are directly evidenced by the diff and identified server behavior. The storage-abuse path is a concrete security and cost risk with a clear remediation.

Special Attention

- Validate segment ownership before writing to R2, or delete the uploaded object whenever acknowledgement fails. - Exercise unauthenticated uploads with arbitrary session and segment IDs to confirm orphaned objects cannot accumulate. - Verify microphone and screen-track cleanup across permission failures, switching, and ended screen shares.

Important Files Changed

File Overview
apps/web/src/recording/capture-inputs.ts Acquires camera or screen streams, attaches microphone audio to screen capture, and listens for ended tracks.
apps/web/src/recording/candidate-recording-journey.tsx Renders the mutually exclusive capture-selection, preview, recording, recovery, and delivery states.
apps/web/src/recording/live-recording.ts Coordinates capture source state, local recording persistence, upload draining, and finalization.
apps/web/src/server/recording-upload.ts Uploads recording segments to R2 and acknowledges them; its write-before-validation ordering creates the orphaned-object risk.
apps/web/tests/e2e/candidate-recording.spec.ts Covers candidate recording flows, including screen-only capture and recovery behavior.

Sequence Diagram

sequenceDiagram
  participant C as Unauthenticated Client
  participant U as Recording Upload Endpoint
  participant R as R2
  participant D as Session Database
  C->>U: Upload arbitrary sessionId/segmentId
  U->>R: Write segment object
  U->>D: Acknowledge segment ownership
  alt Segment belongs to session
    D-->>U: Success
    U-->>C: Acknowledged
  else Unknown or unauthorized segment
    D-->>U: 404 / failure
    U-->>C: Error
    Note over R: Object remains orphaned
  end
Loading
Audit history

@access-time-code-pr-reviewer access-time-code-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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


🤖 review-bot · openai/gpt-5.6-luna · standard · 143.4s · 923,118 tokens · diff: 10 files · preloaded context: 10 changed + 8 related · policy: github-pr-review, thermo-nuclear-code-quality-review · optional skills invoked: react-useeffect, vercel-composition-patterns, vercel-react-best-practices

Comment thread apps/web/src/recording/capture-inputs.ts
Comment thread apps/web/src/recording/capture-inputs.ts Outdated
Display audio plus a mic track can confuse MediaRecorder, and an ended
mic/system track was treated as the user stopping screen share.
@mrevanzak
mrevanzak merged commit a5097f2 into main Aug 18, 2026
3 checks passed
@mrevanzak
mrevanzak deleted the cursor/add-screen-recording-input-bc73 branch August 18, 2026 05:51
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