Skip to content

fix(configurator): dark palette swatches, token display, collapsed groups, cheatsheet - #434

Merged
jackgranatowski merged 3 commits into
mainfrom
claude/dark-palettes-ui-fixes-f7mmib
Jun 28, 2026
Merged

fix(configurator): dark palette swatches, token display, collapsed groups, cheatsheet#434
jackgranatowski merged 3 commits into
mainfrom
claude/dark-palettes-ui-fixes-f7mmib

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 28, 2026

Copy link
Copy Markdown
Contributor
  • ColorsPanel: replace broken themed-probe palette swatch approach with concrete
    color-mix() expressions computed from literal OKLCH source values; dark L/D
    rows now show visually distinct tints/shades instead of mirroring light
  • ColorsPanel: add getLightSurface/getDarkSurface/getLightText/getDarkText helpers
    and computePaletteSwatch() that bypasses CSS cascade issues entirely
  • OklchColorDesk: show full token name and OKLCH value instead of truncating;
    value moved below token name for clean layout
  • All panels: collapse every foldable group by default (showXxx = $state(false))
    across Colors, Typography, Spacing, Layout, Borders, Shadows, Motion, Effects,
    Macros, Misc, WCAG panels
  • DomainPanel: split cheatsheet domain from setup; cheatsheet now renders its
    own panel instead of ExportPanel
  • CheatsheetPanel: new searchable reference panel with CSS classes tab (232
    entries with kind, description, copy button) and CSS variables tab (686
    tokens grouped by category/group with role badges and copy button)
  • sync-api.mjs: also generate classes.generated.json from api-index class
    entries so the cheatsheet panel has structured data at build time

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01HNDMX9UPFoTYJeLxbD3xfC

Summary by CodeRabbit

  • New Features

    • Added a searchable cheatsheet view for browsing CSS classes and tokens, with tabs, grouping, copy actions, and empty-state handling.
    • Introduced a new generated class index to support the cheatsheet content.
  • Bug Fixes

    • Improved several color previews and swatches so they match rendered results more accurately.
    • Updated token and badge displays to show fuller values and clearer labels.
  • UI/UX

    • Many configuration sections now start collapsed by default, making the interface less cluttered on load.

claude added 2 commits June 28, 2026 00:32
…oups, cheatsheet

- ColorsPanel: replace broken themed-probe palette swatch approach with concrete
  color-mix() expressions computed from literal OKLCH source values; dark L/D
  rows now show visually distinct tints/shades instead of mirroring light
- ColorsPanel: add getLightSurface/getDarkSurface/getLightText/getDarkText helpers
  and computePaletteSwatch() that bypasses CSS cascade issues entirely
- OklchColorDesk: show full token name and OKLCH value instead of truncating;
  value moved below token name for clean layout
- All panels: collapse every foldable group by default (showXxx = $state(false))
  across Colors, Typography, Spacing, Layout, Borders, Shadows, Motion, Effects,
  Macros, Misc, WCAG panels
- DomainPanel: split cheatsheet domain from setup; cheatsheet now renders its
  own panel instead of ExportPanel
- CheatsheetPanel: new searchable reference panel with CSS classes tab (232
  entries with kind, description, copy button) and CSS variables tab (686
  tokens grouped by category/group with role badges and copy button)
- sync-api.mjs: also generate classes.generated.json from api-index class
  entries so the cheatsheet panel has structured data at build time

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

coderabbitai Bot commented Jun 28, 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 42 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: c4a2f031-3768-4097-9f7c-b454159592ae

📥 Commits

Reviewing files that changed from the base of the PR and between 38a09f8 and 1fb3ac5.

📒 Files selected for processing (3)
  • configurator/scripts/sync-api.mjs
  • configurator/src/components/panels/CheatsheetPanel.svelte
  • configurator/src/components/panels/ColorsPanel.svelte
📝 Walkthrough

Walkthrough

Adds a sync-api.mjs step that generates classes.generated.json from api-index.json, introduces a new CheatsheetPanel Svelte component with searchable class/token tabs and copy buttons, wires it into DomainPanel, reworks ColorsPanel palette swatch computation to use color-mix() expressions, collapses all configurator panel sections by default, and updates the badge gzip size.

Changes

Cheatsheet Feature

Layer / File(s) Summary
Class catalogue generator and generated data
configurator/scripts/sync-api.mjs, configurator/src/data/classes.generated.json
sync-api.mjs adds a CLASSES_OUT path and a generation step that filters type: "class" entries (excluding INTERNAL), projects fields, sorts by name, and writes the result; the generated JSON contains the full classes array with metadata.
CheatsheetPanel component
configurator/src/components/panels/CheatsheetPanel.svelte
New component loads classes and tokens datasets, reactively filters and groups by category/group, and renders searchable tabs with copy-to-clipboard buttons for selectors and var(<token>) names.
DomainPanel wiring
configurator/src/components/DomainPanel.svelte
Imports CheatsheetPanel and routes the "cheatsheet" domain branch to it, separating it from the "setup" branch that still renders ExportPanel.

ColorsPanel Palette Swatch Computation

Layer / File(s) Summary
Endpoint and swatch helpers
configurator/src/components/panels/ColorsPanel.svelte
Adds functions to derive light/dark surface and text endpoints from overrides and to compute a swatch color by building and resolving a color-mix(in oklab, ...) expression.
Brand, status, curve, and mini palette rendering
configurator/src/components/panels/ColorsPanel.svelte
All palette swatch strips, status strips, shade/curve preview steps, and mini palettes replace paintTheme(var(--sf-color-…)) probing with computePaletteSwatch calls using derived endpoints.

Panel Collapse Defaults and Minor UI Tweaks

Layer / File(s) Summary
Collapse-by-default across all panels
configurator/src/components/panels/Border..., Effects..., Layout..., Macros..., Misc..., Motion..., Shadows..., Spacing..., Typography..., WcagPanel.svelte
All panel $state visibility toggles changed from true to false so sections start collapsed.
OklchColorDesk label and badge
configurator/src/components/inputs/OklchColorDesk.svelte, badges/badge-optimal.json
Removes shortName/value truncation in the compact swatch label; updates badge gzip message from 36.4 kB to 17.4 kB.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#351: Regenerates api-index annotations that directly populate the classes and description fields consumed by CheatsheetPanel.
  • codeslash-dev/SLASHED#430: Also modifies ColorsPanel.svelte to change how palette preview swatches are computed via the preview resolver.
  • codeslash-dev/SLASHED#433: Introduces the collapsible section infrastructure in the same panel components whose defaults this PR flips to false.

Suggested labels

codex

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly captures the main configurator UI changes: palette swatches, token display, collapsed panels, and the new cheatsheet.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/dark-palettes-ui-fixes-f7mmib

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.

@coderabbitai coderabbitai Bot added the codex label Jun 28, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

fix(configurator): dark palette swatches, token display, collapsed groups, cheatsheet
🐞 Bug fix ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

Description

• Fix dark palette swatch rendering in ColorsPanel by replacing CSS-cascade-dependent var() probe
 with concrete color-mix(in oklab, …) expressions computed from literal OKLCH source values
• Add new CheatsheetPanel with searchable CSS classes (232 entries) and CSS variables (686 tokens)
 tabs, each with kind/role badges and copy buttons; split from ExportPanel in DomainPanel
• Collapse all foldable panel groups by default ($state(false)) across 10 panels (Colors,
 Typography, Spacing, Layout, Borders, Shadows, Motion, Effects, Macros, Misc, WCAG)
• Fix OklchColorDesk token display to show full token name and OKLCH value on separate lines
 instead of truncating
• Extend sync-api.mjs build script to generate classes.generated.json from api-index class
 entries for cheatsheet data
• Update badge to reflect new 17.4 kB gzip bundle size
Diagram

graph TD
    syncApi["sync-api.mjs"] --> classesJson["classes.generated.json"]
    syncApi --> apiIndex["api-index.generated.json"]

    DomainPanel["DomainPanel"] --> CheatsheetPanel["CheatsheetPanel"]
    DomainPanel --> ExportPanel["ExportPanel"]

    CheatsheetPanel --> classesJson
    CheatsheetPanel --> apiIndex

    ColorsPanel["ColorsPanel"] --> computeSwatch(["computePaletteSwatch()"])
    computeSwatch --> colorMix{{"color-mix() expr"}}

    OklchColorDesk["OklchColorDesk"] --> tokenDisplay["Full token + OKLCH value"]

    subgraph Legend
      direction LR
      _file["Svelte Component"] ~~~ _fn(["Helper Function"]) ~~~ _data{{"CSS Expression"}} ~~~ _json["Generated JSON"]
    end
Loading
High-Level Assessment

The PR's approach is well-suited to the problem. Using concrete color-mix(in oklab, …) expressions computed from literal OKLCH values is the correct fix for dark palette swatches — the previous CSS cascade probe approach was fundamentally broken in the configurator's dark-mode context. The new CheatsheetPanel correctly separates concerns from ExportPanel and uses build-time generated JSON for performance. Collapsing groups by default is a straightforward UX improvement. No meaningful alternative approaches were identified.

Files changed (17) +2698 / -74

Enhancement (12) +283 / -54
sync-api.mjsGenerate classes.generated.json from api-index class entries +26/-0

Generate classes.generated.json from api-index class entries

• Adds a new output file 'classes.generated.json' that projects non-INTERNAL class entries from the api-index (name, selector, kind, category, group, description, optional, layer) sorted alphabetically. This provides structured build-time data for the new CheatsheetPanel.

configurator/scripts/sync-api.mjs

BordersPanel.svelteCollapse all border panel groups by default +7/-7

Collapse all border panel groups by default

• Changes all 7 'showXxx' state variables from '$state(true)' to '$state(false)' so all foldable groups start collapsed.

configurator/src/components/panels/BordersPanel.svelte

CheatsheetPanel.svelteNew searchable CSS classes and CSS variables reference panel +203/-0

New searchable CSS classes and CSS variables reference panel

• Introduces a 203-line Svelte component with a search input, tab switcher (CSS classes / CSS vars), and scrollable grouped lists. Classes show selector, kind badge, optional badge, and description with a copy button. Tokens show name, role/tier badges, value, and description with a copy-var() button. Data is sourced from the generated JSON files at build time.

configurator/src/components/panels/CheatsheetPanel.svelte

EffectsPanel.svelteCollapse all effects panel groups by default +6/-6

Collapse all effects panel groups by default

• Changes all 6 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/EffectsPanel.svelte

LayoutPanel.svelteCollapse all layout panel groups by default +6/-6

Collapse all layout panel groups by default

• Changes all 6 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/LayoutPanel.svelte

MacrosPanel.svelteCollapse all macros panel groups by default +5/-5

Collapse all macros panel groups by default

• Changes all 5 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/MacrosPanel.svelte

MiscPanel.svelteCollapse all misc panel groups by default +7/-7

Collapse all misc panel groups by default

• Changes all 7 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/MiscPanel.svelte

MotionPanel.svelteCollapse all motion panel groups by default +7/-7

Collapse all motion panel groups by default

• Changes all 7 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/MotionPanel.svelte

ShadowsPanel.svelteCollapse all shadows panel groups by default +4/-4

Collapse all shadows panel groups by default

• Changes all 4 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/ShadowsPanel.svelte

SpacingPanel.svelteCollapse all spacing panel groups by default +4/-4

Collapse all spacing panel groups by default

• Changes all 4 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/SpacingPanel.svelte

TypographyPanel.svelteCollapse all typography panel groups by default +6/-6

Collapse all typography panel groups by default

• Changes all 6 'showXxx' state variables from '$state(true)' to '$state(false)'.

configurator/src/components/panels/TypographyPanel.svelte

WcagPanel.svelteCollapse WCAG pair checker and matrix groups by default +2/-2

Collapse WCAG pair checker and matrix groups by default

• Changes 'showPairChecker' and 'showMatrix' from '$state(true)' to '$state(false)'.

configurator/src/components/panels/WcagPanel.svelte

Bug fix (3) +86 / -19
DomainPanel.svelteRoute 'cheatsheet' domain to new CheatsheetPanel instead of ExportPanel +4/-1

Route 'cheatsheet' domain to new CheatsheetPanel instead of ExportPanel

• Imports 'CheatsheetPanel' and splits the previously combined 'setup || cheatsheet' condition into two separate branches so the cheatsheet domain renders its own dedicated panel.

configurator/src/components/DomainPanel.svelte

OklchColorDesk.svelteShow full token name and OKLCH value without truncation +2/-2

Show full token name and OKLCH value without truncation

• Removes the 'truncate' class from the short name line and adds a new line below it to display the full OKLCH value, replacing the previously truncated inline value display.

configurator/src/components/inputs/OklchColorDesk.svelte

ColorsPanel.svelteFix dark palette swatches using concrete color-mix() expressions +80/-16

Fix dark palette swatches using concrete color-mix() expressions

• Replaces the broken themed-probe 'var(--sf-color-*-step)' approach with four new helper functions ('getLightSurface', 'getDarkSurface', 'getLightText', 'getDarkText') and a 'computePaletteSwatch()' function that builds explicit 'color-mix(in oklab, …)' expressions from literal OKLCH source values. Also collapses 'showBrandSources', 'showTextContrast', and 'showShadeCurve' groups by default.

configurator/src/components/panels/ColorsPanel.svelte

Other (2) +2329 / -1
badge-optimal.jsonUpdate optimal bundle badge to 17.4 kB gzip +1/-1

Update optimal bundle badge to 17.4 kB gzip

• Updates the badge message to reflect the new optimized bundle size of 17.4 kB gzip, down from 36.4 kB.

badges/badge-optimal.json

classes.generated.jsonAdd generated CSS class catalogue (232 entries) for CheatsheetPanel +2328/-0

Add generated CSS class catalogue (232 entries) for CheatsheetPanel

• New build-time generated file containing 232 CSS class entries (name, selector, kind, category, group, description, optional, layer) derived from the api-index. Consumed by CheatsheetPanel at runtime.

configurator/src/data/classes.generated.json

@qodo-code-review

qodo-code-review Bot commented Jun 28, 2026

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 6 rules

Grey Divider


Remediation recommended

1. Empty classes not detected ✓ Resolved 🐞 Bug ☼ Reliability
Description
configurator/scripts/sync-api.mjs writes classes.generated.json without validating that any class
entries were extracted, so an upstream api-index schema/data change can produce an empty cheatsheet
while the build still succeeds. This is inconsistent with the token path, which explicitly fails on
an empty token set.
Code

configurator/scripts/sync-api.mjs[R263-287]

+  // Class catalogue for the cheatsheet — project class entries from api-index.
+  const classes = entries
+    .filter((e) => e && e.type === 'class' && e.tier !== 'INTERNAL')
+    .map((e) => ({
+      name: e.name,
+      selector: e.selector || `.${e.name}`,
+      kind: e.kind || '',
+      category: e.category || 'Other',
+      group: e.group || '',
+      description: e.description || '',
+      optional: !!e.optional,
+      layer: e.layer || null,
+    }))
+    .sort((a, b) => a.name.localeCompare(b.name));
+
+  const classesOut = {
+    _sync: { generatedBy: 'configurator/scripts/sync-api.mjs', source: out._sync.source },
+    classes,
+  };
+  fs.writeFileSync(CLASSES_OUT, JSON.stringify(classesOut, null, 2) + '\n', 'utf8');
+  console.log(
+    `[configurator:sync] ${path.relative(FRAMEWORK_ROOT, CLASSES_OUT)} ← ` +
+      `${out._sync.source} (${classes.length} classes)`
+  );
+
Relevance

⭐⭐⭐ High

sync-api.mjs already hard-fails on empty tokens; team favors failing loudly on bad upstream schema
(PR285).

PR-#285

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The script explicitly exits when tokens.length === 0, but the new classes generation path has no
analogous check and will write an empty list without failing.

configurator/scripts/sync-api.mjs[202-287]

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

### Issue description
`sync-api.mjs` now generates `classes.generated.json`, but unlike the token catalogue it does not guard against an empty result. If `raw.entries` stops containing `type: "class"` rows (schema drift / generation failure), the cheatsheet silently becomes empty.

### Issue Context
The script already treats an empty token set as a build-time error; classes should be handled similarly since CheatsheetPanel relies on this file.

### Fix Focus Areas
- configurator/scripts/sync-api.mjs[202-287]

### Suggested change
After computing `classes`, add a non-empty validation similar to the `tokens.length === 0` guard, e.g.:
- if `classes.length === 0`, print an actionable error mentioning missing `type: "class"` entries / schema change and `process.exit(1)`.
Optionally, include the source path in the message (same as tokens) to aid debugging.

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



Informational

2. Unwrapped token/value strings 🐞 Bug ⚙ Maintainability
Description
OklchColorDesk now renders the full token name and full OKLCH value without any truncation or
word-breaking, so long unbroken strings can overflow or visually crowd the row in narrow sidebars.
This is a UI robustness regression relative to the previous truncate behavior.
Code

configurator/src/components/inputs/OklchColorDesk.svelte[R64-65]

+      <div class="text-[9px] font-mono text-slate-500">{shortName}</div>
+      <div class="text-[9px] font-mono text-slate-600">{value}</div>
Relevance

⭐⭐ Medium

Team fixes overflow issues (PR315/308), but showing full token/value was intentional; unclear if
they’ll re-add truncation.

PR-#315
PR-#308

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The token/value lines are plain text in a flex row with no truncate, break-*, or
overflow-hidden classes, so long unbroken strings have no way to wrap cleanly.

configurator/src/components/inputs/OklchColorDesk.svelte[53-66]

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

### Issue description
`OklchColorDesk` removed truncation and added an extra value line, but the rendered mono strings (token shortName and OKLCH value) have no wrapping/overflow strategy. Long unbroken strings can overflow their container.

### Issue Context
The component is used throughout Colors/Status panels where sidebar width can be constrained.

### Fix Focus Areas
- configurator/src/components/inputs/OklchColorDesk.svelte[53-66]

### Suggested change
Keep showing the full strings, but add a wrapping strategy such as:
- add `break-all` / `break-words` (or `overflow-wrap:anywhere`) to the token/value lines, and/or
- add `overflow-hidden` with `text-ellipsis` only if you decide truncation is still acceptable.
Also consider adding `title={shortName}` / `title={value}` for easy full-text hover when wrapped.

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


Grey Divider

Qodo Logo

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

🧹 Nitpick comments (1)
configurator/src/components/panels/ColorsPanel.svelte (1)

290-314: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use one source-value helper for all palette inputs.

The main brand row uses sourceTokenMap as a fallback, but endpoint helpers, status rows, curve preview, and mini palettes fall back directly to hard-coded defaults. Extracting one lookup path prevents those previews from drifting if token defaults change.

♻️ Suggested consolidation
+  function getSourceValue(colorKey: string, side: "light" | "dark", fallback = ""): string {
+    const name = `--sf-color-${colorKey}-source-${side}`;
+    return overrides[name]
+      ?? sourceTokenMap[name]?.value
+      ?? BRAND_SOURCES.find((s) => s.name === name)?.default
+      ?? STATUS_SOURCES.find((s) => s.name === name)?.default
+      ?? fallback;
+  }
+
   function getLightSurface(): string {
-    return overrides["--sf-color-base-source-light"] ?? "oklch(0.96 0.006 250)";
+    return getSourceValue("base", "light", "oklch(0.96 0.006 250)");
   }

Also applies to: 409-412, 568-569, 666-671, 781-785

🤖 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/panels/ColorsPanel.svelte` around lines 290 -
314, Consolidate palette input lookup so all preview helpers use the same
source-value path as the main brand row, instead of mixing `sourceTokenMap` and
hard-coded defaults. Update the endpoint helpers in
`ColorsPanel.svelte`—including `getLightSurface`, `getDarkSurface`,
`getLightText`, `getDarkText`, and the other referenced
preview/curve/mini-palette helpers—to resolve values through one shared helper
that checks `sourceTokenMap` first and only then falls back to defaults. Keep
the existing helper names and call sites, but route them through the shared
lookup so token default changes stay consistent across all previews.
🤖 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/scripts/sync-api.mjs`:
- Around line 263-286: The class catalogue generation in sync-api.mjs can
silently write an empty classes.generated.json, so add a hard failure in the
classes build path when classes.length is zero after filtering/mapping api-index
entries. Update the logic around the classes pipeline and the
fs.writeFileSync/console.log block to validate the result before writing, and
throw or exit with a clear error message if no class entries are produced. Use
the existing classes, classesOut, and out._sync.source symbols to place the
check in the same flow so upstream api-index drift fails the sync instead of
shipping a blank cheatsheet panel.

In `@configurator/src/components/panels/CheatsheetPanel.svelte`:
- Around line 135-139: The copy buttons in CheatsheetPanel.svelte are only
revealed on hover, which hides the copy affordance on touch and keyboard users.
Update the button styling/behavior in the copy selector and other matching copy
actions (including the one near the later copy block) so they are visible or
otherwise discoverable without hover, while still preserving any hover
enhancement.
- Around line 56-60: The copy success state in copyText should not be reset by
an earlier timeout when users copy again quickly. Update the timeout handling in
CheatsheetPanel’s copyText function to clear any existing reset timer before
scheduling a new one, and keep a reusable timer reference alongside the copied
state so the latest copy action controls when copied is cleared.

In `@configurator/src/components/panels/ColorsPanel.svelte`:
- Around line 326-327: The swatch fallback in ColorsPanel.svelte is returning
the raw sourceColor when resolveColor(expr) is empty, which collapses all
non-500 shades to one color. Update the logic around the color-mix expression so
the helper that builds the mix returns expr when resolution fails, allowing the
browser to render the computed mix directly instead of falling back to
sourceColor.

---

Nitpick comments:
In `@configurator/src/components/panels/ColorsPanel.svelte`:
- Around line 290-314: Consolidate palette input lookup so all preview helpers
use the same source-value path as the main brand row, instead of mixing
`sourceTokenMap` and hard-coded defaults. Update the endpoint helpers in
`ColorsPanel.svelte`—including `getLightSurface`, `getDarkSurface`,
`getLightText`, `getDarkText`, and the other referenced
preview/curve/mini-palette helpers—to resolve values through one shared helper
that checks `sourceTokenMap` first and only then falls back to defaults. Keep
the existing helper names and call sites, but route them through the shared
lookup so token default changes stay consistent across all previews.
🪄 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: 6f48b973-be03-4ab2-bd3e-c4f9575231be

📥 Commits

Reviewing files that changed from the base of the PR and between 5c23cb2 and 38a09f8.

📒 Files selected for processing (17)
  • badges/badge-optimal.json
  • configurator/scripts/sync-api.mjs
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/inputs/OklchColorDesk.svelte
  • configurator/src/components/panels/BordersPanel.svelte
  • configurator/src/components/panels/CheatsheetPanel.svelte
  • configurator/src/components/panels/ColorsPanel.svelte
  • configurator/src/components/panels/EffectsPanel.svelte
  • configurator/src/components/panels/LayoutPanel.svelte
  • configurator/src/components/panels/MacrosPanel.svelte
  • configurator/src/components/panels/MiscPanel.svelte
  • configurator/src/components/panels/MotionPanel.svelte
  • configurator/src/components/panels/ShadowsPanel.svelte
  • configurator/src/components/panels/SpacingPanel.svelte
  • configurator/src/components/panels/TypographyPanel.svelte
  • configurator/src/components/panels/WcagPanel.svelte
  • configurator/src/data/classes.generated.json

Comment thread configurator/scripts/sync-api.mjs
Comment thread configurator/src/components/panels/CheatsheetPanel.svelte Outdated
Comment thread configurator/src/components/panels/CheatsheetPanel.svelte
Comment thread configurator/src/components/panels/ColorsPanel.svelte Outdated
- sync-api.mjs: guard against empty class catalogue — exit(1) if no
  type:"class" entries found, matching the existing token guard
- CheatsheetPanel: fix copy timer race — clear previous timeout before
  scheduling a new one so rapid copies don't prematurely clear the
  success state
- CheatsheetPanel: copy buttons are now always visible at 40% opacity
  (hover raises to 100%) instead of fully hidden until hover, so they
  are discoverable on touch and keyboard
- ColorsPanel: fall back to the concrete color-mix() expression instead
  of sourceColor when resolveColor() returns empty — allows the browser
  to paint the computed mix directly rather than collapsing all non-500
  steps to the source hue

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