diff --git a/configurator/src/App.svelte b/configurator/src/App.svelte index 38f054ce..d8308f17 100644 --- a/configurator/src/App.svelte +++ b/configurator/src/App.svelte @@ -59,17 +59,6 @@ // Transient feedback after an import (the old flow failed silently). let importStatus = $state(null); let importStatusTimer: ReturnType | null = null; - - function navigateTo(domainId: string, token?: string) { - domain = domainId; - if (token) { - focusNonce += 1; - focusRequest = { token, nonce: focusNonce }; - } else { - focusRequest = null; - } - mobileView = "controls"; - } // On narrow screens the controls panel and the live preview can't both fit, so // we show one at a time and let the user fold between them (desktop shows both). let mobileView = $state<"controls" | "preview">("controls"); @@ -340,7 +329,7 @@
{ navigateTo(d); }} + onSelect={(d) => { domain = d; }} overridesByDomain={domainBadges} />
@@ -378,7 +367,7 @@ onReset={handleReset} onBulkChange={handleBulkChange} onApplyTheme={handleApplyTheme} - onSelectDomain={(d) => { navigateTo(d); }} + onSelectDomain={(d) => { domain = d; }} onResetAll={handleResetAll} /> @@ -412,7 +401,10 @@ tokens={ALL_TOKENS} {overrides} onNavigate={(d, token) => { - navigateTo(d, token); + domain = d; + if (token) { focusNonce += 1; focusRequest = { token, nonce: focusNonce }; } + // On mobile, deep-linking into a token means we want the controls side. + mobileView = "controls"; }} onClose={() => { showPalette = false; }} /> diff --git a/configurator/src/components/CommandPalette.svelte b/configurator/src/components/CommandPalette.svelte index 38ab1aaf..708a5ac1 100644 --- a/configurator/src/components/CommandPalette.svelte +++ b/configurator/src/components/CommandPalette.svelte @@ -24,17 +24,11 @@ // Navigation destinations — makes this a real command palette (jump to any // panel/tool), not just a token search. - const NAV_ALIASES: Record = { - borders: ["border", "radius", "shape"], shadows: ["shadow", "depth"], - effects: ["effect"], wcag: ["accessibility", "contrast"], - themes: ["theme", "preset"], setup: ["install", "export"], - cheatsheet: ["reference", "classes"], misc: ["system"], - }; const NAV = [ "home", "colors", "typography", "spacing", "borders", "motion", "layout", "depth", "macros", "components", "misc", "changes", "wcag", "themes", "setup", "cheatsheet", - ].map((id) => ({ id, label: DOMAIN_LABELS[id] ?? id, terms: [id, ...(NAV_ALIASES[id] ?? [])] })); + ].map((id) => ({ id, label: DOMAIN_LABELS[id] ?? id })); type Result = | { kind: "nav"; id: string; label: string } @@ -44,9 +38,7 @@ const q = query.trim().toLowerCase(); // Navigation matches (all destinations when empty, so the palette is useful // before typing). - const nav: Result[] = (q ? NAV.filter((n) => - n.label.toLowerCase().includes(q) || n.terms.some((term) => term.includes(q)) - ) : NAV) + const nav: Result[] = (q ? NAV.filter((n) => n.label.toLowerCase().includes(q)) : NAV) .map((n) => ({ kind: "nav", id: n.id, label: n.label })); const tokenMatches: Result[] = []; @@ -110,7 +102,7 @@
No matches for "{query}"
{:else} {#each results as r, i (r.kind === "nav" ? `nav:${r.id}` : `tok:${r.token.name}`)} - {#if i === 0 && navCount > 0} + {#if i === 0}
Go to
{/if} {#if r.kind === "token" && i === navCount} diff --git a/configurator/src/components/panels/ComponentsPanel.svelte b/configurator/src/components/panels/ComponentsPanel.svelte index 1fc15164..5ad2028a 100644 --- a/configurator/src/components/panels/ComponentsPanel.svelte +++ b/configurator/src/components/panels/ComponentsPanel.svelte @@ -1,4 +1,5 @@