@cueloop/client 0.1.0-alpha.4 → 0.1.0-alpha.40

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 (131) hide show
  1. package/package.json +32 -24
  2. package/src/App.autoclose.test.tsx +137 -0
  3. package/src/App.diff.test.tsx +158 -22
  4. package/src/App.export.test.tsx +44 -37
  5. package/src/App.plan-review.test.tsx +632 -0
  6. package/src/App.readonly.test.tsx +60 -36
  7. package/src/App.rendering.test.tsx +132 -0
  8. package/src/App.review-panel.test.tsx +136 -0
  9. package/src/App.submit-confirm.test.tsx +220 -0
  10. package/src/App.test.tsx +128 -69
  11. package/src/App.toast.test.tsx +75 -0
  12. package/src/App.tsx +0 -0
  13. package/src/App.walk.test.tsx +288 -0
  14. package/src/attribution.test.ts +31 -0
  15. package/src/attribution.ts +38 -0
  16. package/src/clipboard.test.ts +23 -0
  17. package/src/clipboard.ts +30 -0
  18. package/src/components/AnnotationCard.compose-rows.test.ts +49 -0
  19. package/src/components/AnnotationCard.stories.tsx +94 -0
  20. package/src/components/AnnotationCard.tsx +228 -0
  21. package/src/components/Breadcrumb.stories.tsx +19 -0
  22. package/src/components/Breadcrumb.tsx +44 -0
  23. package/src/components/CodeBlock.stories.tsx +42 -0
  24. package/src/components/CodeBlock.tsx +83 -0
  25. package/src/components/CompletionOverlay.stories.tsx +23 -0
  26. package/src/components/CompletionOverlay.tsx +59 -0
  27. package/src/components/ConfirmCard.stories.tsx +56 -0
  28. package/src/components/ConfirmCard.tsx +135 -0
  29. package/src/components/ConfirmDialog.stories.tsx +21 -0
  30. package/src/components/ConfirmDialog.tsx +64 -0
  31. package/src/components/DiffSheet.scroll.test.tsx +123 -0
  32. package/src/components/DiffSheet.stories.tsx +78 -0
  33. package/src/components/DiffSheet.syntax.test.tsx +62 -0
  34. package/src/components/DiffSheet.tsx +355 -0
  35. package/src/components/InboxList.stories.tsx +31 -0
  36. package/src/components/InboxList.tsx +62 -0
  37. package/src/components/KeybindsDialog.stories.tsx +31 -0
  38. package/src/components/KeybindsDialog.tsx +58 -0
  39. package/src/components/MarkerPopover.stories.tsx +58 -0
  40. package/src/components/MarkerPopover.tsx +102 -0
  41. package/src/components/MenuBar.stories.tsx +37 -0
  42. package/src/components/MenuBar.tsx +74 -0
  43. package/src/components/PlanSheet.stories.tsx +113 -0
  44. package/src/components/PlanSheet.tsx +389 -0
  45. package/src/components/PromptDialog.stories.tsx +36 -0
  46. package/src/components/PromptDialog.tsx +78 -0
  47. package/src/components/ReviewPanel.stories.tsx +86 -0
  48. package/src/components/ReviewPanel.tsx +101 -0
  49. package/src/components/ReviewRail.stories.tsx +220 -0
  50. package/src/components/ReviewRail.tsx +316 -0
  51. package/src/components/SettingsDialog.stories.tsx +111 -0
  52. package/src/components/SettingsDialog.tsx +141 -0
  53. package/src/components/SettingsRows.stories.tsx +18 -0
  54. package/src/components/SettingsRows.tsx +108 -0
  55. package/src/components/Toast.stories.tsx +12 -0
  56. package/src/components/Toast.tsx +44 -0
  57. package/src/components/WalkWizard.stories.tsx +100 -0
  58. package/src/components/WalkWizard.tsx +152 -0
  59. package/src/components/__snapshots__/stories.test.tsx.snap +1829 -0
  60. package/src/components/agent-launcher.stories.tsx +26 -0
  61. package/src/components/agent-launcher.test.tsx +21 -0
  62. package/src/components/agent-launcher.tsx +123 -0
  63. package/src/components/diff-sheet-layout.test.ts +127 -0
  64. package/src/components/diff-sheet-layout.ts +167 -0
  65. package/src/components/primitives/Button.stories.tsx +32 -0
  66. package/src/components/primitives/Button.tsx +48 -0
  67. package/src/components/primitives/Card.stories.tsx +25 -0
  68. package/src/components/primitives/Card.tsx +59 -0
  69. package/src/components/primitives/Dialog.stories.tsx +24 -0
  70. package/src/components/primitives/Dialog.tsx +64 -0
  71. package/src/components/primitives/StatusBar.stories.tsx +11 -0
  72. package/src/components/primitives/StatusBar.tsx +22 -0
  73. package/src/components/primitives/Tabs.stories.tsx +29 -0
  74. package/src/components/primitives/Tabs.tsx +98 -0
  75. package/src/components/primitives/Toolbar.stories.tsx +17 -0
  76. package/src/components/primitives/Toolbar.tsx +14 -0
  77. package/src/components/primitives/frame.test.ts +12 -0
  78. package/src/components/primitives/frame.ts +14 -0
  79. package/src/components/quick-actions-editor.stories.tsx +54 -0
  80. package/src/components/quick-actions-editor.tsx +136 -0
  81. package/src/components/stories-app.tsx +123 -0
  82. package/src/components/stories.test.tsx +62 -0
  83. package/src/components/story-fixtures.ts +98 -0
  84. package/src/components/story.ts +69 -0
  85. package/src/components/syntax-highlight.ts +92 -0
  86. package/src/components/theme-context.stories.tsx +46 -0
  87. package/src/components/theme-context.tsx +36 -0
  88. package/src/components/truncate-text.ts +6 -0
  89. package/src/config.test.ts +430 -31
  90. package/src/config.ts +304 -26
  91. package/src/diff-hunk-curate.test.ts +315 -0
  92. package/src/diff-hunk-curate.ts +233 -0
  93. package/src/diff-intraline.test.ts +164 -0
  94. package/src/diff-intraline.ts +132 -0
  95. package/src/diff-syntax.test.ts +96 -0
  96. package/src/diff-syntax.ts +154 -0
  97. package/src/editor.test.ts +143 -0
  98. package/src/editor.ts +123 -9
  99. package/src/herdr.test.ts +41 -0
  100. package/src/herdr.ts +27 -0
  101. package/src/index.ts +10 -0
  102. package/src/integrations.test.ts +41 -0
  103. package/src/integrations.ts +30 -0
  104. package/src/intent-dispatch.test.ts +492 -0
  105. package/src/intent-dispatch.ts +428 -0
  106. package/src/key-bindings.test.ts +152 -0
  107. package/src/key-bindings.ts +424 -0
  108. package/src/keymap.test.ts +622 -0
  109. package/src/keymap.ts +339 -0
  110. package/src/review-panel.test.ts +113 -0
  111. package/src/review-panel.ts +83 -0
  112. package/src/run.ts +9 -5
  113. package/src/serve.test.ts +24 -9
  114. package/src/serve.ts +7 -7
  115. package/src/session-controller.curate.test.ts +253 -0
  116. package/src/session-controller.share.test.ts +309 -0
  117. package/src/session-controller.ts +900 -0
  118. package/src/share.ts +113 -0
  119. package/src/test-support.test.ts +55 -0
  120. package/src/test-support.ts +187 -0
  121. package/src/theme-presets.ts +168 -0
  122. package/src/theme.ts +36 -15
  123. package/src/version.ts +5 -0
  124. package/src/view-diff.test.ts +19 -8
  125. package/src/view-diff.ts +34 -23
  126. package/src/view-plan.test.ts +294 -0
  127. package/src/view-plan.ts +408 -0
  128. package/src/walk.test.ts +121 -0
  129. package/src/walk.ts +70 -0
  130. package/src/view.test.ts +0 -157
  131. package/src/view.ts +0 -0
@@ -0,0 +1,424 @@
1
+ /**
2
+ * Binding resolution over @opentui/keymap: the loaded config keymap
3
+ * registers as layers (grammar, span, compose, submit, completion) on one
4
+ * Keymap instance, key events resolve to action names through its dispatch,
5
+ * and the status-line hints generate from getActiveKeys() - a rebound key
6
+ * shows its real binding in the hints. The pure intent reducer (keymap.ts)
7
+ * stays the dispatch layer beneath: this module answers "which action", the
8
+ * reducer answers "which intents".
9
+ */
10
+
11
+ import { Keymap, type KeymapEvent, type KeymapHost } from "@opentui/keymap";
12
+ import { registerDefaultKeys } from "@opentui/keymap/addons";
13
+ import type { KeyState } from "./keymap";
14
+
15
+ export interface ResolvableKey {
16
+ name: string;
17
+ shift: boolean;
18
+ }
19
+
20
+ /** The layer-activation slice of the view state. */
21
+ export interface KeyLayerContext {
22
+ overlay: KeyState["overlay"];
23
+ spanMode: boolean;
24
+ }
25
+
26
+ /** Hint templates keyed by the same view states the status line shows. */
27
+ export type HintMode =
28
+ | "normal"
29
+ | "collaborator"
30
+ | "card"
31
+ | "span"
32
+ | "compose"
33
+ | "submit"
34
+ | "walk"
35
+ | "read-only";
36
+
37
+ export interface CheatsheetEntry {
38
+ keys: string;
39
+ label: string;
40
+ }
41
+ export interface CheatsheetSection {
42
+ title: string;
43
+ entries: CheatsheetEntry[];
44
+ }
45
+
46
+ type HintEntry = { text: string } | { commands: string[]; label: string; labelFirst?: boolean };
47
+
48
+ const HINT_TEMPLATES: Record<HintMode, HintEntry[]> = {
49
+ normal: [
50
+ { commands: ["down", "up"], label: "move" },
51
+ { commands: ["span"], label: "span" },
52
+ { text: "drag selects" },
53
+ { commands: ["comment"], label: "comment" },
54
+ { commands: ["cut"], label: "cut" },
55
+ { commands: ["edit"], label: "edit" },
56
+ { commands: ["next_annotation", "prev_annotation"], label: "annotations" },
57
+ { commands: ["submit"], label: "submit" },
58
+ { commands: ["quit"], label: "quit" },
59
+ ],
60
+ // A share viewer: annotate and navigate, no plan edit / verdict submit.
61
+ collaborator: [
62
+ { commands: ["down", "up"], label: "move" },
63
+ { commands: ["span"], label: "span" },
64
+ { text: "drag selects" },
65
+ { commands: ["comment"], label: "comment" },
66
+ { commands: ["next_annotation", "prev_annotation"], label: "annotations" },
67
+ { commands: ["quit"], label: "quit" },
68
+ ],
69
+ card: [
70
+ { text: "card" },
71
+ { commands: ["edit"], label: "edit" },
72
+ { commands: ["cut"], label: "Cut" },
73
+ { commands: ["next_annotation", "prev_annotation"], label: "cards" },
74
+ { commands: ["deselect"], label: "deselect" },
75
+ { commands: ["submit"], label: "submit" },
76
+ ],
77
+ span: [
78
+ { text: "span" },
79
+ { commands: ["span_grow", "span_shrink"], label: "grow/shrink" },
80
+ { commands: ["span_slide_forward", "span_slide_back"], label: "slide" },
81
+ { commands: ["span_to_end"], label: "end" },
82
+ { commands: ["span_comment"], label: "comment" },
83
+ { commands: ["span_cancel"], label: "" },
84
+ ],
85
+ compose: [
86
+ { text: "typing" },
87
+ { commands: ["save_compose"], label: "save" },
88
+ { commands: ["cancel_overlay"], label: "cancel" },
89
+ ],
90
+ submit: [
91
+ { commands: ["cycle_verdict_left", "cycle_verdict_right"], label: "verdict", labelFirst: true },
92
+ { commands: ["submit_verdict"], label: "submit" },
93
+ { commands: ["cancel_submit"], label: "cancel" },
94
+ ],
95
+ walk: [
96
+ { text: "walk" },
97
+ { commands: ["walk_next"], label: "next (marks viewed)" },
98
+ { commands: ["walk_prev"], label: "back" },
99
+ { commands: ["walk_leave"], label: "leave walk" },
100
+ { commands: ["quit"], label: "quit" },
101
+ ],
102
+ "read-only": [
103
+ { text: "observer - read-only" },
104
+ { commands: ["down", "up"], label: "move" },
105
+ { commands: ["next_annotation", "prev_annotation"], label: "annotations" },
106
+ { commands: ["quit"], label: "quit" },
107
+ ],
108
+ };
109
+
110
+ /** Status-line glyphs for named keys. */
111
+ const KEY_GLYPHS: Record<string, string> = {
112
+ return: "enter",
113
+ enter: "enter",
114
+ escape: "esc",
115
+ left: "←",
116
+ right: "→",
117
+ backspace: "⌫",
118
+ down: "↓",
119
+ up: "↑",
120
+ };
121
+
122
+ function makeKeymapEvent(name: string, shift = false): KeymapEvent {
123
+ return {
124
+ name,
125
+ ctrl: false,
126
+ shift,
127
+ meta: false,
128
+ preventDefault: () => {},
129
+ stopPropagation: () => {},
130
+ propagationStopped: false,
131
+ };
132
+ }
133
+
134
+ class HeadlessKeymapHost implements KeymapHost<object, KeymapEvent> {
135
+ readonly metadata = {
136
+ platform: "unknown" as const,
137
+ primaryModifier: "unknown" as const,
138
+ modifiers: {
139
+ ctrl: "supported" as const,
140
+ shift: "supported" as const,
141
+ meta: "supported" as const,
142
+ super: "unknown" as const,
143
+ hyper: "unknown" as const,
144
+ },
145
+ };
146
+ readonly rootTarget = {};
147
+ readonly isDestroyed = false;
148
+ private readonly pressListeners = new Set<(event: KeymapEvent) => void>();
149
+
150
+ getFocusedTarget(): object | null {
151
+ return null;
152
+ }
153
+ getParentTarget(): object | null {
154
+ return null;
155
+ }
156
+ isTargetDestroyed(): boolean {
157
+ return false;
158
+ }
159
+ onKeyPress(listener: (event: KeymapEvent) => void): () => void {
160
+ this.pressListeners.add(listener);
161
+ return () => this.pressListeners.delete(listener);
162
+ }
163
+ onKeyRelease(): () => void {
164
+ return () => {};
165
+ }
166
+ onFocusChange(): () => void {
167
+ return () => {};
168
+ }
169
+ onTargetDestroy(): () => void {
170
+ return () => {};
171
+ }
172
+ createCommandEvent(): KeymapEvent {
173
+ return makeKeymapEvent("");
174
+ }
175
+ emitKeyPress(event: KeymapEvent): void {
176
+ for (const listener of this.pressListeners) listener(event);
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Terminal key events name shifted letters either "g"+shift or "G"; the
182
+ * keymap's canonical form is lowercase + the shift modifier. Non-letter
183
+ * single characters ("$", "0") already encode their shift in the character.
184
+ */
185
+ function normalizedEvent(key: ResolvableKey): { name: string; shift: boolean } {
186
+ if (key.name.length === 1) {
187
+ if (/[a-zA-Z]/.test(key.name)) {
188
+ return {
189
+ name: key.name.toLowerCase(),
190
+ shift: key.shift || key.name !== key.name.toLowerCase(),
191
+ };
192
+ }
193
+ return { name: key.name, shift: false };
194
+ }
195
+ return { name: key.name, shift: key.shift };
196
+ }
197
+
198
+ /** Config combos write shifted letters as uppercase; the parser wants shift+. */
199
+ function bindingKeyFor(combo: string): string {
200
+ if (combo.length === 1 && /[A-Z]/.test(combo)) return `shift+${combo.toLowerCase()}`;
201
+ return combo;
202
+ }
203
+
204
+ /** The grammar actions live in the base layer; these live in mode layers. */
205
+ const SPAN_COMMANDS: [key: string, command: string][] = [
206
+ ["l", "span_grow"],
207
+ ["h", "span_shrink"],
208
+ ["w", "span_slide_forward"],
209
+ ["b", "span_slide_back"],
210
+ ["$", "span_to_end"],
211
+ ["0", "span_to_start"],
212
+ ["c", "span_comment"],
213
+ ["escape", "span_cancel"],
214
+ ];
215
+
216
+ export class KeyBindings {
217
+ private readonly host = new HeadlessKeymapHost();
218
+ private readonly keymap = new Keymap<object, KeymapEvent>(this.host);
219
+ private context: KeyLayerContext = { overlay: "none", spanMode: false };
220
+ private resolvedCommand: string | undefined;
221
+ private unregisterGrammarLayer: (() => void) | null = null;
222
+
223
+ constructor(keys: Record<string, string[]>) {
224
+ // the standard binding-string parser and event matcher
225
+ registerDefaultKeys(this.keymap);
226
+ // binding/layer `when` fields register runtime matchers, so getActiveKeys
227
+ // and dispatch only see the layer that owns the current mode
228
+ this.keymap.registerLayerFields({
229
+ when: (value, fieldContext) => {
230
+ if (typeof value === "function") fieldContext.activeWhen(value as () => boolean);
231
+ },
232
+ });
233
+ this.registerModeLayers();
234
+ this.setKeys(keys);
235
+ }
236
+
237
+ /** Rebuild the grammar layer from a (re)loaded config keymap. */
238
+ setKeys(keys: Record<string, string[]>): void {
239
+ this.unregisterGrammarLayer?.();
240
+ const bindings: { key: string; cmd: string }[] = [];
241
+ const commandNames = new Set<string>();
242
+ for (const [action, combos] of Object.entries(keys)) {
243
+ commandNames.add(action);
244
+ for (const combo of combos) bindings.push({ key: bindingKeyFor(combo), cmd: action });
245
+ }
246
+ // deselect is a hardwired escape in the plan grammar; hints show it
247
+ commandNames.add("deselect");
248
+ bindings.push({ key: "escape", cmd: "deselect" });
249
+ this.unregisterGrammarLayer = this.keymap.registerLayer({
250
+ priority: 0,
251
+ when: () => this.context.overlay === "none" && !this.context.spanMode,
252
+ bindings,
253
+ commands: [...commandNames].map((name) => ({
254
+ name,
255
+ run: () => {
256
+ this.resolvedCommand = name;
257
+ return true;
258
+ },
259
+ })),
260
+ });
261
+ }
262
+
263
+ private registerModeLayers(): void {
264
+ const record = (name: string) => ({
265
+ name,
266
+ run: () => {
267
+ this.resolvedCommand = name;
268
+ return true;
269
+ },
270
+ });
271
+ this.keymap.registerLayer({
272
+ priority: 10,
273
+ when: () => this.context.overlay === "none" && this.context.spanMode,
274
+ bindings: SPAN_COMMANDS.map(([key, command]) => ({ key, cmd: command })),
275
+ commands: SPAN_COMMANDS.map(([, command]) => record(command)),
276
+ });
277
+ // the walk wizard: prev/next stepping, leave, and submit from the end card
278
+ this.keymap.registerLayer({
279
+ priority: 20,
280
+ when: () => this.context.overlay === "walk",
281
+ bindings: [
282
+ { key: "]", cmd: "walk_next" },
283
+ { key: "[", cmd: "walk_prev" },
284
+ { key: "escape", cmd: "walk_leave" },
285
+ { key: "return", cmd: "walk_submit" },
286
+ { key: "enter", cmd: "walk_submit" },
287
+ { key: "q", cmd: "quit" },
288
+ ],
289
+ commands: [
290
+ record("walk_next"),
291
+ record("walk_prev"),
292
+ record("walk_leave"),
293
+ record("walk_submit"),
294
+ record("quit"),
295
+ ],
296
+ });
297
+ this.keymap.registerLayer({
298
+ priority: 20,
299
+ when: () => this.context.overlay === "compose",
300
+ bindings: [
301
+ { key: "return", cmd: "save_compose" },
302
+ { key: "enter", cmd: "save_compose" },
303
+ { key: "escape", cmd: "cancel_overlay" },
304
+ ],
305
+ commands: [record("save_compose"), record("cancel_overlay")],
306
+ });
307
+ this.keymap.registerLayer({
308
+ priority: 20,
309
+ when: () => this.context.overlay === "submit",
310
+ bindings: [
311
+ { key: "return", cmd: "submit_verdict" },
312
+ { key: "enter", cmd: "submit_verdict" },
313
+ { key: "left", cmd: "cycle_verdict_left" },
314
+ { key: "right", cmd: "cycle_verdict_right" },
315
+ { key: "escape", cmd: "cancel_submit" },
316
+ ],
317
+ commands: [
318
+ record("submit_verdict"),
319
+ record("cycle_verdict_left"),
320
+ record("cycle_verdict_right"),
321
+ record("cancel_submit"),
322
+ ],
323
+ });
324
+ this.keymap.registerLayer({
325
+ priority: 20,
326
+ when: () =>
327
+ this.context.overlay === "completion-prompt" ||
328
+ this.context.overlay === "completion-counting",
329
+ bindings: [
330
+ { key: "return", cmd: "finish_review" },
331
+ { key: "enter", cmd: "finish_review" },
332
+ { key: "q", cmd: "finish_review" },
333
+ { key: "a", cmd: "opt_in_auto_close" },
334
+ { key: "escape", cmd: "dismiss_completion" },
335
+ ],
336
+ commands: [
337
+ record("finish_review"),
338
+ record("opt_in_auto_close"),
339
+ record("dismiss_completion"),
340
+ ],
341
+ });
342
+ }
343
+
344
+ setContext(context: KeyLayerContext): void {
345
+ this.context = context;
346
+ }
347
+
348
+ /**
349
+ * Resolve a key event to its command name through the keymap's dispatch.
350
+ * In the base grammar layer the command IS the config action name, so the
351
+ * result feeds straight into the intent reducer.
352
+ */
353
+ resolveAction(key: ResolvableKey): string | undefined {
354
+ const normalized = normalizedEvent(key);
355
+ this.resolvedCommand = undefined;
356
+ this.host.emitKeyPress(makeKeymapEvent(normalized.name, normalized.shift));
357
+ return this.resolvedCommand;
358
+ }
359
+
360
+ /** First active key display for a command, mapped through the glyph table. */
361
+ private keyDisplayFor(command: string): string | null {
362
+ for (const activeKey of this.keymap.getActiveKeys({ includeBindings: true })) {
363
+ const bindingCommand =
364
+ typeof activeKey.command === "string"
365
+ ? activeKey.command
366
+ : activeKey.bindings?.[0]?.command;
367
+ if (bindingCommand !== command) continue;
368
+ return KEY_GLYPHS[activeKey.stroke.name] ?? activeKey.display;
369
+ }
370
+ return null;
371
+ }
372
+
373
+ /** The status-line hint for a view state, generated from the active keys. */
374
+ statusHint(mode: HintMode): string {
375
+ const fragments: string[] = [];
376
+ for (const entry of HINT_TEMPLATES[mode]) {
377
+ if ("text" in entry) {
378
+ fragments.push(entry.text);
379
+ continue;
380
+ }
381
+ const displays = entry.commands
382
+ .map((command) => this.keyDisplayFor(command))
383
+ .filter((display): display is string => display !== null);
384
+ if (!displays.length) continue;
385
+ const keyPart = displays.join("/");
386
+ if (!entry.label) fragments.push(keyPart);
387
+ else
388
+ fragments.push(
389
+ entry.labelFirst ? `${entry.label} ${keyPart}` : `${keyPart} ${entry.label}`,
390
+ );
391
+ }
392
+ return fragments.join(" · ");
393
+ }
394
+
395
+ /**
396
+ * The full keybinding cheatsheet, grouped by mode. Each section sets the
397
+ * layer context so getActiveKeys resolves that mode's real bindings, then
398
+ * restores it - a rebound key shows its live binding here too.
399
+ */
400
+ cheatsheet(): CheatsheetSection[] {
401
+ const saved = this.context;
402
+ const build = (context: KeyLayerContext, mode: HintMode, title: string): CheatsheetSection => {
403
+ this.context = context;
404
+ const entries: CheatsheetEntry[] = [];
405
+ for (const entry of HINT_TEMPLATES[mode]) {
406
+ if ("text" in entry || !entry.label) continue;
407
+ const keys = entry.commands
408
+ .map((command) => this.keyDisplayFor(command))
409
+ .filter((display): display is string => display !== null)
410
+ .join(" / ");
411
+ if (keys) entries.push({ keys, label: entry.label });
412
+ }
413
+ return { title, entries };
414
+ };
415
+ const sections = [
416
+ build({ overlay: "none", spanMode: false }, "normal", "Review"),
417
+ build({ overlay: "none", spanMode: true }, "span", "Selection"),
418
+ build({ overlay: "submit", spanMode: false }, "submit", "Submit"),
419
+ build({ overlay: "walk", spanMode: false }, "walk", "Walk"),
420
+ ];
421
+ this.context = saved;
422
+ return sections.filter((section) => section.entries.length > 0);
423
+ }
424
+ }