feat(portal): add light/dark theme sync and OA drive navigation
Memind CI / Test, build, and release guards (push) Successful in 4m31s

Unify chat and OA drive appearance with shared memind-theme storage, default light mode, and cross-frame sync so users can switch themes from chat or the drive shell.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-09-10 20:10:06 +08:00
parent 97a3e89ff7
commit 3e6b0c262a
10 changed files with 520 additions and 128 deletions
+26
View File
@@ -0,0 +1,26 @@
export type MemindTheme = 'light' | 'dark';
export const THEME_STORAGE_KEY = 'memind-theme';
export function getStoredTheme(): MemindTheme {
const stored = localStorage.getItem(THEME_STORAGE_KEY);
return stored === 'dark' ? 'dark' : 'light';
}
export function applyTheme(theme: MemindTheme) {
const normalized: MemindTheme = theme === 'dark' ? 'dark' : 'light';
document.documentElement.dataset.theme = normalized;
document.documentElement.style.colorScheme = normalized;
localStorage.setItem(THEME_STORAGE_KEY, normalized);
window.dispatchEvent(new CustomEvent('memind-theme-change', { detail: { theme: normalized } }));
}
export function initTheme() {
applyTheme(getStoredTheme());
}
export function toggleTheme(): MemindTheme {
const next: MemindTheme = getStoredTheme() === 'light' ? 'dark' : 'light';
applyTheme(next);
return next;
}