Refactor studios to use shared StudioFrame with per-panel controls - #412
Refactor studios to use shared StudioFrame with per-panel controls#412jackgranatowski wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThe configurator now uses panel-based studio schema data and panel-aware rendering across ChangesStudio panel navigation refactor
Control section viewport init
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
PR Summary by QodoRefactor token studios to use StudioFrame panels with scoped controls Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
5 rules 1. Panel nav highlight desync
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
configurator/src/components/editors/EffectsStudio.svelte (1)
35-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffOptional: the
controlssnippet is identical across all five studios.
{#snippetcontrols(activePanel)}<StudioControls groups={activePanel.groups} />{/snippet}is duplicated inEffectsStudio,LayoutStudio,ShapeStudio,ShadowStudio, andMotionStudio. Since the body is the same in every consumer, consider renderingStudioControlsfrom the active panel insideStudioFrame(with a slot/prop opt-out) so consumers only passpanels. This removes the repeated wiring and the per-fileStudioControlsimport.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@configurator/src/components/editors/EffectsStudio.svelte` around lines 35 - 37, The `controls` snippet is duplicated across the studio components, so move the `StudioControls` rendering into `StudioFrame` and let it render from the active panel by default. Update `StudioFrame` to accept the needed panel data (with a slot/prop opt-out for custom controls), then remove the repeated `controls` snippet and `StudioControls` import from `EffectsStudio` and the other studio consumers so they only pass `panels`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@configurator/src/components/editors/EffectsStudio.svelte`:
- Around line 35-37: The `controls` snippet is duplicated across the studio
components, so move the `StudioControls` rendering into `StudioFrame` and let it
render from the active panel by default. Update `StudioFrame` to accept the
needed panel data (with a slot/prop opt-out for custom controls), then remove
the repeated `controls` snippet and `StudioControls` import from `EffectsStudio`
and the other studio consumers so they only pass `panels`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 66a4e69c-4346-4cb7-8252-9c5bfb59eaa8
📒 Files selected for processing (11)
configurator/src/components/ControlSection.svelteconfigurator/src/components/DomainPanel.svelteconfigurator/src/components/editors/EffectsStudio.svelteconfigurator/src/components/editors/LayoutStudio.svelteconfigurator/src/components/editors/MotionStudio.svelteconfigurator/src/components/editors/ShadowStudio.svelteconfigurator/src/components/editors/ShapeStudio.svelteconfigurator/src/components/editors/StudioFrame.svelteconfigurator/src/lib/studioSchema.jsconfigurator/tests-components/studios.test.jsconfigurator/tests/studio-schema.test.js
Motivation
All variables.Description
StudioFrame.svelteto render three areas: left navigation (panels), main preview canvas (renders children with the currentactivePanel), and an active-section controls panel that calls back into the studio to render scoped controls.LayoutStudio.svelte,ShapeStudio.svelte,ShadowStudio.svelte,MotionStudio.svelte, andEffectsStudio.svelteto declarepanels(arrays of{ label, description, groups }) viatokenByNameand removed their local duplicated workflow/navigation UI.StudioControls {groups}usage with a snippet that rendersStudioControlsforactivePanel.groupsso each panel only exposes its related knobs and live preview.configurator/tests-components/studios.test.jsto match the new panel labels and expectations.Testing
npm run check(Svelte diagnostics); no errors, only existing warnings about values captured at initialization.npm run test:components(Vitest); component smoke tests passed after updating expectations (all tests green).npm run build(Vite); production build completed successfully.npx playwright install chromiumand a Playwright screenshot for a visual sanity check, but the browser download failed with a CDN403 Domain forbidden, so browser-based screenshot could not be produced.Codex Task
Summary by CodeRabbit
New Features
Bug Fixes