@flowdrop/flowdrop 2.16.0 → 2.18.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 (130) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/README.md +6 -1
  3. package/dist/api/enhanced-client.d.ts +3 -1
  4. package/dist/api/enhanced-client.js +4 -2
  5. package/dist/commands/executor.js +9 -0
  6. package/dist/commands/storeIntegration.svelte.js +6 -0
  7. package/dist/commands/types.d.ts +8 -0
  8. package/dist/components/App.svelte +414 -105
  9. package/dist/components/App.svelte.d.ts +31 -0
  10. package/dist/components/CanvasToolbar.svelte +40 -3
  11. package/dist/components/CanvasToolbar.svelte.d.ts +5 -1
  12. package/dist/components/ConnectPortPicker.svelte +8 -4
  13. package/dist/components/DoctorMenu.svelte +208 -126
  14. package/dist/components/FlowDropZone.svelte +7 -1
  15. package/dist/components/FlowDropZone.svelte.d.ts +5 -0
  16. package/dist/components/ImpactConfirm.svelte +554 -0
  17. package/dist/components/ImpactConfirm.svelte.d.ts +22 -0
  18. package/dist/components/Input.svelte +8 -2
  19. package/dist/components/LockBanner.svelte +76 -0
  20. package/dist/components/LockBanner.svelte.d.ts +14 -0
  21. package/dist/components/LockFence.svelte +33 -0
  22. package/dist/components/LockFence.svelte.d.ts +19 -0
  23. package/dist/components/Navbar.svelte +77 -9
  24. package/dist/components/Navbar.svelte.d.ts +10 -0
  25. package/dist/components/NodeSidebar.svelte +36 -15
  26. package/dist/components/NodeSidebar.svelte.d.ts +2 -0
  27. package/dist/components/NodeSwapPicker.svelte +4 -14
  28. package/dist/components/RunBar.svelte +50 -3
  29. package/dist/components/RunBar.svelte.d.ts +5 -0
  30. package/dist/components/RunInputsDialog.svelte +198 -0
  31. package/dist/components/RunInputsDialog.svelte.d.ts +34 -0
  32. package/dist/components/Textarea.svelte +7 -1
  33. package/dist/components/WorkflowCompareDialog.svelte +177 -0
  34. package/dist/components/WorkflowCompareDialog.svelte.d.ts +10 -0
  35. package/dist/components/WorkflowEditor.svelte +120 -15
  36. package/dist/components/WorkflowEditor.svelte.d.ts +6 -0
  37. package/dist/components/WorkflowInterfaceEditor.svelte +17 -4
  38. package/dist/components/WorkflowInterfaceEntryCard.svelte +40 -7
  39. package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +2 -0
  40. package/dist/components/WorkflowPlaygroundSettings.svelte +9 -1
  41. package/dist/components/form/FieldFactory.svelte +13 -6
  42. package/dist/components/form/FormArray.svelte +0 -1
  43. package/dist/components/form/FormArrayRows.svelte +4 -4
  44. package/dist/components/form/FormCodeEditor.svelte +18 -2
  45. package/dist/components/form/FormMarkdownEditor.svelte +22 -8
  46. package/dist/components/form/FormTemplateEditor.svelte +17 -1
  47. package/dist/components/form/readOnly.d.ts +13 -0
  48. package/dist/components/form/readOnly.js +18 -0
  49. package/dist/components/nodes/CaptionNode.svelte +1 -0
  50. package/dist/components/nodes/NodeCard.svelte +2 -2
  51. package/dist/components/primitives/Checkbox.svelte +5 -1
  52. package/dist/components/primitives/Select.svelte +6 -1
  53. package/dist/components/primitives/Switch.svelte +5 -1
  54. package/dist/components/toast/DismissibleToast.svelte +25 -6
  55. package/dist/components/toast/DismissibleToast.svelte.d.ts +3 -0
  56. package/dist/config/endpoints.d.ts +7 -0
  57. package/dist/config/endpoints.js +2 -1
  58. package/dist/editor/connectCandidates.d.ts +3 -0
  59. package/dist/editor/connectCandidates.js +14 -5
  60. package/dist/editor/index.d.ts +2 -1
  61. package/dist/editor/index.js +1 -1
  62. package/dist/helpers/workflowEditorHelper.d.ts +15 -0
  63. package/dist/helpers/workflowEditorHelper.js +9 -0
  64. package/dist/index.d.ts +2 -0
  65. package/dist/messages/defaults.d.ts +145 -0
  66. package/dist/messages/defaults.js +139 -1
  67. package/dist/openapi/v1/openapi.yaml +492 -0
  68. package/dist/registry/nodeComponentRegistry.d.ts +5 -0
  69. package/dist/schemas/v1/workflow.schema.json +2 -0
  70. package/dist/services/draftStorage.d.ts +24 -10
  71. package/dist/services/draftStorage.js +60 -35
  72. package/dist/services/globalSave.d.ts +45 -10
  73. package/dist/services/globalSave.js +296 -32
  74. package/dist/services/impactGate.d.ts +38 -0
  75. package/dist/services/impactGate.js +72 -0
  76. package/dist/services/impactService.d.ts +45 -0
  77. package/dist/services/impactService.js +157 -0
  78. package/dist/services/runsService.d.ts +9 -0
  79. package/dist/services/runsService.js +13 -0
  80. package/dist/services/toastQueue.d.ts +9 -0
  81. package/dist/services/toastService.d.ts +4 -0
  82. package/dist/services/toastService.js +9 -3
  83. package/dist/services/workflowLaunchService.d.ts +6 -0
  84. package/dist/services/workflowLaunchService.js +5 -1
  85. package/dist/settings/index.d.ts +2 -2
  86. package/dist/settings/index.js +1 -1
  87. package/dist/stores/doctorStore.svelte.d.ts +24 -1
  88. package/dist/stores/doctorStore.svelte.js +105 -2
  89. package/dist/stores/historyStore.svelte.d.ts +12 -2
  90. package/dist/stores/historyStore.svelte.js +25 -2
  91. package/dist/stores/instanceContainer.svelte.d.ts +23 -0
  92. package/dist/stores/instanceContainer.svelte.js +32 -2
  93. package/dist/stores/lockStore.svelte.d.ts +39 -0
  94. package/dist/stores/lockStore.svelte.js +109 -0
  95. package/dist/stores/runController.svelte.d.ts +2 -0
  96. package/dist/stores/runController.svelte.js +27 -11
  97. package/dist/stores/saveConflictStore.svelte.d.ts +62 -0
  98. package/dist/stores/saveConflictStore.svelte.js +169 -0
  99. package/dist/stores/workflowStore.svelte.d.ts +14 -4
  100. package/dist/stores/workflowStore.svelte.js +55 -18
  101. package/dist/styles/base.css +6 -0
  102. package/dist/styles/toast.css +10 -1
  103. package/dist/svelte-app.d.ts +33 -0
  104. package/dist/svelte-app.js +178 -22
  105. package/dist/types/doctor.d.ts +3 -1
  106. package/dist/types/events.d.ts +37 -0
  107. package/dist/types/events.js +2 -0
  108. package/dist/types/impact.d.ts +77 -0
  109. package/dist/types/impact.js +7 -0
  110. package/dist/types/lock.d.ts +35 -0
  111. package/dist/types/lock.js +13 -0
  112. package/dist/types/navbar.d.ts +6 -0
  113. package/dist/types/settings.d.ts +31 -0
  114. package/dist/types/settings.js +132 -0
  115. package/dist/utils/draftRestore.d.ts +27 -0
  116. package/dist/utils/draftRestore.js +36 -0
  117. package/dist/utils/interfaceTags.js +4 -1
  118. package/dist/utils/links.d.ts +29 -0
  119. package/dist/utils/links.js +63 -0
  120. package/dist/utils/nodeSearch.d.ts +10 -0
  121. package/dist/utils/nodeSearch.js +37 -0
  122. package/dist/utils/runOffer.d.ts +21 -0
  123. package/dist/utils/runOffer.js +13 -0
  124. package/dist/utils/workflowCompare.d.ts +35 -0
  125. package/dist/utils/workflowCompare.js +84 -0
  126. package/dist/utils/workflowInterface.d.ts +26 -1
  127. package/dist/utils/workflowInterface.js +91 -11
  128. package/dist/webmcp/runtime.js +16 -3
  129. package/dist/webmcp/types.d.ts +11 -1
  130. package/package.json +3 -2
@@ -0,0 +1,33 @@
1
+ <!--
2
+ @component
3
+ LockFence: makes the form controls inside it read-only while the editor is locked.
4
+
5
+ It tells every form field below it, through the form read-only context, that the
6
+ form is read-only. Inputs, selects, switches, code editors and the buttons that
7
+ add, move or remove things then stop answering, while text stays selectable and
8
+ the buttons that only open, close or refresh something keep working. The workflow
9
+ store refuses edits as well; this is what the person sees.
10
+
11
+ **Use it for** wrapping a config form or panel body that edits the workflow.
12
+ **Not for** navigation inside a panel (tabs stay usable on a locked workflow).
13
+ -->
14
+
15
+ <script lang="ts">
16
+ import type { Snippet } from 'svelte';
17
+ import { getInstance } from '../stores/getInstance.svelte.js';
18
+ import { provideFormReadOnly } from './form/readOnly.js';
19
+
20
+ let { children }: { children: Snippet } = $props();
21
+ const fd = getInstance();
22
+ provideFormReadOnly(() => fd.lock.isLocked);
23
+ </script>
24
+
25
+ <div class="flowdrop-lock-fence" data-locked={fd.lock.isLocked ? '' : undefined}>
26
+ {@render children()}
27
+ </div>
28
+
29
+ <style>
30
+ .flowdrop-lock-fence {
31
+ display: contents;
32
+ }
33
+ </style>
@@ -0,0 +1,19 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children: Snippet;
4
+ };
5
+ /**
6
+ * LockFence: makes the form controls inside it read-only while the editor is locked.
7
+ *
8
+ * It tells every form field below it, through the form read-only context, that the
9
+ * form is read-only. Inputs, selects, switches, code editors and the buttons that
10
+ * add, move or remove things then stop answering, while text stays selectable and
11
+ * the buttons that only open, close or refresh something keep working. The workflow
12
+ * store refuses edits as well; this is what the person sees.
13
+ *
14
+ * **Use it for** wrapping a config form or panel body that edits the workflow.
15
+ * **Not for** navigation inside a panel (tabs stay usable on a locked workflow).
16
+ */
17
+ declare const LockFence: import("svelte").Component<$$ComponentProps, {}, "">;
18
+ type LockFence = ReturnType<typeof LockFence>;
19
+ export default LockFence;
@@ -45,6 +45,8 @@
45
45
  showStatus?: boolean;
46
46
  /** Page title */
47
47
  title?: string;
48
+ /** Heading level of the title: 1 makes it the page's H1 */
49
+ titleLevel?: 1 | 2;
48
50
  /** Breadcrumb navigation items */
49
51
  breadcrumbs?: BreadcrumbItem[];
50
52
  /** Show settings gear icon */
@@ -71,17 +73,26 @@
71
73
  * it in the menu. Off by default: a host page may have its own Save shortcut.
72
74
  */
73
75
  saveShortcut?: boolean;
76
+ /**
77
+ * Called when Ctrl/Cmd+S is pressed (with `saveShortcut`) while the first
78
+ * action (Save) is `disabled`. The key is still taken, so the browser's own
79
+ * Save Page does not open; use this to say why nothing was saved.
80
+ */
81
+ onDisabledSave?: () => void;
74
82
  /**
75
83
  * Drawn in the action row before the Save button: the Problems indicator.
76
84
  * Renders nothing of its own, so an empty snippet leaves no gap.
77
85
  */
78
86
  status?: Snippet;
87
+ /** The workflow has changes that are not saved: the first action (Save) shows a dot. */
88
+ dirty?: boolean;
79
89
  }
80
90
 
81
91
  let {
82
92
  primaryActions = [],
83
93
  showStatus = true,
84
94
  title,
95
+ titleLevel = 2,
85
96
  breadcrumbs = [],
86
97
  showSettings = true,
87
98
  settingsCategories,
@@ -92,7 +103,9 @@
92
103
  onWorkflowSettings,
93
104
  workflowSettingsOpen = false,
94
105
  saveShortcut = false,
95
- status
106
+ onDisabledSave,
107
+ status,
108
+ dirty = false
96
109
  }: Props = $props();
97
110
 
98
111
  // Settings modal state
@@ -177,6 +190,13 @@
177
190
  }
178
191
  const save = taskActions[0];
179
192
  if (!save?.onclick) return;
193
+ // Disabled (for example locked): the key still belongs to the editor, so
194
+ // the browser's Save Page does not open in its place.
195
+ if (save.disabled) {
196
+ event.preventDefault();
197
+ onDisabledSave?.();
198
+ return;
199
+ }
180
200
  event.preventDefault();
181
201
  save.onclick(event);
182
202
  }
@@ -184,6 +204,16 @@
184
204
  return () => window.removeEventListener('keydown', onKeydown);
185
205
  });
186
206
 
207
+ /** Run an action's handler, unless it is disabled (then the link goes nowhere). */
208
+ function run(action: NavbarAction, event: Event, after?: () => void): void {
209
+ if (action.disabled) {
210
+ event.preventDefault();
211
+ return;
212
+ }
213
+ action.onclick?.(event);
214
+ after?.();
215
+ }
216
+
187
217
  // Cmd/Ctrl+, opens the full settings dialog, as in most desktop apps.
188
218
  $effect(() => {
189
219
  if (!showSettings) return;
@@ -210,10 +240,8 @@
210
240
  href={action.href}
211
241
  role="menuitem"
212
242
  class="flowdrop-navbar__dropdown-item"
213
- onclick={(e) => {
214
- action.onclick?.(e);
215
- close();
216
- }}
243
+ aria-disabled={action.disabled ? 'true' : undefined}
244
+ onclick={(e) => run(action, e, close)}
217
245
  target={action.external ? '_blank' : undefined}
218
246
  rel={action.external ? 'noopener noreferrer' : undefined}
219
247
  >
@@ -323,7 +351,10 @@
323
351
  {:else if title}
324
352
  <div class="flowdrop-navbar__title-container">
325
353
  <div class="flowdrop-navbar__title">
326
- <h2 class="flowdrop-navbar__title-text">{title}</h2>
354
+ <svelte:element
355
+ this={titleLevel === 1 ? 'h1' : 'h2'}
356
+ class="flowdrop-navbar__title-text">{title}</svelte:element
357
+ >
327
358
  </div>
328
359
  </div>
329
360
  {/if}
@@ -348,11 +379,15 @@
348
379
  {#if taskActions.length > 0}
349
380
  <!-- Split mode: all actions as individual side-by-side buttons -->
350
381
  <div class="flowdrop-navbar__split-actions">
351
- {#each taskActions as action (action.label)}
382
+ {#each taskActions as action, index (action.label)}
383
+ {@const unsaved = dirty && index === 0}
352
384
  <a
353
385
  href={action.href}
354
386
  class="flowdrop-navbar__action flowdrop-navbar__action--{action.variant || 'primary'}"
355
- onclick={action.onclick}
387
+ data-dirty={unsaved ? 'true' : undefined}
388
+ title={unsaved ? `${action.label}, ${nav.unsavedChanges}` : undefined}
389
+ aria-disabled={action.disabled ? 'true' : undefined}
390
+ onclick={(e) => run(action, e)}
356
391
  target={action.external ? '_blank' : undefined}
357
392
  rel={action.external ? 'noopener noreferrer' : undefined}
358
393
  >
@@ -362,6 +397,10 @@
362
397
  </span>
363
398
  {/if}
364
399
  <span class="flowdrop-navbar__action-label">{action.label}</span>
400
+ {#if unsaved}
401
+ <span class="flowdrop-navbar__dirty-dot" aria-hidden="true"></span>
402
+ <span class="flowdrop-navbar__visually-hidden">, {nav.unsavedChanges}</span>
403
+ {/if}
365
404
  </a>
366
405
  {/each}
367
406
  </div>
@@ -374,7 +413,10 @@
374
413
  href={primaryAction.href}
375
414
  class="flowdrop-navbar__primary-action flowdrop-navbar__action--{primaryAction.variant ||
376
415
  'primary'}"
377
- onclick={primaryAction.onclick}
416
+ data-dirty={dirty ? 'true' : undefined}
417
+ title={dirty ? `${primaryAction.label}, ${nav.unsavedChanges}` : undefined}
418
+ aria-disabled={primaryAction.disabled ? 'true' : undefined}
419
+ onclick={(e) => run(primaryAction, e)}
378
420
  target={primaryAction.external ? '_blank' : undefined}
379
421
  rel={primaryAction.external ? 'noopener noreferrer' : undefined}
380
422
  >
@@ -384,6 +426,10 @@
384
426
  </span>
385
427
  {/if}
386
428
  <span class="flowdrop-navbar__action-label">{primaryAction.label}</span>
429
+ {#if dirty}
430
+ <span class="flowdrop-navbar__dirty-dot" aria-hidden="true"></span>
431
+ <span class="flowdrop-navbar__visually-hidden">, {nav.unsavedChanges}</span>
432
+ {/if}
387
433
  </a>
388
434
  {/if}
389
435
 
@@ -1004,6 +1050,11 @@
1004
1050
  background-color: var(--fd-muted);
1005
1051
  }
1006
1052
 
1053
+ a[aria-disabled='true'] {
1054
+ opacity: 0.5;
1055
+ cursor: not-allowed;
1056
+ }
1057
+
1007
1058
  .flowdrop-navbar__action {
1008
1059
  display: flex;
1009
1060
  align-items: center;
@@ -1072,6 +1123,23 @@
1072
1123
  font-weight: 500;
1073
1124
  }
1074
1125
 
1126
+ .flowdrop-navbar__dirty-dot {
1127
+ width: 6px;
1128
+ height: 6px;
1129
+ border-radius: var(--fd-radius-full);
1130
+ background: var(--fd-warning);
1131
+ flex-shrink: 0;
1132
+ }
1133
+
1134
+ .flowdrop-navbar__visually-hidden {
1135
+ position: absolute;
1136
+ width: 1px;
1137
+ height: 1px;
1138
+ overflow: hidden;
1139
+ clip-path: inset(50%);
1140
+ white-space: nowrap;
1141
+ }
1142
+
1075
1143
  .flowdrop-navbar__end {
1076
1144
  display: flex;
1077
1145
  align-items: center;
@@ -13,6 +13,8 @@ interface Props {
13
13
  showStatus?: boolean;
14
14
  /** Page title */
15
15
  title?: string;
16
+ /** Heading level of the title: 1 makes it the page's H1 */
17
+ titleLevel?: 1 | 2;
16
18
  /** Breadcrumb navigation items */
17
19
  breadcrumbs?: BreadcrumbItem[];
18
20
  /** Show settings gear icon */
@@ -39,11 +41,19 @@ interface Props {
39
41
  * it in the menu. Off by default: a host page may have its own Save shortcut.
40
42
  */
41
43
  saveShortcut?: boolean;
44
+ /**
45
+ * Called when Ctrl/Cmd+S is pressed (with `saveShortcut`) while the first
46
+ * action (Save) is `disabled`. The key is still taken, so the browser's own
47
+ * Save Page does not open; use this to say why nothing was saved.
48
+ */
49
+ onDisabledSave?: () => void;
42
50
  /**
43
51
  * Drawn in the action row before the Save button: the Problems indicator.
44
52
  * Renders nothing of its own, so an empty snippet leaves no gap.
45
53
  */
46
54
  status?: Snippet;
55
+ /** The workflow has changes that are not saved: the first action (Save) shows a dot. */
56
+ dirty?: boolean;
47
57
  }
48
58
  /**
49
59
  * The bar along the top of the editor: logo and breadcrumbs on the left, actions in the middle,
@@ -20,6 +20,7 @@
20
20
  import { getInstance } from '../stores/getInstance.svelte.js';
21
21
  import { getUiSettings } from '../stores/settingsStore.svelte.js';
22
22
  import { extractConfigDefaults } from '../utils/nodeIds.js';
23
+ import { searchNodeTypes } from '../utils/nodeSearch.js';
23
24
  import { m } from '../messages/index.js';
24
25
 
25
26
  interface Props {
@@ -41,6 +42,8 @@
41
42
  * flat 32px category rows (no card, no border) with a filled search field.
42
43
  */
43
44
  listStyle?: 'cards' | 'flat' | 'rows';
45
+ /** Called when a palette item is clicked or activated with Enter or Space. */
46
+ onadd?: (nodeType: NodeMetadata) => void;
44
47
  }
45
48
 
46
49
  let props: Props = $props();
@@ -103,7 +106,7 @@
103
106
 
104
107
  /**
105
108
  * Filter node types based on search query and selected category
106
- * Preserves the API order - no client-side sorting applied
109
+ * Without a query the API order is preserved; a query ranks matches
107
110
  */
108
111
  function getFilteredNodes(): NodeMetadata[] {
109
112
  // Start with format-compatible nodes
@@ -114,21 +117,25 @@
114
117
  filtered = filtered.filter((node) => node.category === selectedCategory);
115
118
  }
116
119
 
117
- // Filter by search query
118
- if (searchInput.trim()) {
119
- const query = searchInput.toLowerCase();
120
- filtered = filtered.filter(
121
- (node) =>
122
- node.name.toLowerCase().includes(query) ||
123
- node.description.toLowerCase().includes(query) ||
124
- node.tags?.some((tag) => tag.toLowerCase().includes(query))
125
- );
126
- }
120
+ // Search ranks exact matches first; blank query keeps API order
121
+ filtered = searchNodeTypes(filtered, searchInput);
127
122
 
128
123
  // Return filtered results preserving API order
129
124
  return filtered;
130
125
  }
131
126
 
127
+ /**
128
+ * Add a node from the keyboard. Enter acts on keydown, Space on keyup (like a
129
+ * button); a held key adds once.
130
+ */
131
+ function handleItemKey(event: KeyboardEvent, nodeType: NodeMetadata): void {
132
+ if (event.key !== 'Enter' && event.key !== ' ') return;
133
+ event.preventDefault();
134
+ if (event.repeat) return;
135
+ if (event.key === 'Enter' && event.type === 'keydown') props.onadd?.(nodeType);
136
+ if (event.key === ' ' && event.type === 'keyup') props.onadd?.(nodeType);
137
+ }
138
+
132
139
  /**
133
140
  * Handle node type drag start - creates a new node instance
134
141
  */
@@ -276,8 +283,12 @@
276
283
  class="flowdrop-card flowdrop-card--compact flowdrop-node-item"
277
284
  draggable="true"
278
285
  ondragstart={(e) => handleNodeDragStart(e, nodeType)}
286
+ onclick={() => props.onadd?.(nodeType)}
287
+ onkeydown={(e) => handleItemKey(e, nodeType)}
288
+ onkeyup={(e) => handleItemKey(e, nodeType)}
279
289
  role="button"
280
290
  tabindex="0"
291
+ aria-label={m().layout.addNode({ name: nodeType.name })}
281
292
  title={nodeType.description}
282
293
  >
283
294
  <div class="flowdrop-card__body flowdrop-p--1 flowdrop-py--1">
@@ -324,13 +335,18 @@
324
335
  <div class="fd-sidebar-flat-category">
325
336
  {getCategoryDisplayName(category).toUpperCase()}
326
337
  </div>
327
- <div class="fd-sidebar-flat-list" role="list">
338
+ <div class="fd-sidebar-flat-list">
328
339
  {#each categoryNodes as nodeType (nodeType.node_type_id)}
329
340
  <div
330
341
  class="fd-sidebar-flat-item"
331
- role="listitem"
342
+ role="button"
343
+ tabindex="0"
344
+ aria-label={m().layout.addNode({ name: nodeType.name })}
332
345
  draggable="true"
333
346
  ondragstart={(e) => handleNodeDragStart(e, nodeType)}
347
+ onclick={() => props.onadd?.(nodeType)}
348
+ onkeydown={(e) => handleItemKey(e, nodeType)}
349
+ onkeyup={(e) => handleItemKey(e, nodeType)}
334
350
  >
335
351
  <span
336
352
  class="fd-sidebar-flat-dot"
@@ -369,13 +385,18 @@
369
385
  </div>
370
386
  </summary>
371
387
  <div class="flowdrop-details__content">
372
- <div class="flowdrop-node-list" role="list">
388
+ <div class="flowdrop-node-list">
373
389
  {#each categoryNodes as nodeType (nodeType.node_type_id)}
374
390
  <div
375
391
  class="flowdrop-card flowdrop-card--compact flowdrop-node-item"
376
- role="listitem"
392
+ role="button"
393
+ tabindex="0"
394
+ aria-label={m().layout.addNode({ name: nodeType.name })}
377
395
  draggable="true"
378
396
  ondragstart={(e) => handleNodeDragStart(e, nodeType)}
397
+ onclick={() => props.onadd?.(nodeType)}
398
+ onkeydown={(e) => handleItemKey(e, nodeType)}
399
+ onkeyup={(e) => handleItemKey(e, nodeType)}
379
400
  title={nodeType.description}
380
401
  >
381
402
  <div class="flowdrop-card__body flowdrop-p--1 flowdrop-py--1">
@@ -18,6 +18,8 @@ interface Props {
18
18
  * flat 32px category rows (no card, no border) with a filled search field.
19
19
  */
20
20
  listStyle?: 'cards' | 'flat' | 'rows';
21
+ /** Called when a palette item is clicked or activated with Enter or Space. */
22
+ onadd?: (nodeType: NodeMetadata) => void;
21
23
  }
22
24
  /**
23
25
  * The node palette: every node type the editor knows, grouped by category in accordions, with a search field.
@@ -14,6 +14,8 @@
14
14
  import { m } from '../messages/index.js';
15
15
  import { getInstance } from '../stores/getInstance.svelte.js';
16
16
  import { getVersionUpgrade } from '../utils/nodeSwap.js';
17
+ import { nodeCanvasLabel } from '../utils/workflowInterface.js';
18
+ import { searchNodeTypes } from '../utils/nodeSearch.js';
17
19
 
18
20
  interface Props {
19
21
  /** The node being swapped */
@@ -48,19 +50,7 @@
48
50
  let formatCompatibleNodes = $derived(availableNodes.filter((n) => isNodeCompatibleWithFormat(n)));
49
51
 
50
52
  /** Apply search filter */
51
- let filteredNodes = $derived.by(() => {
52
- let nodes = formatCompatibleNodes;
53
- if (searchInput.trim()) {
54
- const query = searchInput.toLowerCase();
55
- nodes = nodes.filter(
56
- (node) =>
57
- node.name.toLowerCase().includes(query) ||
58
- node.description.toLowerCase().includes(query) ||
59
- node.tags?.some((tag) => tag.toLowerCase().includes(query))
60
- );
61
- }
62
- return nodes;
63
- });
53
+ let filteredNodes = $derived(searchNodeTypes(formatCompatibleNodes, searchInput));
64
54
 
65
55
  /** Get unique categories preserving API order */
66
56
  let categories = $derived.by(() => {
@@ -97,7 +87,7 @@
97
87
  <!-- Current node info -->
98
88
  <div class="swap-picker__current">
99
89
  <span class="swap-picker__current-label">Current:</span>
100
- <span class="swap-picker__current-name">{currentNode.data.label}</span>
90
+ <span class="swap-picker__current-name">{nodeCanvasLabel(currentNode)}</span>
101
91
  </div>
102
92
 
103
93
  <!-- Version upgrade banner -->
@@ -34,13 +34,18 @@
34
34
  * failed with a known pipeline.
35
35
  */
36
36
  onAskAssistant?: (runId: string) => void;
37
+ /**
38
+ * An already expanded URL of the run's page. With a known run id the pill links "Open run" to it in
39
+ * every status.
40
+ */
41
+ runLink?: string | null;
37
42
  /** How long a finished run's pill stays, in milliseconds. @default 4500 */
38
43
  fadeMs?: number;
39
44
  /** Editor mode the pill is shown in. @default 'edit' */
40
45
  mode?: 'edit' | 'test';
41
46
  }
42
47
 
43
- let { onOpen, onAskAssistant, fadeMs = 4500, mode = 'edit' }: Props = $props();
48
+ let { onOpen, onAskAssistant, runLink, fadeMs = 4500, mode = 'edit' }: Props = $props();
44
49
 
45
50
  const fd = getInstance();
46
51
  const getMsgs = getMessages();
@@ -67,8 +72,20 @@
67
72
  /** Test mode shows the pill only while the run is live. */
68
73
  const visible = $derived(mode === 'test' ? live : status !== null);
69
74
 
70
- const statusLabel = $derived(status ? msgs[status] : '');
71
- const announcement = $derived(status ? msgs.announce[status] : '');
75
+ const statusLabel = $derived(
76
+ status === 'running' && run?.waitingForWorker
77
+ ? msgs.waitingForWorker
78
+ : status
79
+ ? msgs[status]
80
+ : ''
81
+ );
82
+ const announcement = $derived(
83
+ status === 'running' && run?.waitingForWorker
84
+ ? msgs.announce.waitingForWorker
85
+ : status
86
+ ? msgs.announce[status]
87
+ : ''
88
+ );
72
89
 
73
90
  // The bar stays put while it is hovered or holds focus: a person reading it
74
91
  // or about to press Open is not made to chase it.
@@ -136,6 +153,16 @@
136
153
  {msgs.askAssistant}
137
154
  </Button>
138
155
  {/if}
156
+ {#if runLink && run.runId}
157
+ <a
158
+ class="flowdrop-run-bar__link"
159
+ href={runLink}
160
+ title={status === 'done' ? msgs.viewResultTitle : msgs.openRunTitle}
161
+ data-testid="run-bar-open-run"
162
+ >
163
+ {status === 'done' ? msgs.viewResult : msgs.openRun}
164
+ </a>
165
+ {/if}
139
166
  {#if live}
140
167
  <Button
141
168
  variant="danger-ghost"
@@ -207,6 +234,26 @@
207
234
  .flowdrop-run-bar__label {
208
235
  white-space: nowrap;
209
236
  }
237
+ /* A link drawn as a small ghost button. */
238
+ .flowdrop-run-bar__link {
239
+ display: inline-flex;
240
+ align-items: center;
241
+ height: calc(var(--fd-canvas-control) - 2 * var(--fd-space-2xs));
242
+ padding: 0 var(--fd-space-sm);
243
+ border-radius: var(--fd-radius-control, var(--fd-radius-surface));
244
+ color: var(--fd-foreground);
245
+ font-size: var(--fd-text-sm);
246
+ font-weight: 500;
247
+ text-decoration: none;
248
+ white-space: nowrap;
249
+ }
250
+ .flowdrop-run-bar__link:hover {
251
+ background-color: var(--fd-muted);
252
+ }
253
+ .flowdrop-run-bar__link:focus-visible {
254
+ outline: 2px solid var(--fd-ring, var(--fd-foreground));
255
+ outline-offset: 1px;
256
+ }
210
257
  .flowdrop-run-bar--fading {
211
258
  opacity: 0;
212
259
  }
@@ -10,6 +10,11 @@ interface Props {
10
10
  * failed with a known pipeline.
11
11
  */
12
12
  onAskAssistant?: (runId: string) => void;
13
+ /**
14
+ * An already expanded URL of the run's page. With a known run id the pill links "Open run" to it in
15
+ * every status.
16
+ */
17
+ runLink?: string | null;
13
18
  /** How long a finished run's pill stays, in milliseconds. @default 4500 */
14
19
  fadeMs?: number;
15
20
  /** Editor mode the pill is shown in. @default 'edit' */