ghcr-manager-visualizer 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,6 +27,9 @@ Open the local URL printed by the command and select:
27
27
 
28
28
  Good search terms for tags in most scenarios are: `image`, `multiarch`, `keep`, or `delete`.
29
29
 
30
+ For an overview of the test scenario graphs and cleanup cases, see
31
+ [test-scenarios](https://github.com/ghcr-manager/ghcr-manager/blob/main/docs/test/scenarios.md).
32
+
30
33
  ## Install
31
34
 
32
35
  ```sh
@@ -90,6 +93,12 @@ This is the fastest way to inspect what changed between two scans of one package
90
93
 
91
94
  [![Visualizer Show Compare Mode](https://raw.githubusercontent.com/ghcr-manager/ghcr-manager/main/docs/images/visualizer/visualizer-show-compare-mode.png)](https://github.com/ghcr-manager/ghcr-manager/blob/main/docs/images/visualizer/visualizer-show-compare-mode.png)
92
95
 
96
+ _Example compare view: red-bordered manifests are present in the older scan and removed in the newer one._
97
+
98
+ [![Visualizer Show Compare Mode Tags](https://raw.githubusercontent.com/ghcr-manager/ghcr-manager/main/docs/images/visualizer/visualizer-show-compare-mode--tag-removed.png)](https://github.com/ghcr-manager/ghcr-manager/blob/main/docs/images/visualizer/visualizer-show-compare-mode--tag-removed.png)
99
+
100
+ _Example compare view: tags with '(-)' were removed. Here the manifest with the other tag remained._
101
+
93
102
  ## Source Checkout
94
103
 
95
104
  From this repository checkout, you can run the visualizer without publishing:
@@ -29,6 +29,8 @@ const elements = {
29
29
  detailArtifactType: document.querySelector("#detail-artifact-type"),
30
30
  detailSubject: document.querySelector("#detail-subject"),
31
31
  detailTags: document.querySelector("#detail-tags"),
32
+ toggleGrid: document.querySelector("#toggle-grid"),
33
+ graphGrid: document.querySelector("#graph-grid"),
32
34
  zoomIn: document.querySelector("#zoom-in"),
33
35
  zoomOut: document.querySelector("#zoom-out"),
34
36
  zoomFit: document.querySelector("#zoom-fit")
@@ -41,7 +43,8 @@ const state = {
41
43
  positionsByViewKey: new Map(),
42
44
  selectedDigest: null,
43
45
  selectedManifestDetails: null,
44
- lookupSuggestionRequestId: 0
46
+ lookupSuggestionRequestId: 0,
47
+ gridVisible: false
45
48
  };
46
49
 
47
50
  const _ZOOM_STEP = 1.15;
@@ -174,6 +177,10 @@ elements.closeRawJson.addEventListener("click", () => {
174
177
  elements.rawJsonDialog.close();
175
178
  });
176
179
 
180
+ elements.toggleGrid.addEventListener("click", () => {
181
+ setGridVisible(!state.gridVisible);
182
+ });
183
+
177
184
  elements.zoomIn.addEventListener("click", () => {
178
185
  zoomBy(_ZOOM_STEP);
179
186
  });
@@ -191,6 +198,7 @@ cy.on("tap", "node", async (event) => {
191
198
  });
192
199
 
193
200
  await initializeSelectors();
201
+ setGridVisible(false);
194
202
 
195
203
  async function loadGraphFromForm() {
196
204
  persistCurrentLayoutState();
@@ -522,6 +530,12 @@ function setStatus(message) {
522
530
  elements.status.textContent = message;
523
531
  }
524
532
 
533
+ function setGridVisible(visible) {
534
+ state.gridVisible = visible;
535
+ elements.graphGrid.hidden = !visible;
536
+ elements.toggleGrid.setAttribute("aria-pressed", String(visible));
537
+ }
538
+
525
539
  function replaceLookupSuggestions(values) {
526
540
  elements.lookupSuggestions.replaceChildren(...values.map((value) => buildOption(value, value)));
527
541
  }
@@ -62,10 +62,12 @@
62
62
  </section>
63
63
  <section class="graph-panel">
64
64
  <div class="graph-toolbar" aria-label="Graph controls">
65
+ <button id="toggle-grid" type="button" title="Toggle screenshot grid" aria-pressed="false">Grid</button>
65
66
  <button id="zoom-in" type="button" title="Zoom in">+</button>
66
67
  <button id="zoom-out" type="button" title="Zoom out">-</button>
67
68
  <button id="zoom-fit" type="button" title="Fit graph">Fit</button>
68
69
  </div>
70
+ <div id="graph-grid" class="graph-grid" hidden aria-hidden="true"></div>
69
71
  <div id="graph"></div>
70
72
  </section>
71
73
  <aside class="details">
@@ -1,7 +1,6 @@
1
1
  body {
2
2
  margin: 0;
3
3
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
4
- background: linear-gradient(180deg, #edf2f0 0%, #dde7e2 100%);
5
4
  color: #112218;
6
5
  }
7
6
 
@@ -14,8 +13,6 @@ body {
14
13
  .controls,
15
14
  .details {
16
15
  padding: 1rem;
17
- background: rgba(255, 255, 255, 0.78);
18
- backdrop-filter: blur(8px);
19
16
  min-width: 0;
20
17
  }
21
18
 
@@ -40,6 +37,8 @@ body {
40
37
  top: 1rem;
41
38
  right: 1rem;
42
39
  display: flex;
40
+ flex-wrap: wrap;
41
+ justify-content: flex-end;
43
42
  gap: 0.5rem;
44
43
  z-index: 2;
45
44
  }
@@ -54,6 +53,29 @@ body {
54
53
  #graph {
55
54
  width: 100%;
56
55
  height: 100vh;
56
+ background: #ffffff;
57
+ }
58
+
59
+ .graph-grid {
60
+ position: absolute;
61
+ inset: 0;
62
+ pointer-events: none;
63
+ z-index: 1;
64
+ background-image:
65
+ linear-gradient(rgba(32, 64, 48, 0.08) 1px, transparent 1px),
66
+ linear-gradient(90deg, rgba(32, 64, 48, 0.08) 1px, transparent 1px),
67
+ linear-gradient(rgba(32, 64, 48, 0.18) 1px, transparent 1px),
68
+ linear-gradient(90deg, rgba(32, 64, 48, 0.18) 1px, transparent 1px);
69
+ background-position:
70
+ 0 0,
71
+ 0 0,
72
+ 0 0,
73
+ 0 0;
74
+ background-size:
75
+ 24px 24px,
76
+ 24px 24px,
77
+ 120px 120px,
78
+ 120px 120px;
57
79
  }
58
80
 
59
81
  form {
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { startVisualizerServer } from "./_server.js";
2
3
  export type { VisualizerServerHandle } from "./_server.js";
3
4
  export interface CliOptions {
package/dist/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { isAbsolute, resolve } from "node:path";
2
3
  import { startVisualizerServer } from "./_server.js";
3
4
  export async function main(args, startServer = startVisualizerServer) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ghcr-manager-visualizer",
3
3
  "description": "Inspect ghcr-manager SQLite scan databases in a local browser graph visualizer.",
4
4
  "homepage": "https://github.com/ghcr-manager/ghcr-manager#readme",
5
- "version": "v1.0.3",
5
+ "version": "v1.0.4",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "keywords": [