Skip to content

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.

feat(dashboard): look up graph files in .ua and legacy .understand-anything

Lum11041b78e3334f2c
diff --git a/understand-anything-plugin/packages/dashboard/vite.config.ts b/understand-anything-plugin/packages/dashboard/vite.config.ts
index 0fdef36b..1f58130c 100644
--- a/understand-anything-plugin/packages/dashboard/vite.config.ts
+++ b/understand-anything-plugin/packages/dashboard/vite.config.ts
@@ -12,15 +12,20 @@ import crypto from "crypto";
const ACCESS_TOKEN = process.env.UNDERSTAND_ACCESS_TOKEN || crypto.randomBytes(16).toString("hex");
const MAX_SOURCE_FILE_BYTES = 1024 * 1024;
+// Legacy directory first — projects analyzed before the `.ua` rename keep
+// their existing `.understand-anything/` data.
+const UA_DIR_CANDIDATES = [".understand-anything", ".ua"];
+
function graphFileCandidates(fileName: string): string[] {
const graphDir = process.env.GRAPH_DIR;
- return [
- ...(graphDir
- ? [path.resolve(graphDir, `.understand-anything/${fileName}`)]
- : []),
- path.resolve(process.cwd(), `.understand-anything/${fileName}`),
- path.resolve(process.cwd(), `../../../.understand-anything/${fileName}`),
+ const roots = [
+ ...(graphDir ? [graphDir] : []),
+ process.cwd(),
+ path.resolve(process.cwd(), "../../.."),
];
+ return roots.flatMap((root) =>
+ UA_DIR_CANDIDATES.map((dir) => path.resolve(root, dir, fileName)),
+ );
}
function findGraphFile(fileName: string): string | null {