Rename Agents to Applications, remove Exchanges, implement Routes search
- Rename "Agents" scope/labels to "Applications" throughout command palette - Remove "Exchanges" scope (was disabled placeholder) - Implement "Routes" scope: derives routes from agents' routeIds, filterable by route ID or owning application name - Selecting a route filters executions by routeId - Route results show purple icon, route ID, and owning application(s) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useRef, useEffect, useCallback } from 'react';
|
||||
import { useExecutionSearch } from './use-execution-search';
|
||||
import { useCommandPalette } from '../../components/command-palette/use-command-palette';
|
||||
import { usePaletteSearch, type PaletteResult } from '../../components/command-palette/use-palette-search';
|
||||
import { usePaletteSearch, type PaletteResult, type RouteInfo } from '../../components/command-palette/use-palette-search';
|
||||
import { PaletteInput } from '../../components/command-palette/PaletteInput';
|
||||
import { ScopeTabs } from '../../components/command-palette/ScopeTabs';
|
||||
import { ResultsList } from '../../components/command-palette/ResultsList';
|
||||
@@ -27,7 +27,7 @@ export function SearchFilters() {
|
||||
const { isOpen, close, scope, setScope, selectedIndex, setSelectedIndex, reset, filters } =
|
||||
useCommandPalette();
|
||||
const openPalette = useCommandPalette((s) => s.open);
|
||||
const { results, executionCount, agentCount, isLoading } = usePaletteSearch();
|
||||
const { results, executionCount, applicationCount, routeCount, isLoading } = usePaletteSearch();
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const handleSelect = useCallback(
|
||||
@@ -39,13 +39,20 @@ export function SearchFilters() {
|
||||
execSearch.setRouteId('');
|
||||
execSearch.setAgentId('');
|
||||
execSearch.setProcessorType('');
|
||||
} else if (result.type === 'agent') {
|
||||
} else if (result.type === 'application') {
|
||||
const agent = result.data as AgentInstance;
|
||||
execSearch.setStatus(['COMPLETED', 'FAILED', 'RUNNING']);
|
||||
execSearch.setAgentId(agent.id);
|
||||
execSearch.setText('');
|
||||
execSearch.setRouteId('');
|
||||
execSearch.setProcessorType('');
|
||||
} else if (result.type === 'route') {
|
||||
const route = result.data as RouteInfo;
|
||||
execSearch.setStatus(['COMPLETED', 'FAILED', 'RUNNING']);
|
||||
execSearch.setRouteId(route.routeId);
|
||||
execSearch.setText('');
|
||||
execSearch.setAgentId('');
|
||||
execSearch.setProcessorType('');
|
||||
}
|
||||
for (const f of filters) {
|
||||
if (f.key === 'status') execSearch.setStatus([f.value.toUpperCase()]);
|
||||
@@ -75,7 +82,7 @@ export function SearchFilters() {
|
||||
// Keyboard handling when open
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
const SCOPES = ['all', 'executions', 'agents'] as const;
|
||||
const SCOPES = ['all', 'executions', 'applications', 'routes'] as const;
|
||||
function handleKeyDown(e: KeyboardEvent) {
|
||||
switch (e.key) {
|
||||
case 'Escape':
|
||||
@@ -127,7 +134,7 @@ export function SearchFilters() {
|
||||
{isOpen ? (
|
||||
<div className={styles.paletteInline}>
|
||||
<PaletteInput />
|
||||
<ScopeTabs executionCount={executionCount} agentCount={agentCount} />
|
||||
<ScopeTabs executionCount={executionCount} applicationCount={applicationCount} routeCount={routeCount} />
|
||||
<ResultsList results={results} isLoading={isLoading} onSelect={handleSelect} />
|
||||
<PaletteFooter />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user