Fix command palette: agent ID propagation, result selection, and scope tabs
- Propagate authenticated agent identity through write buffers via TaggedExecution/TaggedDiagram wrappers so ClickHouse rows get real agent IDs instead of empty strings - Add execution_id to text search LIKE clause so selecting an execution by ID in the palette actually finds it - Clear status filter to all three statuses on palette selection so the chosen execution/agent isn't filtered out - Add disabled Routes and Exchanges scope tabs with "coming soon" state Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,12 +22,14 @@ export function CommandPalette() {
|
||||
(result: PaletteResult) => {
|
||||
if (result.type === 'execution') {
|
||||
const exec = result.data as ExecutionSummary;
|
||||
execSearch.setStatus(['COMPLETED', 'FAILED', 'RUNNING']);
|
||||
execSearch.setText(exec.executionId);
|
||||
execSearch.setRouteId('');
|
||||
execSearch.setAgentId('');
|
||||
execSearch.setProcessorType('');
|
||||
} else if (result.type === 'agent') {
|
||||
const agent = result.data as AgentInstance;
|
||||
execSearch.setStatus(['COMPLETED', 'FAILED', 'RUNNING']);
|
||||
execSearch.setAgentId(agent.agentId);
|
||||
execSearch.setText('');
|
||||
execSearch.setRouteId('');
|
||||
|
||||
@@ -11,7 +11,7 @@ interface ResultsListProps {
|
||||
}
|
||||
|
||||
export function ResultsList({ results, isLoading, onSelect }: ResultsListProps) {
|
||||
const { selectedIndex, query } = useCommandPalette();
|
||||
const { selectedIndex, query, scope } = useCommandPalette();
|
||||
const listRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -21,6 +21,24 @@ export function ResultsList({ results, isLoading, onSelect }: ResultsListProps)
|
||||
items?.[selectedIndex]?.scrollIntoView({ block: 'nearest' });
|
||||
}, [selectedIndex]);
|
||||
|
||||
if (scope === 'routes' || scope === 'exchanges') {
|
||||
const label = scope === 'routes' ? 'Route' : 'Exchange';
|
||||
return (
|
||||
<div className={styles.results}>
|
||||
<div className={styles.emptyState}>
|
||||
<svg className={styles.emptyIcon} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<path d="M12 6v6l4 2" />
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
</svg>
|
||||
<span className={styles.emptyText}>{label} search coming soon</span>
|
||||
<span className={styles.emptyHint}>
|
||||
This feature is planned for a future release
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (isLoading && results.length === 0) {
|
||||
return (
|
||||
<div className={styles.results}>
|
||||
|
||||
@@ -10,16 +10,18 @@ const SCOPES: { key: PaletteScope; label: string; disabled?: boolean }[] = [
|
||||
{ key: 'all', label: 'All' },
|
||||
{ key: 'executions', label: 'Executions' },
|
||||
{ key: 'agents', label: 'Agents' },
|
||||
{ key: 'routes', label: 'Routes', disabled: true },
|
||||
{ key: 'exchanges', label: 'Exchanges', disabled: true },
|
||||
];
|
||||
|
||||
export function ScopeTabs({ executionCount, agentCount }: ScopeTabsProps) {
|
||||
const { scope, setScope } = useCommandPalette();
|
||||
|
||||
function getCount(key: PaletteScope): number {
|
||||
function getCount(key: PaletteScope): string | number {
|
||||
if (key === 'all') return executionCount + agentCount;
|
||||
if (key === 'executions') return executionCount;
|
||||
if (key === 'agents') return agentCount;
|
||||
return 0;
|
||||
return '\u2014';
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -27,7 +29,13 @@ export function ScopeTabs({ executionCount, agentCount }: ScopeTabsProps) {
|
||||
{SCOPES.map((s) => (
|
||||
<button
|
||||
key={s.key}
|
||||
className={scope === s.key ? styles.scopeTabActive : styles.scopeTab}
|
||||
className={
|
||||
s.disabled
|
||||
? styles.scopeTabDisabled
|
||||
: scope === s.key
|
||||
? styles.scopeTabActive
|
||||
: styles.scopeTab
|
||||
}
|
||||
onClick={() => !s.disabled && setScope(s.key)}
|
||||
>
|
||||
{s.label}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
export type PaletteScope = 'all' | 'executions' | 'agents';
|
||||
export type PaletteScope = 'all' | 'executions' | 'agents' | 'routes' | 'exchanges';
|
||||
|
||||
export interface PaletteFilter {
|
||||
key: 'status' | 'route' | 'agent' | 'processor';
|
||||
|
||||
Reference in New Issue
Block a user