diff --git a/understand-anything-plugin/packages/core/src/analyzer/layer-detector.ts b/understand-anything-plugin/packages/core/src/analyzer/layer-detector.ts index 07eb89f..e50e94f 100644 --- a/understand-anything-plugin/packages/core/src/analyzer/layer-detector.ts +++ b/understand-anything-plugin/packages/core/src/analyzer/layer-detector.ts @@ -39,6 +39,16 @@ const LAYER_PATTERNS: Array<{ patterns: string[]; layerName: string; description layerName: "Middleware Layer", description: "Request/response middleware and interceptors", }, + { + patterns: ["client", "integration", "external", "sdk", "vendor", "adapter"], + layerName: "External Services", + description: "External service integrations, SDKs, and third-party adapters", + }, + { + patterns: ["worker", "job", "queue", "cron", "consumer", "processor", "scheduler", "background"], + layerName: "Background Tasks", + description: "Background workers, job processors, and scheduled tasks", + }, { patterns: ["util", "helper", "lib", "common", "shared"], layerName: "Utility Layer", diff --git a/understand-anything-plugin/packages/dashboard/src/components/Breadcrumb.tsx b/understand-anything-plugin/packages/dashboard/src/components/Breadcrumb.tsx new file mode 100644 index 0000000..f35de41 --- /dev/null +++ b/understand-anything-plugin/packages/dashboard/src/components/Breadcrumb.tsx @@ -0,0 +1,100 @@ +import { useCallback, useEffect } from "react"; +import { useDashboardStore } from "../store"; +import type { ViewMode } from "../store"; + +export default function Breadcrumb() { + const navigationLevel = useDashboardStore((s) => s.navigationLevel); + const activeLayerId = useDashboardStore((s) => s.activeLayerId); + const viewMode = useDashboardStore((s) => s.viewMode); + const graph = useDashboardStore((s) => s.graph); + const navigateToOverview = useDashboardStore((s) => s.navigateToOverview); + const setViewMode = useDashboardStore((s) => s.setViewMode); + + const activeLayer = graph?.layers.find((l) => l.id === activeLayerId); + + // Escape key to go back to overview (only in graph mode) + const handleKeyDown = useCallback( + (e: KeyboardEvent) => { + if ( + e.key === "Escape" && + viewMode === "graph" && + navigationLevel === "layer-detail" + ) { + navigateToOverview(); + } + }, + [viewMode, navigationLevel, navigateToOverview], + ); + + useEffect(() => { + document.addEventListener("keydown", handleKeyDown); + return () => document.removeEventListener("keydown", handleKeyDown); + }, [handleKeyDown]); + + const handleViewToggle = useCallback( + (mode: ViewMode) => { + setViewMode(mode); + }, + [setViewMode], + ); + + return ( +
+ {child.summary} +