Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: sidebar color edge cases in system/dark mode with vibrancy

Louis Beaumont09ffe5988873
diff --git a/apps/screenpipe-app-tauri/app/globals.css b/apps/screenpipe-app-tauri/app/globals.css
index f3e040921..b87658ba7 100644
--- a/apps/screenpipe-app-tauri/app/globals.css
+++ b/apps/screenpipe-app-tauri/app/globals.css
@@ -357,11 +357,18 @@
/* Vibrant sidebar theme — Minimal macOS backdrop */
.vibrant-sidebar {
/* CRITICAL FIX for macOS WKWebView backdrop-filter flicker */
- background-color: rgba(0, 0, 0, 0.15) !important;
+ background-color: rgba(0, 0, 0, 0.08) !important;
border-color: transparent;
}
.dark .vibrant-sidebar {
- background-color: rgba(0, 0, 0, 0.15) !important;
+ background-color: rgba(255, 255, 255, 0.06) !important;
+ }
+
+ /* System dark mode fallback — covers the gap before JS applies .dark class */
+ @media (prefers-color-scheme: dark) {
+ html:not(.light) .vibrant-sidebar {
+ background-color: rgba(255, 255, 255, 0.06) !important;
+ }
}
.vibrant-sidebar-border {
border-color: transparent;
diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsx
index a317cbd84..163a5b5af 100644
--- a/apps/screenpipe-app-tauri/app/home/page.tsx
+++ b/apps/screenpipe-app-tauri/app/home/page.tsx
@@ -474,7 +474,7 @@ function SettingsPageContent() {
title={manualMeeting ? "stop meeting" : "start meeting"}
>
{manualMeeting && (
- <span className="absolute -top-0.5 -right-0.5 h-1.5 w-1.5 rounded-full bg-red-500 animate-pulse" />
+ <span className="absolute -top-0.5 -right-0.5 h-1.5 w-1.5 rounded-full bg-foreground animate-pulse" />
)}
<Phone className="h-3.5 w-3.5" />
</button>
@@ -558,12 +558,12 @@ function SettingsPageContent() {
<div className={cn(
"transition-colors flex-shrink-0",
isActive
- ? isTranslucent ? "" : "text-primary"
- : isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground"
+ ? isTranslucent ? "vibrant-sidebar-fg" : "text-primary"
+ : isTranslucent ? "vibrant-sidebar-fg-muted" : "text-muted-foreground group-hover:text-foreground"
)}>
{section.icon}
</div>
- {!sidebarCollapsed && <span className={cn("text-sm truncate", isActive && isTranslucent ? "font-semibold" : "font-medium")}>{section.label}</span>}
+ {!sidebarCollapsed && <span className={cn("text-sm truncate", isActive && isTranslucent ? "font-semibold vibrant-sidebar-fg" : "font-medium")}>{section.label}</span>}
</button>
);
if (sidebarCollapsed) {
diff --git a/apps/screenpipe-app-tauri/components/theme-provider.tsx b/apps/screenpipe-app-tauri/components/theme-provider.tsx
index dbf68eb10..103f2b8f7 100644
--- a/apps/screenpipe-app-tauri/components/theme-provider.tsx
+++ b/apps/screenpipe-app-tauri/components/theme-provider.tsx
@@ -31,11 +31,22 @@ export function ThemeProvider({
storageKey = "screenpipe-ui-theme",
...props
}: ThemeProviderProps) {
- const [theme, setThemeState] = useState<ColorTheme | undefined>(undefined);
- const [isLoaded, setIsLoaded] = useState(false);
+ const [theme, setThemeState] = useState<ColorTheme | undefined>(() => {
+ // Read theme synchronously on first render to avoid flash
+ if (typeof window === "undefined") return undefined;
+ try {
+ const stored = localStorage?.getItem(storageKey) as ColorTheme;
+ return stored || "system";
+ } catch {
+ return "system";
+ }
+ });
+ const [isLoaded, setIsLoaded] = useState(() => typeof window !== "undefined");
const { updateSettings } = useSettings();
useEffect(() => {
+ // Fallback for SSR or edge cases where initializer didn't run
+ if (theme && isLoaded) return;
try {
const storedTheme = localStorage?.getItem(storageKey) as ColorTheme;
if (storedTheme) {
@@ -47,7 +58,7 @@ export function ThemeProvider({
setThemeState("system");
}
setIsLoaded(true);
- }, [storageKey]);
+ }, [storageKey, theme, isLoaded]);
useEffect(() => {
if (!theme || !isLoaded) return;