diff --git a/src/ui/desktop/DesktopApp.tsx b/src/ui/desktop/DesktopApp.tsx index d5c38610..478d4592 100644 --- a/src/ui/desktop/DesktopApp.tsx +++ b/src/ui/desktop/DesktopApp.tsx @@ -35,6 +35,12 @@ function AppContent() { const [rightSidebarOpen, setRightSidebarOpen] = useState(false); const [rightSidebarWidth, setRightSidebarWidth] = useState(400); + const isDarkMode = + theme === "dark" || + (theme === "system" && + window.matchMedia("(prefers-color-scheme: dark)").matches); + const lineColor = isDarkMode ? "#151517" : "#f9f9f9"; + const lastShiftPressTime = useRef(0); // DEBUG: Theme toggle - double-tap left Alt/Option to toggle light/dark mode @@ -194,14 +200,15 @@ function AppContent() { if (authLoading) { return (
@@ -310,16 +317,17 @@ function AppContent() { {isTransitioning && (
diff --git a/src/ui/desktop/authentication/Auth.tsx b/src/ui/desktop/authentication/Auth.tsx index 58e8e088..444a7fab 100644 --- a/src/ui/desktop/authentication/Auth.tsx +++ b/src/ui/desktop/authentication/Auth.tsx @@ -75,6 +75,12 @@ export function Auth({ const { t } = useTranslation(); const { theme, setTheme } = useTheme(); + const isDarkMode = + theme === "dark" || + (theme === "system" && + window.matchMedia("(prefers-color-scheme: dark)").matches); + const lineColor = isDarkMode ? "#151517" : "#f9f9f9"; + const isInElectronWebView = () => { if ((window as ExtendedWindow).IS_ELECTRON_WEBVIEW) { return true; @@ -771,7 +777,17 @@ export function Auth({ if (dbHealthChecking && !dbConnectionFailed) { return (
@@ -791,7 +807,17 @@ export function Auth({ if (dbConnectionFailed) { return (
{ - const isDark = theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches); + const isDark = + theme === "dark" || + (theme === "system" && + window.matchMedia("(prefers-color-scheme: dark)") + .matches); setTheme(isDark ? "light" : "dark"); }} > - {(theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches)) ? ( + {theme === "dark" || + (theme === "system" && + window.matchMedia("(prefers-color-scheme: dark)").matches) ? ( ) : ( @@ -880,8 +912,8 @@ export function Auth({ 45deg, transparent, transparent 35px, - rgba(128, 128, 128, 0.05) 35px, - rgba(128, 128, 128, 0.05) 37px + ${lineColor} 35px, + ${lineColor} 37px )`, }} > @@ -1376,11 +1408,20 @@ export function Auth({ size="icon" className="h-8 w-8" onClick={() => { - const isDark = theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches); + const isDark = + theme === "dark" || + (theme === "system" && + window.matchMedia( + "(prefers-color-scheme: dark)", + ).matches); setTheme(isDark ? "light" : "dark"); }} > - {(theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches)) ? ( + {theme === "dark" || + (theme === "system" && + window.matchMedia( + "(prefers-color-scheme: dark)", + ).matches) ? ( ) : (