Skip to content

Introduce Studio framework for domain editors; add token-name toggle and related refactors - #413

Merged
jackgranatowski merged 4 commits into
mainfrom
codex/popraw-sekcje-studio-w-konfiguratorze
Jun 25, 2026
Merged

Introduce Studio framework for domain editors; add token-name toggle and related refactors#413
jackgranatowski merged 4 commits into
mainfrom
codex/popraw-sekcje-studio-w-konfiguratorze

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Replace scattered per-domain workflows with a unified Studio frame and panel model to provide richer, navigable editor surfaces and consistent controls layout.
  • Add a global toggle to show/hide raw token names in friendly and studio controls for better power-user inspection without cluttering the default UI.

Description

  • Add a new StudioFrame component and new panel-driven Studio UIs for Color, Typography, Spacing, Layout, Shape, Shadow, Motion and Effects editors, replacing the old workflow bits and StudioWorkflow component; editors now supply panels and render controls via the Studio API.
  • Replace many legacy per-editor group/resolver usage with explicit panel definitions and wire StudioControls to render group tokens; delete StudioWorkflow.svelte and update editor UIs accordingly.
  • Add ui.showTokens state with persistence (store.svelte.js, uiState.js, App.svelte) and a header button to toggle token-name visibility; StudioControls and Friendly controls respond to the setting.
  • Domain/layout changes: fold gradients into the colors domain and update domain previews/patterns (domains.js, domainPreviews.js, domainSettings.js) and token mapping to reflect gradient tokens as part of colors.
  • Improve ShadeRamp with optional colorKey and showIntro props, computed shade metrics, and a small metrics table for lightness/chroma.
  • Remove overflow:clip/hidden in control container styles and update ControlSection CSS so panels do not clip control content; update StudioFrame layout to avoid control clipping.
  • Update tests to match the new Studio model and the showTokens toggle, and add new smoke / behavior checks around Studio frame overflow and token-name visibility.

Testing

  • Ran component smoke and studio tests with Vitest and @testing-library/svelte (tests-components/studios.test.js) and verified each Studio mounts and renders expected panels and controls, the Studio frame overflow behaviour check, and token visibility toggling; all tests passed.
  • Ran domain settings unit tests (tests/domain-settings.test.js) to assert smart setting coverage and kinds, which passed after updating gradients mapping.
  • Ran domains and smoke pipeline tests (tests/domains.test.js, tests/smoke.test.js) with updated token mappings (gradients now under colors) and confirmed the smoke edit set and domain classification tests passed.

Codex Task

Summary by CodeRabbit

  • New Features
    • Added a token-visibility toggle to the header, including persistence across reloads.
    • Updated studio editors to use a panel-based navigation/control layout.
  • UI Improvements
    • Refreshed the color shade ramp to a more metrics-focused table presentation.
    • Removed the “Gradients” option from the preview pane selector; gradients remain available within the relevant color experiences.
  • Bug Fixes
    • Moved gradient-related tokens/settings under the Colors area (instead of a standalone gradients domain), updating routing and rendering accordingly.
    • Improved control-panel overflow behavior to prevent clipping.
  • Tests
    • Updated unit and end-to-end coverage for the new studio and navigation behavior.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 12 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c67a3f90-7f39-4e86-8ab1-1ae6a10a7a6c

📥 Commits

Reviewing files that changed from the base of the PR and between ddae5f7 and c101384.

📒 Files selected for processing (1)
  • configurator/tests-e2e/generator.spec.js
📝 Walkthrough

Walkthrough

The configurator adds a persisted showTokens UI flag, panel-based studio navigation, and updated color/gradient routing. Preview and domain settings move gradient content under colors, while legacy domain rendering and related tests are updated.

Changes

Configurator UI refresh

Layer / File(s) Summary
Token visibility state
configurator/src/App.svelte, configurator/src/components/Header.svelte, configurator/src/components/editors/StudioControls.svelte, configurator/src/lib/store.svelte.js, configurator/src/lib/uiState.js, configurator/tests-components/studios.test.js
showTokens is added to persisted UI state, toggled from the header, and consumed by studio controls and token-visibility tests.
Panel-driven studio shell
configurator/src/components/ControlSection.svelte, configurator/src/components/editors/StudioFrame.svelte, configurator/src/components/editors/StudioWorkflow.svelte, configurator/src/components/editors/EffectsStudio.svelte, configurator/src/components/editors/LayoutStudio.svelte, configurator/src/components/editors/MotionStudio.svelte, configurator/src/components/editors/ShadowStudio.svelte, configurator/src/components/editors/ShapeStudio.svelte, configurator/tests-components/studios.test.js
StudioFrame now selects a panel and optional controls, and the studio editors switch from workflow steps to token-driven panel definitions.
Spacing and typography panels
configurator/src/components/editors/SpacingStudio.svelte, configurator/src/components/editors/TypographyStudio.svelte, configurator/tests-e2e/generator.spec.js, configurator/tests-e2e/undo-redo.spec.js, configurator/tests-components/studios.test.js
Spacing and typography editors now drive explicit panels and sub-scopes, including scale generation and heading-level controls.
Color studio and shade ramp
configurator/src/components/editors/ColorStudio.svelte, configurator/src/components/ShadeRamp.svelte
ColorStudio becomes a panel-based editor for colors, gradients, curves, contrast, and assignments, and ShadeRamp renders visible-brand metric tables.
Gradient routing and legacy domains
configurator/src/components/DomainPanel.svelte, configurator/src/components/Preview.svelte, configurator/src/lib/domainPreviews.js, configurator/src/lib/domainSettings.js, configurator/src/lib/domains.js, configurator/tests-components/domain-preview.test.js, configurator/tests/domain-settings.test.js, configurator/tests/domains.test.js, configurator/tests/smoke.test.js, configurator/tests-e2e/a11y.spec.js, configurator/tests-e2e/domain-preview.spec.js, configurator/tests-e2e/shell.spec.js
Gradient tokens and preview entries move under colors, the preview drops the Gradients section, and DomainPanel only exposes legacy controls and docs outside Studio-owned domains.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#402: Updates the shared studio frame and editor composition patterns around StudioFrame.svelte and StudioControls.svelte.
  • codeslash-dev/SLASHED#398: Touches the Preview section routing and gradients tab wiring that this PR removes.
  • codeslash-dev/SLASHED#382: Changes the smart-settings gradient domain placement that matches the colors/gradients split here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main Studio framework refactor and token-name toggle addition.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/popraw-sekcje-studio-w-konfiguratorze

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Unify domain editors under StudioFrame; add global token-name visibility toggle
✨ Enhancement 🧪 Tests 🐞 Bug fix 🕐 40+ Minutes

Grey Divider

Description

• Introduce panel-based StudioFrame layout across domain studios and remove StudioWorkflow.
• Add persisted ui.showTokens toggle and wire it through Friendly/Studio controls.
• Fold gradients into Colors domain and update previews, smart settings, and tests.
Diagram

graph TD
  H["Header.svelte"] --> UI(("ui store")) --> SC["StudioControls.svelte"] --> FC["FriendlyControl"]
  UI(("ui store")) --> SF["StudioFrame.svelte"] --> ED["Studio editors"]
  A["App.svelte"] --> LS[("localStorage")]
  UI(("ui store")) --> A["App.svelte"]
  DT["domains.js + domainSettings.js"] --> ED["Studio editors"] --> T["Vitest tests"]
  UI(("ui store")) --> T["Vitest tests"]
  subgraph Legend
    direction LR
    _cmp["Component"] ~~~ _state(("State")) ~~~ _db[("Storage")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep studioSchema-driven groups (minimal editor changes)
  • ➕ Less duplication of per-editor panel/group definitions
  • ➕ Centralizes token grouping rules in one schema module
  • ➖ Harder to express bespoke panels like ColorStudio gradients/curve builders
  • ➖ Less flexibility for editor-specific previews and control ordering
2. Introduce a shared panel-builder helper (factory) for token-based panels
  • ➕ Reduces repeated panel(label, description, tokens) patterns across studios
  • ➕ Encourages consistent panel metadata (id/label/description/groups)
  • ➖ Adds an abstraction layer that may obscure per-studio customization
  • ➖ Still requires bespoke handling for generators/presets (e.g., Typography/Spacing)
3. Persist active Studio panel per domain in ui state
  • ➕ Restores the last-used panel after reloads, improving power-user flow
  • ➕ Would align with existing persisted domain/outputMode/theme prefs
  • ➖ More UI state surface area and migration concerns in sanitiseUiState
  • ➖ Potentially surprising if panel restores to a context-specific view

Recommendation: Current approach (explicit per-studio panels wired into a shared StudioFrame) is the right direction for richer, domain-specific editor canvases. Consider extracting a small panel factory/helper to reduce repetition, but keep per-studio explicitness where bespoke controls (generators, gradient presets, heading scopes) benefit from custom structure.

Files changed (25) +588 / -331

Enhancement (10) +391 / -128
App.sveltePersist showTokens in UI snapshot +1/-1

Persist showTokens in UI snapshot

• Extends the persisted UI snapshot written to localStorage to include ui.showTokens, ensuring token-name visibility survives reloads.

configurator/src/App.svelte

Header.svelteAdd header toggle for token-name visibility +1/-0

Add header toggle for token-name visibility

• Adds a new header button that toggles ui.showTokens with appropriate aria state and titles.

configurator/src/components/Header.svelte

ShadeRamp.svelteAdd per-color filtering and shade metrics table +38/-6

Add per-color filtering and shade metrics table

• Adds optional colorKey and showIntro props, computes lightness/chroma metrics per shade, and renders a compact metrics table. Also supports showing only a selected brand color ramp.

configurator/src/components/ShadeRamp.svelte

ColorStudio.svelteConvert ColorStudio to panel-driven Studio UI +136/-63

Convert ColorStudio to panel-driven Studio UI

• Replaces the old workflow/sections with explicit panels (main colors, semantic colors, gradients, shade curve, contrast, assignments). Adds gradient builder presets and slider-driven palette curve controls, and integrates ShadeRamp per active color.

configurator/src/components/editors/ColorStudio.svelte

SpacingStudio.svelteAdd spacing panels and integrate ScaleGenerator in-studio +78/-10

Add spacing panels and integrate ScaleGenerator in-studio

• Introduces panel navigation (Scale/Rhythm/Sections/Components/Advanced), resolves active groups per panel, and embeds ScaleGenerator for the Scale panel while keeping the preview labs.

configurator/src/components/editors/SpacingStudio.svelte

StudioControls.svelteRespect global showTokens setting +3/-2

Respect global showTokens setting

• Wires ui.showTokens into StudioControls so FriendlyControl shows/hides raw token names globally in studio panels.

configurator/src/components/editors/StudioControls.svelte

StudioFrame.svelteRedesign StudioFrame into nav/canvas/panel layout +52/-23

Redesign StudioFrame into nav/canvas/panel layout

• Expands StudioFrame to support panel navigation, active panel selection, and a dedicated sticky controls column. Updates styling to avoid overflow clipping and enable scroll within the controls panel.

configurator/src/components/editors/StudioFrame.svelte

TypographyStudio.svelteRestructure TypographyStudio panels and add heading scope + scale generator +74/-21

Restructure TypographyStudio panels and add heading scope + scale generator

• Replaces prior studioSchema panel model with explicit panels (Headings/Text/Fonts/Scale/Advanced). Adds heading level scope selection, embeds ScaleGenerator for type/display ramps, and updates which specimen blocks render per panel.

configurator/src/components/editors/TypographyStudio.svelte

store.svelte.jsAdd ui.showTokens state +3/-1

Add ui.showTokens state

• Adds showTokens to the global ui state, defaulting from persisted UI state, and updates loadUiState typing docs accordingly.

configurator/src/lib/store.svelte.js

uiState.jsSanitise persisted showTokens preference +5/-1

Sanitise persisted showTokens preference

• Extends sanitiseUiState to accept and validate a boolean showTokens field from localStorage.

configurator/src/lib/uiState.js

Bug fix (1) +1 / -1
ControlSection.svelteStop clipping control content +1/-1

Stop clipping control content

• Removes overflow:clip from control sections so nested controls and studio side panels don’t get visually cut off.

configurator/src/components/ControlSection.svelte

Refactor (10) +139 / -188
DomainPanel.svelteGate legacy layout when Studio is present +61/-78

Gate legacy layout when Studio is present

• Refactors domain panel rendering so Studio-based domains own their control layout, while non-studio domains keep the legacy generator/knobs/presets flow. Also hides docs link for Studio domains.

configurator/src/components/DomainPanel.svelte

Preview.svelteRemove dedicated Gradients preview section +0/-40

Remove dedicated Gradients preview section

• Drops the Gradients preview tab/section and mapping, reflecting gradients being treated as part of the Colors domain.

configurator/src/components/Preview.svelte

EffectsStudio.svelteDefine Effects panels and wire into StudioFrame controls slot +13/-8

Define Effects panels and wire into StudioFrame controls slot

• Replaces schema/workflow wiring with explicit panels backed by token lists, and renders controls via StudioFrame’s activePanel snippet.

configurator/src/components/editors/EffectsStudio.svelte

LayoutStudio.svelteDefine Layout panels and render active panel controls +13/-16

Define Layout panels and render active panel controls

• Moves from workflow + resolved groups to explicit panels (containers/grid/measure/anchors) and renders controls for the active panel via StudioFrame’s controls snippet.

configurator/src/components/editors/LayoutStudio.svelte

MotionStudio.svelteDefine Motion panels and render active panel controls +13/-8

Define Motion panels and render active panel controls

• Replaces workflow/schema grouping with explicit token-based panels (durations/easing/presets/reduced motion) and connects them to the StudioFrame active panel model.

configurator/src/components/editors/MotionStudio.svelte

ShadowStudio.svelteDefine Shadow panels and render active panel controls +13/-8

Define Shadow panels and render active panel controls

• Switches from workflow/schema groups to explicit panels (elevation/surfaces/overlays/text & media) with token lists, rendered via the active panel controls slot.

configurator/src/components/editors/ShadowStudio.svelte

ShapeStudio.svelteDefine Shape panels and render active panel controls +13/-8

Define Shape panels and render active panel controls

• Replaces StudioWorkflow and schema-derived groups with explicit panels (radius/borders/dividers/focus) and renders active panel controls via StudioFrame.

configurator/src/components/editors/ShapeStudio.svelte

domainPreviews.jsTreat gradients preview metadata as part of Colors +1/-1

Treat gradients preview metadata as part of Colors

• Renames/moves the gradient preview configuration under the Colors domain preview entry.

configurator/src/lib/domainPreviews.js

domainSettings.jsMove gradient builder smart panel into Colors domain +7/-10

Move gradient builder smart panel into Colors domain

• Adds gradient-builder smart settings section to Colors and removes the separate Gradients domain smart settings entry.

configurator/src/lib/domainSettings.js

domains.jsFold gradients into Colors domain classification +5/-11

Fold gradients into Colors domain classification

• Updates the Colors domain namespaces/patterns/essentials to include gradients and removes the standalone Gradients domain entry.

configurator/src/lib/domains.js

Tests (4) +57 / -14
studios.test.jsUpdate studio smoke tests; add overflow + showTokens behavior coverage +54/-9

Update studio smoke tests; add overflow + showTokens behavior coverage

• Updates expected text assertions for the new panel UIs, adds a regression test ensuring StudioFrame/control sections don’t clip via overflow, and adds tests for global token toggle plus local FriendlyControl token reveal.

configurator/tests-components/studios.test.js

domain-settings.test.jsRemove Gradients domain from required smart settings coverage +1/-1

Remove Gradients domain from required smart settings coverage

• Updates the required smart settings domains list to reflect gradients now living under Colors.

configurator/tests/domain-settings.test.js

domains.test.jsExpect gradients to resolve to Colors domain +2/-2

Expect gradients to resolve to Colors domain

• Updates domainOf routing expectations so --sf-gradient-* tokens map to the Colors domain.

configurator/tests/domains.test.js

smoke.test.jsRemove gradient token edit from smoke pipeline +0/-2

Remove gradient token edit from smoke pipeline

• Drops the representative gradient override from the global smoke edits set, aligning with gradients no longer being treated as a separate domain in test coverage.

configurator/tests/smoke.test.js

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 5 rules

Grey Divider


Remediation recommended

1. Overflow clipping returns in cards 🐞 Bug ☼ Reliability
Description
ColorStudio introduces overflow: clip on new card containers (.color-item, .gradient-card,
.curve-slider), which can clip focus outlines/visual affordances and reintroduce the
control-clipping class of issues this PR is trying to avoid.
Code

configurator/src/components/editors/ColorStudio.svelte[R158-168]

+  .main-colors, .rows { display: grid; gap: 10px; }
+  .color-item { border: 1px solid var(--cfg-border); border-radius: var(--cfg-radius); background: var(--cfg-surface); overflow: clip; }
+  .color-item--active { border-color: color-mix(in oklab, var(--cfg-accent) 65%, var(--cfg-border)); }
+  .color-item__summary { width: 100%; display: grid; grid-template-columns: 34px 34px 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 0; background: var(--cfg-surface-2); color: inherit; text-align: left; font-weight: 850; cursor: pointer; }
+  .color-item__toggle { inline-size: 28px; block-size: 16px; border-radius: 999px; background: var(--cfg-accent-strong); box-shadow: inset 13px 0 0 white; }
+  .color-item__swatch { inline-size: 30px; block-size: 30px; border-radius: 9px; border: 1px solid var(--cfg-border-strong); }
+  .color-item__chev { transition: transform .14s; }
+  .color-item__summary[aria-expanded='true'] .color-item__chev { transform: rotate(90deg); }
+  .gradient-grid, .curve-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
+  .gradient-card, .curve-slider { border: 1px solid var(--cfg-border); border-radius: var(--cfg-radius); overflow: clip; background: var(--cfg-bg-2); }
+  .gradient-card__swatch { min-height: 90px; border-bottom: 1px solid var(--cfg-border); }
Relevance

⭐⭐⭐ High

Team recently removed overflow clip/hidden to avoid control clipping; tests assert no clip/hidden on
ColorStudio elements.

PR-#402
PR-#403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
ControlSection no longer sets overflow clipping (to avoid clipping controls), but ColorStudio
adds overflow: clip to several new containers that wrap control UIs, reintroducing the same
clipping risk.

configurator/src/components/editors/ColorStudio.svelte[148-170]
configurator/src/components/ControlSection.svelte[16-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Interactive container cards in `ColorStudio` use `overflow: clip`, which can clip focus rings, shadows, and any content that needs to extend outside the card (common with interactive controls). This conflicts with the PR’s broader anti-clipping changes.

### Issue Context
The PR explicitly removed `overflow: clip` from `ControlSection` to prevent clipping, but `ColorStudio` adds it back on multiple containers that wrap controls.

### Fix Focus Areas
- configurator/src/components/editors/ColorStudio.svelte[158-168]
- configurator/src/components/ControlSection.svelte[16-20]

### Suggested change
1. Remove `overflow: clip` from `.color-item` and from `.gradient-card, .curve-slider`.
2. If clipping is only desired for rounded-corner visuals, move the clipping to a non-interactive inner wrapper (e.g., clip only the swatch area), keeping the outer interactive container `overflow: visible`.
This keeps rounded visuals without risking clipped focus/overlays.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Legacy token toggle bypass 🐞 Bug ≡ Correctness
Description
ui.showTokens does not affect legacy FriendlyControl instances rendered in DomainPanel (basic
groups never receive showToken, while Essentials forces it on), so the new global toggle behaves
inconsistently across domains.
Code

configurator/src/components/DomainPanel.svelte[R210-225]

+        {#if basicGroups.length}
+          {#each basicGroups as group (group.title)}
+            <ControlSection title={group.title} modifiedCount={group.controls.filter((c) => overrides[c.token] != null).length}>
+              <div class="panel__card-rows">
+                {#each group.controls as c (c.token)}
+                  <FriendlyControl token={c.tokenObj} label={c.label} help={c.help} />
+                {/each}
+              </div>
+            </ControlSection>
+          {/each}
+        {:else if essentials.length}
+          <ControlSection title="Essentials" hint="Curated for most projects." modifiedCount={essentials.filter((t) => overrides[t.name] != null).length}>
            <div class="panel__card-rows">
-              {#each group.controls as c (c.token)}
-                <FriendlyControl token={c.tokenObj} label={c.label} help={c.help} />
+              {#each essentials as token (token.name)}
+                <FriendlyControl {token} showToken />
              {/each}
Relevance

⭐⭐ Medium

No prior suggestions found about wiring ui.showTokens through DomainPanel legacy FriendlyControl
sections; toggle feature is new.

PR-#402

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
DomainPanel renders FriendlyControl in legacy sections without wiring ui.showTokens, but
FriendlyControl only displays the token name when the showToken prop (or rawOpen) is true—so
the global toggle cannot influence these rows and Essentials will always show token names.

configurator/src/components/DomainPanel.svelte[210-227]
configurator/src/components/FriendlyControl.svelte[7-32]
configurator/src/components/editors/StudioControls.svelte[1-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The global token-name toggle (`ui.showTokens`) is not applied to legacy DomainPanel rendering paths. As a result, toggling token visibility does not consistently show/hide raw token names in the fallback layout.

### Issue Context
`FriendlyControl` only shows the raw token name when its `showToken` prop is true (or when the per-control `rawOpen` is toggled). The new global state lives on `ui.showTokens`, but `DomainPanel` does not pass it to `FriendlyControl` in the legacy sections.

### Fix Focus Areas
- configurator/src/components/DomainPanel.svelte[210-227]
- configurator/src/components/FriendlyControl.svelte[7-32]

### Suggested change
1. Import `ui` into `DomainPanel.svelte`.
2. Update legacy `FriendlyControl` call sites:
  - For `basicGroups` controls: pass `showToken={ui.showTokens}`.
  - For `Essentials`: replace the unconditional `showToken` with `showToken={ui.showTokens}`.
This makes the global toggle consistent while still allowing the per-control “Show token” button to work.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

3. StudioFrame empty third column 🐞 Bug ⚙ Maintainability
Description
StudioFrame always uses a 3-column grid, reserving space for the right-hand controls panel even
when controls isn’t provided (e.g., Typography/Spacing/Color studios), unnecessarily shrinking the
main canvas on wide screens.
Code

configurator/src/components/editors/StudioFrame.svelte[R49-50]

+  .studio { display: grid; grid-template-columns: minmax(170px, .26fr) minmax(0, 1fr) minmax(250px, .34fr); gap: 18px; padding: 18px; border: 1px solid var(--cfg-border); border-radius: var(--cfg-radius-l); background: radial-gradient(circle at 0 0, color-mix(in oklab, var(--cfg-accent) 16%, transparent), transparent 34%), linear-gradient(135deg, color-mix(in oklab, var(--cfg-accent) 8%, transparent), transparent 48%), var(--cfg-surface); overflow: visible; }
+  .studio__nav, .studio__panel { position: sticky; top: 10px; align-self: start; display: grid; gap: 14px; min-width: 0; }
Relevance

⭐⭐ Medium

No historical evidence for conditional StudioFrame grid columns when controls panel absent; layout
may be intentional.

PR-#402
PR-#403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
StudioFrame’s CSS defines three columns unconditionally, but the controls panel markup is
conditional ({#if activePanel && controls}), so when controls is not supplied the third column
remains empty yet still consumes layout width.

configurator/src/components/editors/StudioFrame.svelte[34-65]
configurator/src/components/editors/TypographyStudio.svelte[57-101]
configurator/src/components/editors/SpacingStudio.svelte[52-80]
configurator/src/components/editors/ColorStudio.svelte[93-106]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`StudioFrame` hard-codes a 3-column layout even when the right-side controls panel is not rendered (no `controls` snippet/prop). This leaves an unused grid track and reduces the available width for the preview canvas.

### Issue Context
Several studios currently use `<StudioFrame ...>` without providing a `controls` snippet/prop, so the third column is empty but still allocated by `grid-template-columns`.

### Fix Focus Areas
- configurator/src/components/editors/StudioFrame.svelte[34-45]
- configurator/src/components/editors/StudioFrame.svelte[48-64]

### Suggested change
1. Add a conditional class on the root `.studio`, e.g. `class:studio--has-panel={!!controls}` (or `controls && panels.length`).
2. Change base CSS to a 2-column grid (nav + surface).
3. Add a `.studio--has-panel` rule that switches to the 3-column grid.
This preserves the new layout where applicable while avoiding wasted space when no controls panel is present.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

The PR folded gradients into the colors domain by adding a `colors` entry
to DOMAIN_PREVIEWS, so rendering with domain='colors' now produces a .dp
element. Switch the "renders nothing" test to use 'misc', which has no
preview spec and never will.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jackgranatowski

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
configurator/src/components/editors/EffectsStudio.svelte (1)

6-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Extract the duplicated panel() helper into a shared module.

This exact panel(label, description, tokens) builder is repeated verbatim in EffectsStudio, LayoutStudio, MotionStudio, ShadowStudio, and ShapeStudio. Hoisting it (e.g. into lib/model.js or a studioPanels.js helper) removes five copies and keeps the panel→token mapping contract in one place.

🤖 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` at line 6, Extract
the duplicated panel(label, description, tokens) builder into a shared helper
module and update EffectsStudio to import and use it instead of defining its own
local version. Centralize the panel-to-token mapping logic in the shared helper
so the same contract is reused by LayoutStudio, MotionStudio, ShadowStudio, and
ShapeStudio, and ensure the helper still maps token names through tokenByName
and filters missing entries.
🤖 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.

Inline comments:
In `@configurator/src/lib/domainSettings.js`:
- Around line 32-38: The e2e navigation target for the retired Gradients domain
is stale and now points to a Sidebar item that no longer exists. Update the
navigation selectors and expectations in a11y.spec.js, shell.spec.js, and
domain-preview.spec.js by replacing sideItem(page, 'Gradients') / NAV_LABELS
entries with Colors, or route the checks through the Colors panel if you still
need to verify gradient-related UI. Also adjust any viewGradients helper or
related test navigation logic so it targets the gradient tab inside the Colors
domain rather than a top-level Gradients domain.

---

Nitpick comments:
In `@configurator/src/components/editors/EffectsStudio.svelte`:
- Line 6: Extract the duplicated panel(label, description, tokens) builder into
a shared helper module and update EffectsStudio to import and use it instead of
defining its own local version. Centralize the panel-to-token mapping logic in
the shared helper so the same contract is reused by LayoutStudio, MotionStudio,
ShadowStudio, and ShapeStudio, and ensure the helper still maps token names
through tokenByName and filters missing entries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 611facd6-bd22-4fa8-a263-fe95ff75d23a

📥 Commits

Reviewing files that changed from the base of the PR and between f391ec2 and 2aed001.

📒 Files selected for processing (27)
  • configurator/src/App.svelte
  • configurator/src/components/ControlSection.svelte
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/Header.svelte
  • configurator/src/components/Preview.svelte
  • configurator/src/components/ShadeRamp.svelte
  • configurator/src/components/editors/ColorStudio.svelte
  • configurator/src/components/editors/EffectsStudio.svelte
  • configurator/src/components/editors/LayoutStudio.svelte
  • configurator/src/components/editors/MotionStudio.svelte
  • configurator/src/components/editors/ShadowStudio.svelte
  • configurator/src/components/editors/ShapeStudio.svelte
  • configurator/src/components/editors/SpacingStudio.svelte
  • configurator/src/components/editors/StudioControls.svelte
  • configurator/src/components/editors/StudioFrame.svelte
  • configurator/src/components/editors/StudioWorkflow.svelte
  • configurator/src/components/editors/TypographyStudio.svelte
  • configurator/src/lib/domainPreviews.js
  • configurator/src/lib/domainSettings.js
  • configurator/src/lib/domains.js
  • configurator/src/lib/store.svelte.js
  • configurator/src/lib/uiState.js
  • configurator/tests-components/domain-preview.test.js
  • configurator/tests-components/studios.test.js
  • configurator/tests/domain-settings.test.js
  • configurator/tests/domains.test.js
  • configurator/tests/smoke.test.js
💤 Files with no reviewable changes (3)
  • configurator/src/components/editors/StudioWorkflow.svelte
  • configurator/tests/smoke.test.js
  • configurator/src/components/Preview.svelte

Comment thread configurator/src/lib/domainSettings.js
claude added 2 commits June 25, 2026 14:01
- DomainPanel: render QuickKnobs and StylePresetRow before Studio component so
  preset buttons and scaling knobs remain accessible for studio domains
  (Borders, Shadows, Spacing, etc.)
- shell/a11y: remove Gradients from NAV_LABELS (merged into Colors Studio);
  update Colors panel assertion to check .color-studio instead of .panel__card
- a11y: navigate to Colors → Gradients studio tab instead of removed Gradients domain
- domain-preview: remove Gradients entry from SECTION_BY_DOMAIN routing table
- generator/undo-redo: click Scale tab before accessing .gen in TypographyStudio
  (the generator is only rendered when the Scale panel is active)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…caleGenerator

TypographyStudio renders a single ScaleGenerator with kinds=['type','display'],
so there is one .gen element with an internal seg-button switcher rather than
two separate .gen elements. Switch to the Display kind via .seg__btn before
asserting the disabled ratio selects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jackgranatowski
jackgranatowski merged commit f3e6f10 into main Jun 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants