Repository navigation
fix(scenes): the Studio gallery marks no scene while the layout is Freeform - #832
Conversation
…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>
|
No actionable comments were generated in the recent review.
|
| 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:
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: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
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.
Comment @coderabbitai help to get the list of available commands.
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 comparedlayoutPresetalone.Fix
galleryPresetIsActive(layout, presetId, activeSavedSceneId)inlib/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.tsxuses 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. Withscene-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-presetall 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 topreset/camera-only, and Record and Clips work.🤖 Generated with Claude Code
Summary by CodeRabbit