From 642626653c49059df69917d8b84ee0681bcec3a2 Mon Sep 17 00:00:00 2001 From: Lum1104 Date: Sat, 28 Mar 2026 18:48:08 +0800 Subject: [PATCH] feat(dashboard): add node type category filter controls Add nodeTypeFilters state and toggleNodeTypeFilter action to the Zustand store, apply category-based filtering in GraphView's useLayerDetailTopology, and render filter toggle buttons in the App header for Code, Config, Docs, Infra, and Data categories with colored indicator dots. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../packages/dashboard/src/App.tsx | 31 +++++++++++++++++++ .../dashboard/src/components/GraphView.tsx | 18 ++++++++++- .../packages/dashboard/src/store.ts | 14 +++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/understand-anything-plugin/packages/dashboard/src/App.tsx b/understand-anything-plugin/packages/dashboard/src/App.tsx index 0a39b73..26b4423 100644 --- a/understand-anything-plugin/packages/dashboard/src/App.tsx +++ b/understand-anything-plugin/packages/dashboard/src/App.tsx @@ -72,6 +72,8 @@ function Dashboard({ accessToken }: { accessToken: string }) { const codeViewerOpen = useDashboardStore((s) => s.codeViewerOpen); const closeCodeViewer = useDashboardStore((s) => s.closeCodeViewer); const setDiffOverlay = useDashboardStore((s) => s.setDiffOverlay); + const nodeTypeFilters = useDashboardStore((s) => s.nodeTypeFilters); + const toggleNodeTypeFilter = useDashboardStore((s) => s.toggleNodeTypeFilter); const [loadError, setLoadError] = useState(null); const [graphIssues, setGraphIssues] = useState([]); const [showKeyboardHelp, setShowKeyboardHelp] = useState(false); @@ -250,6 +252,35 @@ function Dashboard({ accessToken }: { accessToken: string }) {
+
+ {([ + { key: "code", label: "Code", color: "var(--color-node-file)" }, + { key: "config", label: "Config", color: "var(--color-node-config)" }, + { key: "docs", label: "Docs", color: "var(--color-node-document)" }, + { key: "infra", label: "Infra", color: "var(--color-node-service)" }, + { key: "data", label: "Data", color: "var(--color-node-table)" }, + ] as const).map((cat) => ( + + ))} +