diff --git a/desktop/src/features/settings/ui/SettingsPanels.tsx b/desktop/src/features/settings/ui/SettingsPanels.tsx index cb6c6d13df..e9773e4a33 100644 --- a/desktop/src/features/settings/ui/SettingsPanels.tsx +++ b/desktop/src/features/settings/ui/SettingsPanels.tsx @@ -1,4 +1,4 @@ -import { useMemo } from "react"; +import { useMemo, useState } from "react"; import { BellRing, Bot, @@ -261,30 +261,31 @@ function PairedThemeTile({ return ( - - - - {formatThemeLabel( - lightName.replace(/-(?:light|latte|dawn|lotus|ochin)$/, ""), - )} - - {isActive ? : null} - + + {formatThemeLabel( + lightName.replace(/-(?:light|latte|dawn|lotus|ochin)$/, ""), + )} + ); } @@ -303,24 +304,28 @@ function SingleThemeTile({ return ( - - - - - {formatThemeLabel(name)} - - {isActive ? : null} - + + + {formatThemeLabel(name)} + ); } @@ -362,6 +367,14 @@ function ThemeSettingsCard() { setFollowSystem(false); }; + const [expandedSections, setExpandedSections] = useState< + Record + >({}); + + const toggleSection = (key: string) => { + setExpandedSections((prev) => ({ ...prev, [key]: !prev[key] })); + }; + return ( - - Adapts to system - + + + Adapts to system + + {pairedLight.length > 4 && ( + toggleSection("paired")} + type="button" + > + {expandedSections.paired ? "Collapse" : "Show all"} + + )} + Automatically switches between light and dark with your system preferences. - + {pairedLight.map((lightName) => { const darkName = getThemePair(lightName); if (!darkName) return null; @@ -402,11 +432,28 @@ function ThemeSettingsCard() { {/* Section 2: Light-only themes */} {lightOnly.length > 0 && ( - Light + + Light + {lightOnly.length > 4 && ( + toggleSection("light")} + type="button" + > + {expandedSections.light ? "Collapse" : "Show all"} + + )} + Always uses a light appearance. - + {lightOnly.map((name) => ( 0 && ( - Dark + + Dark + {darkOnly.length > 4 && ( + toggleSection("dark")} + type="button" + > + {expandedSections.dark ? "Collapse" : "Show all"} + + )} + Always uses a dark appearance. - + {darkOnly.map((name) => (
Automatically switches between light and dark with your system preferences.
Always uses a light appearance.
Always uses a dark appearance.