feat: add processor tracing toggle to exchange detail views
Wire getActions on ProcessorTimeline and RouteFlow to send SET_TRACED_PROCESSORS commands to all agents of the same application. Tracing state managed via Zustand store with optimistic UI and rollback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
ui/src/stores/tracing-store.ts
Normal file
24
ui/src/stores/tracing-store.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { create } from 'zustand'
|
||||
|
||||
interface TracingState {
|
||||
tracedProcessors: Record<string, Set<string>>
|
||||
isTraced: (appRoute: string, processorId: string) => boolean
|
||||
toggleProcessor: (appRoute: string, processorId: string) => Set<string>
|
||||
}
|
||||
|
||||
export const useTracingStore = create<TracingState>((set, get) => ({
|
||||
tracedProcessors: {},
|
||||
|
||||
isTraced: (appRoute, processorId) =>
|
||||
get().tracedProcessors[appRoute]?.has(processorId) ?? false,
|
||||
|
||||
toggleProcessor: (appRoute, processorId) => {
|
||||
const current = new Set(get().tracedProcessors[appRoute] ?? [])
|
||||
if (current.has(processorId)) current.delete(processorId)
|
||||
else current.add(processorId)
|
||||
set((state) => ({
|
||||
tracedProcessors: { ...state.tracedProcessors, [appRoute]: current },
|
||||
}))
|
||||
return current
|
||||
},
|
||||
}))
|
||||
Reference in New Issue
Block a user