From ac6a0afdc7be689b922262aa91ef73dba11f2148 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Mon, 17 Aug 2026 18:36:47 +0200 Subject: [PATCH] fix(app): calm the segmented control's selected segment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The selected segment was an inverted fill — theme foreground behind surface0 text — which in dark mode dropped a white slab into thin chrome like the file toolbar, and the fully rounded corners made it read as a lozenge rather than a tab. It now uses a surface3 fill with foreground text, and each segment takes the corner radius of the button at its size tier. Segments also drop one padding step below the equivalent button. The gap between segments already supplies the visual padding, so matching button padding made the track wider than it needed to be and ate the breathing room around it in a 32px toolbar row. Selection changes colour only. No weight or size change, so labels never reflow as you switch segments. Carries the buttonControlHeight extraction that was already sitting in control-geometry.ts, since the two files could not be split apart cleanly for this commit. Its callers stay uncommitted. --- docs/design.md | 2 +- .../components/ui/control-geometry.test.ts | 28 +++++++++++++------ .../app/src/components/ui/control-geometry.ts | 27 +++++++++++------- .../src/components/ui/segmented-control.tsx | 6 ++-- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/docs/design.md b/docs/design.md index 5eb619a66..af1bdfb93 100644 --- a/docs/design.md +++ b/docs/design.md @@ -64,7 +64,7 @@ The button is `