From 6311b5a94ab5f3ae0729709f0afd50ec80f52996 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Jul 2026 16:40:39 +0000 Subject: [PATCH 1/4] fix(configurator): add per-category reset button, fix invisible reset icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire up the panel header with a "Reset N" button that clears just the active category's overrides (the matching logic already existed unused in DomainPanel.svelte). Also fix per-token reset controls that relied on bare `opacity-0 group-hover:opacity-100`, which never becomes visible on touch devices or via keyboard focus — apply the same opacity-100 below `sm:`, group-focus-within/focus fallback already used correctly in ThemesPanel.svelte across TokenRow, SliderRow, PowerKnobRow, and the inline reset buttons in MiscPanel/TypographyPanel/MotionPanel. --- configurator/src/App.svelte | 32 +++++++++++++++++-- .../src/components/DomainPanel.svelte | 15 --------- .../src/components/inputs/PowerKnobRow.svelte | 2 +- .../src/components/inputs/SliderRow.svelte | 4 +-- .../src/components/inputs/TokenRow.svelte | 2 +- .../src/components/panels/MiscPanel.svelte | 2 +- .../src/components/panels/MotionPanel.svelte | 2 +- .../components/panels/TypographyPanel.svelte | 8 ++--- 8 files changed, 39 insertions(+), 28 deletions(-) diff --git a/configurator/src/App.svelte b/configurator/src/App.svelte index 3c3f068b..54d5c672 100644 --- a/configurator/src/App.svelte +++ b/configurator/src/App.svelte @@ -1,6 +1,6 @@ {#if NO_CONTROLS_TAB.has(domain)} diff --git a/configurator/src/components/inputs/PowerKnobRow.svelte b/configurator/src/components/inputs/PowerKnobRow.svelte index 1f239ad5..f6bdaa6b 100644 --- a/configurator/src/components/inputs/PowerKnobRow.svelte +++ b/configurator/src/components/inputs/PowerKnobRow.svelte @@ -36,7 +36,7 @@ {#if isOverridden} diff --git a/configurator/src/components/inputs/SliderRow.svelte b/configurator/src/components/inputs/SliderRow.svelte index 0b58b2a6..837dc944 100644 --- a/configurator/src/components/inputs/SliderRow.svelte +++ b/configurator/src/components/inputs/SliderRow.svelte @@ -57,14 +57,14 @@ class={`text-[9px] font-mono cursor-pointer transition-all px-0.5 ${ showRaw ? 'text-indigo-400' - : 'opacity-0 group-hover:opacity-100 text-slate-500 hover:text-indigo-400' + : 'opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100 focus:opacity-100 text-slate-500 hover:text-indigo-400' }`} ></> {/if} {#if overridden} {/if} diff --git a/configurator/src/components/inputs/TokenRow.svelte b/configurator/src/components/inputs/TokenRow.svelte index 9807e872..464c9f5b 100644 --- a/configurator/src/components/inputs/TokenRow.svelte +++ b/configurator/src/components/inputs/TokenRow.svelte @@ -86,7 +86,7 @@ {#if isOverridden} diff --git a/configurator/src/components/panels/MiscPanel.svelte b/configurator/src/components/panels/MiscPanel.svelte index 00adbf1b..e8fc861a 100644 --- a/configurator/src/components/panels/MiscPanel.svelte +++ b/configurator/src/components/panels/MiscPanel.svelte @@ -333,7 +333,7 @@
Underline thickness {#if "--sf-link-underline-thickness" in overrides} - + {/if}
diff --git a/configurator/src/components/panels/MotionPanel.svelte b/configurator/src/components/panels/MotionPanel.svelte index 1157fea3..b25dff18 100644 --- a/configurator/src/components/panels/MotionPanel.svelte +++ b/configurator/src/components/panels/MotionPanel.svelte @@ -288,7 +288,7 @@
Stagger base {#if STAGGER_TOKENS.some(t => t in overrides)} - + {/if}
{row.label} weight {#if isOverridden} - + {/if}
@@ -615,7 +615,7 @@
{row.label} {#if row.token in overrides} - + {/if}
@@ -692,7 +692,7 @@
{row.label} weight {#if isOverridden} - + {/if}
@@ -796,7 +796,7 @@
{t.label} {#if t.token in overrides} - + {/if}
Date: Wed, 1 Jul 2026 17:27:51 +0000 Subject: [PATCH 2/4] fix(configurator): scope category reset by domainOf(), not raw pattern overlap domainPatterns.some(p => k.includes(p)) matched against the active domain's own pattern list in isolation, but DOMAIN_PATTERNS substrings overlap across domains (e.g. layout's "-bg-" also appears in color tokens like --sf-color-bg--active). Resetting Layout could therefore wipe out unrelated Colors overrides. Use domainOf(k) === domain instead, the same classifier already used for the sidebar override badges, so the reset button only ever touches keys that actually belong to the active category. (caught by automated review on codeslash-dev/SLASHED#468) --- configurator/src/App.svelte | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/configurator/src/App.svelte b/configurator/src/App.svelte index 54d5c672..3d753411 100644 --- a/configurator/src/App.svelte +++ b/configurator/src/App.svelte @@ -9,7 +9,7 @@ import DomainPanel from './components/DomainPanel.svelte'; import { fa } from './lib/codec'; import { loadInitialOverrides, injectLivePreview, saveOverrides, hasWpBoot } from './lib/persistence'; - import { domainOf, DOMAIN_PATTERNS } from './lib/domains'; + import { domainOf } from './lib/domains'; import tokensRaw from './data/api-index.generated.json'; import CommandPalette from './components/CommandPalette.svelte'; @@ -58,12 +58,13 @@ // Derived let overridesCount = $derived(Object.keys(overrides).length); let domainBadges = $derived(overridesByDomain(overrides)); - // Token-name substrings that scope the active category, used to reset just - // that category's overrides (falls back to the raw domain key when no - // pattern list exists, e.g. for the non-token panels like home/themes). - let domainPatterns = $derived(DOMAIN_PATTERNS[domain] ?? [domain]); + // Scope the active category's reset to exactly the keys domainOf() would + // badge under this domain — matching against the domain's own pattern list + // directly would over-match, since patterns overlap across domains (e.g. + // layout's "-bg-" also appears in color tokens like --sf-color-bg--active, + // which domainOf() resolves to "colors" by checking that domain first). let domainOverridesCount = $derived( - Object.keys(overrides).filter((k) => domainPatterns.some((p) => k.includes(p))).length + Object.keys(overrides).filter((k) => domainOf(k) === domain).length ); let canUndo = $derived(past.length > 0); let canRedo = $derived(future.length > 0); @@ -154,7 +155,7 @@ function handleResetDomain() { const patch: Record = {}; for (const k of Object.keys(overrides)) { - if (domainPatterns.some((p) => k.includes(p))) patch[k] = null; + if (domainOf(k) === domain) patch[k] = null; } handleBulkChange(patch); } From ccdcbe04bd436942ffdee2fdce68f8edf867a477 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Jul 2026 17:55:21 +0000 Subject: [PATCH 3/4] fix(configurator): align All-tokens badge count with domainOf() scoping domainOverridesInTokenTab still filtered by raw DOMAIN_PATTERNS substring matching after 205f9ab switched the "Reset N" count to domainOf(k) === domain, so the two could disagree for overlapping tokens (e.g. --sf-color-bg--active matches layout's "-bg-" pattern but domainOf() resolves it to colors). Use the same domainOf() predicate here so both counts always agree. (caught by automated review on codeslash-dev/SLASHED-Plugins#128) --- configurator/src/components/DomainPanel.svelte | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configurator/src/components/DomainPanel.svelte b/configurator/src/components/DomainPanel.svelte index b051f6fc..8df3e773 100644 --- a/configurator/src/components/DomainPanel.svelte +++ b/configurator/src/components/DomainPanel.svelte @@ -1,7 +1,7 @@ From 081e9d815ce902c13f2735c7a44914af9af6288d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Jul 2026 18:41:37 +0000 Subject: [PATCH 4/4] refactor(configurator): dedupe domain-scoped override key filter domainOverridesCount and handleResetDomain each recomputed Object.keys(overrides).filter(k => domainOf(k) === domain) independently. Extract the shared domainOverrideKeys derived so both consumers stay guaranteed in sync as the logic evolves. (nitpick from automated review on codeslash-dev/SLASHED#468) --- configurator/src/App.svelte | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/configurator/src/App.svelte b/configurator/src/App.svelte index 3d753411..6b5d3b7d 100644 --- a/configurator/src/App.svelte +++ b/configurator/src/App.svelte @@ -63,9 +63,10 @@ // directly would over-match, since patterns overlap across domains (e.g. // layout's "-bg-" also appears in color tokens like --sf-color-bg--active, // which domainOf() resolves to "colors" by checking that domain first). - let domainOverridesCount = $derived( - Object.keys(overrides).filter((k) => domainOf(k) === domain).length + let domainOverrideKeys = $derived( + Object.keys(overrides).filter((k) => domainOf(k) === domain) ); + let domainOverridesCount = $derived(domainOverrideKeys.length); let canUndo = $derived(past.length > 0); let canRedo = $derived(future.length > 0); @@ -154,9 +155,7 @@ function handleResetDomain() { const patch: Record = {}; - for (const k of Object.keys(overrides)) { - if (domainOf(k) === domain) patch[k] = null; - } + for (const k of domainOverrideKeys) patch[k] = null; handleBulkChange(patch); }