fix: dark mode toggle and search auth headers (#102)
Dark mode: - Toggle now applies data-theme='dark' attribute to <html> - Theme applied immediately on page load to prevent FOUC - Comprehensive dark mode CSS covering all UI components: sidebar, top bar, search, file cards, list view, context menus, modals, dialogs, notifications, user menu, etc. Search: - Add Authorization headers to all search API fetch calls (searchFiles, advancedSearch, clearSearchCache) - Fix missing checkbox column in search results list header
This commit is contained in:
+7
-4
@@ -188,11 +188,14 @@ function setupUserMenu() {
|
||||
});
|
||||
}
|
||||
|
||||
// Theme toggle (dark mode placeholder — toggles pill visually)
|
||||
// Theme toggle (dark mode)
|
||||
if (themeBtn) {
|
||||
const pill = document.getElementById('theme-toggle-pill');
|
||||
const isDark = localStorage.getItem('oxicloud_theme') === 'dark';
|
||||
if (isDark && pill) pill.classList.add('active');
|
||||
if (isDark) {
|
||||
if (pill) pill.classList.add('active');
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
}
|
||||
|
||||
themeBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
@@ -200,10 +203,10 @@ function setupUserMenu() {
|
||||
pill.classList.toggle('active');
|
||||
const dark = pill.classList.contains('active');
|
||||
localStorage.setItem('oxicloud_theme', dark ? 'dark' : 'light');
|
||||
// Theme switching could be expanded here in the future
|
||||
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light');
|
||||
window.ui.showNotification(
|
||||
dark ? '🌙' : '☀️',
|
||||
dark ? 'Dark mode enabled (coming soon)' : 'Light mode enabled'
|
||||
dark ? 'Dark mode enabled' : 'Light mode enabled'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user