From 1f39a5676bb8b312e6d36414d9607a4e0222e0d6 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 4 Jun 2026 22:55:58 +0200 Subject: [PATCH] fix(temas/color): group on-solid by Roles/Intents (not white/dark) The previous split was by the text pick (white/dark) - wrong. Group the on-solid chips by the SAME taxonomy as the Roles section: Jerarquia (primary/secondary/ tertiary) and Intents (neutral/affirm/fulfill/risk/threat/loss), reusing GROUPS. Removed the now-unused onSolidGroups derived. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/routes/temas/color/+page.svelte | 30 ++++++----------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/web/routes/temas/color/+page.svelte b/web/routes/temas/color/+page.svelte index 9d905dc17..3ae6fd571 100644 --- a/web/routes/temas/color/+page.svelte +++ b/web/routes/temas/color/+page.svelte @@ -194,17 +194,6 @@ return out }) - // Split the roles by their on-solid TEXT pick (white vs dark) — the 2 groups. - const onSolidGroups = $derived.by((): { white: ColorRole[]; dark: ColorRole[] } => { - const white: ColorRole[] = [] - const dark: ColorRole[] = [] - for (const role of COLOR_ROLES) { - if (onSolidInfo(role).picked === 'dark') dark.push(role) - else white.push(role) - } - return { white, dark } - }) - interface BuilderRole { role: string steps: string[] @@ -501,9 +490,8 @@ El color del texto SOBRE el sólido (--color-{'{role}'}-contrast). El motor prefiere blanco salvo que falle el suelo APCA (|Lc| < 60) o WCAG (< 3) — entonces voltea a oscuro. El chip usa los tokens REALES; el pie muestra - el cálculo APCA en vivo. Se agrupan por el pick — texto blanco (sólidos - oscuros) y texto oscuro (sólidos claros); con el tema base solo risk va a - oscuro. + el cálculo APCA en vivo, agrupado en jerarquía e intents + como arriba. Solo voltea a oscuro en sólidos claros (con el tema base, solo risk).

{#snippet chipFor(role: ColorRole)} @@ -516,18 +504,12 @@ on-solid: {info.picked} · |Lc| {Math.abs(info.lc).toFixed(0)} · WCAG {info.wcag.toFixed(2)} {/snippet} - {#if onSolidGroups.white.length} -
Texto blanco ({onSolidGroups.white.length})
-
- {#each onSolidGroups.white as role}{@render chipFor(role)}{/each} -
- {/if} - {#if onSolidGroups.dark.length} -
Texto oscuro ({onSolidGroups.dark.length})
+ {#each GROUPS as group} +
{group.label} ({group.roles.length})
- {#each onSolidGroups.dark as role}{@render chipFor(role)}{/each} + {#each group.roles as role}{@render chipFor(role)}{/each}
- {/if} + {/each}