Skip to content
Documentation GitHub
Platform

Command Palette

Phase: MVP (Phase 1) Depends On: Page System


The Command Palette is a keyboard-driven interface for search, navigation, and actions. It serves as the primary discovery mechanism and entry point for AI assistance.

  • macOS: Cmd+K
  • Windows/Linux: Ctrl+K

This follows conventions from VS Code, Linear, Notion, and other modern apps.

Single input searches across:

  • Page titles (fuzzy match)
  • Quick actions (create, settings, etc.)
  • Recent items

Full keyboard navigation:

  • ↑/↓ or Tab/Shift+Tab: Navigate results
  • Enter: Select item
  • Escape: Close palette
  • Type to filter

Results grouped by type:

┌─────────────────────────────────────┐
│ 🔍 Search... │
├─────────────────────────────────────┤
│ Recent │
│ 📄 Character: Elena │
│ 📄 World Overview │
├─────────────────────────────────────┤
│ Pages │
│ 📄 Characters │
│ 📄 Locations │
├─────────────────────────────────────┤
│ Actions │
│ ➕ Create new page │
│ ⚙️ Open settings │
│ 🤖 Ask AI... │
└─────────────────────────────────────┘
  • Modal overlay with backdrop blur
  • Centered, ~500px wide
  • Appears with subtle animation
  • Auto-focuses search input
  • Fuzzy matching (typo-tolerant)
  • Results update as user types (debounced)
  • Empty state shows recent + suggestions
  • No results state with helpful message
  • Opens in under 100ms
  • Search results in under 50ms
  • Index pages in memory for speed
Use CaseDescription
SearchPagesUseCaseFuzzy search page titles
GetRecentPagesUseCaseGet recently opened pages
ExecuteActionUseCaseRun quick action
// Search pages by query
search_pages(query: string): Promise<SearchResult[]>
// Get recent pages
get_recent_pages(limit?: number): Promise<Page[]>
interface SearchResult {
type: 'page' | 'action';
id: string;
title: string;
subtitle?: string;
icon?: string;
score: number; // Relevance score for sorting
}
interface QuickAction {
id: string;
title: string;
shortcut?: string;
icon: string;
handler: () => void;
}
ActionShortcutDescription
Create pageCmd+NOpen create page dialog
Open settingsCmd+,Open settings panel
Toggle sidebarCmd+BShow/hide sidebar
CommandPalette/
├── CommandPalette.tsx # Main component
├── CommandInput.tsx # Search input with keyboard handling
├── ResultsList.tsx # Virtualized results list
├── ResultItem.tsx # Individual result row
├── useCommandPalette.ts # State and search logic
└── actions.ts # Quick action definitions
// Global listener
useEffect(() => {
const handler = (e: KeyboardEvent) => {
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
e.preventDefault();
togglePalette();
}
};
window.addEventListener('keydown', handler);
return () => window.removeEventListener('keydown', handler);
}, []);
  • Unit: Search algorithm, result ranking
  • Component: Keyboard navigation, result display
  • E2E: Open palette → search → navigate → select

Depends on Page System. Required by First Launch Experience.

Was this page helpful?