@whzxc/agent-design-gallery 0.14.1 → 0.16.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 (111) hide show
  1. package/README.md +29 -16
  2. package/package.json +2 -1
  3. package/public/access.css +15 -2
  4. package/public/app.js +1284 -521
  5. package/public/arrangement-worker.js +7 -7
  6. package/public/arrangement.js +35 -30
  7. package/public/assets.js +85 -48
  8. package/public/auth.js +59 -4
  9. package/public/boards.js +129 -0
  10. package/public/comment-anchors.js +50 -0
  11. package/public/comments.css +400 -0
  12. package/public/comments.js +1106 -0
  13. package/public/context-menu.js +97 -0
  14. package/public/frame-identity.js +51 -14
  15. package/public/hub.css +25 -3
  16. package/public/hub.html +10 -2
  17. package/public/hub.js +127 -23
  18. package/public/icons.js +9 -0
  19. package/public/index.html +26 -10
  20. package/public/instance-actions.js +9 -2
  21. package/public/layout.js +156 -86
  22. package/public/motion-flow.js +28 -0
  23. package/public/motion-identity.js +100 -0
  24. package/public/motion-paint.js +332 -0
  25. package/public/motion-scene.js +165 -0
  26. package/public/motion-specimens.js +335 -0
  27. package/public/player.css +270 -0
  28. package/public/player.js +753 -0
  29. package/public/recent-updates.js +535 -0
  30. package/public/selection.js +1 -1
  31. package/public/style.css +91 -154
  32. package/public/switcher.css +5 -4
  33. package/public/switcher.js +109 -34
  34. package/public/token-catalog.js +8 -3
  35. package/public/tokens.css +20 -1
  36. package/public/view-boards.css +131 -0
  37. package/public/view-boards.js +350 -0
  38. package/public/view-route.js +1 -2
  39. package/src/boards/board.mjs +30 -0
  40. package/src/boards/motion-board.mjs +202 -0
  41. package/src/boards/token-board.mjs +200 -0
  42. package/src/cli-output.mjs +10 -5
  43. package/src/cli.mjs +89 -35
  44. package/src/comments.mjs +293 -0
  45. package/src/http.mjs +7 -5
  46. package/src/hub/project-link.mjs +41 -0
  47. package/src/hub/registry.mjs +5 -0
  48. package/src/hub.mjs +14 -10
  49. package/src/link.mjs +13 -1
  50. package/src/recent-frames.mjs +295 -0
  51. package/src/recent-history.mjs +100 -0
  52. package/src/recent-job.mjs +63 -0
  53. package/src/recent-worker.mjs +171 -0
  54. package/src/server.mjs +285 -110
  55. package/src/service.mjs +46 -12
  56. package/src/toolkit/arch-git.mjs +8 -14
  57. package/src/toolkit/arch.mjs +3 -2
  58. package/src/toolkit/asset-rules.mjs +24 -1
  59. package/src/toolkit/browser.mjs +1 -13
  60. package/src/toolkit/build-store.mjs +9 -1
  61. package/src/toolkit/build-worker.mjs +6 -0
  62. package/src/toolkit/build.mjs +22 -16
  63. package/src/toolkit/commands.mjs +105 -9
  64. package/src/toolkit/compare.mjs +13 -11
  65. package/src/toolkit/config.mjs +2 -2
  66. package/{public/review.js → src/toolkit/diff-document.mjs} +137 -43
  67. package/src/toolkit/diff-inputs.mjs +97 -52
  68. package/src/toolkit/diff.mjs +198 -43
  69. package/src/toolkit/frame-declarations.mjs +36 -0
  70. package/src/toolkit/git-blobs.mjs +50 -0
  71. package/src/toolkit/impact-inputs.mjs +11 -19
  72. package/src/toolkit/impact-selection.mjs +27 -12
  73. package/src/toolkit/impact.mjs +49 -15
  74. package/src/toolkit/implementation-map.mjs +17 -6
  75. package/src/toolkit/input-generation.mjs +15 -0
  76. package/src/toolkit/inspect-output.mjs +1 -1
  77. package/src/toolkit/inspect.d.ts +9 -1
  78. package/src/toolkit/inspect.mjs +25 -1
  79. package/src/toolkit/motion-check.mjs +382 -0
  80. package/src/toolkit/motion-css.mjs +105 -0
  81. package/src/toolkit/motion-flows.mjs +95 -0
  82. package/src/toolkit/motion-impact.mjs +87 -0
  83. package/src/toolkit/motion-inventory.mjs +202 -0
  84. package/src/toolkit/motion-label.mjs +111 -0
  85. package/src/toolkit/motion-patterns.mjs +216 -0
  86. package/src/toolkit/motion-primitives.mjs +94 -0
  87. package/src/toolkit/motion-queries.mjs +169 -0
  88. package/src/toolkit/motion.mjs +300 -0
  89. package/src/toolkit/move-pairing.mjs +140 -0
  90. package/src/toolkit/owner.mjs +19 -6
  91. package/src/toolkit/play-endpoint.mjs +66 -0
  92. package/src/toolkit/project-index.mjs +4 -4
  93. package/src/toolkit/recent-structure.mjs +201 -0
  94. package/src/toolkit/results.mjs +3 -3
  95. package/src/toolkit/review-document.mjs +440 -0
  96. package/src/toolkit/review-embed-document.mjs +671 -0
  97. package/src/toolkit/review-filmstrip.mjs +76 -0
  98. package/src/toolkit/review-groups.mjs +29 -0
  99. package/src/toolkit/review-motion-card.mjs +51 -0
  100. package/src/toolkit/review-motion.mjs +159 -0
  101. package/src/toolkit/review-observation.mjs +131 -0
  102. package/src/toolkit/review-playback.js +123 -0
  103. package/src/toolkit/review-sheet.mjs +125 -0
  104. package/src/toolkit/review-specimens.mjs +60 -0
  105. package/src/toolkit/review.mjs +240 -0
  106. package/src/toolkit/runtime.mjs +8 -2
  107. package/src/toolkit/theme.mjs +16 -0
  108. package/src/viewer-cache.mjs +48 -12
  109. package/public/annotations.js +0 -816
  110. package/public/labels.js +0 -122
  111. package/src/annotations.mjs +0 -238
@@ -0,0 +1,97 @@
1
+ export function createContextMenu(menu, { viewport, onOverlayChange }) {
2
+ let restoreTarget = null;
3
+ let suppressAutoRestore = false;
4
+
5
+ const enabledItems = () => [...menu.querySelectorAll('button[role="menuitem"]:not(:disabled)')];
6
+
7
+ menu.addEventListener('toggle', event => {
8
+ if (event.newState === 'open') {
9
+ for (const other of document.querySelectorAll(':popover-open')) {
10
+ if (other !== menu) other.hidePopover();
11
+ }
12
+ } else if (!suppressAutoRestore && restoreTarget?.isConnected) {
13
+ if (!document.activeElement || document.activeElement === document.body || menu.contains(document.activeElement)) {
14
+ restoreTarget.focus({ preventScroll: true });
15
+ }
16
+ restoreTarget = null;
17
+ }
18
+ onOverlayChange?.();
19
+ });
20
+
21
+ menu.addEventListener('keydown', event => {
22
+ const items = enabledItems();
23
+ const index = items.indexOf(document.activeElement);
24
+ if (event.key === 'ArrowDown' && items.length) {
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ items[(index + 1 + items.length) % items.length].focus();
28
+ } else if (event.key === 'ArrowUp' && items.length) {
29
+ event.preventDefault();
30
+ event.stopPropagation();
31
+ items[(index - 1 + items.length) % items.length].focus();
32
+ } else if (event.key === 'Home' && items.length) {
33
+ event.preventDefault();
34
+ event.stopPropagation();
35
+ items[0].focus();
36
+ } else if (event.key === 'End' && items.length) {
37
+ event.preventDefault();
38
+ event.stopPropagation();
39
+ items.at(-1).focus();
40
+ } else if ((event.key === 'Enter' || event.key === ' ') && index >= 0) {
41
+ event.preventDefault();
42
+ event.stopPropagation();
43
+ items[index].click();
44
+ } else if (event.key === 'Escape' || event.key === 'Tab') {
45
+ event.preventDefault();
46
+ event.stopPropagation();
47
+ close(true);
48
+ }
49
+ });
50
+
51
+ function close(restore = true) {
52
+ const target = restoreTarget;
53
+ suppressAutoRestore = true;
54
+ if (menu.matches(':popover-open')) menu.hidePopover();
55
+ suppressAutoRestore = false;
56
+ restoreTarget = null;
57
+ if (restore && target?.isConnected) target.focus({ preventScroll: true });
58
+ onOverlayChange?.();
59
+ }
60
+
61
+ function open(items, { x, y, returnFocus } = {}) {
62
+ restoreTarget = returnFocus ?? (document.activeElement instanceof HTMLElement ? document.activeElement : viewport);
63
+ const nodes = items.map(entry => {
64
+ if (entry.separator) {
65
+ const rule = document.createElement('div');
66
+ rule.className = 'rule';
67
+ rule.setAttribute('role', 'separator');
68
+ return rule;
69
+ }
70
+ const button = document.createElement('button');
71
+ button.type = 'button';
72
+ button.setAttribute('role', 'menuitem');
73
+ button.textContent = entry.label;
74
+ button.disabled = !!entry.disabled;
75
+ button.onclick = () => {
76
+ const target = restoreTarget;
77
+ close(false);
78
+ if (target?.isConnected) target.focus({ preventScroll: true });
79
+ entry.action?.();
80
+ };
81
+ return button;
82
+ });
83
+ menu.replaceChildren(...nodes);
84
+ menu.style.left = '0px';
85
+ menu.style.top = '0px';
86
+ if (!menu.matches(':popover-open')) menu.showPopover();
87
+ const mw = menu.offsetWidth || 220, mh = menu.offsetHeight || 160;
88
+ const left = Math.max(8, Math.min(window.innerWidth - mw - 8, Math.round(x)));
89
+ const top = Math.max(8, Math.min(window.innerHeight - mh - 8, Math.round(y)));
90
+ menu.style.left = `${left}px`;
91
+ menu.style.top = `${top}px`;
92
+ enabledItems()[0]?.focus({ preventScroll: true });
93
+ onOverlayChange?.();
94
+ }
95
+
96
+ return { open, close, isOpen: () => menu.matches(':popover-open') };
97
+ }
@@ -53,6 +53,11 @@ const digest = value => sha256Hex(value).slice(0, 24);
53
53
  const normalize = value => value.normalize('NFC').replace(/\p{White_Space}+/gu, ' ').trim();
54
54
  const namingAttributes = new Set(['id', 'data-part', 'role', 'aria-label', 'aria-labelledby', 'aria-describedby']);
55
55
  const containerRoots = new Set(['div', 'main', 'section', 'article', 'aside', 'header', 'footer', 'nav', 'form']);
56
+ const additionalCommentRoles = new Map(Object.entries({
57
+ article: 'article', aside: 'complementary', dialog: 'dialog', fieldset: 'group', hr: 'separator',
58
+ li: 'listitem', main: 'main', meter: 'meter', nav: 'navigation', ol: 'list', option: 'option', output: 'status',
59
+ progress: 'progressbar', summary: 'button', table: 'table', td: 'cell', th: 'columnheader', tr: 'row', ul: 'list',
60
+ }));
56
61
 
57
62
  export function identityNode(node, path, parentPath, owners, styleFor) {
58
63
  const attributes = {};
@@ -77,7 +82,7 @@ export function identityNode(node, path, parentPath, owners, styleFor) {
77
82
  const name = normalize(labelled || node.getAttribute('aria-label') || node.getAttribute('alt') || (role === 'textbox' || role === 'combobox' ? Array.from(node.labels ?? []).map(l => l.textContent).join(' ') : role ? node.textContent : '') || '');
78
83
  const resource = node.localName === 'svg' && (node.hasAttribute('data-adg-icon') || node.getAttribute('aria-hidden') === 'true' || !node.querySelector('text,foreignObject') && !node.hasAttribute('role'));
79
84
  return {
80
- path, parentPath, tag: node.localName, namespace: node.namespaceURI, attributes, owners, neutral, resource,
85
+ path, parentPath, tag: node.localName, namespace: node.namespaceURI, attributes, owners, neutral, resource, role, name,
81
86
  ...(role && name ? { semantic: { role, name } } : {}),
82
87
  keys: JSON.parse(node.getAttribute('data-adg-keys') ?? '[]'),
83
88
  password,
@@ -191,28 +196,60 @@ export function collectViewerElements(shell, { projectSource, assetPath, frame,
191
196
  }
192
197
  const clean = n => n === 0 ? 0 : n;
193
198
  const elements = [];
199
+ const boundaries = new Map();
200
+ const clips = new Map();
201
+ const clipsOverflow = /^(hidden|clip|scroll|auto)$/;
194
202
  for (let i = 0; i < domNodes.length; i++) {
195
203
  const node = domNodes[i], input = inputs[i], idRow = assigned[i];
196
- if (input.neutral) continue;
197
- if (node === root && !input.owners.length && !node.hasAttribute('data-adg-id') && !node.hasAttribute('role') && containerRoots.has(node.localName)) continue;
198
- const rect = rectFor(node);
199
- let left = Math.max(rect.left, origin.left), right = Math.min(rect.right, origin.right);
200
- let top = Math.max(rect.top, origin.top), bottom = Math.min(rect.bottom, origin.bottom);
201
- for (let p = node; p && p !== shell; p = p.parentElement) {
202
- const s = styleFor(p);
203
- if (s.display === 'none' || (p === node && s.visibility !== 'visible') || Number(s.opacity) === 0) { left = right; break; }
204
- if (p !== node && s.display !== 'inline') {
205
- const clip = rectFor(p);
206
- if (/(hidden|clip|scroll|auto)/.test(s.overflowX)) { left = Math.max(left, clip.left); right = Math.min(right, clip.right); }
207
- if (/(hidden|clip|scroll|auto)/.test(s.overflowY)) { top = Math.max(top, clip.top); bottom = Math.min(bottom, clip.bottom); }
208
- }
204
+ const parentBoundary = boundaries.get(input.parentPath) ?? null;
205
+ boundaries.set(input.path, parentBoundary);
206
+ // Ancestor opacity/display and each overflow axis apply to the whole subtree.
207
+ // Visibility can be overridden lower down, so test it on the hit itself.
208
+ const inherited = clips.get(input.parentPath) ?? origin;
209
+ if (inherited === false) { clips.set(input.path, false); continue; }
210
+ const style = styleFor(node);
211
+ if (style.display === 'none' || Number(style.opacity) === 0) {
212
+ clips.set(input.path, false);
213
+ continue;
209
214
  }
215
+ const clipX = style.display !== 'inline' && clipsOverflow.test(style.overflowX);
216
+ const clipY = style.display !== 'inline' && clipsOverflow.test(style.overflowY);
217
+ if (clipX || clipY) {
218
+ const rect = rectFor(node);
219
+ clips.set(input.path, {
220
+ left: clipX ? Math.max(inherited.left, rect.left) : inherited.left,
221
+ right: clipX ? Math.min(inherited.right, rect.right) : inherited.right,
222
+ top: clipY ? Math.max(inherited.top, rect.top) : inherited.top,
223
+ bottom: clipY ? Math.min(inherited.bottom, rect.bottom) : inherited.bottom,
224
+ });
225
+ } else clips.set(input.path, inherited);
226
+ if (input.neutral || style.visibility !== 'visible') continue;
227
+ const semanticRole = input.role ?? additionalCommentRoles.get(input.tag);
228
+ const role = /^(none|presentation)$/.test(semanticRole) ? null : semanticRole?.trim().split(/\s+/, 1)[0];
229
+ const boundary = Boolean(input.owners.length || input.keys.length || role ||
230
+ Object.keys(input.attributes).some(name => name === 'data-adg-id' || name !== 'role' && namingAttributes.has(name)) ||
231
+ node.hasAttribute('alt') || node.hasAttribute('title'));
232
+ const commentOnly = node === root && !input.owners.length && !node.hasAttribute('data-adg-id') &&
233
+ !node.hasAttribute('role') && containerRoots.has(node.localName);
234
+ if (commentOnly && !boundary) continue;
235
+ const rect = rectFor(node);
236
+ const left = Math.max(rect.left, inherited.left), right = Math.min(rect.right, inherited.right);
237
+ const top = Math.max(rect.top, inherited.top), bottom = Math.min(rect.bottom, inherited.bottom);
210
238
  if (right <= left || bottom <= top) continue;
211
239
  const owner = idRow.defining.at(-1) ?? { source: assetPath, export: null };
240
+ if (boundary) boundaries.set(input.path, idRow.id);
241
+ const text = (input.semantic?.name || normalize(input.directText)).slice(0, 120) || null;
212
242
  elements.push({
213
243
  id: idRow.id,
214
244
  owners: input.owners,
215
245
  owner,
246
+ tag: input.tag,
247
+ text,
248
+ ...(commentOnly ? { commentOnly } : {}),
249
+ commentBoundary: boundaries.get(input.path),
250
+ commentName: role || owner.export || null,
251
+ commentText: (input.name || text || (boundary && !input.password ? normalize(node.textContent) : '') ||
252
+ normalize(node.getAttribute('title') ?? '')).slice(0, 120) || null,
216
253
  x: clean(left - origin.left),
217
254
  y: clean(top - origin.top),
218
255
  width: Math.max(0, right - left),
package/public/hub.css CHANGED
@@ -10,22 +10,39 @@ a:focus-visible,button:focus-visible { outline:1px solid var(--accent); outline-
10
10
  button { font:inherit; color:inherit; border:0; cursor:pointer; }
11
11
  .icon { display:block; flex:none; pointer-events:none; }
12
12
  [data-icon] { display:inline-flex; flex:none; }
13
+ @keyframes hub-spin { to { transform:rotate(360deg); } }
13
14
  #hub { min-height:100dvh; padding:12px; display:flex; flex-direction:column; gap:32px; }
14
15
  .hub-bar { display:inline-flex; align-self:flex-start; align-items:center; height:44px; padding:6px; border-radius:var(--radius-panel); background:var(--surface); box-shadow:var(--shadow-float); }
15
16
  .hub-bar span { padding:0 8px; font-size:var(--text-section); font-weight:650; }
16
17
  #hub main { display:flex; flex-direction:column; gap:32px; width:100%; max-width:1080px; margin:0 auto; padding-top:24px; }
17
18
  #hub main>section { display:flex; flex-direction:column; gap:16px; }
18
19
  #hub main>.live-section { gap:12px; }
19
- .hub-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
20
+ .hub-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 16px; }
21
+ .hub-controls { display:flex; align-items:center; gap:8px; margin-left:auto; }
22
+ .hub-search { width:240px; height:var(--field-height); display:flex; align-items:center; gap:8px; padding:0 10px; border-radius:var(--radius-field); background:var(--surface); box-shadow:var(--shadow-float); color:var(--text-tertiary); }
23
+ .hub-search:focus-within { outline:1px solid var(--accent); outline-offset:-1px; }
24
+ .hub-search input { flex:1; min-width:0; height:100%; padding:0; border:0; outline:none; background:none; color:var(--text); font:inherit; }
25
+ .hub-search input::placeholder { color:var(--text-tertiary); opacity:1; }
26
+ .hub-search input::-webkit-search-cancel-button { display:none; }
27
+ .hub-search kbd { flex:none; font:var(--text-caption)/1 var(--font-mono); color:var(--text-tertiary); }
28
+ #hub-search-clear { display:grid; place-items:center; flex:none; padding:2px; background:none; color:var(--text-tertiary); border-radius:var(--radius-row); }
29
+ #hub-search-clear:hover { color:var(--text); }
20
30
  h1 { font-size:var(--text-title); font-weight:650; }
21
31
  h2 { font-size:var(--text-section); font-weight:600; }
22
32
  #rescan { height:32px; display:inline-flex; align-items:center; gap:10px; padding:0 12px; flex:none; border-radius:var(--radius-field); background:var(--surface-sunken); font-weight:550; line-height:16px; }
23
33
  #rescan .icon { color:var(--text-secondary); }
24
34
  #rescan:disabled { opacity:.6; cursor:default; }
35
+ #rescan:disabled[data-loading] .icon, .instance-close[data-loading] .icon { animation:hub-spin .9s linear infinite; }
25
36
  .hub-list { overflow:hidden; border-radius:var(--radius-panel); background:var(--surface); box-shadow:var(--shadow-float); }
26
37
  .project-columns { display:grid; grid-template-columns:minmax(0,1fr) 144px 200px 148px; gap:24px; align-items:center; }
27
38
  .project-header { padding:12px 20px; border-bottom:1px solid var(--border); font-size:var(--text-caption); color:var(--text-tertiary); }
39
+ .project-row, .instance-row { position:relative; }
28
40
  .project-row { padding:20px; }
41
+ .project-row:has(a.hub-title):hover, .instance-row:has(a.hub-title):hover { background:var(--surface-sunken); }
42
+ a.hub-title::after { content:''; position:absolute; inset:0; }
43
+ a.hub-title:hover { text-decoration:none; }
44
+ a.hub-title:focus-visible { outline:none; }
45
+ .project-row:has(a.hub-title:focus-visible), .instance-row:has(a.hub-title:focus-visible) { outline:1px solid var(--accent); outline-offset:-1px; }
29
46
  .project-row+.project-row,.instance-row+.instance-row { border-top:1px solid var(--border); }
30
47
  .project-identity { min-width:0; }
31
48
  .hub-name { display:flex; align-items:center; gap:8px; }
@@ -44,11 +61,13 @@ h2 { font-size:var(--text-section); font-weight:600; }
44
61
  .instance-row { padding:16px 20px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
45
62
  .instance-identity { display:flex; min-width:0; flex-direction:column; gap:4px; }
46
63
  .instance-row .hub-name a,.instance-row .hub-name>span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
64
+ .instance-meta { flex-wrap:nowrap; }
65
+ .instance-dir { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-secondary); }
47
66
  .instance-start { flex:none; color:var(--text-tertiary); }
48
67
  .instance-warning { display:flex; align-items:center; flex:none; gap:8px; font-size:var(--text-meta); color:var(--danger); }
49
- .instance-close { display:grid; place-items:center; flex:none; width:var(--control-size); height:var(--control-size); padding:0;
68
+ .instance-close { position:relative; z-index:1; display:grid; place-items:center; flex:none; width:var(--control-size); height:var(--control-size); padding:0;
50
69
  border-radius:var(--radius-row); background:none; color:var(--text-secondary); }
51
- .instance-close:hover:not(:disabled) { background:var(--surface-sunken); }
70
+ .instance-close:hover:not(:disabled) { background:var(--surface); color:var(--text); }
52
71
  .instance-close:disabled { opacity:.45; cursor:default; }
53
72
  .hub-empty { display:flex; flex-direction:column; align-items:center; gap:12px; padding:48px 24px; text-align:center; }
54
73
  .hub-empty>.icon { color:var(--text-tertiary); }
@@ -56,6 +75,9 @@ h2 { font-size:var(--text-section); font-weight:600; }
56
75
  #error { color:var(--danger); }
57
76
  @media (max-width:700px) {
58
77
  #hub main { padding-top:0; }
78
+ .hub-controls { flex:1 1 100%; }
79
+ .hub-search { flex:1; width:auto; min-width:0; }
80
+ .hub-search kbd { display:none; }
59
81
  .project-header.project-columns,.desktop-change { display:none; }
60
82
  .project-row { padding:16px; }
61
83
  .project-columns { display:flex; flex-direction:column; align-items:stretch; gap:12px; }
package/public/hub.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="referrer" content="same-origin">
7
- <title>ADG</title>
7
+ <title>Projects — Agent Design Gallery</title>
8
8
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
9
9
  <link rel="stylesheet" href="tokens.css">
10
10
  <link rel="stylesheet" href="hub.css">
@@ -18,7 +18,15 @@
18
18
  <section aria-labelledby="projects-title">
19
19
  <div class="hub-heading">
20
20
  <h1 id="projects-title">Projects</h1>
21
- <button id="rescan" type="button"><span data-icon="refresh-cw" data-size="14"></span><span>Rescan</span></button>
21
+ <div class="hub-controls">
22
+ <div id="hub-search" class="hub-search" hidden>
23
+ <span data-icon="search" data-size="14"></span>
24
+ <input id="hub-search-input" type="search" placeholder="Find project or instance…" aria-label="Find project or instance" autocomplete="off">
25
+ <kbd id="hub-search-key">⌘F</kbd>
26
+ <button id="hub-search-clear" type="button" aria-label="Clear search" hidden><span data-icon="x" data-size="14"></span></button>
27
+ </div>
28
+ <button id="rescan" type="button"><span data-icon="refresh-cw" data-size="14"></span><span>Rescan</span></button>
29
+ </div>
22
30
  </div>
23
31
  <p id="error" role="alert" hidden></p>
24
32
  <div id="projects"></div>
package/public/hub.js CHANGED
@@ -4,9 +4,20 @@ import { instanceCloseButton } from './instance-actions.js';
4
4
 
5
5
  const projects = document.querySelector('#projects');
6
6
  const instances = document.querySelector('#instances');
7
+ const liveSection = document.querySelector('.live-section');
7
8
  const error = document.querySelector('#error');
8
9
  const rescan = document.querySelector('#rescan');
10
+ const searchBox = document.querySelector('#hub-search');
11
+ const searchInput = document.querySelector('#hub-search-input');
12
+ const searchKey = document.querySelector('#hub-search-key');
13
+ const searchClear = document.querySelector('#hub-search-clear');
9
14
  const media = matchMedia('(prefers-color-scheme: dark)');
15
+
16
+ let projectData = [];
17
+ let instanceData = [];
18
+ let rootData = [];
19
+ let rescanning = false;
20
+
10
21
  function applyTheme() {
11
22
  const saved = localStorage.getItem('adg-theme');
12
23
  document.documentElement.dataset.theme = saved === 'light' || saved === 'dark' ? saved : media.matches ? 'dark' : 'light';
@@ -41,6 +52,19 @@ function relativeTime(value) {
41
52
  const days = Math.floor(seconds / 86400);
42
53
  return `${days} ${days === 1 ? 'day' : 'days'} ago`;
43
54
  }
55
+ function proxyReason(reason) {
56
+ if (reason === 'proxy-auth-unsupported') return 'Update ADG to proxy';
57
+ if (reason === 'health-unavailable') return 'Viewer not responding';
58
+ return 'Proxy unavailable';
59
+ }
60
+ function formatCounts(project) {
61
+ if (project.sourceCount == null && project.frameCount == null) return '—';
62
+ const s = project.sourceCount ?? 0;
63
+ const sources = `${s} ${s === 1 ? 'source' : 'sources'}`;
64
+ if (project.frameCount == null) return sources;
65
+ const f = project.frameCount;
66
+ return `${sources} · ${f} ${f === 1 ? 'frame' : 'frames'}`;
67
+ }
44
68
  function change(project, phone = false) {
45
69
  const node = element('span', phone ? 'phone-change' : 'hub-change desktop-change');
46
70
  if (project.lastDesignChange?.dirty) {
@@ -57,8 +81,9 @@ function change(project, phone = false) {
57
81
  }
58
82
  function git(branch, head) {
59
83
  const node = element('div', 'hub-git');
60
- const label = element('span', '', branch || '—');
61
- label.title = branch || '';
84
+ const text = branch || (head ? 'HEAD' : '—');
85
+ const label = element('span', '', text);
86
+ label.title = branch || (head ? 'Detached HEAD' : '');
62
87
  node.append(glyph('git-branch', 13), label);
63
88
  if (head) node.append(element('code', '', head));
64
89
  return node;
@@ -83,7 +108,7 @@ function projectRow(project) {
83
108
  pathNode.title = path;
84
109
  identity.append(name, pathNode);
85
110
  columns.append(identity, change(project), git(project.branch, project.head),
86
- element('div', 'hub-counts', `${project.sourceCount ?? '—'} sources · ${project.frameCount ?? '—'} frames`));
111
+ element('div', 'hub-counts', formatCounts(project)));
87
112
  row.append(columns);
88
113
  if (incompatible || project.error) {
89
114
  const warning = element('div', 'hub-warning');
@@ -100,23 +125,34 @@ function instanceRow(instance) {
100
125
  const identity = element('div', 'instance-identity');
101
126
  identity.append(destination(instance.projectName ?? instance.name ?? instance.id,
102
127
  instance.proxyable ? instance.url ?? `/i/${encodeURIComponent(instance.id)}/` : null, 'radio'));
103
- const branch = git(instance.branch);
104
- const started = element('span', 'instance-start', `· Started ${relativeTime(instance.startedAt)}`);
128
+ const meta = element('div', 'hub-git instance-meta');
129
+ if (instance.branch) {
130
+ const branchLabel = element('span', '', instance.branch);
131
+ branchLabel.title = instance.branch;
132
+ meta.append(glyph('git-branch', 13), branchLabel);
133
+ }
134
+ if (instance.port != null) meta.append(element('code', '', `:${instance.port}`));
135
+ if (instance.directory) {
136
+ const dir = element('span', 'instance-dir', instance.directory);
137
+ dir.title = instance.directory;
138
+ meta.append(dir);
139
+ }
140
+ const started = element('span', 'instance-start', `${meta.childElementCount ? '· ' : ''}Started ${relativeTime(instance.startedAt)}`);
105
141
  started.title = instance.startedAt || '';
106
- branch.append(started);
107
- identity.append(branch);
142
+ meta.append(started);
143
+ identity.append(meta);
108
144
  row.append(identity);
109
145
  if (!instance.proxyable) {
110
- const warning = element('span', 'instance-warning', 'Proxy unavailable');
146
+ const warning = element('span', 'instance-warning', proxyReason(instance.reason));
111
147
  warning.prepend(glyph('circle-alert', 14));
112
148
  row.append(warning);
113
149
  }
114
150
  if (instance.stoppable) {
115
151
  row.classList.add('instance-row-closeable');
116
152
  row.append(instanceCloseButton(instance, 'instance-close', () => {
117
- row.remove();
118
- document.querySelector('.live-section').hidden = !instances.childElementCount;
119
- (instances.querySelector('a, button') ?? rescan).focus({ preventScroll: true });
153
+ instanceData = instanceData.filter(item => item !== instance);
154
+ renderLists();
155
+ (instances.querySelector('a, button') ?? (rescan.disabled ? document.querySelector('#projects a') : rescan))?.focus({ preventScroll: true });
120
156
  }, report));
121
157
  }
122
158
  return row;
@@ -128,22 +164,63 @@ function empty(title, detail) {
128
164
  node.append(glyph('folders', 24), copy);
129
165
  return node;
130
166
  }
131
- async function refresh() {
132
- const [projectData, instanceData, roots] = await Promise.all([api('api/projects'), api('api/instances'), api('api/roots')]);
133
- if (projectData.length) {
167
+ function matchesQuery(fields, query) {
168
+ if (!query) return true;
169
+ return fields.some(value => value && String(value).toLowerCase().includes(query));
170
+ }
171
+ function updateRescanState() {
172
+ rescan.disabled = rescanning || rootData.length === 0;
173
+ rescan.toggleAttribute('data-loading', rescanning);
174
+ rescan.title = !rescanning && rootData.length === 0 ? 'No roots registered' : '';
175
+ rescan.replaceChildren(glyph(rescanning ? 'loader-circle' : 'refresh-cw', 14),
176
+ element('span', '', rescanning ? 'Rescanning…' : 'Rescan'));
177
+ }
178
+ function renderLists() {
179
+ const total = projectData.length + instanceData.length;
180
+ const showSearch = total >= 5;
181
+ searchBox.hidden = !showSearch;
182
+ if (!showSearch && searchInput.value) {
183
+ searchInput.value = '';
184
+ searchClear.hidden = true;
185
+ searchKey.hidden = false;
186
+ }
187
+ const query = showSearch ? searchInput.value.trim().toLowerCase() : '';
188
+ const filteredProjects = projectData.filter(project =>
189
+ matchesQuery([project.name, project.design, project.path, project.branch, project.head], query));
190
+ const filteredInstances = instanceData.filter(instance =>
191
+ matchesQuery([instance.projectName, instance.name, instance.id, instance.directory, instance.branch, instance.port != null ? `:${instance.port}` : ''], query));
192
+
193
+ if (filteredProjects.length) {
194
+ projects.hidden = false;
134
195
  projects.className = 'hub-list';
135
196
  const header = element('div', 'project-columns project-header');
136
197
  header.append(...['Projects', 'Design changed', 'Git', 'Designs'].map(label => element('span', '', label)));
137
- projects.replaceChildren(header, ...projectData.map(projectRow));
198
+ projects.replaceChildren(header, ...filteredProjects.map(projectRow));
199
+ } else if (query) {
200
+ if (filteredInstances.length) {
201
+ projects.hidden = true;
202
+ projects.replaceChildren();
203
+ } else {
204
+ projects.hidden = false;
205
+ projects.className = '';
206
+ projects.replaceChildren(empty('No matches', `Nothing matched “${searchInput.value.trim()}”.`));
207
+ }
138
208
  } else {
209
+ projects.hidden = false;
139
210
  projects.className = '';
140
- projects.replaceChildren(empty(roots.length ? 'No projects found' : 'No roots registered', roots.length
141
- ? `No design sources found in the ${roots.length} registered ${roots.length === 1 ? 'root' : 'roots'}.`
142
- : 'Register a root in the hub configuration to list projects.'));
211
+ projects.replaceChildren(empty(rootData.length ? 'No projects found' : 'No roots registered', rootData.length
212
+ ? `No design sources found in the ${rootData.length} registered ${rootData.length === 1 ? 'root' : 'roots'}.`
213
+ : 'Run adg root add <dir> to register a workspace.'));
143
214
  }
215
+
144
216
  instances.className = 'hub-list';
145
- instances.replaceChildren(...instanceData.map(instanceRow));
146
- document.querySelector('.live-section').hidden = !instanceData.length;
217
+ instances.replaceChildren(...filteredInstances.map(instanceRow));
218
+ liveSection.hidden = !filteredInstances.length;
219
+ }
220
+ async function refresh() {
221
+ [projectData, instanceData, rootData] = await Promise.all([api('api/projects'), api('api/instances'), api('api/roots')]);
222
+ updateRescanState();
223
+ renderLists();
147
224
  }
148
225
  function report(failure) {
149
226
  if (isUnauthorized()) return;
@@ -151,10 +228,37 @@ function report(failure) {
151
228
  error.hidden = false;
152
229
  }
153
230
  function pending(value) {
154
- rescan.disabled = value;
155
- rescan.replaceChildren(glyph(value ? 'loader-circle' : 'refresh-cw', 14),
156
- element('span', '', value ? 'Rescanning…' : 'Rescan'));
231
+ rescanning = value;
232
+ updateRescanState();
157
233
  }
234
+
235
+ searchInput.addEventListener('input', () => {
236
+ const hasValue = Boolean(searchInput.value);
237
+ searchClear.hidden = !hasValue;
238
+ searchKey.hidden = hasValue;
239
+ renderLists();
240
+ });
241
+ searchClear.addEventListener('click', () => {
242
+ searchInput.value = '';
243
+ searchClear.hidden = true;
244
+ searchKey.hidden = false;
245
+ renderLists();
246
+ searchInput.focus();
247
+ });
248
+ searchInput.addEventListener('keydown', event => {
249
+ if (event.key === 'Escape' && searchInput.value) {
250
+ event.preventDefault();
251
+ searchClear.click();
252
+ }
253
+ });
254
+ document.addEventListener('keydown', event => {
255
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'f' && !searchBox.hidden) {
256
+ event.preventDefault();
257
+ searchInput.focus();
258
+ searchInput.select();
259
+ }
260
+ });
261
+
158
262
  rescan.addEventListener('click', async () => {
159
263
  pending(true);
160
264
  error.hidden = true;
package/public/icons.js CHANGED
@@ -1,8 +1,17 @@
1
1
  // Lucide geometry (ISC; see LICENSE). No runtime dependency.
2
2
  const geometry = {
3
+ "route": "<circle cx=\"6\" cy=\"19\" r=\"3\"></circle><path d=\"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15\"></path><circle cx=\"18\" cy=\"5\" r=\"3\"></circle>",
4
+ "settings-2": "<path d=\"M14 17H5\"></path><path d=\"M19 7h-9\"></path><circle cx=\"17\" cy=\"17\" r=\"3\"></circle><circle cx=\"7\" cy=\"7\" r=\"3\"></circle>",
5
+ "log-out": "<path d=\"m16 17 5-5-5-5\"></path><path d=\"M21 12H9\"></path><path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"></path>",
6
+ "rotate-ccw": "<path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\"></path><path d=\"M3 3v5h5\"></path>",
7
+ "pause": "<rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\"></rect><rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\"></rect>",
8
+ "list-filter": '<path d="M3 6h18M6 12h12M9 18h6"/>',
3
9
  "message-square": '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />',
10
+ "message-square-plus": '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2zM9 10h6m-3-3v6" />',
11
+ "messages-square": '<path d="M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2zm4-5h2a2 2 0 0 1 2 2v16l-4-4h-7a2 2 0 0 1-2-2v-1" />',
4
12
  "palette": "<path d=\"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z\"></path><circle cx=\"13.5\" cy=\"6.5\" r=\".5\" fill=\"currentColor\"></circle><circle cx=\"17.5\" cy=\"10.5\" r=\".5\" fill=\"currentColor\"></circle><circle cx=\"6.5\" cy=\"12.5\" r=\".5\" fill=\"currentColor\"></circle><circle cx=\"8.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\"></circle>",
5
13
  "type": "<path d=\"M12 4v16\"></path><path d=\"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\"></path><path d=\"M9 20h6\"></path>",
14
+ "play": '<path d="m6 3 15 9-15 9z"/>',
6
15
  "ruler": "<path d=\"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z\"></path><path d=\"m14.5 12.5 2-2\"></path><path d=\"m11.5 9.5 2-2\"></path><path d=\"m8.5 6.5 2-2\"></path><path d=\"m17.5 15.5 2-2\"></path>",
7
16
  "corner-up-right": "<path d=\"m15 14 5-5-5-5\"></path><path d=\"M4 20v-7a4 4 0 0 1 4-4h12\"></path>",
8
17
  "timer": "<line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\"></line><line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\"></line><circle cx=\"12\" cy=\"14\" r=\"8\"></circle>",
package/public/index.html CHANGED
@@ -1,21 +1,22 @@
1
1
  <!doctype html>
2
2
  <html lang="en" data-theme="light">
3
3
  <head>
4
- <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
4
+ <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="darkreader-lock">
5
5
  <base href="/">
6
6
  <title>Agent Design Gallery</title>
7
7
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
8
- <link rel="stylesheet" href="tokens.css"><link rel="stylesheet" href="style.css"><link rel="stylesheet" href="switcher.css"><link rel="stylesheet" href="access.css">
8
+ <link rel="stylesheet" href="tokens.css"><link rel="stylesheet" href="style.css"><link rel="stylesheet" href="switcher.css"><link rel="stylesheet" href="access.css"><link rel="stylesheet" href="comments.css">
9
+ <link rel="stylesheet" href="view-boards.css">
9
10
  <script type="module" src="app.js"></script>
10
11
  </head>
11
12
  <body>
12
13
  <div class="gallery">
13
14
  <main class="gallery-viewport" tabindex="0" aria-label="Design canvas" aria-describedby="controls">
14
- <canvas id="canvas-background" aria-hidden="true"></canvas><canvas id="drawings" aria-hidden="true"></canvas><div id="hover-outline" hidden></div><div id="selection-outline" hidden></div><div id="labels"></div><div id="asset-access" class="sr"></div>
15
- <div id="empty" hidden>No SVG files in this directory.</div>
15
+ <canvas id="canvas-background" aria-hidden="true"></canvas><canvas id="drawings" aria-hidden="true"></canvas><div id="hover-outline" hidden></div><div id="selection-outline" hidden></div><div id="asset-access" class="sr"></div>
16
+ <div id="empty" hidden>No design sources in this directory.</div>
16
17
  </main>
17
18
  <main id="token-catalog" class="floating" aria-labelledby="token-title" hidden>
18
- <header><h2 id="token-title">Tokens</h2><code id="token-source"></code></header>
19
+ <header><div class="token-header-meta"><h2 id="token-title">Tokens</h2><code id="token-source"></code></div><button type="button" id="token-board-button" class="view-pill" hidden><span data-icon="layout-grid" data-size="14"></span><span>Board view</span></button></header>
19
20
  <div class="token-scroll">
20
21
  <table id="token-table">
21
22
  <thead><tr><th scope="col">Token</th><th scope="col">Light</th><th scope="col">Dark</th></tr></thead>
@@ -23,24 +24,37 @@
23
24
  <p id="token-status" role="status" hidden></p>
24
25
  </div>
25
26
  </main>
26
- <main id="review-page" class="floating" aria-labelledby="review-title" hidden></main>
27
27
  <div id="app-bar" class="floating" role="toolbar" aria-label="Gallery navigation" hidden>
28
28
  <button id="sidebar-toggle" class="icon-button" aria-label="Contents" aria-controls="sidebar" aria-expanded="false" data-tooltip="Contents"><span data-icon="panel-left"></span></button>
29
29
  <button type="button" id="app-directory" class="picker" aria-label="Current project"><span data-icon="folder" data-size="14"></span><span class="directory-name"></span><span class="switcher-chevron" data-icon="chevron-down" data-size="12" hidden></span></button>
30
30
  <span class="separator project-divider"></span>
31
31
  <div id="scope-tabs" role="tablist" aria-label="Design scope"></div>
32
+ <div id="frame-filter"><button id="filter-toggle" class="view-pill" aria-expanded="false" aria-controls="filter-options"><span data-icon="list-filter"></span><span id="filter-label">Filter frames</span><span data-icon="chevron-down" data-size="12"></span></button>
33
+ <div id="filter-options" hidden><button type="button" data-filter="all">All frames</button><button type="button" data-filter="playable">Playable</button><button type="button" data-filter="recent">Recently updated</button></div></div>
34
+ <button type="button" id="scope-isolation" class="isolation-pill" data-tooltip="Show full layer" hidden></button>
35
+ <button type="button" id="token-view-toggle" class="view-pill" hidden></button>
32
36
  <span class="separator search-divider"></span>
33
37
  <div class="search-field"><span data-icon="search" data-size="14"></span><input id="search" type="search" placeholder="Find assets…" aria-label="Find assets" autocomplete="off"><span id="search-key">⌘F</span><button id="search-clear" aria-label="Clear search" hidden><span data-icon="x" data-size="14"></span></button></div>
34
38
  </div>
39
+ <main id="view-board" aria-labelledby="view-board-title" tabindex="-1" hidden>
40
+ <div class="view-board-page">
41
+ <header class="view-board-heading">
42
+ <button id="all-frames" class="view-pill"><span data-icon="arrow-left" data-size="14"></span>All frames</button>
43
+ <h1 id="view-board-title"></h1>
44
+ </header>
45
+ <div id="view-board-content"></div>
46
+ </div>
47
+ </main>
35
48
  <aside id="sidebar" class="floating" aria-label="Contents" hidden>
36
49
  <nav id="modules" aria-label="Design modules"></nav>
37
50
  </aside>
38
51
  <div id="tools" class="floating" role="toolbar" aria-label="View controls" hidden>
39
- <button id="annotate" class="icon-button" aria-label="Annotations" aria-controls="annotations-panel" aria-expanded="false" data-tooltip="Annotations"><span data-icon="message-square"></span></button>
52
+ <button id="comments-toggle" class="icon-button" aria-label="Comments" aria-controls="comments-panel" aria-expanded="false" data-tooltip="Comments"><span data-icon="messages-square"></span></button>
40
53
  <button id="more" class="icon-button" popovertarget="more-menu" aria-label="More" aria-expanded="false" data-tooltip="More"><span data-icon="ellipsis"></span></button>
41
54
  <button id="inspect" class="icon-button" aria-label="Inspector" aria-controls="source" aria-expanded="false" data-tooltip="Inspector" disabled><span data-icon="panel-right"></span></button>
42
55
  </div>
43
- <aside id="annotations-panel" class="floating" hidden aria-label="Annotations"></aside>
56
+ <aside id="comments-panel" class="floating" hidden aria-label="Comments"></aside>
57
+ <div id="comment-layer"></div>
44
58
  <aside id="source" class="floating" hidden aria-label="Inspector">
45
59
  <div class="inspector-heading"><h2 id="source-name"></h2><button id="copy-path" class="detail-copy" aria-label="Copy source path"><span id="source-path"></span><span data-icon="copy" data-size="12"></span></button><div id="frame-detail"><button id="copy-frame" class="detail-copy" aria-label="Copy frame name"><span id="frame-name"></span><span data-icon="copy" data-size="12"></span></button><span id="frame-size"></span></div></div>
46
60
  <div class="rule"></div><h3 id="forms-heading">Frames</h3><div id="forms"></div>
@@ -53,19 +67,21 @@
53
67
  <button id="plus" class="icon-button" aria-label="Zoom in" data-tooltip="Zoom in"><span data-icon="plus"></span></button><span class="separator"></span>
54
68
  <button id="fit-current" class="icon-button" aria-label="Fit" data-tooltip="Fit"><span data-icon="scan"></span></button>
55
69
  <button id="map-toggle" class="icon-button" aria-label="Minimap" aria-pressed="false" data-tooltip="Minimap"><span data-icon="map"></span></button>
70
+ <button id="comment-tool" class="icon-button" aria-label="Comment" aria-pressed="false" data-tooltip="Comment (C)"><span data-icon="message-square-plus"></span></button>
56
71
  </div>
57
72
  <canvas id="minimap" class="floating" hidden aria-label="Minimap"></canvas>
58
73
  <div id="more-menu" class="menu" popover aria-label="More">
59
74
  <button id="fullscreen">Fullscreen</button><div class="rule"></div>
60
75
  <h3>Theme</h3><div id="themes"><button data-theme="system">System</button><button data-theme="light">Light</button><button data-theme="dark">Dark</button></div>
61
- <div class="rule"></div><h3>Canvas</h3><div id="backgrounds"><button data-background="theme">Match theme</button><button data-background="light">Light</button><button data-background="dark">Dark</button><button data-background="neutral">Neutral</button></div>
62
- <div id="canvas-actions"><div class="rule"></div><button id="arrange">Arrange current group</button><button id="shortcuts">Keyboard shortcuts<span class="key">?</span></button></div>
76
+ <div id="canvas-background-section"><div class="rule"></div><h3>Canvas</h3><div id="backgrounds"><button data-background="theme">Match theme</button><button data-background="light">Light</button><button data-background="dark">Dark</button><button data-background="neutral">Neutral</button></div></div>
77
+ <div id="canvas-actions"><div class="rule"></div><button id="token-list-toggle" hidden>List view</button><button id="arrange">Arrange current group</button><button id="shortcuts">Keyboard shortcuts<span class="key">?</span></button></div>
63
78
  </div>
64
79
  <div id="zoom-menu" class="menu" popover aria-label="Zoom"><button id="zoom-fit-all">Fit all<span class="key">0</span></button><button id="zoom-fit-group">Fit group</button><button id="zoom-fit-selection">Fit selection</button><div class="rule"></div><button id="zoom-actual">Zoom to 100%<span class="key">1</span></button></div>
65
80
  <div id="context-menu" class="menu" popover role="menu" aria-label="Context menu"></div>
66
81
  <div id="tooltip" role="tooltip" hidden></div>
67
82
  <dialog id="keys" aria-labelledby="keys-title"><h2 id="keys-title">Keyboard shortcuts</h2><button id="keys-close" class="icon-button dialog-close" aria-label="Close keyboard shortcuts"><span data-icon="x" data-size="14"></span></button><dl>
68
83
  <div><dt>Search</dt><dd><kbd>⌘F</kbd></dd></div><div><dt>Fit all</dt><dd><kbd>0</kbd></dd></div><div><dt>Zoom to 100%</dt><dd><kbd>1</kbd></dd></div><div><dt>Zoom in or out</dt><dd><kbd>+</kbd><kbd>−</kbd></dd></div><div><dt>Pan</dt><dd><kbd>←</kbd><kbd>↑</kbd><kbd>→</kbd><kbd>↓</kbd></dd></div><div><dt>Focus selection</dt><dd><kbd>Enter</kbd></dd></div><div><dt>Back or close</dt><dd><kbd>Esc</kbd></dd></div>
84
+ <div><dt>Play selected frame</dt><dd><kbd>P</kbd></dd></div><div><dt>Comment</dt><dd><kbd>C</kbd></dd></div><div><dt>Hide or show comment pins</dt><dd><kbd>⇧C</kbd></dd></div>
69
85
  </dl></dialog>
70
86
  <div id="error" role="alert" hidden></div>
71
87
  <p id="controls" class="sr">Drag or scroll to pan. Pinch or Control or Command scroll to zoom. Arrow keys pan; plus and minus zoom; zero fits all; Escape goes back; one sets 100%. Click to select; double-click or Enter to focus.</p>