From 433f7196760e5d76f77ea6d5464ee7f1b602a4ee Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Fri, 4 Sep 2026 13:02:01 -0500 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20tab=20=E2=9C=95=20fade=20lands?= =?UTF-8?q?=20on=20the=20visible=20field=20under=20Glass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under Window Translucency → Glass, the glass block sets the surface tokens transparent so is the sole painter. A tab's `--tab-face` read those tokens, so the ✕ runway resolved to transparent→transparent and the chip's `bg-(--tab-face)` painted nothing: hovering showed a bare ✕ over un-faded text, with no gradient at all. Add a `data-glass-field` contract beside the block's existing `data-glass-opaque` / `data-glass-raised`: a declarer receives `--glass-field`, the same body mix glass already paints. The tab prefers it and falls back to its own surface token (`--tab-surface`, which TAB_ACTIVE / TAB_IDLE now set instead of `--tab-bg` so they feed the chain rather than bypass it). Face, hover-darken, and the selection wash all inherit the one base. Inert with glass off: the fallback resolves to the exact opaque surface it did before. --- apps/desktop/src/components/ui/pane-tab.tsx | 12 +++++++++--- apps/desktop/src/styles.css | 10 ++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/components/ui/pane-tab.tsx b/apps/desktop/src/components/ui/pane-tab.tsx index 5eb64e4e02..b115563a66 100644 --- a/apps/desktop/src/components/ui/pane-tab.tsx +++ b/apps/desktop/src/components/ui/pane-tab.tsx @@ -16,8 +16,13 @@ export const PANE_TAB_STRIP_LINE_RIGHT = 'shadow-[inset_-1px_0_0_var(--ui-stroke // the label after every wash lands. The hover close-button gradient fades into // it, so the fade is seamless on any theme. Idle hover repaints it below with // the same color-mix the darkening wash applies. +// +// `--tab-bg` is the base every wash mixes onto. Under Glass the surface tokens +// are transparent and the field is what shows through a tab, so the +// base prefers `--glass-field` (styles.css sets it only under glass, on +// `data-glass-field` declarers) and falls back to the tab's own surface token. const TAB = - 'group/tab relative flex shrink-0 items-center border-transparent bg-(--tab-bg) text-[0.6875rem] font-medium [-webkit-app-region:no-drag] [--tab-face:var(--tab-bg)]' + 'group/tab relative flex shrink-0 items-center border-transparent bg-(--tab-bg) text-[0.6875rem] font-medium [-webkit-app-region:no-drag] [--tab-face:var(--tab-bg)] [--tab-bg:var(--glass-field,var(--tab-surface))]' // Full height: with the strip's rule removed there is no last-pixel row to // leave uncovered, so tabs fill the bar and no sliver of gutter shows through. @@ -31,7 +36,7 @@ const TAB_CLOSEABLE = 'min-w-13' const TAB_VERTICAL = 'w-full max-h-48 justify-center not-first:border-t not-first:border-t-(--ui-stroke-quaternary) [writing-mode:vertical-rl]' -const TAB_ACTIVE = 'h-full text-foreground [--tab-bg:var(--pane-tab-active-bg,var(--ui-editor-surface-background))]' +const TAB_ACTIVE = 'h-full text-foreground [--tab-surface:var(--pane-tab-active-bg,var(--ui-editor-surface-background))]' // Horizontal only: the active tab is the sole seam on the strip — a // theme-primary underline drawn as an inset shadow in its own last pixel row, @@ -44,7 +49,7 @@ const TAB_ACTIVE_UNDERLINE = 'shadow-[inset_0_-2px_0_var(--pane-tab-active-accen // a darkening wash to register at all. `--tab-face` tracks the wash — the same // mix flattened onto `--tab-bg` — so the close gradient matches what shows. const TAB_IDLE = - 'text-(--ui-text-tertiary) [--tab-bg:var(--pane-tab-strip-bg,var(--ui-sidebar-surface-background))] hover:shadow-[inset_0_0_0_100vmax_color-mix(in_srgb,#000_var(--ui-tab-hover-darken),transparent)] hover:[--tab-face:color-mix(in_srgb,#000_var(--ui-tab-hover-darken),var(--tab-bg))] hover:text-(--ui-text-secondary)' + 'text-(--ui-text-tertiary) [--tab-surface:var(--pane-tab-strip-bg,var(--ui-sidebar-surface-background))] hover:shadow-[inset_0_0_0_100vmax_color-mix(in_srgb,#000_var(--ui-tab-hover-darken),transparent)] hover:[--tab-face:color-mix(in_srgb,#000_var(--ui-tab-hover-darken),var(--tab-bg))] hover:text-(--ui-text-secondary)' // A tab riding a multi-tab selection: an accent wash over whatever surface the // tab sits on. A background-image gradient (not a shadow) so it stacks cleanly @@ -117,6 +122,7 @@ export const PaneTab = React.forwardRef(function P )} data-active={active} data-closeable={(onClose && !vertical) || undefined} + data-glass-field="" data-selected={selected || undefined} data-vertical={vertical || undefined} onClickCapture={event => { diff --git a/apps/desktop/src/styles.css b/apps/desktop/src/styles.css index c0583524d3..c0ff2b7cb8 100644 --- a/apps/desktop/src/styles.css +++ b/apps/desktop/src/styles.css @@ -617,6 +617,16 @@ background: color-mix(in srgb, var(--ui-bg-chrome) var(--translucency-glass-keep, 100%), transparent); } + /* A surface that FADES INTO the field (a pane tab's hover ✕ runway) declares + `data-glass-field` and reads `--glass-field` for its endpoint. Under glass + the surface tokens are transparent, so a fade aimed at one goes + transparent→transparent and the runway vanishes; the field is the + mix above, so that is what a fade must land on. Inert with glass off: + the caller's own fallback (its surface token) applies. */ + :root[data-hermes-glass] [data-glass-field] { + --glass-field: color-mix(in srgb, var(--ui-bg-chrome) var(--translucency-glass-keep, 100%), transparent); + } + /* Sidebar scope (the Finder shape): glass rail, opaque content column. stays the one painter but splits at the rail's visual edge — the store publishes it as --glass-rail-edge (live-tracked through collapse