ketatlas 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2
4
+
5
+ - Show screen status, blockers, linked PR states and scoped state checks in preview footers, with direct access to progress details.
6
+ - Keep the footer visible when scrolling, refresh it after edits, and support read-only previews.
7
+
3
8
  ## 0.2.1
4
9
 
5
10
  - Show compact numeric progress badges after workflow step counts, with status counts, checklist completion and blockers in tooltips.
package/README.md CHANGED
@@ -17,15 +17,15 @@ https://github.com/user-attachments/assets/13f24fc8-7b8e-4bda-9e02-364c120ee163
17
17
  [KetAtlas is available on npm](https://www.npmjs.com/package/ketatlas). Use Node.js 22+ and run it from any directory:
18
18
 
19
19
  ```sh
20
- npx --yes ketatlas@0.2.1 scaffold my-atlas --template web
21
- npx --yes ketatlas@0.2.1 serve my-atlas/atlas.json
22
- npx --yes ketatlas@0.2.1 audit my-atlas/atlas.json --strict
20
+ npx --yes ketatlas@0.2.2 scaffold my-atlas --template web
21
+ npx --yes ketatlas@0.2.2 serve my-atlas/atlas.json
22
+ npx --yes ketatlas@0.2.2 audit my-atlas/atlas.json --strict
23
23
  ```
24
24
 
25
25
  Or install the CLI once for your user account:
26
26
 
27
27
  ```sh
28
- npm install --global ketatlas@0.2.1
28
+ npm install --global ketatlas@0.2.2
29
29
  ketatlas scaffold my-atlas
30
30
  ketatlas serve my-atlas/atlas.json
31
31
  ketatlas audit my-atlas/atlas.json --strict
package/docs/progress.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Open **Screens** to review delivery across the project. Counts use unique screen IDs, not repeated workflow nodes. Filter by status, workflow, blocker, or search names, IDs, tasks and owners. **View in map** focuses a screen; **Screen progress** opens its record from the node inspector. Mockup badges remain separate from implementation status.
4
4
 
5
+ Screen and state preview footers show the shared screen status, blockers and linked PRs with their recorded states. **Progress details** opens the same screen record. State-specific acceptance counts appear only when checks explicitly reference the previewed workflow/node; the shared screen status is not a separate claim that a state has been verified. Missing evidence displays **No linked PRs**. The footer stays visible while scrolling and updates after a save.
6
+
5
7
  ## Sidebar and project completion
6
8
 
7
9
  Project-wide verified/checklist percentages and blocker counts appear in the top bar beside **Screens**. The sidebar shows one compact numeric badge after each workflow’s step count (`2 steps [30%]`). **Verified %** is the number of Verified screens divided by the total unique screens in that scope. Repeated nodes and error variants count once; note/external nodes do not count. Screenless flows have no badge. Percentages round down so unfinished work cannot appear as 100%.
@@ -69,11 +71,11 @@ Evidence kinds are `pr`, `test`, `release`, `reference`. Required fields: `id`,
69
71
  ## Editing locally and from agents
70
72
 
71
73
  ```sh
72
- npx --yes ketatlas@0.2.1 serve atlas.json
73
- npx --yes ketatlas@0.2.1 serve atlas.json --read-only
74
- npx --yes ketatlas@0.2.1 progress atlas.json --init
75
- npx --yes ketatlas@0.2.1 progress atlas.json --json
76
- npx --yes ketatlas@0.2.1 progress atlas.json --set sign-in --record record.json --expect REVISION_FROM_READ
74
+ npx --yes ketatlas@0.2.2 serve atlas.json
75
+ npx --yes ketatlas@0.2.2 serve atlas.json --read-only
76
+ npx --yes ketatlas@0.2.2 progress atlas.json --init
77
+ npx --yes ketatlas@0.2.2 progress atlas.json --json
78
+ npx --yes ketatlas@0.2.2 progress atlas.json --set sign-in --record record.json --expect REVISION_FROM_READ
77
79
  ```
78
80
 
79
81
  `--init` explicitly creates Unassessed records and refuses an existing progress file. `--set` replaces one complete screen record; preserve existing checklist IDs, evidence and state references. Read the revision with `--json` first. Do not retry a stale revision by blindly substituting a new one: reload and reconcile changes. `updatedAt` is stamped on successful record writes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ketatlas",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Interactive HTML maps for screens, workflows, and user journeys.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.js CHANGED
@@ -379,6 +379,7 @@ export function createAtlas(container, input, options = {}) {
379
379
  return;
380
380
  }
381
381
  previewNode = n;
382
+ progressUI.preview(n.screenId, n.flowId, n.id);
382
383
  $("dialog-screen-id").textContent = n.screenId;
383
384
  $("dialog-title").textContent = n.title;
384
385
  $("dialog-open").href = n.url;
@@ -20,7 +20,8 @@ export function mountProgress(root, config, initial, options, selectScreen) {
20
20
  editing,
21
21
  draft,
22
22
  baseline,
23
- saving = false;
23
+ saving = false,
24
+ preview;
24
25
  const $ = (id) => root.getElementById(id);
25
26
  const container = document.createElement("div");
26
27
  container.innerHTML = `
@@ -70,8 +71,29 @@ export function mountProgress(root, config, initial, options, selectScreen) {
70
71
  : "pending";
71
72
  }
72
73
  }
74
+ function paintPreview() {
75
+ if (!preview) return;
76
+ const r = record(preview.screenId);
77
+ const checks = (r.checks || []).filter((c) =>
78
+ c.nodes?.some((n) => n.flowId === preview.flowId && n.nodeId === preview.nodeId),
79
+ );
80
+ const prs = (r.evidence || [])
81
+ .filter((ev) => ev.kind === "pr")
82
+ .map((ev) => {
83
+ const url = safeURL(ev.url, options.baseURL || document.baseURI);
84
+ const parts = new URL(url, document.baseURI).pathname.match(/\/([^/]+)\/pull\/(\d+)\/?$/);
85
+ const title = parts ? `${parts[1]}#${parts[2]}` : ev.title;
86
+ return `<a href="${e(url)}" target="_blank" rel="noopener noreferrer" title="${e(ev.title)}">${e(title)}${ev.state ? ` <span>· ${e(ev.state)}</span>` : ""} ↗</a>`;
87
+ });
88
+ $("dialog-progress").innerHTML =
89
+ `<div class="preview-status"><span>Screen status</span>${badge(r)}${checks.length ? `<span>State checks: ${checks.filter((c) => c.done).length}/${checks.length}</span>` : ""}</div>${r.blocker?.trim() ? `<p class="preview-blocker">${e(r.blocker)}</p>` : ""}<div class="preview-prs" aria-label="Screen pull requests">${prs.length ? prs.join("") : "<span>No linked PRs</span>"}</div>`;
90
+ }
91
+ $("dialog-progress-details").onclick = () => {
92
+ if (preview) edit(preview.screenId);
93
+ };
73
94
  function paint() {
74
95
  paintSidebar();
96
+ paintPreview();
75
97
  for (const el of root.querySelectorAll("[data-progress-screen]"))
76
98
  el.innerHTML = badge(record(el.dataset.progressScreen));
77
99
  const summary = summarizeProgress(data, config.screens);
@@ -274,7 +296,7 @@ export function mountProgress(root, config, initial, options, selectScreen) {
274
296
  $("progress-error").textContent = err.message;
275
297
  $("progress-reload-latest").hidden = !options.reloadProgress;
276
298
  } finally {
277
- saving = false;
299
+ ((saving = false), preview);
278
300
  $("progress-save").disabled = false;
279
301
  }
280
302
  };
@@ -283,6 +305,10 @@ export function mountProgress(root, config, initial, options, selectScreen) {
283
305
  edit,
284
306
  paint,
285
307
  paintSidebar,
308
+ preview(screenId, flowId, nodeId) {
309
+ preview = { screenId, flowId, nodeId };
310
+ paintPreview();
311
+ },
286
312
  open() {
287
313
  paint();
288
314
  $("progress-screens").showModal();
package/src/template.js CHANGED
@@ -30,7 +30,7 @@ export function template(config) {
30
30
  <div class="map-minimap"><span>Current flow</span><svg id="minimap" viewBox="0 0 168 114" role="img" aria-label="Current viewport position"></svg><button id="minimap-fit">Fit entire flow</button></div>
31
31
  </main>
32
32
  </div>
33
- <dialog id="screen-dialog" class="screen-dialog" aria-labelledby="dialog-title"><header><div><small id="dialog-screen-id"></small><h2 id="dialog-title"></h2></div><button id="close-screen" class="icon-button" aria-label="Close preview"></button></header><div id="dialog-preview"></div><footer><p>Interactive preview</p><a id="dialog-open" data-ui="action" data-variant="secondary" target="_blank" rel="noopener noreferrer">Open in new tab</a></footer></dialog>
33
+ <dialog id="screen-dialog" class="screen-dialog" aria-labelledby="dialog-title"><header><div><small id="dialog-screen-id"></small><h2 id="dialog-title"></h2></div><button id="close-screen" class="icon-button" aria-label="Close preview"></button></header><div id="dialog-preview"></div><footer><div id="dialog-progress" class="preview-progress"></div><div class="preview-actions"><button id="dialog-progress-details" data-ui="action" data-variant="secondary">Progress details</button><a id="dialog-open" data-ui="action" data-variant="secondary" target="_blank" rel="noopener noreferrer">Open in new tab</a></div></footer></dialog>
34
34
  <dialog id="help-dialog" class="help-dialog" aria-labelledby="help-title"><h2 id="help-title">Explore the whole journey</h2><ul>
35
35
  <li>Drag the canvas or a screen card to move around.</li><li>Use + / −, Ctrl/⌘ + scroll, or pinch to zoom.</li><li>Choose a workflow in the sidebar. Fit the flow to see every branch.</li><li>Click a node to follow its outgoing steps. Double-click a screen to interact.</li><li>Use arrow keys to pan, F to fit, 0 to return to the start, and Escape to close.</li>
36
36
  </ul><p>Arrows describe the authored flow. Embedded screens keep their own behavior.</p><button id="close-help" data-ui="action" data-variant="primary">Got it</button></dialog>
@@ -1357,3 +1357,52 @@ a svg {
1357
1357
  font-size: var(--kv-text-2xs);
1358
1358
  }
1359
1359
  }
1360
+
1361
+ /* Keep delivery context visible while scrolling a full-size screen preview. */
1362
+ .screen-dialog footer {
1363
+ position: sticky;
1364
+ bottom: 0;
1365
+ z-index: 1;
1366
+ background: var(--kv-panel-bg);
1367
+ flex-wrap: wrap;
1368
+ max-height: 40dvh;
1369
+ overflow: auto;
1370
+ }
1371
+ .preview-progress {
1372
+ flex: 1;
1373
+ min-width: min(240px, 100%);
1374
+ font-size: var(--kv-text-xs);
1375
+ }
1376
+ .preview-status,
1377
+ .preview-prs,
1378
+ .preview-actions {
1379
+ display: flex;
1380
+ flex-wrap: wrap;
1381
+ align-items: center;
1382
+ gap: var(--kv-space-2);
1383
+ }
1384
+ .preview-status {
1385
+ color: var(--kv-text-muted);
1386
+ }
1387
+ .preview-prs {
1388
+ margin-top: var(--kv-space-2);
1389
+ color: var(--kv-text-muted);
1390
+ }
1391
+ .preview-prs a {
1392
+ color: var(--kv-accent);
1393
+ overflow-wrap: anywhere;
1394
+ }
1395
+ .preview-prs a span {
1396
+ color: var(--kv-text-muted);
1397
+ }
1398
+ .screen-dialog .preview-blocker {
1399
+ color: var(--kv-warning);
1400
+ margin-top: var(--kv-space-2);
1401
+ overflow-wrap: anywhere;
1402
+ }
1403
+ .preview-actions {
1404
+ margin-left: auto;
1405
+ }
1406
+ .preview-actions [data-ui] {
1407
+ font-size: var(--kv-text-xs);
1408
+ }
@@ -7,7 +7,7 @@ npx ketatlas serve atlas.json
7
7
  npx ketatlas audit atlas.json --strict
8
8
  ```
9
9
 
10
- Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML, package manifest, lockfile, node_modules, or build step is needed. Alternatively, install the CLI once with npm install --global ketatlas@0.2.1 and use ketatlas serve atlas.json.
10
+ Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML, package manifest, lockfile, node_modules, or build step is needed. Alternatively, install the CLI once with npm install --global ketatlas@0.2.2 and use ketatlas serve atlas.json.
11
11
 
12
12
  Edit the HTML files in screens/ to replace the sample product. styles/design-system.css is generated from the pinned KetJS design system; do not manually fork its tokens.
13
13
 
@@ -7,7 +7,7 @@ npx ketatlas serve atlas.json
7
7
  npx ketatlas audit atlas.json --strict
8
8
  ```
9
9
 
10
- Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML, package manifest, lockfile, node_modules, or build step is needed. Alternatively, install the CLI once with npm install --global ketatlas@0.2.1 and use ketatlas serve atlas.json.
10
+ Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML, package manifest, lockfile, node_modules, or build step is needed. Alternatively, install the CLI once with npm install --global ketatlas@0.2.2 and use ketatlas serve atlas.json.
11
11
 
12
12
  This template models a process without HTML screens. Add a screen registry and screen nodes when needed.
13
13
 
@@ -7,7 +7,7 @@ npx ketatlas serve atlas.json
7
7
  npx ketatlas audit atlas.json --strict
8
8
  ```
9
9
 
10
- Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML, package manifest, lockfile, node_modules, or build step is needed. Alternatively, install the CLI once with npm install --global ketatlas@0.2.1 and use ketatlas serve atlas.json.
10
+ Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML, package manifest, lockfile, node_modules, or build step is needed. Alternatively, install the CLI once with npm install --global ketatlas@0.2.2 and use ketatlas serve atlas.json.
11
11
 
12
12
  Edit the HTML files in screens/ to replace the sample product. styles/design-system.css is generated from the pinned KetJS design system; do not manually fork its tokens.
13
13