From e7d46737ab85e48e86c55cadb9f72593dbcce9d4 Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 29 Jul 2026 23:54:05 +0200 Subject: [PATCH] web/components: make the button group match the figma segmented control a joined group is a tab switcher, but the selected segment was the plain default variant, which reads as the hovered state of an unselected one, and the group itself drew nothing. per figma (design system 605:3859): the group owns the outer border and a recessed background-subtle surface, the selected segment is default + its inset shadow so it reads as a raised card, and unselected segments are ghost with the default foreground rather than ghost's muted one. each segment's own border is pulled onto the group's (-m-px) so the selected segment's edge doubles as the divider and unselected segments show no divider at all. segmentProps() carries the recipe so the call sites stop repeating the variant ternary. verified pixel for pixel against the figma render: 36px tall, #e5e7eb border on all four edges, #ffffff on the selected segment against #f9fafb on the unselected, a 1px divider at the selected segment's edge, and the inset shadow two rows above the bottom border. ghost's own foreground is still muted where it's used outside a group, which figma disagrees with; that's a wider change, left alone here. Signed-off-by: eti --- .../repo/issues/IssueToolbar.svelte | 6 ++-- .../components/ui/ButtonGroup.stories.svelte | 14 ++++++++- web/src/lib/components/ui/ButtonGroup.svelte | 29 +++++++++++++++++-- .../lib/components/ui/MarkdownEditor.svelte | 6 ++-- 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/web/src/lib/components/repo/issues/IssueToolbar.svelte b/web/src/lib/components/repo/issues/IssueToolbar.svelte index 24c527a8..dd07c791 100644 --- a/web/src/lib/components/repo/issues/IssueToolbar.svelte +++ b/web/src/lib/components/repo/issues/IssueToolbar.svelte @@ -4,7 +4,7 @@ import CircleX from "$icon/circle-x"; import Plus from "$icon/plus"; import Button from "$lib/components/ui/Button.svelte"; - import ButtonGroup from "$lib/components/ui/ButtonGroup.svelte"; + import ButtonGroup, { segmentProps } from "$lib/components/ui/ButtonGroup.svelte"; import IssueSearch from "./IssueSearch.svelte"; interface Props { @@ -33,7 +33,7 @@