Skip to content

Configurator v2: dogfooded chrome, shareable URLs, bundle picker, SVG icons & preview-first panels - #374

Merged
jackgranatowski merged 1 commit into
mainfrom
claude/configurator-v2-redesign-yk7qno
Jun 22, 2026
Merged

Configurator v2: dogfooded chrome, shareable URLs, bundle picker, SVG icons & preview-first panels#374
jackgranatowski merged 1 commit into
mainfrom
claude/configurator-v2-redesign-yk7qno

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Configurator v2

Evolves the existing, well-tested configurator into a living showcase of SLASHED. The tested core logic (model.js, css.js, color.js, contrast.js, fluidEngine.js, historyOps.js) is preserved; this PR layers on the v2 workstreams.

What's in here

Dogfood the chrome — the UI is now built from SLASHED's own tokens. app.css defines its --cfg-* names as aliases onto --sf-* (--cfg-bg: var(--sf-color-bg), --cfg-accent: var(--sf-color-primary), …), the chrome theme flips the framework's own [data-theme], and user overrides stay scoped to the preview stage (never :root).

Shareable config URLsshare.js + codec.js encode the override map into a compact binary config code in the URL, so a configuration is bookmarkable/shareable with no deploy.

Bundle / module picker — an Install panel (bundles.js, BundlePicker.svelte) reads an auto-synced bundles.generated.json (from bundle.config.json via sync-api.mjs) and emits a complete drop-in <link>/@import snippet plus the override layer.

Inline SVG icon set — replaces every emoji domain/nav icon with a single self-contained stroke sprite (Icon.svelte + lib/icons.js) that inherits theme color via currentColor. No binary assets, no icon font.

Useful, preview-first domain panels — each token category now opens with its live preview as the first, expanded element (Colors leads with Semantic roles). The Layout preview was rebuilt: container widths now render to true relative scale (computed proportionally instead of all clamping to 100%), alongside aspect-ratio tiles and real-dimension sizing swatches. Effects gained a realistic opacity/scrim demo.

Test hardening — vitest component tests (incl. a new icon-coverage test), @axe-core/playwright a11y checks, firefox + webkit cross-browser projects, a curation tripwire (check-curation.mjs) that flags uncurated public knobs, and an updated domain-preview e2e spec. CI runs the full matrix.

Verification

  • cd configurator && npm test (unit + component) and npm run test:e2e (flows + a11y + cross-browser) green locally.
  • Root npm run check:version green — no version bump; configurator stays pinned to the root framework version.

🤖 Generated with Claude Code


Generated by Claude Code


Summary by cubic

Replaced emoji icons with a self-contained inline SVG set and made every token panel preview-first. Rebuilt the Layout preview to show true relative widths, with new ratio and sizing samples.

  • New Features
    • Inline SVG icons via Icon.svelte + lib/icons.js; used in sidebar, home, and panel headers. Inherits theme via currentColor. No icon font.
    • Preview-first panels: a live “Preview” card now leads each domain and opens by default. Colors leads with Semantic roles for parity.
    • Layout preview rebuild: container widths measured with hidden probes and drawn proportionally with px labels; added aspect-ratio tiles and real-size sizing swatches (header, touch, icon).
    • Effects preview tweaks: opacity shown on a real UI chip; added scrim gradient sample.

Written for commit 8c42293. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Domain panel previews now display expanded by default instead of requiring manual expansion.
    • Enhanced layout domain preview with proportional container widths, aspect ratio tiles, and sizing swatches.
    • Improved effects domain preview with dedicated opacity chips and scrim samples.
  • Style

    • Interface icons updated from emoji to vector graphics for improved visual consistency.

…anels

Replace the emoji domain icons with a self-contained inline-SVG stroke set
(Icon.svelte + lib/icons.js) that inherits the dogfooded theme colour via
currentColor — no binary assets. Swap at every render site (sidebar, home,
panel header) and add the Overview "home" glyph.

Make the inline live preview the FIRST thing in every token category and open
by default (Colors leads with its Semantic-roles map for parity), instead of a
collapsed card near the bottom of the settings zone.

Fix the Layout preview, which was useless: container max-widths all dwarf the
editor panel, so the old `min(100%, var())` clamp rendered all four bars
identical. Measure each container's resolved width via hidden probes carrying
the live cascade and draw bars to true relative scale (with px labels), plus
aspect-ratio tiles and real-size sizing swatches (header/touch/icon). Enrich
the Effects preview: opacity shown as a real UI state and a scrim-gradient
sample.

Tests: new icon tripwire (every domain icon resolves, no emoji leaks); layout
preview asserts proportional probes + aspect/sizing tiles; e2e updated for the
open, preview-first, distinct-width behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fg7U9rTiqBgbsPuz9kdWea
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Introduces an Icon.svelte component backed by an ICON_PATHS map in icons.js, replacing all emoji/glyph domain icons across Sidebar, Home, and DomainPanel. Separately restructures DomainPanel so the preview card leads the panel body open by default, and expands DomainPreview with DOM-probe-based proportional layout widths, aspect-ratio tiles, sizing swatches, opacity chips, and scrim rendering. domainPreviews.js specs are updated to supply the new groups and tokens.

Changes

SVG Icon System and Lead Preview Card

Layer / File(s) Summary
Icon data, component, and domain field migration
configurator/src/lib/icons.js, configurator/src/components/Icon.svelte, configurator/src/lib/domains.js
icons.js exports ICON_PATHS keyed SVG path markup strings. Icon.svelte accepts name/size props, looks up markup from ICON_PATHS, and injects it into an inline <svg> inheriting currentColor. All DOMAINS entries replace emoji values with Icon.svelte key strings.
Icon integration into UI shells
configurator/src/components/Sidebar.svelte, configurator/src/components/Home.svelte, configurator/src/components/DomainPanel.svelte
Sidebar replaces home and per-domain emoji buttons with Icon invocations. Home replaces the aria-hidden text span with <Icon>. DomainPanel header replaces the raw domain.icon string with <Icon name={domain.icon} size={18} />.
Domain preview spec data for layout and effects
configurator/src/lib/domainPreviews.js
layout preview spec gains "Aspect ratios" and "Sizing" groups with new token entries alongside the existing "Container widths" group. effects spec gains a "Scrim" group with --sf-scrim-gradient. Blurb text updated for both.
DomainPreview rendering: layout measurement, opacity chips, scrim
configurator/src/components/DomainPreview.svelte
Adds reactive DOM-probe logic that measures hidden off-layout elements to derive proportional pixel widths per container token, sizing bar fills accordingly. Introduces template branches for aspect-ratio tiles and sizing swatches. Reworks effects rendering with opacity chip UI and scrim gradient overlay. Adds all supporting CSS for probes, tiles, swatches, chips, and scrim.
DomainPanel lead preview card and disclosure state
configurator/src/components/DomainPanel.svelte
A new "LIVE PREVIEW" section is inserted at the top of the panel body, rendering DomainPreview (or ColorAssignments for brand-color domains) in a <details> that is open by default. Old inline preview placements are removed. .panel__card--lead receives accent border/stripe CSS.
Component and e2e tests for icon system and preview
configurator/tests-components/icon.test.js, configurator/tests-components/domain-preview.test.js, configurator/tests-e2e/domain-preview.spec.js
icon.test.js verifies all domain icon keys resolve to non-empty SVG markup and contain no emoji, and smoke-tests Icon.svelte render. Component test checks layout preview renders four width probes plus .dp__ratios and .dp__sizes sections. E2e spec asserts open-by-default Preview card at first position, distinct proportional widths for layout, and that the live override test no longer needs to open the accordion.

Sequence Diagram(s)

sequenceDiagram
  participant User
  rect rgba(70, 130, 180, 0.5)
    Note over User,DomainPanel: Open domain panel
  end
  User->>DomainPanel: click domain in Sidebar
  DomainPanel->>DomainPanel: render lead <details open> card
  DomainPanel->>DomainPreview: pass previewSpec + cascade styles
  rect rgba(100, 160, 100, 0.5)
    Note over DomainPreview,ProbeEls: Layout domain only
  end
  DomainPreview->>ProbeEls: mount hidden probe elements
  ProbeEls-->>DomainPreview: getBoundingClientRect() pixel widths
  DomainPreview->>DomainPreview: compute percentages per container token
  DomainPreview-->>User: visible stage (bar fills, ratio tiles, sizing swatches, opacity chips, scrim)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#369: Directly modifies DomainPanel.svelte around the Colors "Semantic roles" preview/disclosure UI, which this PR reorders into the new lead preview section.
  • codeslash-dev/SLASHED#371: Introduces the domainPreviews.js specs and DomainPreview.svelte component that this PR further expands with layout/scrim/opacity rendering and lead-card positioning.
  • codeslash-dev/SLASHED#302: Restructures the domain panel tabbed routing and preview gating in DomainPanel.svelte, directly related to this PR's reordering of the panel body's lead preview block.
🚥 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 encompasses the entire PR scope: SVG icons, preview-first panels, bundle picker, shareable URLs, and framework dogfooding—covering all major features documented in the objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/configurator-v2-redesign-yk7qno

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 and usage tips.

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

🧹 Nitpick comments (1)
configurator/tests-e2e/domain-preview.spec.js (1)

40-52: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider stricter distinctness assertion for robustness.

The current test verifies at least 2 distinct widths exist, which correctly catches the regression where all containers clamped to identical widths. However, with 4 container tokens of different sizes, you'd typically expect 3-4 distinct widths.

Consider strengthening line 51 to check for at least 3 distinct values:

expect(new Set(widths.map((w) => Math.round(w))).size, 'most widths are distinct').toBeGreaterThanOrEqual(3);

This would provide higher confidence that proportional scaling is working correctly across all containers, not just that they're not all identical.

That said, the current assertion is sufficient for the stated goal of preventing the clamp-to-100% regression.

🤖 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/tests-e2e/domain-preview.spec.js` around lines 40 - 52,
Strengthen the distinctness assertion in the test to ensure higher confidence in
proportional scaling across all containers. Locate the expect statement at line
51 that checks the size of the Set of rounded widths using toBeGreaterThan(1),
and change it to use toBeGreaterThanOrEqual(3) instead. This verifies that at
least 3 out of 4 container widths are distinct, rather than just confirming
they're not all identical. Optionally update the assertion message from 'widths
are not all identical' to 'most widths are distinct' for better clarity.
🤖 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/tests-e2e/domain-preview.spec.js`:
- Around line 40-52: Strengthen the distinctness assertion in the test to ensure
higher confidence in proportional scaling across all containers. Locate the
expect statement at line 51 that checks the size of the Set of rounded widths
using toBeGreaterThan(1), and change it to use toBeGreaterThanOrEqual(3)
instead. This verifies that at least 3 out of 4 container widths are distinct,
rather than just confirming they're not all identical. Optionally update the
assertion message from 'widths are not all identical' to 'most widths are
distinct' for better clarity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b4011d3b-415d-472a-995f-995ed40b316b

📥 Commits

Reviewing files that changed from the base of the PR and between f9c16e1 and 8c42293.

📒 Files selected for processing (11)
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/DomainPreview.svelte
  • configurator/src/components/Home.svelte
  • configurator/src/components/Icon.svelte
  • configurator/src/components/Sidebar.svelte
  • configurator/src/lib/domainPreviews.js
  • configurator/src/lib/domains.js
  • configurator/src/lib/icons.js
  • configurator/tests-components/domain-preview.test.js
  • configurator/tests-components/icon.test.js
  • configurator/tests-e2e/domain-preview.spec.js

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 11 files

You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

@jackgranatowski
jackgranatowski merged commit f3aef37 into main Jun 22, 2026
14 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.

2 participants