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 72952d84a1
commit 01915bcb45
2 changed files with 13 additions and 0 deletions

View File

@@ -791,6 +791,11 @@ def resolve_dependencies(
continue
dep_artifact_id, dep_version, dep_size = resolved_dep
# Skip if resolved to same artifact (self-dependency at artifact level)
if dep_artifact_id == artifact_id:
continue
_resolve_recursive(
dep_artifact_id,
dep.dependency_project,

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);