Skip to content

fix(scenes): the Studio gallery marks no scene while the layout is Freeform - #832

Merged
TheOrcDev merged 1 commit into
mainfrom
fix/scene-gallery-freeform-not-a-preset
Oct 26, 2026
Merged

TheOrcDev merged 1 commit into
mainfrom
fix/scene-gallery-freeform-not-a-preset

Conversation

@TheOrcDev

@TheOrcDev TheOrcDev commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Symptom

Found in the Linux retest on ogre (retest 150). Scene → Layout → Freeform, Screen = None. The Studio's Scenes gallery still ticks Camera only ✓ (evidence/livebg/studio-vertical.png), while the program is a Freeform canvas that still has a visible screen layer (scene.get: [('screen', True, no source), ('camera', True, source)]). Record then waits with #824's "This scene shows a screen, but Screen is set to None. Choose a screen in Sources, or pick a scene without one." The user has, as far as the gallery shows, already picked one. Before #824 the same state failed with the engine's "screen preview source(s) produced no frames".

Cause

Freeform keeps the last preset's name in layout.layoutPreset. The Scene page treats Freeform as the choice (layout-tab.tsx: !isFreeform && layout.layoutPreset === preset.id), but the Studio gallery compared layoutPreset alone.

Fix

galleryPresetIsActive(layout, presetId, activeSavedSceneId) in lib/scene-presets.ts: a card is on air only with no saved scene applied, the layout not in Freeform, and the same preset. scenes-gallery.tsx uses it. Clicking a card still applies that preset (and leaves Freeform), as before.

Tests

  • scene-presets.test.ts: active for the preset; not for another preset; not in Freeform; not with a saved scene applied. With scene-card.test.ts: 41/41.
  • pnpm typecheck, pnpm lint (0 errors; the pre-existing exhaustive-deps warning), Prettier. Eager bundle 396,166 / 400,000 gzip.

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

Scene → Freeform, then Studio: no gallery card is selected (data-scene-preset all unselected; before: Camera only ✓). Record via remote intent in that state: refused with the plain #824 copy, matching the backend scene. Clicking Camera only switches the layout to preset/camera-only, and Record and Clips work.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Preset cards now show as active only when their preset matches the current layout, no saved scene is selected, and the layout is not in Freeform mode. Freeform layouts and selected saved scenes no longer incorrectly highlight a preset.

…eeform

Freeform keeps the last preset's name underneath, so the Studio gallery
ticked e.g. Camera only while the program was a Freeform canvas with a
screen layer. With Screen set to None, Record then waited with "This
scene shows a screen" although the gallery showed a camera-only scene.
The Scene page already treated Freeform as the choice; the gallery now
does too.

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: d99f97e2-affc-4347-b732-84e5e6e011f6
Commits

Reviewing files that changed from the base of the PR and between 27f8f89 and 3c5ea2e.

Files selected for processing: 3
  • apps/desktop/src/renderer/src/components/studio/scenes-gallery.tsx
  • apps/desktop/src/renderer/src/lib/scene-presets.test.ts
  • apps/desktop/src/renderer/src/lib/scene-presets.ts

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 gallery now uses galleryPresetIsActive to determine whether a preset card is active. The helper checks for a matching preset, a non-Freeform arrangement, and no active saved scene.

Changes: Gallery preset activity

Layer / File(s) Summary
Preset activity logic
apps/desktop/src/renderer/src/lib/scene-presets.ts, apps/desktop/src/renderer/src/components/studio/scenes-gallery.tsx, apps/desktop/src/renderer/src/lib/scene-presets.test.ts
Adds galleryPresetIsActive and uses it to set each gallery card’s active state. Tests cover a matching preset, a different preset, Freeform mode, and an active saved scene.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 3c5ea

The gallery activity change is consistent with the repository’s layout and saved-scene contracts, with no merge-blocking risk identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. 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 clearly identifies the Studio gallery and the Freeform active-state bug addressed by the changes.
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.
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 8510c06 into main Oct 26, 2026
5 of 7 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.

1 participant