From 622af7e0b388e1e7951b672fb6a73ef0f934f27e Mon Sep 17 00:00:00 2001 From: Anso Date: Fri, 5 Jun 2026 17:34:38 -0400 Subject: [PATCH] fix(theme): make sheets and dialogs track the active theme (#1315) * fix(theme): make sheets and dialogs track the active theme Portaled panels (scan-history and other sheets, dialogs, confirm modals) only partially followed the theme: their popover surface was a flat per-theme literal, so OLED mode never reached true black inside them and the contrast control did not move their fill. The accent stopped at the thin rail because the ambient glow was painted only on the main app shell, never inside a portaled panel, and the overlay scrim was a hardcoded black. - Derive the popover surface from per-theme lightness and alpha plus the contrast spread, the same way the page background is derived, so every floating surface tones with the active theme (including OLED true black) and deepens with contrast. Dim and Light are unchanged at the default contrast. - Add an accent wash to sheets and large dialogs so the chosen accent reads inside them, matching the page. Small dropdowns and tooltips keep the themed tone without the wash. - Replace the hardcoded modal and sheet scrim with a theme-aware token that softens to a light dim in the Light theme. Tested across Dim, OLED, and Light with multiple accents and contrast levels. * fix(theme): keep the command palette token-only (no accent wash) The command palette renders through DialogContent, so it picked up the accent wash meant for content sheets and dialogs. It is a command menu, so it should stay token-only like dropdowns and tooltips. Add an optional panelGlow flag to DialogContent (on by default, so every other dialog is unchanged) and turn it off for the palette. --- frontend/src/components/ui/alert-dialog.tsx | 4 +-- frontend/src/components/ui/command.tsx | 4 ++- frontend/src/components/ui/dialog.tsx | 7 ++--- frontend/src/components/ui/sheet.tsx | 4 +-- frontend/src/index.css | 30 +++++++++++++++++++-- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/ui/alert-dialog.tsx b/frontend/src/components/ui/alert-dialog.tsx index 7f5c44b8..2ac4345c 100644 --- a/frontend/src/components/ui/alert-dialog.tsx +++ b/frontend/src/components/ui/alert-dialog.tsx @@ -14,7 +14,7 @@ const AlertDialogOverlay = React.forwardRef< >(({ className, ...props }, ref) => ( { return ( - + {/* The command palette is a menu/list surface, so it stays token-only like + dropdowns and tooltips: no accent wash behind the results. */} + {children} diff --git a/frontend/src/components/ui/dialog.tsx b/frontend/src/components/ui/dialog.tsx index 996cf0ae..2cb68319 100644 --- a/frontend/src/components/ui/dialog.tsx +++ b/frontend/src/components/ui/dialog.tsx @@ -20,14 +20,15 @@ import { // while delegating animation to animate-ui's spring-based dialog const DialogContent = React.forwardRef< HTMLDivElement, - React.ComponentProps & { showClose?: boolean } ->(({ className, children, showClose = true, ...props }, ref) => ( + React.ComponentProps & { showClose?: boolean; panelGlow?: boolean } +>(({ className, children, showClose = true, panelGlow = true, ...props }, ref) => ( - + (({ className, ...props }, ref) => (