Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: mount the accessible theme menu (#5132)

[._.]/ Adam Eivy40b9b3bc471c
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index b0d9f6982c..3b45b717f7 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -130,6 +130,7 @@ import { useSidebarSeries } from '../hooks/useSidebarSeries.js';
import { useSidebarUniverses } from '../hooks/useSidebarUniverses.js';
import { useThemeContext } from './ThemeContext';
import NotificationDropdown from './NotificationDropdown';
+import ThemeSwitcher from './ThemeSwitcher';
import VoiceToggleButton from './voice/VoiceToggleButton';
import CmdKSearch from './CmdKSearch';
import KeyboardHelp from './KeyboardHelp';
@@ -1280,6 +1281,7 @@ export default function Layout() {
<Monitor size={18} />
</NavLink>
<ThemeModeToggle />
+ <ThemeSwitcher className={collapsed ? 'lg:hidden' : ''} />
<VoiceToggleButton className={collapsed ? 'lg:hidden' : ''} />
<NotificationDropdown
notifications={notifications}
@@ -1400,6 +1402,7 @@ export default function Layout() {
<Monitor size={18} />
</NavLink>
<ThemeModeToggle />
+ <ThemeSwitcher position="below" />
<VoiceToggleButton />
</div>
</header>
diff --git a/client/src/components/ThemeSwitcher.jsx b/client/src/components/ThemeSwitcher.jsx
index 4d38bde2e8..c6de048f51 100644
--- a/client/src/components/ThemeSwitcher.jsx
+++ b/client/src/components/ThemeSwitcher.jsx
@@ -34,10 +34,10 @@ export default function ThemeSwitcher({ position = 'above', className = '' }) {
useEscapeKey(open, () => close(true));
useEffect(() => {
- if (!open) return;
+ if (!open || !menuStyle) return;
const selected = menuRef.current?.querySelector(`${ITEM_SELECTOR}[aria-checked="true"]`);
(selected ?? menuRef.current?.querySelector(ITEM_SELECTOR))?.focus();
- }, [open, menuRef]);
+ }, [open, menuRef, menuStyle]);
const menuItems = () => Array.from(menuRef.current?.querySelectorAll(ITEM_SELECTOR) ?? []);
diff --git a/client/src/components/ThemeSwitcher.test.jsx b/client/src/components/ThemeSwitcher.test.jsx
index 33580aa580..40bd524c91 100644
--- a/client/src/components/ThemeSwitcher.test.jsx
+++ b/client/src/components/ThemeSwitcher.test.jsx
@@ -36,6 +36,7 @@ describe('ThemeSwitcher', () => {
const menu = screen.getByRole('menu', { name: 'Interface theme' });
const active = within(menu).getByRole('menuitemradio', { name: /Classic Midnight/ });
const inactive = within(menu).getByRole('menuitemradio', { name: /Blueprint Day/ });
+ expect(menu).toHaveStyle({ visibility: 'visible' });
expect(active).toHaveAttribute('aria-checked', 'true');
expect(inactive).toHaveAttribute('aria-checked', 'false');
expect(active).toHaveFocus();