From cd56d00ebfa9f4a175ef1d8eda6eeacd0a9f433b Mon Sep 17 00:00:00 2001 From: Mondo Diaz Date: Fri, 30 Jan 2026 12:36:40 -0600 Subject: [PATCH] Improve system project UX and make dependencies a modal - Hide tag count stat for system projects (show "versions" instead of "artifacts") - Hide "Latest" tag stat for system projects - Change "Create/Update Tag" to only show for non-system projects - Add "View Artifact ID" menu option with modal showing the SHA256 hash - Move dependencies section to a modal (opened via "View Dependencies" menu) - Add deps-modal and artifact-id-modal CSS styles --- frontend/src/pages/PackagePage.css | 54 +++++++ frontend/src/pages/PackagePage.tsx | 222 +++++++++++++++-------------- 2 files changed, 167 insertions(+), 109 deletions(-) diff --git a/frontend/src/pages/PackagePage.css b/frontend/src/pages/PackagePage.css index f9b30ad..a70ed1a 100644 --- a/frontend/src/pages/PackagePage.css +++ b/frontend/src/pages/PackagePage.css @@ -930,3 +930,57 @@ tr:hover .copy-btn { padding-top: 16px; border-top: 1px solid var(--border-primary); } + +/* Dependencies Modal */ +.deps-modal { + background: var(--bg-secondary); + border-radius: var(--radius-lg); + width: 90%; + max-width: 600px; + max-height: 80vh; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.deps-modal .modal-body { + overflow-y: auto; + flex: 1; +} + +.deps-modal-controls { + display: flex; + gap: 8px; + margin-bottom: 16px; +} + +/* Artifact ID Modal */ +.artifact-id-modal { + background: var(--bg-secondary); + border-radius: var(--radius-lg); + width: 90%; + max-width: 500px; +} + +.artifact-id-display { + display: flex; + align-items: center; + gap: 12px; + padding: 16px; + background: var(--bg-tertiary); + border-radius: var(--radius-md); + border: 1px solid var(--border-primary); +} + +.artifact-id-display code { + font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; + font-size: 0.8125rem; + color: var(--text-primary); + word-break: break-all; + flex: 1; +} + +.artifact-id-display .copy-btn { + opacity: 1; + flex-shrink: 0; +} diff --git a/frontend/src/pages/PackagePage.tsx b/frontend/src/pages/PackagePage.tsx index ac56c54..16e2f64 100644 --- a/frontend/src/pages/PackagePage.tsx +++ b/frontend/src/pages/PackagePage.tsx @@ -91,6 +91,13 @@ function PackagePage() { // Dependency graph modal state const [showGraph, setShowGraph] = useState(false); + // Dependencies modal state + const [showDepsModal, setShowDepsModal] = useState(false); + + // Artifact ID modal state + const [showArtifactIdModal, setShowArtifactIdModal] = useState(false); + const [viewArtifactId, setViewArtifactId] = useState(null); + // Ensure file modal state const [showEnsureFile, setShowEnsureFile] = useState(false); const [ensureFileContent, setEnsureFileContent] = useState(null); @@ -516,18 +523,21 @@ function PackagePage() { style={{ top: menuPosition.top, left: menuPosition.left }} onClick={(e) => e.stopPropagation()} > + - {canWrite && ( + {canWrite && !isSystemProject && ( )} - @@ -606,14 +616,14 @@ function PackagePage() { {pkg && (pkg.tag_count !== undefined || pkg.artifact_count !== undefined) && (
- {pkg.tag_count !== undefined && ( + {!isSystemProject && pkg.tag_count !== undefined && ( {pkg.tag_count} tags )} {pkg.artifact_count !== undefined && ( - {pkg.artifact_count} artifacts + {pkg.artifact_count} {isSystemProject ? 'versions' : 'artifacts'} )} {pkg.total_size !== undefined && pkg.total_size > 0 && ( @@ -621,7 +631,7 @@ function PackagePage() { {formatBytes(pkg.total_size)} total )} - {pkg.latest_tag && ( + {!isSystemProject && pkg.latest_tag && ( Latest: {pkg.latest_tag} @@ -680,110 +690,6 @@ function PackagePage() { /> )} - {/* Dependencies Section */} - {tags.length > 0 && ( -
-
-

Dependencies

-
- {selectedTag && ( - <> - - - - )} -
-
-
- {selectedTag && ( - - )} -
- - {depsLoading ? ( -
Loading dependencies...
- ) : depsError ? ( -
{depsError}
- ) : dependencies.length === 0 ? ( -
- {selectedTag ? ( - {selectedTag.name} has no dependencies - ) : ( - No dependencies - )} -
- ) : ( -
-
- {selectedTag?.name} has {dependencies.length} {dependencies.length === 1 ? 'dependency' : 'dependencies'}: -
-
    - {dependencies.map((dep) => ( -
  • - - {dep.project}/{dep.package} - - - @ {dep.version || dep.tag} - - - ✓ - -
  • - ))} -
-
- )} -
- )} - {/* Used By (Reverse Dependencies) Section */}

Used By

@@ -1016,6 +922,104 @@ function PackagePage() {
)} + {/* Dependencies Modal */} + {showDepsModal && selectedTag && ( +
setShowDepsModal(false)}> +
e.stopPropagation()}> +
+

Dependencies for {selectedTag.version || selectedTag.name}

+ +
+
+
+ + +
+ {depsLoading ? ( +
Loading dependencies...
+ ) : depsError ? ( +
{depsError}
+ ) : dependencies.length === 0 ? ( +
No dependencies
+ ) : ( +
+
+ {dependencies.length} {dependencies.length === 1 ? 'dependency' : 'dependencies'}: +
+
    + {dependencies.map((dep) => ( +
  • + setShowDepsModal(false)} + > + {dep.project}/{dep.package} + + + @ {dep.version || dep.tag} + + + ✓ + +
  • + ))} +
+
+ )} +
+
+
+ )} + + {/* Artifact ID Modal */} + {showArtifactIdModal && viewArtifactId && ( +
setShowArtifactIdModal(false)}> +
e.stopPropagation()}> +
+

Artifact ID

+ +
+
+

SHA256 hash identifying this artifact:

+
+ {viewArtifactId} + +
+
+
+
+ )} + {/* Action Menu Dropdown */} {renderActionMenu()}