diff options
| author | Adam Malczewski <[email protected]> | 2026-10-21 20:32:41 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-10-21 20:32:41 +0900 |
| commit | bac1e1c39398ddcb0866db510c11bed75ac3a9a8 (patch) | |
| tree | 5b2bde4e1db4683290ea0c1a42eb61c498a06402 /src/features/tabs/ui | |
| parent | 564b2c1d03cf477d7cfc23414b60d1ec76904ecc (diff) | |
| download | dispatch-web-bac1e1c39398ddcb0866db510c11bed75ac3a9a8.tar.gz dispatch-web-bac1e1c39398ddcb0866db510c11bed75ac3a9a8.zip | |
feat(tabs): rotate three theme colours per group nesting level
Diffstat (limited to 'src/features/tabs/ui')
| -rw-r--r-- | src/features/tabs/ui/TabGroupBox.svelte | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/features/tabs/ui/TabGroupBox.svelte b/src/features/tabs/ui/TabGroupBox.svelte index a941814..f9a3ae2 100644 --- a/src/features/tabs/ui/TabGroupBox.svelte +++ b/src/features/tabs/ui/TabGroupBox.svelte @@ -1,7 +1,7 @@ <script lang="ts"> import type { Snippet } from "svelte"; import type { TabGroupNode } from "../tab-groups"; - import { groupBleedPx, lastRowIsGroup } from "../tab-groups"; + import { groupBleedPx, groupTone, lastRowIsGroup } from "../tab-groups"; import type { Tab } from "../tabs"; import TabGroupBox from "./TabGroupBox.svelte"; @@ -13,9 +13,11 @@ * inside stay on the same two columns as top-level cards: every card keeps * identical dimensions at every depth. The padding is EQUAL on all four * sides (= the bleed) so the box looks even — except below a nested box on - * the last row, where it is trimmed to match that box's side gaps. Every - * box paints a 15% secondary (lavender) tint, which compounds: each - * nesting level reads a little stronger than the one around it. + * the last row, where it is trimmed to match that box's side gaps. Each + * box is tinted with one of three theme colours ROTATING by level + * (`groupTone`), painted OPAQUE (mixed into the sidebar well colour) so a + * nested box never blends with the box around it, plus a border in the same + * colour so every box edge reads at a glance. */ let { node, @@ -32,6 +34,7 @@ } = $props(); const bleed = $derived(groupBleedPx(level, maxDepth)); + const tone = $derived(groupTone(level)); // Even spacing: when the last row is a nested box, the gap below it would // be this box's full padding while its side gaps are only the DIFFERENCE // in bleed (the nested box bleeds outward too) — trim the bottom to match. @@ -41,13 +44,15 @@ </script> <div - class="col-span-2 rounded-lg bg-secondary/15" + class="tab-group-box col-span-2 rounded-lg" + style:--group-tone="var(--color-{tone})" style:margin-inline="-{bleed}px" style:padding="{bleed}px {bleed}px {padBottom}px" role="group" aria-label={`Subagents of ${node.tab.title}`} data-tab-group={node.tab.conversationId} data-level={level} + data-tone={tone} > <div class="grid grid-flow-row-dense grid-cols-2 gap-1.5"> {@render card(node.tab, true, node.children.length)} @@ -60,3 +65,17 @@ {/each} </div> </div> + +<style> + /* Opaque tint: the tone mixed into the sidebar's `.inset-well` colour (the + surface the tab grid sits on), so nested boxes replace — never compound + with — the colour around them. */ + .tab-group-box { + background-color: color-mix( + in oklab, + var(--group-tone) 16%, + var(--inset-well-bg, var(--color-base-200)) + ); + box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--group-tone) 55%, transparent); + } +</style> |
