From 78c8ce260228be0714c137a273d6d402adca7f5a Mon Sep 17 00:00:00 2001 From: Lum1104 Date: Sat, 28 Mar 2026 18:46:49 +0800 Subject: [PATCH] feat(dashboard): add file type breakdown to ProjectOverview Show a categorized count of node types (Code, Config, Docs, Infra, Data) with colored dots matching node type colors. Only displayed when non-code nodes are present in the graph. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/components/ProjectOverview.tsx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/understand-anything-plugin/packages/dashboard/src/components/ProjectOverview.tsx b/understand-anything-plugin/packages/dashboard/src/components/ProjectOverview.tsx index 3969511..81d4018 100644 --- a/understand-anything-plugin/packages/dashboard/src/components/ProjectOverview.tsx +++ b/understand-anything-plugin/packages/dashboard/src/components/ProjectOverview.tsx @@ -21,6 +21,16 @@ export default function ProjectOverview() { typeCounts[node.type] = (typeCounts[node.type] ?? 0) + 1; } + // Category breakdowns + const categoryBreakdown = [ + { label: "Code", color: "var(--color-node-file)", count: (typeCounts["file"] ?? 0) + (typeCounts["function"] ?? 0) + (typeCounts["class"] ?? 0) }, + { label: "Config", color: "var(--color-node-config)", count: typeCounts["config"] ?? 0 }, + { label: "Docs", color: "var(--color-node-document)", count: typeCounts["document"] ?? 0 }, + { label: "Infra", color: "var(--color-node-service)", count: (typeCounts["service"] ?? 0) + (typeCounts["resource"] ?? 0) + (typeCounts["pipeline"] ?? 0) }, + { label: "Data", color: "var(--color-node-table)", count: (typeCounts["table"] ?? 0) + (typeCounts["endpoint"] ?? 0) + (typeCounts["schema"] ?? 0) }, + ]; + const hasNonCodeNodes = categoryBreakdown.some((c) => c.label !== "Code" && c.count > 0); + return (
{/* Project name */} @@ -47,6 +57,25 @@ export default function ProjectOverview() {
+ {/* File Types breakdown */} + {hasNonCodeNodes && ( +
+

File Types

+
+ {categoryBreakdown.filter((c) => c.count > 0).map((cat) => ( +
+ + {cat.label} + {cat.count} +
+ ))} +
+
+ )} + {/* Languages */} {project.languages.length > 0 && (