Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
TypeScript antigravity-skillsbusiness-knowledgeclaude-codeclaude-skillscodebase-analysiscodexcodex-skillsdeveloper-tools-ai-agentgemini-cli-skillskarpathy-llm-wikiknowledge-baseknowledge-graphmemoryopencode-skillspi-agentunderstandcodevibe-coding
feat(dashboard): add domain view state to store (viewMode, domainGraph, activeDomainId)
Lum110422fd49a821a1
diff --git a/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx b/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsxindex 1cae9706..bc06c976 100644--- a/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx+++ b/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx@@ -18,6 +18,9 @@ const typeColors: Record<NodeType, string> = {pipeline: "var(--color-node-pipeline)",schema: "var(--color-node-schema)",resource: "var(--color-node-resource)",+ domain: "var(--color-node-concept)",+ flow: "var(--color-node-pipeline)",+ step: "var(--color-node-function)",};const typeTextColors: Record<NodeType, string> = {@@ -34,6 +37,9 @@ const typeTextColors: Record<NodeType, string> = {pipeline: "text-node-pipeline",schema: "text-node-schema",resource: "text-node-resource",+ domain: "text-node-concept",+ flow: "text-node-pipeline",+ step: "text-node-function",};const complexityColors: Record<string, string> = {diff --git a/understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx b/understand-anything-plugin/packages/dashboard/src/components/GraphView.tsxindex c49f1ff5..c3701a81 100644--- a/understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx+++ b/understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx@@ -56,6 +56,7 @@ const NODE_TYPE_TO_CATEGORY: Record<NodeType, NodeCategory> = {document: "docs",service: "infra", resource: "infra", pipeline: "infra",table: "data", endpoint: "data", schema: "data",+ domain: "code", flow: "code", step: "code",} as const;// ── Helper components that must live inside <ReactFlow> ────────────────diff --git a/understand-anything-plugin/packages/dashboard/src/components/NodeInfo.tsx b/understand-anything-plugin/packages/dashboard/src/components/NodeInfo.tsxindex 6bee4b40..a06bf088 100644--- a/understand-anything-plugin/packages/dashboard/src/components/NodeInfo.tsx+++ b/understand-anything-plugin/packages/dashboard/src/components/NodeInfo.tsx@@ -17,6 +17,9 @@ const typeBadgeColors: Record<NodeType, string> = {pipeline: "text-node-pipeline border border-node-pipeline/30 bg-node-pipeline/10",schema: "text-node-schema border border-node-schema/30 bg-node-schema/10",resource: "text-node-resource border border-node-resource/30 bg-node-resource/10",+ domain: "text-node-concept border border-node-concept/30 bg-node-concept/10",+ flow: "text-node-pipeline border border-node-pipeline/30 bg-node-pipeline/10",+ step: "text-node-function border border-node-function/30 bg-node-function/10",};const complexityBadgeColors: Record<string, string> = {@@ -56,6 +59,9 @@ const EDGE_LABELS: Record<EdgeType, { forward: string; backward: string }> = {routes: { forward: "routes to", backward: "routed from" },defines_schema: { forward: "defines schema for", backward: "schema defined by" },triggers: { forward: "triggers", backward: "triggered by" },+ contains_flow: { forward: "contains flow", backward: "flow in" },+ flow_step: { forward: "flow step", backward: "step of" },+ cross_domain: { forward: "cross-domain to", backward: "cross-domain from" },};/**diff --git a/understand-anything-plugin/packages/dashboard/src/store.ts b/understand-anything-plugin/packages/dashboard/src/store.tsindex a2c10518..f4652066 100644--- a/understand-anything-plugin/packages/dashboard/src/store.ts+++ b/understand-anything-plugin/packages/dashboard/src/store.ts@@ -9,9 +9,10 @@ import type { ReactFlowInstance } from "@xyflow/react";export type Persona = "non-technical" | "junior" | "experienced";export type NavigationLevel = "overview" | "layer-detail";-export type NodeType = "file" | "function" | "class" | "module" | "concept" | "config" | "document" | "service" | "table" | "endpoint" | "pipeline" | "schema" | "resource";+export type NodeType = "file" | "function" | "class" | "module" | "concept" | "config" | "document" | "service" | "table" | "endpoint" | "pipeline" | "schema" | "resource" | "domain" | "flow" | "step";export type Complexity = "simple" | "moderate" | "complex";export type EdgeCategory = "structural" | "behavioral" | "data-flow" | "dependencies" | "semantic";+export type ViewMode = "structural" | "domain";export interface FilterState {nodeTypes: Set<NodeType>;@@ -20,7 +21,7 @@ export interface FilterState {edgeCategories: Set<EdgeCategory>;}-export const ALL_NODE_TYPES: NodeType[] = ["file", "function", "class", "module", "concept", "config", "document", "service", "table", "endpoint", "pipeline", "schema", "resource"];+export const ALL_NODE_TYPES: NodeType[] = ["file", "function", "class", "module", "concept", "config", "document", "service", "table", "endpoint", "pipeline", "schema", "resource", "domain", "flow", "step"];export const ALL_COMPLEXITIES: Complexity[] = ["simple", "moderate", "complex"];export const ALL_EDGE_CATEGORIES: EdgeCategory[] = ["structural", "behavioral", "data-flow", "dependencies", "semantic"];@@ -32,6 +33,8 @@ export const EDGE_CATEGORY_MAP: Record<EdgeCategory, string[]> = {semantic: ["related", "similar_to"],};+export const DOMAIN_EDGE_TYPES = ["contains_flow", "flow_step", "cross_domain"];+const DEFAULT_FILTERS: FilterState = {nodeTypes: new Set<NodeType>(ALL_NODE_TYPES),complexities: new Set<Complexity>(ALL_COMPLEXITIES),@@ -127,6 +130,15 @@ interface DashboardStore {setTourStep: (step: number) => void;nextTourStep: () => void;prevTourStep: () => void;++ // Domain view+ viewMode: ViewMode;+ domainGraph: KnowledgeGraph | null;+ activeDomainId: string | null;++ setDomainGraph: (graph: KnowledgeGraph) => void;+ setViewMode: (mode: ViewMode) => void;+ navigateToDomain: (domainId: string) => void;}function getSortedTour(graph: KnowledgeGraph): TourStep[] {@@ -442,4 +454,30 @@ export const useDashboardStore = create<DashboardStore>()((set, get) => ({});}},++ viewMode: "structural",+ domainGraph: null,+ activeDomainId: null,++ setDomainGraph: (graph) => {+ set({ domainGraph: graph, viewMode: "domain" });+ },++ setViewMode: (mode) => {+ set({+ viewMode: mode,+ selectedNodeId: null,+ focusNodeId: null,+ codeViewerOpen: false,+ codeViewerNodeId: null,+ });+ },++ navigateToDomain: (domainId) => {+ set({+ activeDomainId: domainId,+ selectedNodeId: null,+ focusNodeId: null,+ });+ },}));