@rasensio/aidlc 1.91.0 → 1.93.0

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.
Files changed (35) hide show
  1. package/dist/commands/start.d.ts.map +1 -1
  2. package/dist/commands/start.js +118 -72
  3. package/dist/commands/start.js.map +1 -1
  4. package/dist/concurrency/worktree.d.ts +13 -0
  5. package/dist/concurrency/worktree.d.ts.map +1 -1
  6. package/dist/concurrency/worktree.js +31 -8
  7. package/dist/concurrency/worktree.js.map +1 -1
  8. package/dist/roadmap/graph.d.ts +20 -1
  9. package/dist/roadmap/graph.d.ts.map +1 -1
  10. package/dist/roadmap/graph.js +91 -18
  11. package/dist/roadmap/graph.js.map +1 -1
  12. package/dist/roadmap/markdown.d.ts +25 -0
  13. package/dist/roadmap/markdown.d.ts.map +1 -0
  14. package/dist/roadmap/markdown.js +144 -0
  15. package/dist/roadmap/markdown.js.map +1 -0
  16. package/dist/roadmap/promote.d.ts +19 -0
  17. package/dist/roadmap/promote.d.ts.map +1 -1
  18. package/dist/roadmap/promote.js +42 -8
  19. package/dist/roadmap/promote.js.map +1 -1
  20. package/dist/roadmap/summary.d.ts +6 -0
  21. package/dist/roadmap/summary.d.ts.map +1 -1
  22. package/dist/roadmap/summary.js +25 -0
  23. package/dist/roadmap/summary.js.map +1 -1
  24. package/dist/roadmap/view-assets.d.ts.map +1 -1
  25. package/dist/roadmap/view-assets.js +95 -25
  26. package/dist/roadmap/view-assets.js.map +1 -1
  27. package/dist/roadmap/view-html.d.ts +4 -3
  28. package/dist/roadmap/view-html.d.ts.map +1 -1
  29. package/dist/roadmap/view-html.js +88 -46
  30. package/dist/roadmap/view-html.js.map +1 -1
  31. package/dist/roadmap/view-model.d.ts +21 -0
  32. package/dist/roadmap/view-model.d.ts.map +1 -1
  33. package/dist/roadmap/view-model.js +39 -3
  34. package/dist/roadmap/view-model.js.map +1 -1
  35. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"summ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U,QAmGtB,CAAC;AAEF,eAAO,MAAM,WAAW,QAsYF,CAAC"}
1
+ {"version":3,"file":"view-assets.d.ts","sourceRoot":"","sources":["../../src/roadmap/view-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,UAAU,QA6HtB,CAAC;AAEF,eAAO,MAAM,WAAW,QAkbF,CAAC"}
@@ -21,11 +21,13 @@
21
21
  export const VIEW_STYLE = String.raw `
22
22
  :root { color-scheme: light; --bg: #ffffff; --bg-2: #f6f7f9; --card: #ffffff; --ink: #1b1d22; --muted: #5b616e; --line: #e1e4e8; --line-2: #c4c9d1;
23
23
  --link: #3e4ab8; --accent-ink: #3e4ab8; --chip-on: #e8eafb; --focus: #5e6ad2; --unmet: #c9252d; --shade: rgba(15, 17, 20, .12);
24
- --st-inbox: #6b7280; --st-backlog: #6b7280; --st-in-progress: #b06d0b; --st-done: #5e6ad2; --st-hold: #6b7280;
24
+ --st-inbox: #6b7280; --st-backlog: #6b7280; --st-in-progress: #a87300; --st-done: #1f7a43; --st-hold: #858b96;
25
+ --st-inbox-bg: #ffffff; --st-backlog-bg: #eef0f3; --st-in-progress-bg: #fdf4d3; --st-done-bg: #e3f3e8; --st-hold-bg: #fafbfc;
25
26
  --ready-bg: #e2f4e7; --ready-ink: #17643a; --blocked-bg: #fde7e7; --blocked-ink: #ae1f28; }
26
27
  :root[data-theme="dark"] { color-scheme: dark; --bg: #101113; --bg-2: #16171a; --card: #1c1d21; --ink: #e8e9ec; --muted: #a0a5ae; --line: #2c2e34; --line-2: #464a53;
27
28
  --link: #a9b0f6; --accent-ink: #a9b0f6; --chip-on: #2b2e4c; --focus: #8f98f4; --unmet: #ff6b6b; --shade: rgba(0, 0, 0, .5);
28
- --st-inbox: #9aa0aa; --st-backlog: #9aa0aa; --st-in-progress: #e3a33b; --st-done: #8f98f4; --st-hold: #9aa0aa;
29
+ --st-inbox: #9aa0aa; --st-backlog: #9aa0aa; --st-in-progress: #e0b03c; --st-done: #4fbf7c; --st-hold: #7a808a;
30
+ --st-inbox-bg: #1c1d21; --st-backlog-bg: #25272c; --st-in-progress-bg: #2c2612; --st-done-bg: #13291c; --st-hold-bg: #18191c;
29
31
  --ready-bg: #12301f; --ready-ink: #74dc9e; --blocked-bg: #3b1719; --blocked-ink: #ff9d9d; }
30
32
  * { box-sizing: border-box; }
31
33
  body { margin: 0; color: var(--ink); background: var(--bg); font: .875rem/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
@@ -66,23 +68,38 @@ h1 { margin: 0; font-size: 1rem; font-weight: 600; }
66
68
  .col.off { flex: 0 0 2.75rem; min-width: 2.75rem; }
67
69
  .col.off > .rail { display: flex; align-items: center; gap: .4rem; width: 2.75rem; min-height: 14rem; padding: .6rem 0; writing-mode: vertical-rl; background: var(--bg-2); color: var(--muted); }
68
70
  .col h3 { display: flex; align-items: center; margin: 0 0 .5rem; padding: .25rem .25rem; font-size: .8125rem; font-weight: 600; }
71
+ .group-h { margin: .6rem .25rem .3rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
69
72
  .count { font-weight: 400; color: var(--muted); margin-left: .4rem; }
70
73
  .cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .375rem; }
71
74
  .card { background: var(--card); border: 1px solid var(--line); border-radius: .375rem; padding: .5rem .625rem; cursor: pointer; }
72
- .card:hover { border-color: var(--line-2); box-shadow: 0 1px 2px var(--shade); }
75
+ .card:hover { box-shadow: 0 1px 2px var(--shade); }
76
+ .card.s-inbox, .sw.s-inbox { border: 1px dashed var(--st-inbox); background: var(--st-inbox-bg); }
77
+ .card.s-backlog, .sw.s-backlog { border: 1px solid var(--st-backlog); background: var(--st-backlog-bg); }
78
+ .card.s-in-progress, .sw.s-in-progress { border: 1px solid var(--st-in-progress); background: var(--st-in-progress-bg); }
79
+ .card.s-done, .sw.s-done { border: 1px solid var(--st-done); background: var(--st-done-bg); }
80
+ .card.s-hold, .sw.s-hold { border: 1.5px dotted var(--st-hold); background: var(--st-hold-bg); }
81
+ .card.s-hold .open { color: var(--muted); }
73
82
  .card p { margin: .2rem 0 0; }
74
83
  .card .title { display: flex; align-items: baseline; margin: 0; }
75
- .card .open { border: 0; background: none; padding: 0; min-height: 0; text-align: left; font-weight: 500; line-height: 1.4; }
84
+ .ships { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .25rem; }
85
+ .ship { display: flex; align-items: baseline; gap: .5rem; padding: .3rem .6rem; border: 1px solid var(--st-done); border-radius: .375rem; background: var(--st-done-bg); cursor: pointer; }
86
+ .ship time { color: var(--muted); font-size: .75rem; }
87
+ .week h3 { margin: .75rem 0 .4rem; font-size: .8125rem; font-weight: 600; }
88
+ .card .open, .ship .open { border: 0; background: none; padding: 0; min-height: 0; text-align: left; font-weight: 500; line-height: 1.4; }
76
89
  .rank { color: var(--muted); font-weight: 600; }
77
90
  .badge { display: inline-block; margin-right: .35rem; padding: 0 .45rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
78
91
  .badge.ready { background: var(--ready-bg); color: var(--ready-ink); }
79
- .badge.blocked { background: var(--blocked-bg); color: var(--blocked-ink); }
92
+ .badge.blocked, .badge.stale { background: var(--blocked-bg); color: var(--blocked-ink); }
80
93
  .age, .links, .hold { font-size: .75rem; }
81
94
  .age, .hold { color: var(--muted); }
82
95
  .board:not(.searching) .col:not(.expanded) .capped { display: none; }
83
96
  .show-all { margin: .5rem 0; }
84
97
  .map-controls, .legend, .empty { margin: 0 0 .5rem; }
85
98
  .legend { color: var(--muted); font-size: .8125rem; }
99
+ .map-wrap { position: relative; }
100
+ .status-legend { position: absolute; top: .5rem; right: .5rem; display: grid; gap: .2rem; margin: 0; padding: .4rem .6rem; list-style: none; font-size: .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: .375rem; }
101
+ .status-legend li { display: flex; align-items: center; gap: .4rem; }
102
+ .sw { display: inline-block; width: 1rem; height: .75rem; border-radius: .2rem; }
86
103
  #map { display: block; width: 100%; height: calc(100vh - 12.5rem); min-height: 24rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--bg-2); touch-action: none; cursor: grab; }
87
104
  #map text { fill: var(--ink); font-size: 14px; }
88
105
  #map .sub, #map .clabel { fill: var(--muted); font-size: 12px; }
@@ -90,9 +107,12 @@ h1 { margin: 0; font-size: 1rem; font-weight: 600; }
90
107
  #map .node rect { fill: var(--card); stroke: var(--line-2); stroke-width: 1.5; }
91
108
  #map .node:focus { outline: none; }
92
109
  #map .node:focus-visible rect, #map .toggle:focus-visible circle { stroke: var(--focus); stroke-width: 3; }
93
- #map .s-inbox rect { stroke: var(--st-inbox); stroke-dasharray: 4 3; }
94
- #map .s-in-progress rect { stroke: var(--st-in-progress); }
95
- #map .s-done rect { stroke: var(--st-done); }
110
+ #map .s-inbox rect { fill: var(--st-inbox-bg); stroke: var(--st-inbox); stroke-dasharray: 4 3; }
111
+ #map .s-backlog rect { fill: var(--st-backlog-bg); stroke: var(--st-backlog); }
112
+ #map .s-in-progress rect { fill: var(--st-in-progress-bg); stroke: var(--st-in-progress); }
113
+ #map .s-done rect { fill: var(--st-done-bg); stroke: var(--st-done); }
114
+ #map .s-hold rect { fill: var(--st-hold-bg); stroke: var(--st-hold); stroke-dasharray: 2 3; }
115
+ #map .s-hold .label { fill: var(--muted); }
96
116
  #map .missing rect { fill: var(--blocked-bg); stroke: var(--unmet); stroke-dasharray: 6 3; }
97
117
  #map .edge { fill: none; stroke: var(--st-hold); stroke-width: 1.5; }
98
118
  #map .edge.further { stroke-dasharray: 2 4; }
@@ -100,7 +120,7 @@ h1 { margin: 0; font-size: 1rem; font-weight: 600; }
100
120
  #map .toggle { cursor: pointer; }
101
121
  #map .toggle circle { fill: var(--card); stroke: var(--muted); stroke-width: 1.5; }
102
122
  #map .toggle text { text-anchor: middle; font-weight: 700; font-size: 15px; }
103
- #map .off { display: none; }
123
+ #map .off, #map.hide-done .node.s-done, #map.hide-done [data-done] { display: none; }
104
124
  #map .dim { opacity: .25; }
105
125
  #map.focus .node:not(.hl) { opacity: .25; }
106
126
  #map.focus .edge:not(.hl) { opacity: .12; }
@@ -111,6 +131,12 @@ h1 { margin: 0; font-size: 1rem; font-weight: 600; }
111
131
  .panel h3 { margin: 1rem 0 .35rem; font-size: .8125rem; font-weight: 600; color: var(--muted); }
112
132
  .panel .meta { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; color: var(--muted); }
113
133
  .panel .close { float: right; }
134
+ .full h4, .full h5, .full h6 { margin: .9rem 0 .3rem; font-size: .875rem; font-weight: 600; }
135
+ .full .table { overflow-x: auto; }
136
+ .full table { border-collapse: collapse; font-size: .8125rem; }
137
+ .full th, .full td { padding: .2rem .4rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
138
+ .full pre { overflow-x: auto; padding: .5rem; border-radius: .25rem; background: var(--bg-2); }
139
+ .full blockquote { margin: .5rem 0; padding-left: .75rem; border-left: 3px solid var(--line-2); color: var(--muted); }
114
140
  .cmds { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
115
141
  .cmds li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
116
142
  .cmd-label { flex-basis: 100%; color: var(--muted); font-size: .75rem; }
@@ -147,17 +173,25 @@ export const VIEW_SCRIPT = String.raw `
147
173
  var DAY = 86400000;
148
174
  var now = Date.now();
149
175
  all('time.age').forEach(function (t) {
150
- var created = Date.parse(t.getAttribute('datetime') + 'T00:00:00Z');
151
- if (isNaN(created)) return;
152
- var days = Math.max(0, Math.floor((now - created) / DAY));
153
- t.textContent = days === 1 ? '1 day old' : days + ' days old';
154
- t.setAttribute('title', 'created ' + t.getAttribute('datetime'));
176
+ var d = t.getAttribute('datetime'), since = Date.parse(d + 'T00:00:00Z');
177
+ if (isNaN(since)) return;
178
+ var days = Math.max(0, Math.floor((now - since) / DAY));
179
+ var p = t.getAttribute('data-phrase'), n = days === 1 ? '1 day' : days + ' days', max = t.getAttribute('data-stale');
180
+ t.textContent = p ? p + ' ' + n : n + ' old';
181
+ t.setAttribute('title', (p ? 'since ' : 'created ') + d);
182
+ if (max && days > +max) {
183
+ var b = doc.createElement('span');
184
+ b.className = 'badge stale';
185
+ b.textContent = 'stale';
186
+ t.parentNode.insertBefore(b, t);
187
+ }
155
188
  });
156
189
 
157
190
  // View state. Each tab keeps its own filters; all of it round-trips through the hash.
158
191
  var ALL = ['inbox', 'backlog', 'in-progress', 'done', 'hold'];
159
192
  var ONLY = ['ready', 'blocked'];
160
- var S = { tab: 'board', open: true, board: { s: ALL.slice(0, 3), o: [] }, deps: { s: ALL.slice(), o: [] } };
193
+ var TABS = ['board', 'deps', 'shipped'];
194
+ var S = { tab: 'board', open: true, hide: true, board: { s: ALL.slice(0, 3), o: [] }, deps: { s: ALL.slice(), o: [] } };
161
195
  function listOf(v, known) {
162
196
  if (v === '') return [];
163
197
  var out = v.split('.');
@@ -170,8 +204,8 @@ export const VIEW_SCRIPT = String.raw `
170
204
  var at = part.indexOf('=');
171
205
  if (at < 0) return;
172
206
  var k = part.slice(0, at), v = part.slice(at + 1), list;
173
- if (k === 'tab' && (v === 'board' || v === 'deps')) S.tab = v;
174
- else if (k === 'open' && (v === '0' || v === '1')) S.open = v === '1';
207
+ if (k === 'tab' && TABS.indexOf(v) >= 0) S.tab = v;
208
+ else if ((k === 'open' || k === 'hide-done') && (v === '0' || v === '1')) S[k === 'open' ? 'open' : 'hide'] = v === '1';
175
209
  else if (k === 'board' || k === 'deps') { list = listOf(v, ALL); if (list) S[k].s = list; }
176
210
  else if (k === 'board-only' || k === 'deps-only') { list = listOf(v, ONLY); if (list) S[k.slice(0, -5)].o = list; }
177
211
  });
@@ -180,7 +214,7 @@ export const VIEW_SCRIPT = String.raw `
180
214
  function writeHash() {
181
215
  if (!live) return;
182
216
  var h = 'tab=' + S.tab + '&board=' + S.board.s.join('.') + '&board-only=' + S.board.o.join('.') +
183
- '&deps=' + S.deps.s.join('.') + '&deps-only=' + S.deps.o.join('.') + '&open=' + (S.open ? 1 : 0);
217
+ '&deps=' + S.deps.s.join('.') + '&deps-only=' + S.deps.o.join('.') + '&open=' + (S.open ? 1 : 0) + '&hide-done=' + (S.hide ? 1 : 0);
184
218
  try { history.replaceState(null, '', '#' + h); } catch (e) { /* the view still works */ }
185
219
  }
186
220
  function toggled(list, v, order) {
@@ -204,6 +238,8 @@ export const VIEW_SCRIPT = String.raw `
204
238
  var viewport = one('#viewport', svg);
205
239
  var unlinked = one('.unlinked', svg);
206
240
  var openBtn = one('#open-chains');
241
+ var hideBtn = one('#hide-done');
242
+ function onMap(n) { return !n.closest('.off') && !(S.hide && n.classList.contains('s-done')); }
207
243
  function place(g) {
208
244
  if (!g) return;
209
245
  var p = g.getAttribute(S.open ? 'data-open' : 'data-all') || g.getAttribute('data-all');
@@ -226,7 +262,14 @@ export const VIEW_SCRIPT = String.raw `
226
262
  var shown = 0, lit = 0, inDeps = 0, dim = {};
227
263
  all('.card').forEach(function (c) { var m = match(c, S.board); c.hidden = !m; if (m) shown++; });
228
264
  board.classList.toggle('searching', q !== '');
265
+ var ships = 0;
266
+ all('.ship').forEach(function (s) { var m = q === '' || s.getAttribute('data-search').indexOf(q) !== -1; s.hidden = !m; if (m) ships++; });
229
267
  if (openBtn) attr(openBtn, 'aria-pressed', S.open);
268
+ svg.classList.toggle('hide-done', S.hide);
269
+ if (hideBtn) {
270
+ attr(hideBtn, 'aria-pressed', S.hide);
271
+ hideBtn.textContent = S.hide ? hideBtn.getAttribute('data-count') + ' done hidden — show' : 'Hide done';
272
+ }
230
273
  all('.cluster', svg).forEach(function (c) {
231
274
  var off = S.open && c.classList.contains('closed');
232
275
  c.classList.toggle('off', off);
@@ -237,12 +280,12 @@ export const VIEW_SCRIPT = String.raw `
237
280
  all('.node', svg).forEach(function (n) {
238
281
  var d = !match(n, S.deps);
239
282
  n.classList.toggle('dim', d);
240
- if (d) dim[n.getAttribute('data-ref')] = 1; else if (!n.closest('.off')) lit++;
283
+ if (d) dim[n.getAttribute('data-ref')] = 1; else if (onMap(n)) lit++;
241
284
  });
242
285
  all('.edge', svg).forEach(function (e) { e.classList.toggle('dim', !!(dim[e.getAttribute('data-from')] || dim[e.getAttribute('data-to')])); });
243
286
  one('#n-board').textContent = shown;
244
287
  one('#n-deps').textContent = inDeps;
245
- var n = S.tab === 'board' ? shown : lit;
288
+ var n = S.tab === 'board' ? shown : S.tab === 'deps' ? lit : ships;
246
289
  one('#search-status').textContent = q === '' ? '' : n === 1 ? '1 item matches' : n + ' items match';
247
290
  writeHash();
248
291
  }
@@ -259,7 +302,7 @@ export const VIEW_SCRIPT = String.raw `
259
302
  t.addEventListener('keydown', function (e) {
260
303
  if (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return;
261
304
  e.preventDefault();
262
- selectTab(S.tab === 'board' ? 'deps' : 'board', true);
305
+ selectTab(TABS[(TABS.indexOf(S.tab) + (e.key === 'ArrowRight' ? 1 : 2)) % 3], true);
263
306
  });
264
307
  });
265
308
  all('.filters').forEach(function (bar) {
@@ -299,14 +342,15 @@ export const VIEW_SCRIPT = String.raw `
299
342
  var closeBtn = one('#panel-close');
300
343
  var say = one('#live');
301
344
  var opener = null;
302
- function openPanel(ref, from) {
345
+ function openPanel(ref, from, keep) {
303
346
  var tpl = doc.getElementById('detail-' + ref);
304
347
  if (!tpl) return;
305
348
  panelBody.replaceChildren(tpl.content.cloneNode(true));
306
349
  say.textContent = '';
307
350
  panel.hidden = false;
308
351
  opener = from || null;
309
- closeBtn.focus();
352
+ cur = ref;
353
+ if (!keep) closeBtn.focus();
310
354
  }
311
355
  function closePanel() {
312
356
  if (panel.hidden) return;
@@ -349,7 +393,7 @@ export const VIEW_SCRIPT = String.raw `
349
393
  e.preventDefault();
350
394
  gotoCard(a.getAttribute('data-goto'));
351
395
  });
352
- all('.card').forEach(function (card) {
396
+ all('.card, .ship').forEach(function (card) {
353
397
  card.addEventListener('click', function (e) {
354
398
  if (e.target.closest('a')) return;
355
399
  openPanel(card.getAttribute('data-ref'), one('.open', card));
@@ -378,6 +422,30 @@ export const VIEW_SCRIPT = String.raw `
378
422
  svg.addEventListener('mouseout', leave);
379
423
  svg.addEventListener('focusout', leave);
380
424
 
425
+ // j and k walk the current tab's shown items. What is shown is read from state, never from
426
+ // the browser's geometry, so jsdom sees what a browser sees (roadmap-view-readability/AC-25, AC-26).
427
+ var cur = null;
428
+ function items() {
429
+ if (S.tab === 'board') {
430
+ return all('.card').filter(function (c) {
431
+ var col = c.closest('.col');
432
+ return !c.hidden && !col.classList.contains('off') && !(c.classList.contains('capped') && q === '' && !col.classList.contains('expanded'));
433
+ });
434
+ }
435
+ if (S.tab === 'shipped') return all('.ship').filter(function (s) { return !s.hidden; });
436
+ return all('.node', svg).filter(onMap);
437
+ }
438
+ function step(by) {
439
+ var list = items(), at = -1;
440
+ if (!list.length) return;
441
+ list.forEach(function (el, i) { if (el.getAttribute('data-ref') === cur) at = i; });
442
+ var el = list[at < 0 ? 0 : Math.max(0, Math.min(list.length - 1, at + by))];
443
+ var focus = el.classList.contains('node') ? el : one('.open', el);
444
+ cur = el.getAttribute('data-ref');
445
+ focus.focus();
446
+ if (!panel.hidden) openPanel(cur, focus, true);
447
+ }
448
+
381
449
  doc.addEventListener('keydown', function (e) {
382
450
  if (e.ctrlKey || e.metaKey || e.altKey) return;
383
451
  if (e.key === 'Escape') {
@@ -388,7 +456,8 @@ export const VIEW_SCRIPT = String.raw `
388
456
  }
389
457
  if (/^(INPUT|TEXTAREA|SELECT)$/.test(e.target.tagName || '')) return;
390
458
  if (e.key === '/') { e.preventDefault(); search.focus(); }
391
- else if (e.key === '1' || e.key === '2') selectTab(e.key === '1' ? 'board' : 'deps', true);
459
+ else if (e.key === 'j' || e.key === 'k') { e.preventDefault(); step(e.key === 'j' ? 1 : -1); }
460
+ else if (/^[123]$/.test(e.key)) selectTab(TABS[+e.key - 1], true);
392
461
  });
393
462
 
394
463
  var k = 1, tx = 0, ty = 0;
@@ -501,6 +570,7 @@ export const VIEW_SCRIPT = String.raw `
501
570
  });
502
571
  }
503
572
  if (openBtn) openBtn.addEventListener('click', function () { S.open = !S.open; render(); fit(); });
573
+ if (hideBtn) hideBtn.addEventListener('click', function () { S.hide = !S.hide; render(); });
504
574
  one('#fit').addEventListener('click', fit);
505
575
 
506
576
  readHash();
@@ -1 +1 @@
1
- {"version":3,"file":"view-assets.js","sourceRoot":"","sources":["../../src/roadmap/view-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGnC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsYpC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,sEAAsE"}
1
+ {"version":3,"file":"view-assets.js","sourceRoot":"","sources":["../../src/roadmap/view-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HnC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkbpC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,sEAAsE"}
@@ -16,11 +16,10 @@
16
16
  * @module
17
17
  */
18
18
  import { type RoadmapStatus } from './paths.js';
19
- import type { RoadmapView, ViewItem } from './view-model.js';
19
+ import { type RoadmapView, type ViewItem } from './view-model.js';
20
+ export { escapeHtml } from './markdown.js';
20
21
  /** Done cards shown before "show all" (AC-18). */
21
22
  export declare const DONE_VISIBLE = 20;
22
- /** Escape text for HTML text and double-quoted attribute values alike. */
23
- export declare function escapeHtml(text: string): string;
24
23
  /** A CSP source expression for `text`. */
25
24
  export declare function cspHash(text: string): string;
26
25
  /** The policy the page carries: nothing loads, and only this page's own style and script run. */
@@ -33,6 +32,8 @@ export declare function contentSecurityPolicy(): string;
33
32
  * library would be the first dependency the page grows.
34
33
  */
35
34
  export declare function renderSummary(markdown: string): string;
35
+ /** Days in state after which an inbox, backlog or in-progress card is marked stale (roadmap-view-readability/AC-18). */
36
+ export declare const STALE_DAYS = 30;
36
37
  /** Statuses the Board shows when the URL names none (AC-1). */
37
38
  export declare const BOARD_DEFAULT: readonly RoadmapStatus[];
38
39
  /** The five presets every tab offers, in order (AC-6). */
@@ -1 +1 @@
1
- {"version":3,"file":"view-html.d.ts","sourceRoot":"","sources":["../../src/roadmap/view-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,kDAAkD;AAClD,eAAO,MAAM,YAAY,KAAK,CAAC;AA8B/B,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,0CAA0C;AAC1C,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAcD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgCtD;AA8DD,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,SAAS,aAAa,EAAwC,CAAC;AAuB3F,0DAA0D;AAC1D,eAAO,MAAM,OAAO,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,EAMlF,CAAC;AAwKF,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAmB3D;AAgDD,6BAA6B;AAC7B,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAiDpD"}
1
+ {"version":3,"file":"view-html.d.ts","sourceRoot":"","sources":["../../src/roadmap/view-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,kDAAkD;AAClD,eAAO,MAAM,YAAY,KAAK,CAAC;AAkB/B,0CAA0C;AAC1C,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgCtD;AAiDD,wHAAwH;AACxH,eAAO,MAAM,UAAU,KAAK,CAAC;AA0B7B,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,SAAS,aAAa,EAAwC,CAAC;AAyC3F,0DAA0D;AAC1D,eAAO,MAAM,OAAO,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,EAMlF,CAAC;AA2MF,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAmB3D;AAkDD,6BAA6B;AAC7B,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAmDpD"}
@@ -16,13 +16,14 @@
16
16
  * @module
17
17
  */
18
18
  import { createHash } from 'node:crypto';
19
- import { NODE_H, NODE_W } from './graph.js';
19
+ import { LABEL_TOP, LINE_H, NODE_W, wrapLabel } from './graph.js';
20
+ import { escapeHtml, inline, renderMarkdown } from './markdown.js';
20
21
  import { ROADMAP_STATUSES } from './paths.js';
21
22
  import { VIEW_SCRIPT, VIEW_STYLE } from './view-assets.js';
23
+ import { shippedWeeks } from './view-model.js';
24
+ export { escapeHtml } from './markdown.js';
22
25
  /** Done cards shown before "show all" (AC-18). */
23
26
  export const DONE_VISIBLE = 20;
24
- /** Map labels are cut to this many code points; the full title is in the node's `<title>`. */
25
- const LABEL_MAX = 34;
26
27
  const COLUMN_NAME = {
27
28
  inbox: 'Inbox',
28
29
  backlog: 'Backlog',
@@ -37,18 +38,6 @@ const STATUS_TEXT = {
37
38
  done: 'done',
38
39
  hold: 'hold',
39
40
  };
40
- const ENTITIES = {
41
- '&': '&amp;',
42
- '<': '&lt;',
43
- '>': '&gt;',
44
- '"': '&quot;',
45
- "'": '&#39;',
46
- '`': '&#96;',
47
- };
48
- /** Escape text for HTML text and double-quoted attribute values alike. */
49
- export function escapeHtml(text) {
50
- return text.replace(/[&<>"'`]/g, (c) => ENTITIES[c]);
51
- }
52
41
  /** A CSP source expression for `text`. */
53
42
  export function cspHash(text) {
54
43
  return `'sha256-${createHash('sha256').update(text, 'utf8').digest('base64')}'`;
@@ -57,19 +46,6 @@ export function cspHash(text) {
57
46
  export function contentSecurityPolicy() {
58
47
  return `default-src 'none'; style-src ${cspHash(VIEW_STYLE)}; script-src ${cspHash(VIEW_SCRIPT)}; base-uri 'none'; form-action 'none'`;
59
48
  }
60
- /** `**bold**` and `` `code` `` inside one line; every other character is escaped. Emits no links. */
61
- function inline(md) {
62
- return md
63
- .split(/(\*\*[^*\n]+\*\*|`[^`\n]+`)/)
64
- .map((part) => {
65
- if (/^\*\*[^*\n]+\*\*$/.test(part))
66
- return `<strong>${escapeHtml(part.slice(2, -2))}</strong>`;
67
- if (/^`[^`\n]+`$/.test(part))
68
- return `<code>${escapeHtml(part.slice(1, -1))}</code>`;
69
- return escapeHtml(part);
70
- })
71
- .join('');
72
- }
73
49
  /**
74
50
  * The executive summary as HTML: paragraphs and `- ` lists, with bold and code spans.
75
51
  *
@@ -115,10 +91,6 @@ export function renderSummary(markdown) {
115
91
  flushList();
116
92
  return blocks.join('');
117
93
  }
118
- function truncate(text) {
119
- const points = Array.from(text);
120
- return points.length <= LABEL_MAX ? text : `${points.slice(0, LABEL_MAX - 1).join('')}…`;
121
- }
122
94
  function link(href, text) {
123
95
  return href === null ? null : `<a href="${escapeHtml(href)}">${escapeHtml(text)}</a>`;
124
96
  }
@@ -153,12 +125,30 @@ function filterable(v) {
153
125
  data: `data-status="${v.status}" data-search="${escapeHtml(`${v.title} ${v.id ?? v.key}`.toLowerCase())}"`,
154
126
  };
155
127
  }
128
+ /** How an open card names its time in state; done cards keep "N days old" (roadmap-view-readability/AC-16). */
129
+ const IN_STATE = {
130
+ inbox: 'in inbox',
131
+ backlog: 'in backlog',
132
+ 'in-progress': 'in progress',
133
+ hold: 'on hold',
134
+ };
135
+ /** Days in state after which an inbox, backlog or in-progress card is marked stale (roadmap-view-readability/AC-18). */
136
+ export const STALE_DAYS = 30;
137
+ /** The age element; the page script turns its date into days, so the bytes do not change daily (AC-19). */
138
+ function ageOf(v) {
139
+ const phrase = IN_STATE[v.status];
140
+ if (phrase === undefined)
141
+ return v.createdAt === null ? '' : `<time class="age" datetime="${v.createdAt}">created ${v.createdAt}</time>`;
142
+ if (v.since === null)
143
+ return '';
144
+ const stale = v.status === 'hold' ? '' : ` data-stale="${STALE_DAYS}"`;
145
+ return `<time class="age" datetime="${v.since}" data-phrase="${phrase}"${stale}>${phrase} since ${v.since}</time>`;
146
+ }
156
147
  function card(v, capped) {
157
148
  const f = filterable(v);
158
149
  const classes = ['card', `s-${v.status}`, f.cls, capped ? 'capped' : ''].filter((c) => c !== '').join(' ');
159
150
  const rank = v.rank === null ? '' : `<span class="rank">#${v.rank}</span> `;
160
- const age = v.createdAt === null ? '' : `<time class="age" datetime="${v.createdAt}">created ${v.createdAt}</time>`;
161
- const marks = badges(v) + age;
151
+ const marks = badges(v) + ageOf(v);
162
152
  return [
163
153
  `<li class="${classes}" id="card-${v.ref}" data-ref="${v.ref}" ${f.data}>`,
164
154
  `<p class="title">${ring(v.status)}<button type="button" class="open" aria-haspopup="dialog">${rank}${escapeHtml(v.title)}</button></p>`,
@@ -170,9 +160,26 @@ function card(v, capped) {
170
160
  }
171
161
  /** Statuses the Board shows when the URL names none (AC-1). */
172
162
  export const BOARD_DEFAULT = ['inbox', 'backlog', 'in-progress'];
163
+ /** Hold's groups, in order: "not now", "never", then anything else (roadmap-view-readability/AC-24). */
164
+ const HOLD_GROUPS = [
165
+ ['parked', 'Parked'],
166
+ ['declined', 'Declined'],
167
+ ['on hold', 'On hold'],
168
+ ];
169
+ function holdGroups(refs, byRef) {
170
+ return HOLD_GROUPS.map(([kind, name]) => {
171
+ const group = refs.filter((ref) => byRef.get(ref).hold?.kind === kind);
172
+ if (group.length === 0)
173
+ return '';
174
+ return `<h4 class="group-h">${name} <span class="count">${group.length}</span></h4>\n<ol class="cards">\n${group.map((ref) => card(byRef.get(ref), false)).join('\n')}\n</ol>`;
175
+ })
176
+ .filter((g) => g !== '')
177
+ .join('\n');
178
+ }
173
179
  function column(view, byRef, status) {
174
180
  const refs = view.columns[status];
175
181
  const cards = refs.map((ref, n) => card(byRef.get(ref), status === 'done' && n >= DONE_VISIBLE)).join('\n');
182
+ const list = status === 'hold' && refs.length > 0 ? holdGroups(refs, byRef) : `<ol class="cards">${cards === '' ? '' : `\n${cards}\n`}</ol>`;
176
183
  const more = status === 'done' && refs.length > DONE_VISIBLE
177
184
  ? `<button type="button" class="show-all" aria-expanded="false" data-more="Show all (${refs.length})" data-less="Show the latest ${DONE_VISIBLE}">Show all (${refs.length})</button>`
178
185
  : '';
@@ -183,7 +190,7 @@ function column(view, byRef, status) {
183
190
  `<button type="button" class="rail" data-show="${status}" aria-label="Show ${COLUMN_NAME[status]}, ${refs.length} ${refs.length === 1 ? 'item' : 'items'}">${ring(status)}<span>${COLUMN_NAME[status]} ${refs.length}</span></button>`,
184
191
  '<div class="body">',
185
192
  `<h3 id="col-${status}">${ring(status)}${COLUMN_NAME[status]} <span class="count">${refs.length}</span></h3>`,
186
- `<ol class="cards">${cards === '' ? '' : `\n${cards}\n`}</ol>`,
193
+ list,
187
194
  more,
188
195
  '</div>',
189
196
  '</section>',
@@ -248,13 +255,16 @@ function labelOf(view, byRef, ref) {
248
255
  done: false,
249
256
  };
250
257
  }
251
- function svgNode(l, ref, x, y, chain, sub) {
258
+ /** A box with its whole title, one `<tspan>` a line, and the status line under it (roadmap-view-readability/AC-1, AC-5). */
259
+ function svgNode(l, ref, x, y, h, chain, sub) {
252
260
  const sub2 = l.blocked ? `${l.statusText} · blocked` : l.statusText;
253
- return (`<g class="node ${l.cls}" id="node-${ref}" data-ref="${ref}" ${l.data} data-x="${x}" data-y="${y}" data-cx="${NODE_W / 2}" data-cy="${NODE_H / 2}" ` +
261
+ const lines = wrapLabel(l.title);
262
+ const label = lines.map((line, n) => `<tspan x="12" y="${LABEL_TOP + n * LINE_H}">${escapeHtml(line)}</tspan>`).join('');
263
+ return (`<g class="node ${l.cls}" id="node-${ref}" data-ref="${ref}" ${l.data} data-x="${x}" data-y="${y}" data-cx="${NODE_W / 2}" data-cy="${h / 2}" ` +
254
264
  `data-chain="${chain.join(' ')}" data-sub="${sub.join(' ')}" transform="translate(${x} ${y})" tabindex="0" role="button" ` +
255
265
  `aria-label="${escapeHtml(`${l.title} — ${sub2}`)}">` +
256
- `<title>${escapeHtml(l.title)}</title><rect width="${NODE_W}" height="${NODE_H}" rx="6"/>` +
257
- `<text class="label" x="12" y="20">${escapeHtml(truncate(l.title))}</text><text class="sub" x="12" y="38">${escapeHtml(sub2)}</text></g>`);
266
+ `<title>${escapeHtml(l.title)}</title><rect width="${NODE_W}" height="${h}" rx="6"/>` +
267
+ `<text class="label">${label}</text><text class="sub" x="12" y="${LABEL_TOP + lines.length * LINE_H}">${escapeHtml(sub2)}</text></g>`);
258
268
  }
259
269
  const xy = (p) => (p === null ? '' : `${p.x} ${p.y}`);
260
270
  function mapSection(view, byRef) {
@@ -268,27 +278,29 @@ function mapSection(view, byRef) {
268
278
  .map((e) => {
269
279
  const a = at.get(e.from);
270
280
  const b = at.get(e.to);
271
- const [x1, y1, x2, y2] = [a.x + NODE_W, a.y + NODE_H / 2, b.x, b.y + NODE_H / 2];
281
+ const [x1, y1, x2, y2] = [a.x + NODE_W, a.y + a.h / 2, b.x, b.y + b.h / 2];
272
282
  const mx = (x1 + x2) / 2;
273
283
  const kind = !labelOf(view, byRef, e.from).done ? ' unmet' : e.dashed ? ' further' : '';
274
- return `<path class="edge${kind}" data-from="${e.from}" data-to="${e.to}" d="M${x1} ${y1} C${mx} ${y1} ${mx} ${y2} ${x2} ${y2}"/>`;
284
+ // Hide done hides every edge touching a done box (roadmap-view-readability/AC-9).
285
+ const done = labelOf(view, byRef, e.from).done || labelOf(view, byRef, e.to).done ? ' data-done' : '';
286
+ return `<path class="edge${kind}"${done} data-from="${e.from}" data-to="${e.to}" d="M${x1} ${y1} C${mx} ${y1} ${mx} ${y2} ${x2} ${y2}"/>`;
275
287
  });
276
288
  const nodes = layout.nodes.filter((n) => n.cluster === c.ref);
277
289
  const toggles = nodes
278
290
  .filter((n) => n.subtree.length > 0)
279
- .map((n) => `<g class="toggle" data-toggle="${n.ref}" transform="translate(${n.x + NODE_W} ${n.y + NODE_H / 2})" tabindex="0" role="button" aria-expanded="true" ` +
291
+ .map((n) => `<g class="toggle" data-toggle="${n.ref}"${labelOf(view, byRef, n.ref).done ? ' data-done' : ''} transform="translate(${n.x + NODE_W} ${n.y + n.h / 2})" tabindex="0" role="button" aria-expanded="true" ` +
280
292
  `aria-label="${escapeHtml(`Collapse or expand what sits under ${labelOf(view, byRef, n.ref).title}`)}"><circle r="10"/><text y="5">−</text></g>`);
281
293
  const label = `${c.refs.length} items · ${c.notDone === 0 ? 'all done' : `${c.notDone} not done`}`;
282
294
  return [
283
295
  `<g class="cluster${c.openAt === null ? ' closed' : ''}" id="${c.ref}" data-all="${xy(c.at)}" data-open="${xy(c.openAt)}" data-n="${c.refs.filter((r) => byRef.has(r)).length}" transform="translate(${xy(c.at)})">`,
284
296
  `<text class="clabel" x="0" y="16">${label}</text>`,
285
297
  `<g class="edges">${edges.join('')}</g>`,
286
- nodes.map((n) => svgNode(labelOf(view, byRef, n.ref), n.ref, n.x, n.y, n.chain, n.subtree)).join('\n'),
298
+ nodes.map((n) => svgNode(labelOf(view, byRef, n.ref), n.ref, n.x, n.y, n.h, n.chain, n.subtree)).join('\n'),
287
299
  toggles.join(''),
288
300
  '</g>',
289
301
  ].join('\n');
290
302
  });
291
- const unlinked = layout.unlinked.map((u) => svgNode(labelOf(view, byRef, u.ref), u.ref, u.x, u.y, [], []));
303
+ const unlinked = layout.unlinked.map((u) => svgNode(labelOf(view, byRef, u.ref), u.ref, u.x, u.y, u.h, [], []));
292
304
  const open = layout.clusters.filter((c) => c.openAt !== null).length;
293
305
  const openButton = layout.clusters.length === 0
294
306
  ? ''
@@ -296,6 +308,11 @@ function mapSection(view, byRef) {
296
308
  const unlinkedButton = layout.unlinked.length === 0
297
309
  ? ''
298
310
  : ` <button type="button" id="unlinked-toggle" aria-pressed="false" data-count="${layout.unlinked.length}">Show unlinked items (${layout.unlinked.length})</button>`;
311
+ const doneOnMap = [...layout.nodes, ...layout.unlinked].filter((n) => byRef.get(n.ref)?.status === 'done').length;
312
+ // On by default; the script keeps it in the hash (roadmap-view-readability/AC-9..AC-11).
313
+ const hideDone = doneOnMap === 0
314
+ ? ''
315
+ : ` <button type="button" id="hide-done" aria-pressed="true" data-count="${doneOnMap}">${doneOnMap} done hidden — show</button>`;
299
316
  const empty = layout.nodes.length === 0 ? '<p class="empty">No dependencies yet: no item depends on another.</p>' : '';
300
317
  const nodeStatuses = layout.nodes.map((n) => byRef.get(n.ref)?.status).filter((s) => s !== undefined);
301
318
  const { all, open: openSizes } = layout.sizes;
@@ -306,10 +323,12 @@ function mapSection(view, byRef) {
306
323
  '<h2 class="sr" id="map-h">Dependencies</h2>',
307
324
  filterBar('deps', countBy(nodeStatuses), ROADMAP_STATUSES),
308
325
  empty,
309
- `<p class="map-controls">${openButton} <button type="button" id="fit">Fit to screen</button>${unlinkedButton}</p>`,
326
+ `<p class="map-controls">${openButton} <button type="button" id="fit">Fit to screen</button>${unlinkedButton}${hideDone}</p>`,
310
327
  '<p class="legend">A red dashed link needs something not yet done; a solid link is the first dependency, a dotted one a further dependency that is done. ' +
311
328
  'Filtered items are dimmed. A red dashed box is an id no item carries.</p>',
312
329
  '<div class="map-wrap">',
330
+ // The status key, in the map's corner, each swatch drawn as a box of that status (roadmap-view-readability/AC-7).
331
+ `<ul class="status-legend" aria-label="Status key">${ROADMAP_STATUSES.map((s) => `<li><span class="sw s-${s}" aria-hidden="true"></span>${STATUS_TEXT[s]}</li>`).join('')}</ul>`,
313
332
  `<svg id="map" role="group" aria-label="Dependency map: drag to pan, scroll or pinch to zoom" ${extents}>`,
314
333
  '<g id="viewport">',
315
334
  clusters.join('\n'),
@@ -322,6 +341,25 @@ function mapSection(view, byRef) {
322
341
  .filter((l) => l !== '')
323
342
  .join('\n');
324
343
  }
344
+ /** Done items by week, newest first, with running totals (roadmap-view-readability/AC-20..AC-22). */
345
+ function shippedSection(view, byRef) {
346
+ const weeks = shippedWeeks(view).map((w) => {
347
+ const rows = w.refs.map((ref) => {
348
+ const v = byRef.get(ref);
349
+ const when = v.finishedAt === null ? '' : ` <time datetime="${v.finishedAt}">${v.finishedAt}</time>`;
350
+ return (`<li class="ship" id="ship-${ref}" data-ref="${ref}" data-search="${escapeHtml(`${v.title} ${v.id ?? v.key}`.toLowerCase())}">` +
351
+ `<button type="button" class="open" aria-haspopup="dialog">${escapeHtml(v.title)}</button>${when}</li>`);
352
+ });
353
+ const head = w.monday === null ? 'No date' : `Week of ${w.monday}`;
354
+ return `<section class="week"><h3>${head} <span class="count">· ${w.shipped} shipped · ${w.total} total</span></h3><ol class="ships">${rows.join('')}</ol></section>`;
355
+ });
356
+ return [
357
+ '<section class="view" id="view-shipped" role="tabpanel" aria-labelledby="tab-shipped" hidden>',
358
+ '<h2 class="sr">Shipped</h2>',
359
+ weeks.length === 0 ? '<p class="empty">Nothing shipped yet.</p>' : weeks.join('\n'),
360
+ '</section>',
361
+ ].join('\n');
362
+ }
325
363
  function refList(view, byRef, refs) {
326
364
  if (refs.length === 0)
327
365
  return '<p>Nothing.</p>';
@@ -372,6 +410,8 @@ function detail(view, byRef, v) {
372
410
  commands(v),
373
411
  '<h3>Executive summary</h3>',
374
412
  v.summary === null ? '<p>No executive summary.</p>' : renderSummary(v.summary),
413
+ // The rest of the item, so reading it does not mean leaving the page (roadmap-view-readability/AC-12).
414
+ v.body === null ? '' : `<h3>Full text</h3><div class="full">${renderMarkdown(v.body)}</div>`,
375
415
  '<h3>Needs</h3>',
376
416
  refList(view, byRef, v.depRefs),
377
417
  '<h3>Needed by</h3>',
@@ -419,6 +459,7 @@ export function renderView(view) {
419
459
  '<div class="tabs" role="tablist" aria-label="Roadmap views">',
420
460
  `<button type="button" role="tab" id="tab-board" data-tab="board" aria-controls="view-board" aria-selected="true">Board <span class="n" id="n-board">${view.items.length}</span></button>`,
421
461
  `<button type="button" role="tab" id="tab-deps" data-tab="deps" aria-controls="view-deps" aria-selected="false" tabindex="-1">Dependencies <span class="n" id="n-deps">${view.layout.nodes.length}</span></button>`,
462
+ `<button type="button" role="tab" id="tab-shipped" data-tab="shipped" aria-controls="view-shipped" aria-selected="false" tabindex="-1">Shipped <span class="n" id="n-shipped">${view.columns.done.length}</span></button>`,
422
463
  '</div>',
423
464
  '<main>',
424
465
  '<section class="view" id="view-board" role="tabpanel" aria-labelledby="tab-board">',
@@ -429,8 +470,9 @@ export function renderView(view) {
429
470
  '</div>',
430
471
  '</section>',
431
472
  mapSection(view, byRef),
473
+ shippedSection(view, byRef),
432
474
  '</main>',
433
- '<p class="keys">Keys: <kbd>/</kbd> search · <kbd>1</kbd> Board · <kbd>2</kbd> Dependencies · <kbd>Esc</kbd> close the panel or clear the search</p>',
475
+ '<p class="keys">Keys: <kbd>/</kbd> search · <kbd>j</kbd> <kbd>k</kbd> next and previous item · <kbd>1</kbd> Board · <kbd>2</kbd> Dependencies · <kbd>3</kbd> Shipped · <kbd>Esc</kbd> close the panel or clear the search</p>',
434
476
  '<aside id="panel" class="panel" role="dialog" aria-modal="false" aria-labelledby="panel-title" hidden>',
435
477
  '<button type="button" class="close" id="panel-close" aria-label="Close the panel">×</button>',
436
478
  '<div id="panel-body"></div>',