Fix circular dependency detection and hide empty graph modal

- Add artifact-level self-dependency check (skip if dep resolves to same artifact)
- Close dependency graph modal if package has no dependencies to show
  (only root package with no children and no missing deps)
This commit is contained in:
Mondo Diaz
2026-02-02 20:31:46 -06:00
parent 101152f87f
commit 0b85f37abd
2 changed files with 13 additions and 0 deletions

View File

@@ -117,6 +117,14 @@ function DependencyGraph({ projectName, packageName, tagName, onClose }: Depende
try {
const result = await resolveDependencies(projectName, packageName, tagName);
// If only the root package (no dependencies) and no missing deps, close the modal
const hasDeps = result.artifact_count > 1 || (result.missing && result.missing.length > 0);
if (!hasDeps) {
onClose();
return;
}
setResolution(result);
const graph = await buildGraph(result);