Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/AppCore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const ToastManager = lazy(() => import("@/components/ToastManager").then(m => ({
const NotificationCenter = lazy(() => import("@/components/NotificationCenter").then(m => ({ default: m.NotificationCenter })));

// COMMAND PALETTE - Core UI, should load early
const CommandPalette = lazy(() => import("@/components/CommandPalette").then(m => ({ default: m.CommandPalette })));
const ViewQuickAccess = lazy(() => import("@/components/ViewQuickAccess").then(m => ({ default: m.ViewQuickAccess })));
const PaletteCommandPalette = lazy(() => import("@/components/palette/CommandPalette").then(m => ({ default: m.PaletteCommandPalette })));
const PaletteQuickOpen = lazy(() => import("@/components/palette/QuickOpen").then(m => ({ default: m.PaletteQuickOpen })));
Expand Down Expand Up @@ -568,7 +567,6 @@ function AppContent(props: ParentProps) {
<Suspense>
<ToastManager />
<NotificationCenter />
<CommandPalette />
<PaletteCommandPalette />
<PaletteQuickOpen />
<ViewQuickAccess />
Expand Down
5 changes: 3 additions & 2 deletions src/components/palette/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ export function PaletteCommandPalette() {
};

const handleGlobalEsc = (e: KeyboardEvent) => { if (e.key === "Escape" && showCommandPalette()) { e.preventDefault(); setShowCommandPalette(false); } };
onMount(() => window.addEventListener("keydown", handleGlobalEsc));
onCleanup(() => window.removeEventListener("keydown", handleGlobalEsc));
const handleToggleEvent = () => { setShowCommandPalette(!showCommandPalette()); };
onMount(() => { window.addEventListener("keydown", handleGlobalEsc); window.addEventListener("command-palette:toggle", handleToggleEvent); });
onCleanup(() => { window.removeEventListener("keydown", handleGlobalEsc); window.removeEventListener("command-palette:toggle", handleToggleEvent); });

const itemStyle = (sel: boolean): JSX.CSSProperties => ({
display: "flex", "align-items": "center", gap: "6px", height: "24px", padding: "0 8px", margin: "1px 4px",
Expand Down
Loading