feat: Cmd+K Enter applies full-text search to dashboard
When pressing Enter in the command palette without explicitly selecting a result (via arrow keys or mouse), the search query is now applied as a server-side full-text filter on the Dashboard table. Explicit selection still navigates to the exchange. Updates design system to v0.1.18 for the new onSubmit prop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -199,6 +199,14 @@ function LayoutContent() {
|
||||
setPaletteOpen(false);
|
||||
}, [navigate, setPaletteOpen]);
|
||||
|
||||
const handlePaletteSubmit = useCallback((query: string) => {
|
||||
// Navigate to dashboard with full-text search applied
|
||||
const currentPath = location.pathname;
|
||||
// Stay on the current app/route context if we're already there
|
||||
const basePath = currentPath.startsWith('/apps/') ? currentPath.split('/').slice(0, 4).join('/') : '/apps';
|
||||
navigate(`${basePath}?text=${encodeURIComponent(query)}`);
|
||||
}, [navigate, location.pathname]);
|
||||
|
||||
return (
|
||||
<AppShell
|
||||
sidebar={
|
||||
@@ -217,6 +225,7 @@ function LayoutContent() {
|
||||
onClose={() => setPaletteOpen(false)}
|
||||
onOpen={() => setPaletteOpen(true)}
|
||||
onSelect={handlePaletteSelect}
|
||||
onSubmit={handlePaletteSubmit}
|
||||
onQueryChange={setPaletteQuery}
|
||||
data={searchData}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user