Skip to content

fix(sources): a scene that shows a source you turned off waits with plain copy - #824

Merged
TheOrcDev merged 1 commit into
mainfrom
fix/scene-needs-source-turned-off
Oct 25, 2026
Merged

TheOrcDev merged 1 commit into
mainfrom
fix/scene-needs-source-turned-off

Conversation

@TheOrcDev

@TheOrcDev TheOrcDev commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Symptom

Found in the Linux retest on ogre (retest 150). Fresh profile: the active scene is Screen + camera. Sources → Screen → None (the #742 sticky None). The gallery greys the screen scenes ("No screen is chosen…"), but Screen + camera stays the active scene. Then:

  • Record fails with the engine's words: "Couldn't start recording: Cannot start: the screen preview source(s) produced no frames, so the recording would not match the preview. Re-select the source (or restart the app) and try again." (evidence/screen-none/record-attempt.png). Restarting doesn't help, and "re-select the source" isn't what the user needs.
  • Clips spends its three start attempts on the same refusal, then gives up.
  • The camera twin is the same: Camera only + Camera Off → "the camera preview source(s) produced no frames…".

The scene the renderer sends still has a visible screen layer with no source (scene.get: [('screen', True, None), ('camera', True, …)]). The backend's start preflight correctly refuses to record something that doesn't match the preview.

Fix (renderer)

  • sceneSourcesTurnedOff(visual, devices) (lib/scene-presets.ts): which sources the active scene shows that were turned off on purpose (captureOff / cameraOff). A never-chosen or chosen-but-missing source is unchanged (it can come back, and the existing paths handle it).
  • sceneSourceOffBlockedReason (lib/start-blocked-copy.ts): the start-blocked copy:
    • "This scene shows a screen, but Screen is set to None. Choose a screen in Sources, or pick a scene without one."
    • "This scene shows a camera, but Camera is off. Turn it on in Sources, or pick a scene without one."
    • both: "This scene shows a screen and a camera, but both are off. Choose them in Sources."
  • startBlockedReasonFor checks it right after the connection and session checks, so Record, Go Live, remote intents and Clips (Starts once a source is ready. …) all wait instead of starting a doomed session.

Budget: +281 eager gzip bytes; main has 152 bytes of headroom (394,848 / 395,000). Recalibrated to 400,000 with an edit byte-identical to the one now on #817, so the two merge in either order (checked with git merge-tree).

Tests

Real-app verification (ogre, Linux, production renderer + release backend)

Case Before After
Fresh profile, Screen + camera, Screen → None, Record "Couldn't start recording: … screen preview source(s) produced no frames … (or restart the app)"; Clips 3 failed starts Record waits: "This scene shows a screen, but Screen is set to None…"; 0 backend start attempts; Clips: "Starts once a source is ready. This scene shows a screen…"
Camera only, Camera Off, Record "… camera preview source(s) produced no frames …" "This scene shows a camera, but Camera is off…"; 0 backend start attempts
Then click Camera only (camera on) — Clips starts by itself (replay.status on, buffer-only)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Starting a scene that requires a screen or camera source explicitly turned off now shows a message explaining what needs attention. When both required sources are off, the message addresses both.
    • Sources that were never selected or are unavailable are not treated as intentionally turned off, avoiding misleading start-blocking messages.

…lain copy

With Screen set to None while Screen + camera stayed the active scene (or
Camera Off on Camera only), Record, Go Live and Clips started a session
that the backend refused with 'the screen preview source(s) produced no
frames ... Re-select the source (or restart the app)', and Clips burned its
three start attempts. The start now waits up front and says which source
the scene shows and how to fix it. A chosen-but-missing source is unchanged.

Recalibrates the eager gzip budget to 400,000 with the same edit as #817.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3da470d4-303c-4322-a9b7-24db9a5e5c9f
Commits

Reviewing files that changed from the base of the PR and between f16a0b8 and 74b8697.

Files selected for processing: 5
  • apps/desktop/src/renderer/src/hooks/use-studio.tsx
  • apps/desktop/src/renderer/src/lib/scene-presets.test.ts
  • apps/desktop/src/renderer/src/lib/scene-presets.ts
  • apps/desktop/src/renderer/src/lib/start-blocked-copy.ts
  • scripts/check-renderer-asset-budget.mjs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The start-reason flow now blocks starts when a required screen or camera source is explicitly turned off. The renderer asset budget’s default total gzip ceiling increases from 395,000 to 400,000 bytes.

Changes: Studio source-off blocking

Layer / File(s) Summary
Detect explicit source-off state
apps/desktop/src/renderer/src/lib/scene-presets.ts, apps/desktop/src/renderer/src/lib/start-blocked-copy.ts, apps/desktop/src/renderer/src/lib/scene-presets.test.ts
New helpers identify explicitly turned-off screen and camera sources and return source-specific blocking messages. Tests cover single-source and combined blocking, and cases where a source does not count as explicitly turned off.
Apply source-off blocking to starts
apps/desktop/src/renderer/src/hooks/use-studio.tsx
The start-reason callback checks the requested scene sources against the current device list. It returns a source-off reason before checking profile entitlements.

Renderer asset budget

Layer / File(s) Summary
Update renderer gzip ceiling
scripts/check-renderer-asset-budget.mjs
The default total gzip limit increases from 395,000 to 400,000 bytes. A calibration comment records the measurements and associated Studio fixes.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant StartIntent
  participant startBlockedReasonFor
  participant sceneSourcesTurnedOff
  participant sceneSourceOffBlockedReason
  StartIntent->>startBlockedReasonFor: layout, visual sources, and current devices
  startBlockedReasonFor->>sceneSourcesTurnedOff: inspect required screen and camera sources
  sceneSourcesTurnedOff-->>startBlockedReasonFor: screen and camera off flags
  startBlockedReasonFor->>sceneSourceOffBlockedReason: build reason from off flags
  sceneSourceOffBlockedReason-->>startBlockedReasonFor: source-specific reason or null
  startBlockedReasonFor-->>StartIntent: return blocker before entitlement checks
Loading

Possibly related PRs

  • TheOrcDev/videorc#817: Both changes affect source selection in use-studio.tsx and use the same renderer asset-budget recalibration.
  • TheOrcDev/videorc#803: It covers persistence of explicit Screen None selections, which this change reads when determining whether to block starts.
  • TheOrcDev/videorc#823: It changes Clips rearming based on source or blocker changes, and this change adds a source-off blocker to the shared start-blocked state.
Merge Risk: Minimal · up to 74b86

The source-off change is ready to merge with normal checks; no actionable blocking issue was established.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a scene that shows a source the user turned off now waits with plain copy. The raw summary confirms the change adds a source-off check to start blocking and a tailored…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a scene that shows a source the user turned off now waits with plain copy. The raw summary confirms the change adds a source-off check to start blocking and a tailored reason message. The title is specific and conventional. It does not list every file, which is expected. The 'fix(sources)' scope is slightly generic, but the description still names the affected behavior.

Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@TheOrcDev
TheOrcDev merged commit c6ef69b into main Oct 25, 2026
5 of 7 checks passed
TheOrcDev pushed a commit that referenced this pull request Oct 25, 2026
Byte-identical to the same edit in #817, #824 and the toast Copy PR, so
they merge in any order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TheOrcDev pushed a commit that referenced this pull request Oct 25, 2026
Byte-identical to the same edit in #817, #824 and the toast Copy PR, so
they merge in any order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TheOrcDev

TheOrcDev commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner Author

Pushed ea3f609: the shared budget comment now names all three retest-150 fixes. The edit is byte-identical on #817, this PR and #829, so they merge in any order.

TheOrcDev added a commit that referenced this pull request Oct 25, 2026
…opy (#829)

Sonner has two button slots. #797 put Copy in the free one, so a toast
that used both (Recording / Livestream stopped unexpectedly: Open in
Library and Show in folder) dropped it, on the error users most need to
send to support. Copy now rides after the description there and closes
the toast like the slot's Copy.

Recalibrates the eager gzip budget with the same edit as #817 and #824.

Co-authored-by: OrcDev <billing@videorc.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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