chore: merge wave 1 (plan 11-01) with conflict resolution

This commit is contained in:
ZacharyZhang-NY committed 2026-03-27 22:08:16 -04:00
commit 2ed5dd3388
6 files changed
+880 -175

No files matched your search

+15 -2
View File
@@ -383,11 +383,24 @@ export function App() {
useEffect(() => {
if (!snapshot) return;
const root = document.documentElement;
root.dataset.theme = snapshot.theme;
root.style.colorScheme = snapshot.theme === "system" ? "light dark" : snapshot.theme;
const applyTheme = () => {
const isDark = snapshot.theme === "dark" ||
(snapshot.theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
root.classList.toggle("dark", isDark);
root.style.colorScheme = isDark ? "dark" : "light";
};
applyTheme();
if (snapshot.locale && snapshot.locale !== locale) {
setLocale(snapshot.locale);
}
if (snapshot.theme === "system") {
const mq = window.matchMedia("(prefers-color-scheme: dark)");
mq.addEventListener("change", applyTheme);
return () => mq.removeEventListener("change", applyTheme);
}
}, [snapshot, locale]);
useEffect(() => {