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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: replace ambient footer link with command search
[._.]/ Adam Eivy2545f2a208cd
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsxindex d30aa60b07..d57b433ea6 100644--- a/client/src/components/Layout.jsx+++ b/client/src/components/Layout.jsx@@ -27,6 +27,7 @@ import {Pin,PinOff,Navigation,+ Search,} from 'lucide-react';// `__APP_VERSION__` is a Vite build-time define (see vite.config.js). Biome does// not honour ESLint-style "global" block comments, so it is declared in@@ -65,6 +66,7 @@ import VoiceToggleButton from './voice/VoiceToggleButton';import CmdKSearch from './CmdKSearch';import KeyboardHelp from './KeyboardHelp';import VoiceWidget from './voice/VoiceWidget';+import { openCmdKSearch } from '../hooks/useCmdKSearch.js';function ThemeModeToggle({ className = '' }) {const { theme, toggleMode } = useThemeContext();@@ -920,18 +922,15 @@ export default function Layout() {v{__APP_VERSION__}</span><div className={`flex items-center gap-0.5 ${collapsed ? 'lg:flex-col lg:gap-1' : ''}`}>- <NavLink- to="/ambient"- className={`inline-flex items-center justify-center min-w-[44px] min-h-[44px] lg:min-w-0 lg:min-h-0 lg:p-1.5 rounded-lg transition-colors ${collapsed ? 'lg:hidden' : ''} ${- isActive('/ambient')- ? 'text-port-accent'- : 'text-gray-500 hover:text-white'- }`}- title="Ambient"- aria-label="Ambient display"+ <button+ type="button"+ onClick={openCmdKSearch}+ className={`inline-flex items-center justify-center min-w-[44px] min-h-[44px] lg:min-w-0 lg:min-h-0 lg:p-1.5 rounded-lg transition-colors ${collapsed ? 'lg:hidden' : ''} text-gray-500 hover:text-white`}+ title="Search"+ aria-label="Open command palette">- <Monitor size={18} />- </NavLink>+ <Search size={18} />+ </button><ThemeModeToggle /><ThemeSwitcher className={collapsed ? 'lg:hidden' : ''} /><VoiceToggleButton className={collapsed ? 'lg:hidden' : ''} />diff --git a/client/src/components/Layout.test.jsx b/client/src/components/Layout.test.jsxindex df525b3666..774ab15492 100644--- a/client/src/components/Layout.test.jsx+++ b/client/src/components/Layout.test.jsx@@ -4,6 +4,7 @@ import { MemoryRouter, useLocation } from 'react-router';import { PINNED_KEY } from '../utils/navWorkingSet.js';import * as api from '../services/api';import { INSTANCE_FEATURES_CHANGED } from '../constants/events.js';+import { CMD_K_SEARCH_OPEN_EVENT } from '../hooks/useCmdKSearch.js';// This suite locks the *integration* path that SingleNavRow.test.jsx can't reach:// pinning a top-level `single: true` row (Dashboard `/`, Review Hub `/review`,@@ -415,9 +416,9 @@ describe('Layout — persistent mobile touch targets', () => {expect(openMenu.closest('header')?.className).toContain('lg:hidden');expect(closeMenu.className).toContain('lg:hidden');- const ambientLinks = screen.getAllByRole('link', { name: 'Ambient display' });- expect(ambientLinks).toHaveLength(2);- ambientLinks.forEach(expectAtLeast44px);+ const searchButtons = screen.getAllByRole('button', { name: 'Open command palette' });+ expect(searchButtons).toHaveLength(1);+ searchButtons.forEach(expectAtLeast44px);const themeToggles = screen.getAllByRole('button', { name: 'Toggle day/night mode' });expect(themeToggles).toHaveLength(2);@@ -442,6 +443,17 @@ describe('Layout — persistent mobile touch targets', () => {});describe('Layout — nav footer', () => {+ it('opens the command palette from the footer search button', async () => {+ await renderLayout();+ const dispatchSpy = vi.spyOn(document, 'dispatchEvent');++ const searchButton = screen.getByRole('button', { name: 'Open command palette' });+ fireEvent.click(searchButton);++ expect(dispatchSpy).toHaveBeenCalledWith(expect.objectContaining({ type: CMD_K_SEARCH_OPEN_EVENT }));+ dispatchSpy.mockRestore();+ });+it('renders a compact footer layout preventing controls from overflowing the sidebar', async () => {await renderLayout();diff --git a/client/src/hooks/useCmdKSearch.js b/client/src/hooks/useCmdKSearch.jsindex 8aba80fd57..4ef1d3e534 100644--- a/client/src/hooks/useCmdKSearch.js+++ b/client/src/hooks/useCmdKSearch.js@@ -1,5 +1,11 @@import { useState, useEffect } from 'react';+export const CMD_K_SEARCH_OPEN_EVENT = 'portos:open-command-palette';++export function openCmdKSearch() {+ document.dispatchEvent(new Event(CMD_K_SEARCH_OPEN_EVENT));+}+export function useCmdKSearch() {const [open, setOpen] = useState(false);@@ -10,8 +16,13 @@ export function useCmdKSearch() {setOpen(prev => !prev);}};+ const openHandler = () => setOpen(true);document.addEventListener('keydown', handler);- return () => document.removeEventListener('keydown', handler);+ document.addEventListener(CMD_K_SEARCH_OPEN_EVENT, openHandler);+ return () => {+ document.removeEventListener('keydown', handler);+ document.removeEventListener(CMD_K_SEARCH_OPEN_EVENT, openHandler);+ };}, []);return { open, setOpen };