From 9a838ff2626d1a685edd2fb437caa7faf6ebf068 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Tue, 6 Oct 2026 09:30:18 -0700 Subject: [PATCH] feat: a dev workspace's badge wears its fork's own colour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every surface that names a dev workspace drew the same blue badge, which said nothing about which workspace it belonged to. One component, DevWorkspaceBadge, now draws it: a fork with a colour fills the badge with that hue and writes the label in white, and a fork without one keeps whatever its row had before. The hue cannot carry white at a fixed lightness — HSL lightness is not perceived brightness, so yellow and purple at the same L differ by several stops — so forkAccentStyle solves the badge's lightness by bisection instead, taking the lightest shade of the hue that still holds white at WCAG AA. Measured across the wheel the contrast lands between 4.52 and 4.64. The session picker opens with every family collapsed, since the fork a session runs in is the session's own and not something that picker should offer to change. Co-Authored-By: Claude Opus 5 (1M context) --- .../lib/components/DevWorkspaceBadge.svelte | 55 +++++++++++ .../lib/components/DevWorkspaceSetting.svelte | 4 +- .../components/WorkspaceScopeTrigger.svelte | 16 +-- .../sessions/SessionDiffDrawer.svelte | 5 +- .../components/sessions/SessionPicker.svelte | 13 ++- .../sessions/WorkspaceFamilyPicker.svelte | 17 ++-- .../sidebar/WorkspacePickerBody.svelte | 30 ++++-- .../components/workspace/WorkspaceCard.svelte | 15 +-- frontend/src/lib/utils/forkColor.ts | 97 ++++++++++++++++++- 9 files changed, 205 insertions(+), 47 deletions(-) create mode 100644 frontend/src/lib/components/DevWorkspaceBadge.svelte diff --git a/frontend/src/lib/components/DevWorkspaceBadge.svelte b/frontend/src/lib/components/DevWorkspaceBadge.svelte new file mode 100644 index 0000000000..e699732c4c --- /dev/null +++ b/frontend/src/lib/components/DevWorkspaceBadge.svelte @@ -0,0 +1,55 @@ + + + +{devBadgeText(label)} diff --git a/frontend/src/lib/components/DevWorkspaceSetting.svelte b/frontend/src/lib/components/DevWorkspaceSetting.svelte index e148d90c22..a050ff55e5 100644 --- a/frontend/src/lib/components/DevWorkspaceSetting.svelte +++ b/frontend/src/lib/components/DevWorkspaceSetting.svelte @@ -1,6 +1,7 @@