@popcorn245/cornfield 0.46.1 → 0.46.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.
Files changed (52) hide show
  1. package/explorer/capped.js +3 -2
  2. package/explorer/engine/feedback.js +49 -0
  3. package/explorer/engine/flow-ui.js +39 -0
  4. package/explorer/engine/fly.js +54 -0
  5. package/explorer/engine/hint.js +97 -0
  6. package/explorer/engine/keyboard.js +156 -0
  7. package/explorer/engine/layers.js +280 -0
  8. package/explorer/engine/layout.js +378 -0
  9. package/explorer/engine/map-style.js +547 -0
  10. package/explorer/engine/piece.js +142 -0
  11. package/explorer/engine/render.js +331 -0
  12. package/explorer/engine/search-status.js +59 -0
  13. package/explorer/engine/selection.js +42 -0
  14. package/explorer/engine/sheets.js +417 -0
  15. package/explorer/engine/strings.js +63 -0
  16. package/explorer/feedback.js +11 -45
  17. package/explorer/flow-style.js +28 -0
  18. package/explorer/flows.js +10 -51
  19. package/explorer/fly.js +11 -43
  20. package/explorer/hint.js +15 -88
  21. package/explorer/index.html +38 -75
  22. package/explorer/input.js +190 -177
  23. package/explorer/instance-state.js +172 -0
  24. package/explorer/instance.js +267 -0
  25. package/explorer/keyboard.js +14 -206
  26. package/explorer/labels.js +3 -3
  27. package/explorer/layers.js +34 -445
  28. package/explorer/layout.js +14 -372
  29. package/explorer/main.js +4 -226
  30. package/explorer/map-style.js +27 -525
  31. package/explorer/mockups-model.js +3 -3
  32. package/explorer/page-pieces.js +61 -0
  33. package/explorer/page.js +232 -0
  34. package/explorer/panels.js +29 -409
  35. package/explorer/pieces/layers.js +325 -0
  36. package/explorer/pieces/node-panel.js +536 -0
  37. package/explorer/pieces/search.js +454 -0
  38. package/explorer/proposal-model.js +1 -1
  39. package/explorer/proposal.js +1 -0
  40. package/explorer/render.js +37 -267
  41. package/explorer/renderer-canvas2d.js +4 -4
  42. package/explorer/renderer-webgl.js +21 -8
  43. package/explorer/renderer.js +11 -9
  44. package/explorer/scene.js +3 -2
  45. package/explorer/search-status.js +8 -47
  46. package/explorer/search.js +26 -324
  47. package/explorer/selection-view.js +17 -19
  48. package/explorer/sheets.js +31 -379
  49. package/explorer/state.js +38 -173
  50. package/explorer/strings.js +17 -60
  51. package/explorer/view.js +4 -5
  52. package/package.json +1 -1
package/explorer/fly.js CHANGED
@@ -1,48 +1,16 @@
1
1
  /**
2
2
  * @module explorer/fly
3
3
  *
4
- * The camera flying to a place: a short glide to `{ x, y, zoom }`, as the scenario player's steps do, so a match chosen in a search
5
- * is not a jump the eye has to find again. Under reduced motion the camera jumps. A new flight replaces the one in the air, and a
6
- * hand on the map (a pan, a wheel) is not fought: `stopFlight()` ends it (input.js calls it when the pointer takes the camera).
7
- * It is a frame client of render.js's loop, so it asks for frames only while it flies.
4
+ * A bridge (spec 0011 D2, step 4): the camera's flight now lives in engine/fly.js, one per instance. This file keeps the old names for the
5
+ * modules that are not yet on an instance (page.js). It goes when page.js is converted.
8
6
  */
7
+ import { pageInstance } from './state.js';
8
+ import { pageMap } from './render.js';
9
+ import * as F from './engine/fly.js';
9
10
 
10
- import { state } from './state.js';
11
- import { render, ensureFlowLoop, addFrameClient } from './render.js';
12
- import { flowReduceMotion } from './flows.js';
13
-
14
- /** How quickly the camera closes on the target: the time constant of the glide (ms) */
15
- export const FLY_MS = 120;
16
- let glide = null; // { to: {x, y, zoom}, last: nowMs|null }
17
-
18
- /** Flies the camera to `target` (jumps there when motion is reduced) */
19
- export function flyTo(target) {
20
- if (!target) return;
21
- if (flowReduceMotion || !state.width) { Object.assign(state.camera, target); glide = null; render(); return; }
22
- glide = { to: { ...target }, last: null };
23
- ensureFlowLoop();
24
- }
25
-
26
- /** Ends a flight where it is */
27
- export function stopFlight() { glide = null; }
28
-
29
- /** Whether the camera is in the air */
30
- export const flying = () => !!glide;
31
-
32
- /** One frame of the glide (exported so a test can be the loop) */
33
- export function tickFlight(now) {
34
- if (!glide) return;
35
- const dt = glide.last === null ? 16 : Math.min(now - glide.last, 100);
36
- glide.last = now;
37
- const k = 1 - Math.exp(-dt / FLY_MS);
38
- const cam = state.camera;
39
- cam.x += (glide.to.x - cam.x) * k;
40
- cam.y += (glide.to.y - cam.y) * k;
41
- cam.zoom += (glide.to.zoom - cam.zoom) * k;
42
- if (Math.abs(glide.to.x - cam.x) < 0.5 && Math.abs(glide.to.y - cam.y) < 0.5 && Math.abs(glide.to.zoom - cam.zoom) < 0.002) {
43
- Object.assign(cam, glide.to);
44
- glide = null;
45
- }
46
- }
47
-
48
- addFrameClient({ wants: flying, tick: tickFlight });
11
+ export { FLY_MS } from './engine/fly.js';
12
+ const page = () => { pageMap(); return pageInstance(); }; // the flight joins the page map's loop, so the map is there first
13
+ export const flyTo = (target) => F.flyTo(page(), target);
14
+ export const stopFlight = () => F.stopFlight(page());
15
+ export const flying = () => F.flying(page());
16
+ export const tickFlight = (now) => F.tickFlight(page(), now);
package/explorer/hint.js CHANGED
@@ -1,92 +1,19 @@
1
1
  /**
2
2
  * @module explorer/hint
3
3
  *
4
- * The hint at the map's corner ("Click a node for what it is"; CF review F56). Three rules:
5
- * - its words follow the pointer: `hintInspect` / `hintDrag` for a mouse or a trackpad, `hintInspectTouch` / `hintDragTouch` where the
6
- * main pointer is coarse (a finger). A repo that sets only `hintInspect` (or `hintDrag`) gets its words on both;
7
- * - it goes once the person has selected a node, for the rest of the session (sessionStorage; the Flow view's own description stays,
8
- * since it says what Flow is, not how to use the map);
9
- * - it is never shown over an open proposal, a node panel, the Work panel or a sheet.
10
- * The icon is `[data-corn="hint-icon"]`, so a theme can restyle or replace it.
4
+ * A bridge (spec 0011 D2, step 4): the hint at the map's corner now lives in engine/hint.js, one per instance. This file keeps the old names for
5
+ * the modules that are not yet on an instance (page.js, view.js), bound to the page's instance. It goes when view.js and page.js are converted.
11
6
  */
12
-
13
- import { state } from './state.js';
14
- import { isOverridden, t } from './strings.js';
15
-
16
- export const HINT_STORAGE_KEY = 'cornfield:hint-done';
17
-
18
- const $ = (id) => document.getElementById(id);
19
-
20
- /** Whether the main pointer is a finger (`(pointer: coarse)`) */
21
- export function coarsePointer(win = typeof window !== 'undefined' ? window : null) {
22
- try { return !!(win && win.matchMedia && win.matchMedia('(pointer: coarse)').matches); } catch { return false; }
23
- }
24
-
25
- /** The words by the pointer: the Touch ones on a finger, unless the repo set only the plain key (then its words serve both) */
26
- export function hintWords(plain, touch, coarse) {
27
- return coarse && (touch.set || !plain.set) ? touch.text : plain.text;
28
- }
29
-
30
- /** The hint for the view in force */
31
- export function hintText(coarse = coarsePointer()) {
32
- if (state.view === 'dataflow') return t('hintDataFlow');
33
- return state.isFreeform
34
- ? hintWords({ text: t('hintDrag'), set: isOverridden('hintDrag') }, { text: t('hintDragTouch'), set: isOverridden('hintDragTouch') }, coarse)
35
- : hintWords({ text: t('hintInspect'), set: isOverridden('hintInspect') }, { text: t('hintInspectTouch'), set: isOverridden('hintInspectTouch') }, coarse);
36
- }
37
-
38
- let dismissed = false;
39
- try { dismissed = window.sessionStorage.getItem(HINT_STORAGE_KEY) === '1'; } catch { dismissed = false; }
40
-
41
- /** Remembers that a node was selected: the hint is not shown again this session */
42
- export function dismissHint() {
43
- if (dismissed) return;
44
- dismissed = true;
45
- try { window.sessionStorage.setItem(HINT_STORAGE_KEY, '1'); } catch { /* storage blocked: it holds for this page load */ }
46
- syncHint();
47
- }
48
-
49
- /** For tests: the hint is new again */
50
- export function resetHintForTests() {
51
- dismissed = false;
52
- try { window.sessionStorage.removeItem(HINT_STORAGE_KEY); } catch { /* none */ }
53
- }
54
-
55
- /** What covers the map: an open proposal, the node panel, the Work panel, a sheet of the dock */
56
- export function mapCovered(doc = document) {
57
- const open = (sel) => doc.querySelector(sel);
58
- const bar = open('#proposal-bar');
59
- if (bar && !bar.hidden) return true;
60
- const drawer = open('#spec-drawer');
61
- if (drawer && drawer.classList.contains('drawer-open')) return true;
62
- const work = open('#forge-panel');
63
- if (work && work.classList.contains('forge-open')) return true;
64
- return !!doc.querySelector('[data-corn="scenario-player"]'); // a scenario is playing (a sheet on a phone)
65
- }
66
-
67
- /** Words, and whether it shows, for the state of the page now */
68
- export function syncHint() {
69
- const text = $('instruction-badge-text');
70
- const words = hintText();
71
- if (text && text.textContent !== words) text.textContent = words;
72
- const hint = text && text.closest('[data-corn="hint"]');
73
- if (!hint) return;
74
- const hide = mapCovered() || (dismissed && state.view !== 'dataflow');
75
- if (hint.hidden !== hide) hint.hidden = hide;
76
- }
77
-
78
- /** Keeps the hint right as panels open and close, and as the pointer kind changes. Returns how to stop. */
79
- export function watchHint(doc = document) {
80
- const win = doc.defaultView;
81
- const stops = [];
82
- const stage = doc.querySelector('[data-corn="stage"]') || doc.body;
83
- if (win && win.MutationObserver && stage) {
84
- const mo = new win.MutationObserver(syncHint);
85
- mo.observe(stage, { attributes: true, attributeFilter: ['class', 'hidden', 'inert'], childList: true, subtree: true });
86
- stops.push(() => mo.disconnect());
87
- }
88
- const media = win && win.matchMedia ? win.matchMedia('(pointer: coarse)') : null;
89
- if (media && media.addEventListener) { media.addEventListener('change', syncHint); stops.push(() => media.removeEventListener('change', syncHint)); }
90
- syncHint();
91
- return () => stops.forEach((fn) => fn());
92
- }
7
+ import { pageInstance } from './state.js';
8
+ import * as H from './engine/hint.js';
9
+
10
+ export { HINT_STORAGE_KEY, hintWords } from './engine/hint.js';
11
+ export const coarsePointer = (win = typeof window !== 'undefined' ? window : null) => H.coarsePointer(win);
12
+ export const hintText = (coarse) => H.hintText(pageInstance(), coarse);
13
+ export const dismissHint = () => H.dismissHint(pageInstance());
14
+ export const resetHintForTests = () => H.resetHint(pageInstance());
15
+ /** @param {Document} [doc] kept for the old signature: the page instance is over the document */
16
+ export const mapCovered = (doc) => H.mapCovered(doc && doc !== pageInstance().root ? { el: (id) => doc.getElementById(id), root: doc } : pageInstance());
17
+ export const syncHint = () => H.syncHint(pageInstance());
18
+ /** @param {Document} [doc] kept for the old signature */
19
+ export const watchHint = () => H.watchHint(pageInstance());
@@ -44,45 +44,41 @@
44
44
  </button>
45
45
  </div>
46
46
 
47
- <!-- The Layers chip: how many of the layers are on; it opens the layers menu. On a phone it sits on the map, top left -->
47
+ <!-- The Layers chip: how many of the layers are on; it opens the layers menu. On a phone it sits on the map, top left. It is a piece (explorer/pieces/layers.js): page.js mounts it here. Until then a stand-in (its markup without ids) holds its place, so the first paint has the chip and nothing moves when the piece comes; test/explorer/page-pieces.test.js keeps the two the same -->
48
+ <!--corn-placeholder:layers/menu-->
48
49
  <div class="hx-menu-wrap hx-layers">
49
- <button type="button" id="legend-toggle-btn" class="hx-layers-chip" data-action="toggle-layers-menu" aria-expanded="false" aria-controls="legend-dropdown" data-corn="layers-button"><span data-corn-string="layers">Layers</span><span id="layers-count" class="hx-layers-count" data-corn="count"></span></button>
50
-
51
- <!-- Interactive section toggles and the legend -->
52
- <div id="legend-dropdown" class="hx-menu glass" hidden data-corn="layers-menu">
53
- <div class="hx-menu-title hx-menu-head" data-corn="menu-title">
50
+ <button type="button" class="hx-layers-chip" data-action="toggle-layers-menu" aria-expanded="false" data-corn="layers-button" part="layers-button"><span data-corn-string="layers">Layers</span><span class="hx-layers-count" data-corn="count" part="count"></span></button>
51
+ <div class="hx-menu glass" hidden data-corn="layers-menu" part="layers-menu">
52
+ <div class="hx-menu-title hx-menu-head" data-corn="menu-title" part="menu-title">
54
53
  <span>Section Toggles</span>
55
54
  <span class="hx-menu-links">
56
- <button type="button" class="hx-textbtn hx-textbtn--accent" data-action="layers-all" data-corn="layers-all" data-corn-kind="quiet" data-corn-string="layersAll">All</button>
55
+ <button type="button" class="hx-textbtn hx-textbtn--accent" data-action="layers-all" data-corn="layers-all" part="layers-all" data-corn-kind="quiet" data-corn-string="layersAll">All</button>
57
56
  <span class="hx-faint">•</span>
58
- <button type="button" class="hx-textbtn" data-action="layers-none" data-corn="layers-none" data-corn-kind="quiet" data-corn-string="layersNone">None</button>
57
+ <button type="button" class="hx-textbtn" data-action="layers-none" data-corn="layers-none" part="layers-none" data-corn-kind="quiet" data-corn-string="layersNone">None</button>
59
58
  </span>
60
59
  </div>
61
60
  <div class="hx-menu-body">
62
- <p id="layers-preset-note" class="hx-note" data-corn="notice" hidden>The data-flow view shows its own tiers and ignores these toggles. Switch it off to use them.</p>
63
- <div id="layer-toggles-container" class="hx-toggles"></div>
64
- <div id="flow-legend" hidden></div>
65
- <div id="edge-key" class="hx-menu-section" data-corn="legend-key"></div>
66
- <div id="cloud-legend" class="hx-menu-section" data-corn="menu-section" hidden></div>
67
-
68
- <!-- What the marks of agent runs mean, while there are runs on the map (runs-map.js) -->
69
- <div id="runs-legend" class="hx-menu-section" data-corn="menu-section" hidden>
70
- <div class="hx-menu-title" data-corn="menu-title"><span>Agent runs</span></div>
61
+ <p class="hx-note" data-corn="notice" part="notice" hidden>The data-flow view shows its own tiers and ignores these toggles. Switch it off to use them.</p>
62
+ <div class="hx-toggles"></div>
63
+ <div hidden></div>
64
+ <div class="hx-menu-section" data-corn="legend-key" part="legend-key"></div>
65
+ <div class="hx-menu-section" data-corn="menu-section" part="menu-section" hidden></div>
66
+ <div class="hx-menu-section" data-corn="menu-section" part="menu-section" hidden>
67
+ <div class="hx-menu-title" data-corn="menu-title" part="menu-title"><span>Agent runs</span></div>
71
68
  <div class="hx-legend-row"><span class="hx-run-swatch hx-run-swatch--flight" aria-hidden="true"></span><span>In flight: a pulsing ring (still under reduced motion)</span></div>
72
69
  <div class="hx-legend-row"><span class="hx-run-swatch hx-run-swatch--collision" aria-hidden="true"></span><span>Collision: dashed ring, ⚠ and the words, where two open runs change one node</span></div>
73
70
  </div>
74
-
75
- <!-- What a proposal's marks mean, while one is open (proposal.js) -->
76
- <div id="proposal-legend" class="hx-menu-section" data-corn="menu-section" hidden>
77
- <div class="hx-menu-title" data-corn="menu-title"><span>Proposal marks</span></div>
78
- <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--added" data-corn="mark-dot" data-corn-state="added"></span><span>Added: dashed ring</span></div>
79
- <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--changed" data-corn="mark-dot" data-corn-state="changed"></span><span>Changed: solid ring</span></div>
80
- <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--removed" data-corn="mark-dot" data-corn-state="removed"></span><span>Removed: faded ring, label struck through</span></div>
81
- <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--edit" data-corn="mark-dot" data-corn-state="edit"></span><span>Your edit: dotted ring, long-dashed line</span></div>
71
+ <div class="hx-menu-section" data-corn="menu-section" part="menu-section" hidden>
72
+ <div class="hx-menu-title" data-corn="menu-title" part="menu-title"><span>Proposal marks</span></div>
73
+ <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--added" data-corn="mark-dot" part="mark-dot" data-corn-state="added"></span><span>Added: dashed ring</span></div>
74
+ <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--changed" data-corn="mark-dot" part="mark-dot" data-corn-state="changed"></span><span>Changed: solid ring</span></div>
75
+ <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--removed" data-corn="mark-dot" part="mark-dot" data-corn-state="removed"></span><span>Removed: faded ring, label struck through</span></div>
76
+ <div class="hx-legend-row"><span class="hx-mark-dot hx-mark-dot--edit" data-corn="mark-dot" part="mark-dot" data-corn-state="edit"></span><span>Your edit: dotted ring, long-dashed line</span></div>
77
+ </div>
82
78
  </div>
83
- </div><!-- .hx-menu-body: the rows scroll, the title with All and None stays (spec 0009 D8) -->
84
79
  </div>
85
80
  </div>
81
+ <!--corn-piece:layers/menu-->
86
82
 
87
83
  <!-- The live layer's chip (explorer/live.js, spec 0029): shown once a live layer is on; a dot on a phone, its line on tap -->
88
84
  <div id="live-wrap" class="hx-menu-wrap hx-live" data-tone="idle" hidden>
@@ -95,24 +91,26 @@
95
91
  </div>
96
92
 
97
93
  <div class="hx-header-right">
98
- <!-- Search: a field with its key hint on a desktop; an icon that opens the search bar on a phone -->
99
- <button type="button" id="mobile-search-toggle" class="hx-hdr-icon hx-only-mobile" data-corn="mobile-search-button" data-action="toggle-mobile-search" aria-label="Open Search" title="Search nodes" data-corn-kind="icon">
94
+ <!-- Search: a field with its key hint on a desktop; an icon that opens the search bar on a phone. It is a piece (explorer/pieces/search.js): page.js mounts it here, in place of the stand-in below (as the Layers chip's) -->
95
+ <!--corn-placeholder:search/field-->
96
+ <button type="button" class="hx-hdr-icon hx-only-mobile" data-corn="mobile-search-button" part="mobile-search-button" data-action="toggle-mobile-search" aria-label="Open Search" title="Search nodes" data-corn-kind="icon">
100
97
  <svg viewBox="0 0 16 16" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="7" cy="7" r="4.5" /><path d="M10.5 10.5L14 14" /></svg>
101
98
  </button>
102
99
 
103
- <div class="hx-search" role="search" data-corn="search">
100
+ <div class="hx-search" role="search" data-corn="search" part="search">
104
101
  <svg class="hx-search-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="7" cy="7" r="4.5" /><path d="M10.5 10.5L14 14" /></svg>
105
- <input type="text" id="node-search" class="hx-search-input" placeholder="Search..." data-corn-string-placeholder="searchPlaceholder" aria-label="Search nodes" aria-keyshortcuts="/" data-corn="search-input" />
106
- <kbd class="hx-kbd" data-corn="search-key" aria-hidden="true">/</kbd>
107
- <span id="search-steps" class="hx-search-steps" data-corn="search-steps" hidden>
108
- <span id="search-count" class="hx-search-count" data-corn="search-count" aria-hidden="true"></span>
102
+ <input type="text" class="hx-search-input" placeholder="Search..." data-corn-string-placeholder="searchPlaceholder" aria-label="Search nodes" aria-keyshortcuts="/" data-corn="search-input" part="search-input" />
103
+ <kbd class="hx-kbd" data-corn="search-key" part="search-key" aria-hidden="true">/</kbd>
104
+ <span class="hx-search-steps" data-corn="search-steps" part="search-steps" hidden>
105
+ <span class="hx-search-count" data-corn="search-count" part="search-count" aria-hidden="true"></span>
109
106
  <button type="button" class="hx-search-btn" data-action="search-prev" aria-label="Previous match" title="Previous match (Shift+Enter)" data-corn-kind="icon"><svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3.5 10.5L8 6l4.5 4.5" /></svg></button>
110
107
  <button type="button" class="hx-search-btn" data-action="search-next" aria-label="Next match" title="Next match (Enter)" data-corn-kind="icon"><svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3.5 5.5L8 10l4.5-4.5" /></svg></button>
111
108
  <button type="button" class="hx-search-btn" data-action="clear-search" aria-label="Clear search" title="Clear search (Escape)" data-corn-kind="icon"><svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true" focusable="false"><path d="M4 4l8 8M12 4l-8 8" /></svg></button>
112
109
  </span>
113
- <div id="search-status" class="hx-search-status" role="status" aria-live="polite" data-corn="search-status"></div>
114
- <div id="search-results" class="hx-search-results" data-corn="search-results" hidden></div>
110
+ <div class="hx-search-status" role="status" aria-live="polite" data-corn="search-status" part="search-status"></div>
111
+ <div class="hx-search-results" data-corn="search-results" part="search-results" hidden></div>
115
112
  </div>
113
+ <!--corn-piece:search/field-->
116
114
 
117
115
  <!-- The Work toggle (explorer/forge-panel.js): opens the Work panel; shown only when the config names a forge -->
118
116
  <button type="button" id="forge-btn" class="hx-work" data-action="toggle-forge" aria-expanded="false" aria-controls="forge-panel" aria-label="Work" data-corn-string-aria-label="issuesAndPrs" title="Issues, pull requests and deploys: a pull request lights the nodes it changes, a deploy the nodes it restarted" hidden data-corn="forge-button">
@@ -168,19 +166,8 @@
168
166
  </div>
169
167
  </header>
170
168
 
171
- <!-- Mobile search bar -->
172
- <div id="mobile-search-bar" class="hx-mobile-search glass-header" role="search" hidden data-corn="mobile-search">
173
- <input type="text" id="mobile-node-search" class="hx-input hx-input--wide" placeholder="Search nodes, apps, components..." aria-label="Search nodes" data-corn="search-input" />
174
- <button type="button" class="hx-textbtn" data-action="close-mobile-search" data-corn-kind="quiet">Cancel</button>
175
- <span id="mobile-search-steps" class="hx-search-steps" data-corn="search-steps" hidden>
176
- <span id="mobile-search-count" class="hx-search-count" data-corn="search-count" aria-hidden="true"></span>
177
- <button type="button" class="hx-search-btn" data-action="search-prev" aria-label="Previous match" title="Previous match (Shift+Enter)" data-corn-kind="icon"><svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3.5 10.5L8 6l4.5 4.5" /></svg></button>
178
- <button type="button" class="hx-search-btn" data-action="search-next" aria-label="Next match" title="Next match (Enter)" data-corn-kind="icon"><svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3.5 5.5L8 10l4.5-4.5" /></svg></button>
179
- <button type="button" class="hx-search-btn" data-action="clear-search" aria-label="Clear search" title="Clear search (Escape)" data-corn-kind="icon"><svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true" focusable="false"><path d="M4 4l8 8M12 4l-8 8" /></svg></button>
180
- </span>
181
- <div id="mobile-search-status" class="hx-search-status" role="status" aria-live="polite" data-corn="search-status"></div>
182
- <div id="mobile-search-results" class="hx-search-results" data-corn="search-results" hidden></div>
183
- </div>
169
+ <!-- Mobile search bar: part of the search piece, which mounts it here -->
170
+ <!--corn-piece:search/bar-->
184
171
 
185
172
  <!-- The map -->
186
173
  <div class="hx-stage" role="main" data-corn="stage">
@@ -352,32 +339,8 @@
352
339
  </div>
353
340
  </aside>
354
341
 
355
- <!-- Node panel: a slide-over on desktop, a bottom sheet on mobile -->
356
- <aside id="spec-drawer" class="hx-drawer glass" aria-label="Node details" inert data-corn="node-panel">
357
- <div class="hx-drawer-body">
358
- <div class="hx-drawer-head">
359
- <div class="hx-drawer-id">
360
- <p class="hx-kicker"><span id="drawer-badge" data-corn="badge">Atom</span><span id="drawer-host" data-corn="node-host"></span><span id="drawer-diff" class="hx-diffpill" data-corn="diff-pill" hidden></span></p>
361
- <h2 id="drawer-title" class="hx-drawer-title" data-corn="node-title">&lt;pop-button&gt;</h2>
362
- </div>
363
- <button type="button" class="hx-close" data-action="close-drawer" aria-label="Close" data-corn-kind="icon">✕</button>
364
- </div>
365
-
366
- <p id="drawer-description" class="hx-lead" hidden></p>
367
-
368
- <div class="hx-block">
369
- <div id="drawer-meta-list" class="hx-meta"></div>
370
- </div>
371
- </div>
372
-
373
- <div class="hx-drawer-foot" data-corn="node-foot">
374
- <a data-corn="open-link" id="drawer-file-btn" data-corn-kind="primary" class="hx-open" href="#" target="_blank" rel="noreferrer" hidden>Open file ↗</a>
375
- <a data-corn="open-link" id="drawer-open-btn" data-corn-kind="primary" class="hx-open" href="#" target="_blank" rel="noreferrer" hidden>Open route ↗</a>
376
- <button data-corn-kind="secondary" type="button" id="drawer-run-btn" class="hx-btn hx-foot-btn" data-action="start-run" data-corn-string="startRun" hidden>Start a run</button>
377
- <button data-corn-kind="quiet" type="button" class="hx-btn hx-btn--quiet hx-foot-btn" data-action="copy-spec" data-corn-string="copySpec">Copy Spec</button>
378
- <p id="copy-spec-result" class="hx-forge-result" data-corn="result" hidden></p>
379
- </div>
380
- </aside>
342
+ <!-- Node panel: a slide-over on desktop, a bottom sheet on mobile. It is a piece (explorer/pieces/node-panel.js): page.js mounts it here -->
343
+ <!--corn-piece:node-panel/drawer-->
381
344
  </div>
382
345
 
383
346
  <div class="hx-hint glass" data-corn="hint">
@@ -394,7 +357,7 @@
394
357
  <button type="button" class="hx-btn hx-btn--active" data-action="retry" data-corn-kind="primary" data-corn-string="retry">Retry</button>
395
358
  </div>
396
359
 
397
- <div id="drawer-backdrop" class="hx-backdrop" data-action="close-drawer" hidden data-corn="backdrop"></div>
360
+ <!--corn-piece:node-panel/backdrop-->
398
361
 
399
362
  </div>
400
363