@kiberon-labs/behave-graph-flow 2.0.0 → 3.0.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 (251) hide show
  1. package/.storybook/manager.ts +6 -0
  2. package/.storybook/preview.ts +49 -1
  3. package/.storybook/styles.css +9 -3
  4. package/.turbo/turbo-build.log +1 -1
  5. package/CHANGELOG.md +368 -0
  6. package/dist/AnyControlImpl-Ds-CShIB.js +20 -0
  7. package/dist/AnyControlImpl-Ds-CShIB.js.map +1 -0
  8. package/dist/DocumentationBrowserPanelImpl-deZNzFX8.js +166 -0
  9. package/dist/DocumentationBrowserPanelImpl-deZNzFX8.js.map +1 -0
  10. package/dist/index.css +36 -33
  11. package/dist/index.css.map +1 -1
  12. package/dist/index.d.ts +1865 -550
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +14357 -11221
  15. package/dist/index.js.map +1 -1
  16. package/dist/noteImpl-KkrrWgJd.js +242 -0
  17. package/dist/noteImpl-KkrrWgJd.js.map +1 -0
  18. package/dist/styles.module-CvmpDkZj.css +3 -0
  19. package/dist/styles.module-CvmpDkZj.css.map +1 -0
  20. package/dist/styles.module-DZxg8aW9.js +271 -0
  21. package/dist/styles.module-DZxg8aW9.js.map +1 -0
  22. package/dist/useChangeNodeData-ChQGK7AI.js +23 -0
  23. package/dist/useChangeNodeData-ChQGK7AI.js.map +1 -0
  24. package/docs/protocol.md +43 -20
  25. package/package.json +5 -9
  26. package/src/components/FloatingToolbar/index.module.css +5 -13
  27. package/src/components/FloatingToolbar/index.tsx +9 -9
  28. package/src/components/Flow.tsx +34 -23
  29. package/src/components/contextMenus/DynamicContextMenu.tsx +85 -0
  30. package/src/components/contextMenus/NodePicker.module.css +13 -13
  31. package/src/components/contextMenus/edge.tsx +9 -95
  32. package/src/components/contextMenus/node.tsx +9 -149
  33. package/src/components/contextMenus/selection.tsx +5 -71
  34. package/src/components/controls/any/AnyControlImpl.tsx +14 -0
  35. package/src/components/controls/any/index.tsx +13 -2
  36. package/src/components/edges/index.tsx +75 -69
  37. package/src/components/layoutController/index.module.css +3 -0
  38. package/src/components/layoutController/index.tsx +24 -1
  39. package/src/components/layoutController/utils.ts +46 -3
  40. package/src/components/menubar/defaults.tsx +55 -19
  41. package/src/components/menubar/menuItem.module.css +18 -3
  42. package/src/components/menubar/menuItem.tsx +34 -1
  43. package/src/components/nodes/behave/NodeContainer.module.css +26 -25
  44. package/src/components/nodes/group/index.tsx +3 -3
  45. package/src/components/nodes/wrapper/styles.module.css +6 -32
  46. package/src/components/panels/alignment/index.module.css +0 -10
  47. package/src/components/panels/alignment/index.tsx +4 -4
  48. package/src/components/panels/base/styles.module.css +2 -2
  49. package/src/components/panels/common/PanelHeader.module.css +24 -0
  50. package/src/components/panels/common/PanelHeader.tsx +22 -0
  51. package/src/components/panels/common/SectionTitle.module.css +13 -0
  52. package/src/components/panels/common/SectionTitle.tsx +10 -0
  53. package/src/components/panels/events/EditEventPanel.tsx +14 -5
  54. package/src/components/panels/events/ManageEventsPanel.tsx +11 -8
  55. package/src/components/panels/events/styles.module.css +6 -64
  56. package/src/components/panels/graphProperties/index.tsx +125 -0
  57. package/src/components/panels/history/index.tsx +2 -2
  58. package/src/components/panels/history/styles.module.css +0 -9
  59. package/src/components/panels/keymaps/index.module.css +3 -13
  60. package/src/components/panels/keymaps/index.tsx +1 -2
  61. package/src/components/panels/layers/index.tsx +20 -15
  62. package/src/components/panels/layers/styles.module.css +9 -12
  63. package/src/components/panels/legend/index.tsx +1 -1
  64. package/src/components/panels/logs/index.module.css +25 -19
  65. package/src/components/panels/logs/index.tsx +7 -7
  66. package/src/components/panels/nodeInputs/InputsGroup.tsx +1 -0
  67. package/src/components/panels/nodeInputs/NodeSettings.tsx +2 -2
  68. package/src/components/panels/nodeInputs/NodeTitleEditor.tsx +1 -1
  69. package/src/components/panels/nodeInputs/OutputsGroup.tsx +2 -12
  70. package/src/components/panels/nodeInputs/index.module.css +99 -75
  71. package/src/components/panels/nodeInputs/index.tsx +21 -11
  72. package/src/components/panels/nodeInputs/useNodeHandlers.ts +2 -2
  73. package/src/components/panels/nodeInputs/useNodeInputsData.ts +23 -43
  74. package/src/components/panels/nodePicker/index.tsx +8 -8
  75. package/src/components/panels/panel/index.module.css +7 -7
  76. package/src/components/panels/search/index.module.css +0 -50
  77. package/src/components/panels/search/index.tsx +2 -2
  78. package/src/components/panels/systemSettings/ConversionsSettings.tsx +203 -0
  79. package/src/components/panels/systemSettings/index.tsx +221 -176
  80. package/src/components/panels/systemSettings/styles.module.css +135 -8
  81. package/src/components/panels/traces/GridLines.tsx +1 -1
  82. package/src/components/panels/traces/TimeGrid.tsx +3 -3
  83. package/src/components/panels/traces/TraceLane.tsx +1 -1
  84. package/src/components/panels/traces/index.module.css +1 -8
  85. package/src/components/panels/traces/index.tsx +8 -4
  86. package/src/components/panels/traces/useDerivedSpans.ts +241 -146
  87. package/src/components/panels/traces/utils.ts +8 -0
  88. package/src/components/panels/variables/CreateVariableScreen.tsx +3 -3
  89. package/src/components/panels/variables/ManageVariablesScreen.tsx +12 -9
  90. package/src/components/panels/variables/index.tsx +2 -2
  91. package/src/components/panels/variables/styles.module.css +4 -91
  92. package/src/components/primitives/icon.module.css +4 -4
  93. package/src/components/sockets/input/index.tsx +9 -2
  94. package/src/components/sockets/input/styles.module.css +2 -3
  95. package/src/components/sockets/output/index.tsx +10 -3
  96. package/src/components/sockets/output/styles.module.css +1 -6
  97. package/src/css/notes.css +135 -0
  98. package/src/css/prosemirror.css +3 -3
  99. package/src/css/rc-dock.css +143 -43
  100. package/src/css/rc-menu.css +56 -55
  101. package/src/css/themes/kiberon.css +127 -0
  102. package/src/css/vars.css +197 -13
  103. package/src/css/vscode-elements.css +124 -0
  104. package/src/generators/CallSubgraphGenerator.tsx +136 -0
  105. package/src/generators/CustomEventOnTriggeredGenerator.tsx +2 -2
  106. package/src/generators/GraphBoundaryGenerator.module.css +32 -0
  107. package/src/generators/GraphBoundaryGenerator.tsx +193 -0
  108. package/src/generators/SequenceGenerator.tsx +2 -2
  109. package/src/generators/SwitchOnIntegerGenerator.tsx +2 -2
  110. package/src/generators/SwitchOnStringGenerator.tsx +2 -2
  111. package/src/generators/callSubgraphSync.ts +126 -0
  112. package/src/generators/registerDefaultGenerators.ts +21 -0
  113. package/src/generators/registerDefaults.ts +26 -0
  114. package/src/hooks/useBehaveGraphFlow.ts +2 -2
  115. package/src/hooks/useFlowHandlers.ts +47 -9
  116. package/src/hooks/useWasdPan.ts +26 -4
  117. package/src/index.css +4 -16
  118. package/src/index.ts +17 -0
  119. package/src/manifest/contributionRegistry.ts +93 -0
  120. package/src/manifest/index.ts +4 -0
  121. package/src/manifest/loadManifest.ts +82 -0
  122. package/src/manifest/manifestPlugin.ts +29 -0
  123. package/src/manifest/passthroughValueType.ts +40 -0
  124. package/src/plugin/alignment/index.ts +22 -12
  125. package/src/plugin/autosave/controller.ts +366 -0
  126. package/src/plugin/autosave/index.tsx +114 -0
  127. package/src/plugin/autosave/panel/BackupPanel.tsx +141 -0
  128. package/src/plugin/autosave/panel/index.tsx +1 -0
  129. package/src/plugin/autosave/panel/styles.module.css +56 -0
  130. package/src/plugin/autosave/settings.ts +65 -0
  131. package/src/plugin/autosave/storage.ts +147 -0
  132. package/src/plugin/docs/index.tsx +2 -4
  133. package/src/plugin/docs/panel/DocumentationBrowserPanelImpl.tsx +200 -0
  134. package/src/plugin/docs/panel/index.tsx +15 -194
  135. package/src/plugin/docs/panel/styles.module.css +8 -8
  136. package/src/plugin/graphrunner/actions.ts +258 -185
  137. package/src/plugin/graphrunner/buttons.tsx +34 -26
  138. package/src/plugin/graphrunner/client.ts +4 -1
  139. package/src/plugin/graphrunner/index.tsx +29 -100
  140. package/src/plugin/graphrunner/panel.tsx +2 -2
  141. package/src/plugin/graphrunner/runController.ts +283 -0
  142. package/src/plugin/graphrunner/runner.ts +21 -192
  143. package/src/plugin/graphrunner/store.ts +14 -24
  144. package/src/plugin/graphrunner/styles.module.css +17 -57
  145. package/src/plugin/graphrunner/transport.ts +26 -0
  146. package/src/plugin/graphrunner/types.ts +21 -0
  147. package/src/plugin/graphrunner-local/execution-utils.ts +260 -80
  148. package/src/plugin/graphrunner-local/index.tsx +8 -2
  149. package/src/plugin/graphrunner-local/panel.tsx +131 -175
  150. package/src/plugin/graphrunner-local/styles.module.css +57 -76
  151. package/src/plugin/graphrunner-local/transport.ts +151 -184
  152. package/src/plugin/graphrunner-webworker/graph-executor.worker.ts +2 -0
  153. package/src/plugin/graphrunner-webworker/index.tsx +4 -10
  154. package/src/plugin/graphrunner-webworker/store.ts +9 -0
  155. package/src/plugin/kitchen-sink/index.ts +38 -0
  156. package/src/{layout/dagre.tsx → plugin/layout/dagre.ts} +17 -5
  157. package/src/{layout → plugin/layout}/elk.ts +22 -6
  158. package/src/plugin/layout/index.ts +80 -0
  159. package/src/plugin/notes/FormatToolbar.tsx +200 -0
  160. package/src/plugin/notes/index.tsx +191 -0
  161. package/src/plugin/notes/nodeActions.ts +100 -0
  162. package/src/plugin/notes/note.tsx +20 -0
  163. package/src/plugin/notes/noteImpl.tsx +89 -0
  164. package/src/plugin/realtime/realtimeRunner.ts +58 -4
  165. package/src/specifics/CustomEventOnTriggeredSpecific.tsx +2 -2
  166. package/src/specifics/CustomEventTriggerSpecific.tsx +2 -2
  167. package/src/specifics/VariableGetSpecific.tsx +2 -2
  168. package/src/specifics/VariableSetSpecific.tsx +2 -2
  169. package/src/store/actions.tsx +5 -5
  170. package/src/store/commands.ts +278 -0
  171. package/src/store/contextMenu.ts +192 -0
  172. package/src/store/conversions.ts +47 -0
  173. package/src/store/flow.tsx +23 -38
  174. package/src/store/graphMeta.ts +39 -0
  175. package/src/store/hotKeys.tsx +301 -260
  176. package/src/store/layers.ts +3 -3
  177. package/src/store/registry.ts +12 -4
  178. package/src/store/selection.ts +3 -3
  179. package/src/store/settings.ts +82 -82
  180. package/src/store/settingsSchema.ts +210 -0
  181. package/src/store/tabs.ts +5 -1
  182. package/src/store/traces.ts +3 -3
  183. package/src/system/graph.ts +11 -14
  184. package/src/system/graphSession.ts +172 -0
  185. package/src/system/index.ts +3 -0
  186. package/src/system/notifications.ts +13 -0
  187. package/src/system/persistence.ts +82 -0
  188. package/src/system/plugin.ts +28 -0
  189. package/src/system/provider.tsx +64 -0
  190. package/src/system/system.ts +518 -88
  191. package/src/system/tabLoader.tsx +70 -32
  192. package/src/system/undoRedo.ts +1 -1
  193. package/src/transformers/Uigraph.ts +5 -4
  194. package/src/transformers/contract.ts +87 -0
  195. package/src/transformers/flowToBehave.ts +13 -5
  196. package/src/types/nodes.ts +8 -3
  197. package/src/types.ts +2 -0
  198. package/src/util/autoConvert.ts +200 -0
  199. package/src/util/isValidConnection.ts +23 -2
  200. package/stories/defaults/defaultStoryProvider.tsx +17 -14
  201. package/stories/defaults/systemGenerator.ts +6 -1
  202. package/stories/{components/nodes/comment.stories.tsx → plugins/notes.stories.tsx} +24 -30
  203. package/tests/autoConvert.test.ts +329 -0
  204. package/tests/autosavePlugin.test.ts +204 -0
  205. package/tests/callSubgraphSync.test.ts +148 -0
  206. package/tests/commandRegistry.test.ts +137 -0
  207. package/tests/contract.test.ts +51 -0
  208. package/tests/contractSerialize.test.ts +62 -0
  209. package/tests/deriveSpans.test.ts +71 -0
  210. package/tests/flowToBehave.test.ts +2 -1
  211. package/tests/hotkeys.test.ts +79 -0
  212. package/tests/keepAliveLifecycle.test.ts +167 -0
  213. package/tests/loadManifest.test.ts +113 -0
  214. package/tests/noteMarkdown.test.ts +65 -0
  215. package/tests/notesPlugin.test.ts +162 -0
  216. package/tests/persistence.test.ts +51 -0
  217. package/tests/saveLoad.test.ts +7 -6
  218. package/tests/settings.test.ts +178 -0
  219. package/tests/traceStore.test.ts +46 -0
  220. package/tests/visual/README.md +2 -2
  221. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-conversation-chromium-win32.png +0 -0
  222. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-events-chromium-win32.png +0 -0
  223. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-history-chromium-win32.png +0 -0
  224. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-keymaps-chromium-win32.png +0 -0
  225. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-layers-chromium-win32.png +0 -0
  226. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-legend-chromium-win32.png +0 -0
  227. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-localGraphRunner-chromium-win32.png +0 -0
  228. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-logs-chromium-win32.png +0 -0
  229. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-nodeInputs-chromium-win32.png +0 -0
  230. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-nodePicker-chromium-win32.png +0 -0
  231. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-panel-chromium-win32.png +0 -0
  232. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-search-chromium-win32.png +0 -0
  233. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-systemSettings-chromium-win32.png +0 -0
  234. package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-variables-chromium-win32.png +0 -0
  235. package/tests/visual/panels.visual.test.tsx +3 -3
  236. package/tests/wasdPan.test.ts +71 -0
  237. package/vitest.config.ts +1 -1
  238. package/vitest.visual.config.ts +7 -0
  239. package/.storybook/vscode.css +0 -814
  240. package/src/components/nodes/comment/FormatToolbar.tsx +0 -118
  241. package/src/components/nodes/comment/comment.tsx +0 -103
  242. package/src/components/nodes/comment/styles.module.css +0 -150
  243. package/src/components/panels/conversation/index.module.css +0 -151
  244. package/src/components/panels/conversation/index.tsx +0 -162
  245. package/src/components/panels/events/CustomEventsEditor.tsx +0 -384
  246. package/src/css/vscode.css +0 -13
  247. package/src/hooks/useDetachNodes.ts +0 -39
  248. package/src/plugin/graphrunner-webworker/types.ts +0 -17
  249. package/src/specifics/registerDefaultSpecifics.ts +0 -5
  250. package/src/store/chat.ts +0 -73
  251. package/src/store/graphRunnerClient.ts +0 -110
@@ -3,12 +3,48 @@ import { useStore } from 'zustand';
3
3
  import {
4
4
  VscodeButton,
5
5
  VscodeTextfield,
6
- VscodeLabel,
7
- VscodeBadge
6
+ VscodeBadge,
7
+ VscodeDivider
8
8
  } from '@vscode-elements/react-elements';
9
9
 
10
10
  import styles from './styles.module.css';
11
11
  import { useSystem } from '@/system/index.js';
12
+ import { BasePanel } from '@/components/panels/base';
13
+ import { SectionTitle } from '@/components/panels/common/SectionTitle';
14
+
15
+ /** A labelled numeric field with a hint, an Apply button, and the current value. */
16
+ const NumberControl = ({
17
+ label,
18
+ hint,
19
+ value,
20
+ current,
21
+ onChange,
22
+ onApply,
23
+ ...inputProps
24
+ }: {
25
+ label: string;
26
+ hint: string;
27
+ value: string;
28
+ current: string;
29
+ onChange: (value: string) => void;
30
+ onApply: () => void;
31
+ } & Record<string, unknown>) => (
32
+ <div className={styles.field}>
33
+ <span className={styles.label}>{label}</span>
34
+ <span className={styles.description}>{hint}</span>
35
+ <div className={styles.inputRow}>
36
+ <VscodeTextfield
37
+ className={styles.input}
38
+ type="number"
39
+ value={value}
40
+ onChange={(e: any) => onChange(e.target.value)}
41
+ {...inputProps}
42
+ />
43
+ <VscodeButton onClick={onApply}>Apply</VscodeButton>
44
+ </div>
45
+ <span className={styles.current}>Current: {current}</span>
46
+ </div>
47
+ );
12
48
 
13
49
  export const LocalGraphRunnerPanel = () => {
14
50
  const system = useSystem();
@@ -47,185 +83,105 @@ export const LocalGraphRunnerPanel = () => {
47
83
  }
48
84
  };
49
85
 
50
- const getStatusBadge = () => {
51
- if (isExecuting && isPaused) {
52
- return <VscodeBadge>Paused</VscodeBadge>;
53
- }
54
- if (isExecuting) {
55
- return <VscodeBadge>Running</VscodeBadge>;
56
- }
57
- return <VscodeBadge>Idle</VscodeBadge>;
86
+ const applyPreset = (speed: number, delay: number, tick: number) => {
87
+ store.getState().setExecutionSpeed(speed);
88
+ store.getState().setStepDelay(delay);
89
+ store.getState().setTickInterval(tick);
90
+ setSpeedInput(speed.toString());
91
+ setDelayInput(delay.toString());
92
+ setTickIntervalInput(tick.toString());
58
93
  };
59
94
 
95
+ const statusLabel = isExecuting ? (isPaused ? 'Paused' : 'Running') : 'Idle';
96
+
60
97
  return (
61
- <div className={styles.panel}>
62
- <div className={styles.scrollContainer}>
63
- <h3 className={styles.title}>Local Graph Runner</h3>
64
-
65
- {/* Status Section */}
66
- <div className={styles.section}>
67
- <div className={styles.statusRow}>
68
- <VscodeLabel>Status:</VscodeLabel>
69
- {getStatusBadge()}
70
- </div>
71
- <div className={styles.statusRow}>
72
- <VscodeLabel>Active Runs:</VscodeLabel>
73
- <span>{activeRuns}</span>
74
- </div>
75
- </div>
98
+ <BasePanel>
99
+ <SectionTitle>Status</SectionTitle>
100
+ <div className={styles.statusRow}>
101
+ <span className={styles.label}>Status</span>
102
+ <VscodeBadge>{statusLabel}</VscodeBadge>
103
+ </div>
104
+ <div className={styles.statusRow}>
105
+ <span className={styles.label}>Active runs</span>
106
+ <span className={styles.statusValue}>{activeRuns}</span>
107
+ </div>
76
108
 
77
- {/* Execution Speed Controls */}
78
- <div className={styles.section}>
79
- <h4 className={styles.sectionTitle}>Execution Speed</h4>
80
-
81
- <div className={styles.formGroup}>
82
- <VscodeLabel>
83
- Speed Multiplier
84
- <span className={styles.helpText}>
85
- (0.1 = slow, 1.0 = normal, 10 = fast)
86
- </span>
87
- </VscodeLabel>
88
- <div className={styles.inputGroup}>
89
- <VscodeTextfield
90
- value={speedInput}
91
- onChange={(e: any) => setSpeedInput(e.target.value)}
92
- placeholder="1.0"
93
- min={0.01}
94
- step={0.01}
95
- max={1}
96
- type="number"
97
- className={styles.formField}
98
- />
99
- <VscodeButton onClick={handleSetSpeed}>Apply</VscodeButton>
100
- </div>
101
- <div className={styles.currentValue}>
102
- Current: {executionSpeed}x
103
- </div>
104
- </div>
105
-
106
- <div className={styles.formGroup}>
107
- <VscodeLabel>
108
- Step Delay (ms)
109
- <span className={styles.helpText}>
110
- (delay between execution steps)
111
- </span>
112
- </VscodeLabel>
113
- <div className={styles.inputGroup}>
114
- <VscodeTextfield
115
- value={delayInput}
116
- onChange={(e: any) => setDelayInput(e.target.value)}
117
- placeholder="0"
118
- type="number"
119
- className={styles.formField}
120
- />
121
- <VscodeButton onClick={handleSetDelay}>Apply</VscodeButton>
122
- </div>
123
- <div className={styles.currentValue}>Current: {stepDelay}ms</div>
124
- </div>
125
-
126
- <div className={styles.formGroup}>
127
- <VscodeLabel>
128
- Tick Interval (ms)
129
- <span className={styles.helpText}>
130
- (delay between tick events)
131
- </span>
132
- </VscodeLabel>
133
- <div className={styles.inputGroup}>
134
- <VscodeTextfield
135
- value={tickIntervalInput}
136
- onChange={(e: any) => setTickIntervalInput(e.target.value)}
137
- placeholder="50"
138
- type="number"
139
- className={styles.formField}
140
- />
141
- <VscodeButton onClick={handleSetTickInterval}>Apply</VscodeButton>
142
- </div>
143
- <div className={styles.currentValue}>Current: {tickInterval}ms</div>
144
- </div>
145
-
146
- {/* Quick Presets */}
147
- <div className={styles.formGroup}>
148
- <VscodeLabel>Quick Presets</VscodeLabel>
149
- <div className={styles.presetButtons}>
150
- <VscodeButton
151
- secondary
152
- onClick={() => {
153
- store.getState().setExecutionSpeed(0.1);
154
- store.getState().setStepDelay(500);
155
- store.getState().setTickInterval(1000);
156
- setSpeedInput('0.1');
157
- setDelayInput('500');
158
- setTickIntervalInput('1000');
159
- }}
160
- >
161
- Very Slow
162
- </VscodeButton>
163
- <VscodeButton
164
- secondary
165
- onClick={() => {
166
- store.getState().setExecutionSpeed(0.5);
167
- store.getState().setStepDelay(100);
168
- store.getState().setTickInterval(200);
169
- setSpeedInput('0.5');
170
- setDelayInput('100');
171
- setTickIntervalInput('200');
172
- }}
173
- >
174
- Slow
175
- </VscodeButton>
176
- <VscodeButton
177
- secondary
178
- onClick={() => {
179
- store.getState().setExecutionSpeed(1.0);
180
- store.getState().setStepDelay(0);
181
- store.getState().setTickInterval(50);
182
- setSpeedInput('1.0');
183
- setDelayInput('0');
184
- setTickIntervalInput('50');
185
- }}
186
- >
187
- Normal
188
- </VscodeButton>
189
- <VscodeButton
190
- secondary
191
- onClick={() => {
192
- store.getState().setExecutionSpeed(5.0);
193
- store.getState().setStepDelay(0);
194
- store.getState().setTickInterval(16);
195
- setSpeedInput('5.0');
196
- setDelayInput('0');
197
- setTickIntervalInput('16');
198
- }}
199
- >
200
- Fast
201
- </VscodeButton>
202
- </div>
203
- </div>
204
- </div>
109
+ <VscodeDivider className={styles.divider} />
110
+ <SectionTitle>Execution Speed</SectionTitle>
111
+
112
+ <NumberControl
113
+ label="Speed Multiplier"
114
+ hint="0.1 = slow, 1.0 = normal, 10 = fast"
115
+ value={speedInput}
116
+ current={`${executionSpeed}x`}
117
+ onChange={setSpeedInput}
118
+ onApply={handleSetSpeed}
119
+ placeholder="1.0"
120
+ min={0.01}
121
+ max={10}
122
+ step={0.01}
123
+ />
124
+
125
+ <NumberControl
126
+ label="Step Delay (ms)"
127
+ hint="delay between execution steps"
128
+ value={delayInput}
129
+ current={`${stepDelay}ms`}
130
+ onChange={setDelayInput}
131
+ onApply={handleSetDelay}
132
+ placeholder="0"
133
+ min={0}
134
+ />
205
135
 
206
- {/* Help Section */}
207
- <div className={styles.section}>
208
- <h4 className={styles.sectionTitle}>How to Use</h4>
209
- <ul className={styles.helpList}>
210
- <li>
211
- <strong>Speed Multiplier:</strong> Controls how fast the engine
212
- executes. Lower values = slower execution, good for debugging.
213
- </li>
214
- <li>
215
- <strong>Step Delay:</strong> Adds a delay between each execution
216
- step. Useful for visualizing graph execution flow.
217
- </li>
218
- <li>
219
- <strong>Tick Interval:</strong> Controls the delay between tick
220
- events (default 50ms). Lower values = faster ticks.
221
- </li>
222
- <li>
223
- <strong>Pause/Step:</strong> Use the toolbar buttons to pause
224
- execution and step through one node at a time.
225
- </li>
226
- </ul>
136
+ <NumberControl
137
+ label="Tick Interval (ms)"
138
+ hint="delay between tick events"
139
+ value={tickIntervalInput}
140
+ current={`${tickInterval}ms`}
141
+ onChange={setTickIntervalInput}
142
+ onApply={handleSetTickInterval}
143
+ placeholder="50"
144
+ min={0}
145
+ />
146
+
147
+ <div className={styles.field}>
148
+ <span className={styles.label}>Quick Presets</span>
149
+ <div className={styles.presets}>
150
+ <VscodeButton secondary onClick={() => applyPreset(0.1, 500, 1000)}>
151
+ Very Slow
152
+ </VscodeButton>
153
+ <VscodeButton secondary onClick={() => applyPreset(0.5, 100, 200)}>
154
+ Slow
155
+ </VscodeButton>
156
+ <VscodeButton secondary onClick={() => applyPreset(1.0, 0, 50)}>
157
+ Normal
158
+ </VscodeButton>
159
+ <VscodeButton secondary onClick={() => applyPreset(5.0, 0, 16)}>
160
+ Fast
161
+ </VscodeButton>
227
162
  </div>
228
163
  </div>
229
- </div>
164
+
165
+ <VscodeDivider className={styles.divider} />
166
+ <SectionTitle>How to Use</SectionTitle>
167
+ <ul className={styles.helpList}>
168
+ <li>
169
+ <strong>Speed Multiplier:</strong> Controls how fast the engine
170
+ executes. Lower values = slower execution, good for debugging.
171
+ </li>
172
+ <li>
173
+ <strong>Step Delay:</strong> Adds a delay between each execution step.
174
+ Useful for visualizing graph execution flow.
175
+ </li>
176
+ <li>
177
+ <strong>Tick Interval:</strong> Controls the delay between tick events
178
+ (default 50ms). Lower values = faster ticks.
179
+ </li>
180
+ <li>
181
+ <strong>Pause/Step:</strong> Use the toolbar buttons to pause
182
+ execution and step through one node at a time.
183
+ </li>
184
+ </ul>
185
+ </BasePanel>
230
186
  );
231
187
  };
@@ -1,101 +1,82 @@
1
- .panel {
2
- height: 100%;
3
- display: flex;
4
- flex-direction: column;
5
- background: var(--vscode-editor-background);
6
- color: var(--vscode-editor-foreground);
7
- }
8
-
9
- .scrollContainer {
10
- flex: 1;
11
- overflow-y: auto;
12
- padding: 16px;
13
- }
14
-
15
- .title {
16
- margin: 0 0 16px 0;
17
- font-size: 16px;
18
- font-weight: 600;
19
- color: var(--vscode-foreground);
20
- }
21
-
22
- .section {
23
- margin-bottom: 24px;
24
- padding: 12px;
25
- background: var(--vscode-editor-inactiveSelectionBackground);
26
- border-radius: 4px;
27
- }
1
+ /* Local Graph Runner panel — follows the shared panel conventions: BasePanel
2
+ chrome, SectionTitle headers, VscodeDivider separators, and the design
3
+ system's spacing/type scale (no card backgrounds or bespoke pixel values). */
28
4
 
29
- .sectionTitle {
30
- margin: 0 0 12px 0;
31
- font-size: 14px;
32
- font-weight: 600;
33
- color: var(--vscode-foreground);
5
+ .divider {
6
+ margin: 0.4rem 0;
34
7
  }
35
8
 
9
+ /* Status rows */
36
10
  .statusRow {
37
- display: flex;
38
- align-items: center;
39
- gap: 8px;
40
- margin-bottom: 8px;
41
- }
42
-
43
- .formGroup {
44
- margin-bottom: 16px;
11
+ display: flex;
12
+ align-items: center;
13
+ gap: var(--space-2, 0.5rem);
14
+ padding: 0.1rem 0;
45
15
  }
46
16
 
47
- .formGroup:last-child {
48
- margin-bottom: 0;
17
+ .statusValue {
18
+ font-size: var(--fs-label, 0.8rem);
19
+ font-variant-numeric: tabular-nums;
20
+ color: var(--ds-fg);
49
21
  }
50
22
 
51
- .inputGroup {
52
- display: flex;
53
- gap: 8px;
54
- align-items: center;
55
- margin-top: 4px;
23
+ /* Labelled control rows (mirrors the Settings panel) */
24
+ .field {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 0.15rem;
28
+ padding: var(--space-1, 0.25rem) 0;
56
29
  }
57
30
 
58
- .formField {
59
- flex: 1;
31
+ .label {
32
+ font-size: var(--fs-label, 0.8rem);
33
+ color: var(--ds-fg);
34
+ line-height: 1.3;
60
35
  }
61
36
 
62
- .currentValue {
63
- margin-top: 4px;
64
- font-size: 12px;
65
- color: var(--vscode-descriptionForeground);
37
+ .description {
38
+ font-size: var(--fs-desc, 0.72rem);
39
+ color: var(--ds-fg-muted);
40
+ line-height: 1.35;
66
41
  }
67
42
 
68
- .helpText {
69
- display: block;
70
- font-size: 11px;
71
- color: var(--vscode-descriptionForeground);
72
- font-weight: normal;
73
- margin-top: 2px;
43
+ .inputRow {
44
+ display: flex;
45
+ gap: var(--space-2, 0.5rem);
46
+ align-items: center;
47
+ margin-top: 0.15rem;
74
48
  }
75
49
 
76
- .presetButtons {
77
- display: flex;
78
- gap: 8px;
79
- flex-wrap: wrap;
80
- margin-top: 8px;
50
+ .input {
51
+ flex: 1;
52
+ min-width: 0;
81
53
  }
82
54
 
83
- .helpList {
84
- margin: 0;
85
- padding-left: 20px;
86
- font-size: 12px;
87
- line-height: 1.6;
88
- color: var(--vscode-descriptionForeground);
55
+ .current {
56
+ font-size: var(--fs-desc, 0.72rem);
57
+ color: var(--ds-fg-muted);
89
58
  }
90
59
 
91
- .helpList li {
92
- margin-bottom: 8px;
60
+ .presets {
61
+ display: flex;
62
+ gap: var(--space-2, 0.5rem);
63
+ flex-wrap: wrap;
64
+ margin-top: 0.15rem;
93
65
  }
94
66
 
95
- .helpList li:last-child {
96
- margin-bottom: 0;
67
+ /* How-to-use list */
68
+ .helpList {
69
+ display: flex;
70
+ flex-direction: column;
71
+ gap: var(--space-2, 0.5rem);
72
+ margin: 0.25rem 0 0;
73
+ padding-left: 1.1rem;
74
+ font-size: var(--fs-desc, 0.72rem);
75
+ line-height: 1.5;
76
+ color: var(--ds-fg-muted);
97
77
  }
98
78
 
99
79
  .helpList strong {
100
- color: var(--vscode-foreground);
101
- }
80
+ color: var(--ds-fg);
81
+ font-weight: 600;
82
+ }