Skip to content

refactor(configurator): flatten IA to one list with two depths - #367

Merged
jackgranatowski merged 3 commits into
mainfrom
claude/configurator-ia-simplify
Jun 21, 2026
Merged

refactor(configurator): flatten IA to one list with two depths#367
jackgranatowski merged 3 commits into
mainfrom
claude/configurator-ia-simplify

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Why

The configurator forced users to juggle five overlapping vocabularies: a global Basic/Advanced mode toggle, an Essentials subset, framework tier, token role (knob/consumption), and a fenced Power knobs bucket. ACSS v4 and Core Framework avoid all of this — one navigation axis (category), you set a few system inputs, the rest is derived, and depth is progressive disclosure inside each category. This PR adopts that model.

What changed

One list, two depths

  • Removed the global Basic/Advanced mode toggle entirely (header control, ui.mode, persistence, the b/a shortcuts, and the mode-guard effect).
  • The sidebar is now a single flat list: Overview + the full domain taxonomy. Every category is always reachable — depth lives inside each panel, not in the nav.

Inputs-first panels — each category leads with a Settings zone (one-click presets, brand colors, font stacks, scale generators, and the global multipliers as a plain "Scaling" group — no more amber "Power" fence). The full catalogue moves into a collapsed "Show all variables (N)" disclosure with the tier/modified/usage filters in its header. Domains with no curated Settings (e.g. Misc) render the catalogue inline so they're never a dead end. An active search collapses the panel to the filtered catalogue ("find any token in this category").

NamingBASIC_DOMAIN_IDSOVERVIEW_DOMAIN_IDS; domain powerIntroscaleIntro. Legacy persisted mode fields are ignored on restore.

Tests

  • Unit (node --test): 378 pass — updated domains.test.js, basics.test.js, ui-state.test.js.
  • Components (vitest): 6 pass.
  • svelte-check: 0 errors. Build + check:curation + check:version: green.
  • e2e specs rewritten for the flat IA (shell, a11y, presets, undo-redo, axe). Playwright browsers couldn't be downloaded in the build environment, so the e2e run is left to CI.

Robustness

Removing modes hides nothing — the "All variables" disclosure guarantees every token is one click away in every category, and the check-curation tripwire still ensures new framework knobs get a home.

🤖 Generated with Claude Code


Generated by Claude Code


Summary by cubic

Flattened the configurator to a single category list with two depths: Settings first, and a collapsed All variables catalogue in every panel. Removed Basic/Advanced, moved scaling knobs into Settings, and made search filter the catalogue.

  • Refactors

    • Removed ui.mode, the header toggle, mode guards, and B/A shortcuts; persistence no longer stores mode (legacy values are ignored).
    • Sidebar always shows Overview + the full taxonomy; [ and ] cycle that list.
    • Domain panels: Settings first (presets, brand colors, curated groups, generators, Scaling knobs). All variables sits under a collapsed disclosure with usage/tier/modified filters. Domains without settings render the catalogue inline. Search collapses the panel to the filtered catalogue.
    • Renamed BASIC_DOMAIN_IDSOVERVIEW_DOMAIN_IDS and domain powerIntroscaleIntro.
    • Updated tests, copy, and JSDoc; scoped brand-color inputs to .bcr__input and the a11y search assertion to .group .row.
  • Migration

    • Remove any references to ui.mode, mode-specific guards, and Basic/Advanced UI.
    • Replace BASIC_DOMAIN_IDS with OVERVIEW_DOMAIN_IDS.
    • Rename domain metadata powerIntro to scaleIntro.
    • Update shortcut docs (B/A removed).

Written for commit e53f3b3. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Overview landing screen for guided domain setup and theming
    • Added All Variables disclosure in domain panels for full token catalogue access
  • Changes

    • Removed Basic/Advanced complexity mode toggle from header
    • Restructured domain panels with dedicated Settings section and progressive full catalogue
    • Sidebar now always displays complete domain taxonomy
    • Updated keyboard shortcuts to cycle through all domains

Replace the Basic/Advanced complexity mode with a single, always-the-same
navigation axis (category) and progressive disclosure inside each panel.
Each category now leads with an inputs-first "Settings" surface (presets,
brand colors, font stacks, scale generators, global "Scaling" multipliers)
and a collapsed "All variables" disclosure exposes the full domain
catalogue, so every token stays one click away.

- Remove ui.mode and the header Basic/Advanced toggle; drop the mode guard,
  mode persistence and the b/a keyboard shortcuts (legacy persisted mode is
  ignored on restore).
- Sidebar always lists Overview + the full taxonomy; depth lives in the
  panel, not the nav.
- DomainPanel: two zones (Settings + All variables); scaling knobs move out
  of the fenced "Power knobs" details into Settings; search collapses the
  panel to the filtered catalogue. Domains with no curated Settings (e.g.
  Misc) render the catalogue inline.
- Rename BASIC_DOMAIN_IDS -> OVERVIEW_DOMAIN_IDS and domain powerIntro ->
  scaleIntro to match the new model.
- Update unit, component and e2e specs for the flat IA.

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

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Removes the Basic/Advanced (ui.mode) dual-mode model from the configurator. BASIC_DOMAIN_IDS is renamed to OVERVIEW_DOMAIN_IDS, powerIntro is replaced with scaleIntro, the ui store drops the mode field, DomainPanel is restructured into SETTINGS + ALL VARIABLES zones, the Header loses its mode segmented control, the Sidebar always shows the full taxonomy, and all related tests are updated.

Changes

Remove Basic/Advanced mode; introduce Overview + All Variables

Layer / File(s) Summary
Domain data contract: OVERVIEW_DOMAIN_IDS and scaleIntro
configurator/src/lib/domains.js
Renames BASIC_DOMAIN_IDSOVERVIEW_DOMAIN_IDS, replaces powerIntro with scaleIntro in six domain entries, and updates the JSDoc type shape.
Store and UI state sanitization: drop mode field
configurator/src/lib/store.svelte.js, configurator/src/lib/uiState.js
Removes mode from ui store initialization; sanitiseUiState accepts only 'home' or a valid domain id, ignores any stored mode, and narrows its return type.
App routing: home derivation, persistence, and keyboard cycling
configurator/src/App.svelte
Redefines home as ui.domain === 'home', persists domain (not mode) to localStorage, and sets [/] cycling to ['home', ...DOMAINS.map(d => d.id)].
Header, Sidebar, and Home screen: remove mode UI
configurator/src/components/Header.svelte, configurator/src/components/Sidebar.svelte, configurator/src/components/Home.svelte
Removes the Basic/Advanced segmented control from Header; Sidebar always shows full DOMAINS with "Overview" first; Home filters by OVERVIEW_DOMAIN_IDS and updates copy.
DomainPanel: two-zone SETTINGS + ALL VARIABLES layout
configurator/src/components/DomainPanel.svelte
Replaces Basic/Advanced branching with a SETTINGS zone (curated inputs) + a progressive-disclosure <details class="allvars"> zone; introduces catalogueVisible, hasSettings, showAll; adds filters() and catalogue() snippets and matching CSS.
Unit tests: OVERVIEW_DOMAIN_IDS, scaleIntro, sanitiseUiState
configurator/tests/basics.test.js, configurator/tests/domains.test.js, configurator/tests/ui-state.test.js
Replaces BASIC_DOMAIN_IDS/powerIntro references with OVERVIEW_DOMAIN_IDS/scaleIntro; adds assertions that mode is dropped, unknown domains are removed, and all domain ids are accepted.
E2E tests: flat taxonomy, allvars, scaling knobs, legacy restore
configurator/tests-e2e/shell.spec.js, configurator/tests-e2e/a11y.spec.js, configurator/tests-e2e/presets.spec.js, configurator/tests-e2e/undo-redo.spec.js, configurator/tests-e2e/axe.spec.js
Rewrites shell suite for flat NAV_LABELS sidebar; adds curated-vs-collapsed and Misc inline-catalogue tests; tests [/] full-taxonomy cycling and legacy mode restore; updates a11y for allvars overflow and search; updates presets/undo-redo for Settings Scaling knobs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#302: Introduced the Basic/Advanced mode segmented control and ui.mode state across App.svelte, Header.svelte, DomainPanel.svelte, and store.svelte.js—the exact logic this PR removes.
  • codeslash-dev/SLASHED#311: Refactored the same Basic/Advanced/Power configurator IA touching App.svelte, Sidebar.svelte, Home.svelte, DomainPanel.svelte, and domains.js/uiState—directly overlapping files and logic.
  • codeslash-dev/SLASHED#366: Modifies App.svelte/store.svelte.js persistence and lib/domains.js domain list structure (adding setup domain and ui.bundle), intersecting with this PR's removal of mode/BASIC_DOMAIN_IDS.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main architectural change: moving from a multi-layered, mode-based navigation system to a single flattened list with hierarchical depth within panels.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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-ia-simplify

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.

The flat-IA panel now always renders the full catalogue (collapsed in the
'All variables' disclosure), so the primary brand-color token has two inputs
with the same aria-label — the Settings brand row and the catalogue row.
Scope the two affected e2e locators to .bcr__input to resolve the
strict-mode violation.

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

@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: 2

🧹 Nitpick comments (2)
configurator/src/lib/store.svelte.js (1)

109-112: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

JSDoc return type is incomplete.

The sanitiseUiState function can also return uiTheme and bundle fields (see lines 44-50 in uiState.js), but the documented return type only mentions domain and outputMode.

📝 Suggested fix
- * `@returns` {{ domain?: string, outputMode?: string }}
+ * `@returns` {{ domain?: string, outputMode?: 'layer'|'root', uiTheme?: 'light'|'dark', bundle?: string }}
🤖 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/lib/store.svelte.js` around lines 109 - 112, The JSDoc
`@returns` type annotation for the `sanitiseUiState` function is incomplete.
Update the `@returns` line to include all four fields that the function returns:
`domain`, `outputMode`, `uiTheme`, and `bundle`, not just `domain` and
`outputMode`. Ensure the type annotations match the actual return types for each
field.
configurator/src/lib/uiState.js (1)

21-22: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

JSDoc return type is incomplete.

The return type documents only domain and outputMode, but the function also returns uiTheme and bundle fields (lines 44-50).

📝 Suggested fix
- * `@returns` {{ domain?: string, outputMode?: 'layer'|'root' }}
+ * `@returns` {{ domain?: string, outputMode?: 'layer'|'root', uiTheme?: 'light'|'dark', bundle?: string }}
🤖 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/lib/uiState.js` around lines 21 - 22, The JSDoc return type
annotation for the function starting at line 21 is incomplete and only documents
domain and outputMode properties. Update the `@returns` JSDoc type annotation to
include all properties that are actually returned by the function, specifically
adding uiTheme and bundle fields to the type definition alongside the existing
domain and outputMode properties to match what the function actually returns on
lines 44-50.
🤖 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/components/DomainPanel.svelte`:
- Around line 104-105: The showAll variable in DomainPanel maintains its open
state across domain navigation, breaking the expected collapsed-by-default
behavior. Reset the showAll variable to false whenever the active domain
changes. This should be done in a reactive context that detects when the domain
selection changes (around the code referenced in lines 279-286). Add logic to
set showAll back to its initial false state whenever a new domain becomes active
to ensure the disclosure state is reset for each domain.

In `@configurator/tests-e2e/a11y.spec.js`:
- Around line 81-82: The assertion on line 82 using page.locator('.row').first()
is too generic and can match rows outside the filtered catalogue, allowing the
test to pass even if catalogue rendering regresses. Instead of selecting the
first row anywhere on the page, scope the row assertion to specifically target
the first row within the filtered catalogue container. Use a more specific
selector that combines the catalogue context (such as a parent container that
wraps the filtered results) with the row selector to ensure you are validating
that rows are visible within the filtered catalogue results.

---

Nitpick comments:
In `@configurator/src/lib/store.svelte.js`:
- Around line 109-112: The JSDoc `@returns` type annotation for the
`sanitiseUiState` function is incomplete. Update the `@returns` line to include
all four fields that the function returns: `domain`, `outputMode`, `uiTheme`,
and `bundle`, not just `domain` and `outputMode`. Ensure the type annotations
match the actual return types for each field.

In `@configurator/src/lib/uiState.js`:
- Around line 21-22: The JSDoc return type annotation for the function starting
at line 21 is incomplete and only documents domain and outputMode properties.
Update the `@returns` JSDoc type annotation to include all properties that are
actually returned by the function, specifically adding uiTheme and bundle fields
to the type definition alongside the existing domain and outputMode properties
to match what the function actually returns on lines 44-50.
🪄 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: 51748001-f5f7-46d2-ad82-6c4b5917290a

📥 Commits

Reviewing files that changed from the base of the PR and between 25508e2 and 99df64e.

📒 Files selected for processing (16)
  • configurator/src/App.svelte
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/Header.svelte
  • configurator/src/components/Home.svelte
  • configurator/src/components/Sidebar.svelte
  • configurator/src/lib/domains.js
  • configurator/src/lib/store.svelte.js
  • configurator/src/lib/uiState.js
  • configurator/tests-e2e/a11y.spec.js
  • configurator/tests-e2e/axe.spec.js
  • configurator/tests-e2e/presets.spec.js
  • configurator/tests-e2e/shell.spec.js
  • configurator/tests-e2e/undo-redo.spec.js
  • configurator/tests/basics.test.js
  • configurator/tests/domains.test.js
  • configurator/tests/ui-state.test.js

Comment thread configurator/src/components/DomainPanel.svelte
Comment thread configurator/tests-e2e/a11y.spec.js Outdated

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

1 issue found and verified against the latest diff

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread configurator/src/lib/store.svelte.js Outdated
…gue assertion

- Expand the sanitiseUiState / loadUiState @returns JSDoc to include the
  uiTheme and bundle fields the validator actually returns (flagged by
  CodeRabbit and cubic).
- Scope the a11y search assertion to catalogue rows (.group .row) so it
  can't pass on stray rows. The catalogue renders outside the collapsed
  disclosure during search, so .group (TokenGroup) is the correct selector.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fg7U9rTiqBgbsPuz9kdWea
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