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:
@@ -30,11 +30,34 @@
|
||||
}
|
||||
|
||||
.tableTitle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.clearSearch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin-left: 4px;
|
||||
border: none;
|
||||
background: var(--bg-hover, #F5F0EA);
|
||||
color: var(--text-secondary, #5C5347);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.clearSearch:hover {
|
||||
background: var(--border, #E4DFD8);
|
||||
color: var(--text-primary, #1A1612);
|
||||
}
|
||||
|
||||
.tableRight {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useMemo, useCallback } from 'react'
|
||||
import { useParams, useNavigate } from 'react-router'
|
||||
import { ExternalLink, AlertTriangle } from 'lucide-react'
|
||||
import { useParams, useNavigate, useSearchParams } from 'react-router'
|
||||
import { ExternalLink, AlertTriangle, X, Search } from 'lucide-react'
|
||||
import {
|
||||
DataTable,
|
||||
DetailPanel,
|
||||
@@ -196,6 +196,8 @@ const SHORTCUTS = [
|
||||
export default function Dashboard() {
|
||||
const { appId, routeId } = useParams<{ appId: string; routeId: string }>()
|
||||
const navigate = useNavigate()
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const textFilter = searchParams.get('text') || undefined
|
||||
const [selectedId, setSelectedId] = useState<string | undefined>()
|
||||
const [panelOpen, setPanelOpen] = useState(false)
|
||||
const [sortField, setSortField] = useState<string>('startTime')
|
||||
@@ -226,12 +228,13 @@ export default function Dashboard() {
|
||||
routeId: routeId || undefined,
|
||||
application: appId || undefined,
|
||||
status: statusParam,
|
||||
text: textFilter,
|
||||
sortField,
|
||||
sortDir,
|
||||
offset: 0,
|
||||
limit: 50,
|
||||
limit: textFilter ? 200 : 50,
|
||||
},
|
||||
true,
|
||||
!textFilter,
|
||||
)
|
||||
const { data: detail } = useExecutionDetail(selectedId ?? null)
|
||||
const { data: diagram } = useDiagramLayout(detail?.diagramContentHash ?? null)
|
||||
@@ -398,12 +401,26 @@ export default function Dashboard() {
|
||||
{/* Exchanges table */}
|
||||
<div className={styles.tableSection}>
|
||||
<div className={styles.tableHeader}>
|
||||
<span className={styles.tableTitle}>Recent Exchanges</span>
|
||||
<span className={styles.tableTitle}>
|
||||
{textFilter ? (
|
||||
<>
|
||||
<Search size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
|
||||
Search: “{textFilter}”
|
||||
<button
|
||||
className={styles.clearSearch}
|
||||
onClick={() => setSearchParams({})}
|
||||
title="Clear search"
|
||||
>
|
||||
<X size={12} />
|
||||
</button>
|
||||
</>
|
||||
) : 'Recent Exchanges'}
|
||||
</span>
|
||||
<div className={styles.tableRight}>
|
||||
<span className={styles.tableMeta}>
|
||||
{rows.length.toLocaleString()} of {(searchResult?.total ?? 0).toLocaleString()} exchanges
|
||||
</span>
|
||||
<Badge label="LIVE" color="success" />
|
||||
{!textFilter && <Badge label="LIVE" color="success" />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user