@grackle-ai/web-components 0.107.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 (279) hide show
  1. package/.rush/temp/3ae72563f781afd72723475938136f113846603e.untar.log +10 -0
  2. package/.rush/temp/bc1d5bf9201ce71abeaeaddd096deb9b0805d703.untar.log +10 -0
  3. package/.rush/temp/operation/_phase_build/all.log +18 -0
  4. package/.rush/temp/operation/_phase_build/log-chunks.jsonl +18 -0
  5. package/.rush/temp/operation/_phase_build/state.json +3 -0
  6. package/.rush/temp/operation/_phase_test/all.log +121 -0
  7. package/.rush/temp/operation/_phase_test/log-chunks.jsonl +121 -0
  8. package/.rush/temp/operation/_phase_test/state.json +3 -0
  9. package/.rush/temp/shrinkwrap-deps.json +938 -0
  10. package/.storybook/main.ts +22 -0
  11. package/.storybook/preview.tsx +30 -0
  12. package/config/rig.json +4 -0
  13. package/config/rush-project.json +12 -0
  14. package/dist/index.css +1 -0
  15. package/dist/index.js +39221 -0
  16. package/eslint.config.cjs +5 -0
  17. package/package.json +83 -0
  18. package/rush-logs/web-components._phase_build.cache.log +4 -0
  19. package/rush-logs/web-components._phase_test.cache.log +4 -0
  20. package/src/components/chat/ChatInput.module.scss +81 -0
  21. package/src/components/chat/ChatInput.stories.tsx +91 -0
  22. package/src/components/chat/ChatInput.tsx +168 -0
  23. package/src/components/chat/index.ts +6 -0
  24. package/src/components/dag/DagView.module.scss +149 -0
  25. package/src/components/dag/DagView.stories.tsx +125 -0
  26. package/src/components/dag/DagView.tsx +109 -0
  27. package/src/components/dag/TaskNode.stories.tsx +133 -0
  28. package/src/components/dag/TaskNode.tsx +40 -0
  29. package/src/components/dag/useDagLayout.ts +139 -0
  30. package/src/components/display/Breadcrumbs.module.scss +71 -0
  31. package/src/components/display/Breadcrumbs.stories.tsx +80 -0
  32. package/src/components/display/Breadcrumbs.tsx +46 -0
  33. package/src/components/display/Button.module.scss +110 -0
  34. package/src/components/display/Button.stories.tsx +88 -0
  35. package/src/components/display/Button.tsx +40 -0
  36. package/src/components/display/ConfirmDialog.module.scss +67 -0
  37. package/src/components/display/ConfirmDialog.stories.tsx +81 -0
  38. package/src/components/display/ConfirmDialog.tsx +88 -0
  39. package/src/components/display/CopyButton.module.scss +41 -0
  40. package/src/components/display/CopyButton.stories.tsx +78 -0
  41. package/src/components/display/CopyButton.tsx +64 -0
  42. package/src/components/display/DemoBanner.module.scss +37 -0
  43. package/src/components/display/DemoBanner.stories.tsx +40 -0
  44. package/src/components/display/DemoBanner.tsx +23 -0
  45. package/src/components/display/EventHoverRow.module.scss +102 -0
  46. package/src/components/display/EventHoverRow.stories.tsx +99 -0
  47. package/src/components/display/EventHoverRow.tsx +154 -0
  48. package/src/components/display/EventRenderer.module.scss +272 -0
  49. package/src/components/display/EventRenderer.stories.tsx +186 -0
  50. package/src/components/display/EventRenderer.tsx +271 -0
  51. package/src/components/display/EventStream.module.scss +93 -0
  52. package/src/components/display/EventStream.stories.tsx +249 -0
  53. package/src/components/display/EventStream.tsx +369 -0
  54. package/src/components/display/FloatingActionBar.module.scss +107 -0
  55. package/src/components/display/FloatingActionBar.stories.tsx +122 -0
  56. package/src/components/display/FloatingActionBar.tsx +119 -0
  57. package/src/components/display/SessionAttemptSelector.module.scss +50 -0
  58. package/src/components/display/SessionAttemptSelector.stories.tsx +78 -0
  59. package/src/components/display/SessionAttemptSelector.tsx +49 -0
  60. package/src/components/display/SessionPicker.module.scss +200 -0
  61. package/src/components/display/SessionPicker.stories.tsx +169 -0
  62. package/src/components/display/SessionPicker.tsx +214 -0
  63. package/src/components/display/Skeleton.module.scss +58 -0
  64. package/src/components/display/Skeleton.stories.tsx +94 -0
  65. package/src/components/display/Skeleton.tsx +127 -0
  66. package/src/components/display/Spinner.module.scss +41 -0
  67. package/src/components/display/Spinner.stories.tsx +66 -0
  68. package/src/components/display/Spinner.tsx +32 -0
  69. package/src/components/display/SplashScreen.module.scss +20 -0
  70. package/src/components/display/SplashScreen.stories.tsx +26 -0
  71. package/src/components/display/SplashScreen.tsx +16 -0
  72. package/src/components/display/SplitButton.module.scss +166 -0
  73. package/src/components/display/SplitButton.stories.tsx +95 -0
  74. package/src/components/display/SplitButton.tsx +128 -0
  75. package/src/components/display/Tooltip.module.scss +84 -0
  76. package/src/components/display/Tooltip.stories.tsx +240 -0
  77. package/src/components/display/Tooltip.tsx +184 -0
  78. package/src/components/display/extractText.test.tsx +48 -0
  79. package/src/components/display/index.ts +20 -0
  80. package/src/components/editable/EditableCheckbox.stories.tsx +54 -0
  81. package/src/components/editable/EditableCheckbox.tsx +39 -0
  82. package/src/components/editable/EditableField.module.scss +135 -0
  83. package/src/components/editable/EditableSelect.tsx +164 -0
  84. package/src/components/editable/EditableTextArea.stories.tsx +50 -0
  85. package/src/components/editable/EditableTextArea.tsx +148 -0
  86. package/src/components/editable/EditableTextField.stories.tsx +62 -0
  87. package/src/components/editable/EditableTextField.tsx +153 -0
  88. package/src/components/editable/EnvironmentSelect.module.scss +17 -0
  89. package/src/components/editable/EnvironmentSelect.stories.tsx +61 -0
  90. package/src/components/editable/EnvironmentSelect.tsx +87 -0
  91. package/src/components/editable/index.ts +13 -0
  92. package/src/components/editable/useEditableField.test.tsx +233 -0
  93. package/src/components/editable/useEditableField.ts +173 -0
  94. package/src/components/index.ts +20 -0
  95. package/src/components/knowledge/KnowledgeDetailPanel.module.scss +162 -0
  96. package/src/components/knowledge/KnowledgeDetailPanel.stories.tsx +208 -0
  97. package/src/components/knowledge/KnowledgeDetailPanel.tsx +122 -0
  98. package/src/components/knowledge/KnowledgeGraph.module.scss +110 -0
  99. package/src/components/knowledge/KnowledgeGraph.stories.tsx +180 -0
  100. package/src/components/knowledge/KnowledgeGraph.tsx +455 -0
  101. package/src/components/knowledge/KnowledgeNav.module.scss +130 -0
  102. package/src/components/knowledge/KnowledgeNav.stories.tsx +108 -0
  103. package/src/components/knowledge/KnowledgeNav.tsx +138 -0
  104. package/src/components/knowledge/index.ts +3 -0
  105. package/src/components/layout/AppNav.module.scss +82 -0
  106. package/src/components/layout/AppNav.stories.tsx +115 -0
  107. package/src/components/layout/AppNav.tsx +133 -0
  108. package/src/components/layout/BottomStatusBar.module.scss +58 -0
  109. package/src/components/layout/BottomStatusBar.stories.tsx +35 -0
  110. package/src/components/layout/BottomStatusBar.tsx +206 -0
  111. package/src/components/layout/Sidebar.module.scss +60 -0
  112. package/src/components/layout/Sidebar.stories.tsx +46 -0
  113. package/src/components/layout/Sidebar.tsx +84 -0
  114. package/src/components/layout/StatusBar.module.scss +108 -0
  115. package/src/components/layout/StatusBar.stories.tsx +119 -0
  116. package/src/components/layout/StatusBar.tsx +70 -0
  117. package/src/components/layout/index.ts +9 -0
  118. package/src/components/lists/EnvironmentNav.module.scss +118 -0
  119. package/src/components/lists/EnvironmentNav.stories.tsx +121 -0
  120. package/src/components/lists/EnvironmentNav.tsx +133 -0
  121. package/src/components/lists/FindingsNav.module.scss +126 -0
  122. package/src/components/lists/FindingsNav.tsx +146 -0
  123. package/src/components/lists/TaskList.module.scss +206 -0
  124. package/src/components/lists/TaskList.stories.tsx +401 -0
  125. package/src/components/lists/TaskList.tsx +509 -0
  126. package/src/components/lists/index.ts +6 -0
  127. package/src/components/lists/listHelpers.tsx +130 -0
  128. package/src/components/notifications/Callout.module.scss +83 -0
  129. package/src/components/notifications/Callout.stories.tsx +81 -0
  130. package/src/components/notifications/Callout.tsx +64 -0
  131. package/src/components/notifications/Toast.module.scss +86 -0
  132. package/src/components/notifications/Toast.stories.tsx +71 -0
  133. package/src/components/notifications/Toast.tsx +51 -0
  134. package/src/components/notifications/ToastContainer.module.scss +23 -0
  135. package/src/components/notifications/ToastContainer.stories.tsx +66 -0
  136. package/src/components/notifications/ToastContainer.tsx +29 -0
  137. package/src/components/notifications/UpdateBanner.stories.tsx +77 -0
  138. package/src/components/notifications/UpdateBanner.test.tsx +64 -0
  139. package/src/components/notifications/UpdateBanner.tsx +44 -0
  140. package/src/components/notifications/index.ts +8 -0
  141. package/src/components/panels/AboutPanel.stories.tsx +70 -0
  142. package/src/components/panels/AboutPanel.tsx +66 -0
  143. package/src/components/panels/AppearancePanel.stories.tsx +45 -0
  144. package/src/components/panels/AppearancePanel.tsx +97 -0
  145. package/src/components/panels/CredentialProvidersPanel.stories.tsx +62 -0
  146. package/src/components/panels/CredentialProvidersPanel.tsx +111 -0
  147. package/src/components/panels/EnvironmentEditPanel.module.scss +170 -0
  148. package/src/components/panels/EnvironmentEditPanel.stories.tsx +206 -0
  149. package/src/components/panels/EnvironmentEditPanel.tsx +785 -0
  150. package/src/components/panels/FindingsPanel.module.scss +94 -0
  151. package/src/components/panels/FindingsPanel.stories.tsx +109 -0
  152. package/src/components/panels/FindingsPanel.tsx +76 -0
  153. package/src/components/panels/KeyboardShortcutsPanel.module.scss +65 -0
  154. package/src/components/panels/KeyboardShortcutsPanel.stories.tsx +40 -0
  155. package/src/components/panels/KeyboardShortcutsPanel.tsx +104 -0
  156. package/src/components/panels/PluginsPanel.tsx +77 -0
  157. package/src/components/panels/SettingsPanel.module.scss +336 -0
  158. package/src/components/panels/TaskActionButtons.module.scss +22 -0
  159. package/src/components/panels/TaskActionButtons.stories.tsx +125 -0
  160. package/src/components/panels/TaskActionButtons.tsx +87 -0
  161. package/src/components/panels/TaskEditPanel.module.scss +202 -0
  162. package/src/components/panels/TaskEditPanel.stories.tsx +75 -0
  163. package/src/components/panels/TaskEditPanel.tsx +328 -0
  164. package/src/components/panels/TaskOverviewPanel.module.scss +236 -0
  165. package/src/components/panels/TaskOverviewPanel.stories.tsx +219 -0
  166. package/src/components/panels/TaskOverviewPanel.tsx +270 -0
  167. package/src/components/panels/TokensPanel.stories.tsx +131 -0
  168. package/src/components/panels/TokensPanel.tsx +143 -0
  169. package/src/components/panels/WorkpadPanel.module.scss +39 -0
  170. package/src/components/panels/WorkpadPanel.stories.tsx +56 -0
  171. package/src/components/panels/WorkpadPanel.tsx +63 -0
  172. package/src/components/panels/index.ts +13 -0
  173. package/src/components/personas/McpToolSelector.module.scss +109 -0
  174. package/src/components/personas/McpToolSelector.stories.tsx +129 -0
  175. package/src/components/personas/McpToolSelector.tsx +180 -0
  176. package/src/components/personas/PersonaManager.module.scss +233 -0
  177. package/src/components/personas/PersonaManager.stories.tsx +139 -0
  178. package/src/components/personas/PersonaManager.tsx +122 -0
  179. package/src/components/schedules/ScheduleManager.module.scss +98 -0
  180. package/src/components/schedules/ScheduleManager.stories.tsx +78 -0
  181. package/src/components/schedules/ScheduleManager.tsx +160 -0
  182. package/src/components/settings/SettingsNav.module.scss +82 -0
  183. package/src/components/settings/SettingsNav.stories.tsx +83 -0
  184. package/src/components/settings/SettingsNav.tsx +104 -0
  185. package/src/components/streams/StreamDetailPanel.module.scss +206 -0
  186. package/src/components/streams/StreamDetailPanel.stories.tsx +132 -0
  187. package/src/components/streams/StreamDetailPanel.tsx +119 -0
  188. package/src/components/streams/StreamList.module.scss +92 -0
  189. package/src/components/streams/StreamList.stories.tsx +99 -0
  190. package/src/components/streams/StreamList.tsx +114 -0
  191. package/src/components/streams/index.ts +10 -0
  192. package/src/components/tools/AgentToolCard.module.scss +118 -0
  193. package/src/components/tools/AgentToolCard.stories.tsx +304 -0
  194. package/src/components/tools/AgentToolCard.tsx +247 -0
  195. package/src/components/tools/FileEditCard.stories.tsx +138 -0
  196. package/src/components/tools/FileEditCard.tsx +160 -0
  197. package/src/components/tools/FileReadCard.stories.tsx +120 -0
  198. package/src/components/tools/FileReadCard.tsx +106 -0
  199. package/src/components/tools/FindingCard.stories.tsx +124 -0
  200. package/src/components/tools/FindingCard.tsx +178 -0
  201. package/src/components/tools/GenericToolCard.stories.tsx +80 -0
  202. package/src/components/tools/GenericToolCard.tsx +111 -0
  203. package/src/components/tools/IpcCard.stories.tsx +129 -0
  204. package/src/components/tools/IpcCard.tsx +178 -0
  205. package/src/components/tools/KnowledgeCard.stories.tsx +112 -0
  206. package/src/components/tools/KnowledgeCard.tsx +165 -0
  207. package/src/components/tools/MetadataCard.stories.tsx +32 -0
  208. package/src/components/tools/MetadataCard.tsx +39 -0
  209. package/src/components/tools/SearchCard.stories.tsx +74 -0
  210. package/src/components/tools/SearchCard.tsx +86 -0
  211. package/src/components/tools/ShellCard.stories.tsx +112 -0
  212. package/src/components/tools/ShellCard.tsx +106 -0
  213. package/src/components/tools/TaskCard.stories.tsx +123 -0
  214. package/src/components/tools/TaskCard.tsx +203 -0
  215. package/src/components/tools/TodoCard.module.scss +131 -0
  216. package/src/components/tools/TodoCard.stories.tsx +202 -0
  217. package/src/components/tools/TodoCard.tsx +200 -0
  218. package/src/components/tools/ToolCard.stories.tsx +177 -0
  219. package/src/components/tools/ToolCard.tsx +60 -0
  220. package/src/components/tools/ToolCardProps.ts +20 -0
  221. package/src/components/tools/ToolSearchCard.stories.tsx +81 -0
  222. package/src/components/tools/ToolSearchCard.tsx +86 -0
  223. package/src/components/tools/WorkpadCard.stories.tsx +106 -0
  224. package/src/components/tools/WorkpadCard.tsx +125 -0
  225. package/src/components/tools/classifyTool.test.ts +44 -0
  226. package/src/components/tools/classifyTool.ts +134 -0
  227. package/src/components/tools/parseDiff.ts +95 -0
  228. package/src/components/tools/parseShellOutput.ts +28 -0
  229. package/src/components/tools/toolCardHelpers.test.ts +53 -0
  230. package/src/components/tools/toolCards.module.scss +234 -0
  231. package/src/components/workspace/WorkspaceBoard.module.scss +238 -0
  232. package/src/components/workspace/WorkspaceBoard.stories.tsx +240 -0
  233. package/src/components/workspace/WorkspaceBoard.tsx +232 -0
  234. package/src/components/workspace/WorkspaceFormFields.module.scss +79 -0
  235. package/src/components/workspace/WorkspaceFormFields.stories.tsx +133 -0
  236. package/src/components/workspace/WorkspaceFormFields.tsx +185 -0
  237. package/src/context/GrackleContext.ts +28 -0
  238. package/src/context/GrackleContextTypes.ts +64 -0
  239. package/src/context/SidebarContext.tsx +53 -0
  240. package/src/context/ThemeContext.tsx +21 -0
  241. package/src/context/ToastContext.tsx +56 -0
  242. package/src/hooks/types.ts +864 -0
  243. package/src/hooks/useEventSelection.test.ts +204 -0
  244. package/src/hooks/useEventSelection.ts +158 -0
  245. package/src/hooks/useSmartScroll.ts +151 -0
  246. package/src/hooks/useTheme.ts +228 -0
  247. package/src/index.ts +210 -0
  248. package/src/mocks/MockGrackleProvider.tsx +1397 -0
  249. package/src/mocks/mockData.ts +1966 -0
  250. package/src/mocks/mockKnowledgeData.ts +294 -0
  251. package/src/scss.d.ts +12 -0
  252. package/src/styles/global.scss +244 -0
  253. package/src/styles/mixins.scss +278 -0
  254. package/src/styles/prism-theme.scss +148 -0
  255. package/src/styles/theme.scss +1102 -0
  256. package/src/test-utils/storybook-decorators.tsx +50 -0
  257. package/src/test-utils/storybook-helpers.ts +262 -0
  258. package/src/themes.ts +142 -0
  259. package/src/utils/boardColumns.ts +141 -0
  260. package/src/utils/breadcrumbs.test.ts +285 -0
  261. package/src/utils/breadcrumbs.ts +222 -0
  262. package/src/utils/dashboard.test.ts +156 -0
  263. package/src/utils/dashboard.ts +195 -0
  264. package/src/utils/eventContent.test.ts +353 -0
  265. package/src/utils/eventContent.ts +209 -0
  266. package/src/utils/findingCategory.ts +33 -0
  267. package/src/utils/format.ts +27 -0
  268. package/src/utils/iconSize.ts +18 -0
  269. package/src/utils/navigation.ts +205 -0
  270. package/src/utils/route-config.test.ts +128 -0
  271. package/src/utils/scrollUtils.test.ts +65 -0
  272. package/src/utils/scrollUtils.ts +49 -0
  273. package/src/utils/sessionEvents.test.ts +302 -0
  274. package/src/utils/sessionEvents.ts +233 -0
  275. package/src/utils/taskStatus.tsx +137 -0
  276. package/src/utils/time.ts +92 -0
  277. package/tsconfig.json +8 -0
  278. package/vite.config.ts +20 -0
  279. package/vitest.config.ts +10 -0
@@ -0,0 +1,336 @@
1
+ @use '../../styles/mixins' as *;
2
+
3
+ // =============================================================================
4
+ // Settings Panel — token management and future settings
5
+ // =============================================================================
6
+
7
+ .container {
8
+ padding: var(--space-lg);
9
+ overflow-y: auto;
10
+ height: 100%;
11
+ }
12
+
13
+ .heading {
14
+ font-size: var(--font-size-xl);
15
+ font-weight: var(--font-weight-heavy);
16
+ color: var(--text-primary);
17
+ margin: 0 0 var(--space-lg);
18
+ }
19
+
20
+ .section {
21
+ @include surface-card;
22
+ padding: var(--space-lg);
23
+ margin-bottom: var(--space-lg);
24
+ }
25
+
26
+ .sectionTitle {
27
+ @include section-label;
28
+ margin: 0 0 var(--space-xs);
29
+ }
30
+
31
+ .sectionDescription {
32
+ font-size: var(--font-size-sm);
33
+ color: var(--text-tertiary);
34
+ margin: 0 0 var(--space-lg);
35
+ }
36
+
37
+ .emptyState {
38
+ font-size: var(--font-size-sm);
39
+ color: var(--text-tertiary);
40
+ padding: var(--space-lg) 0;
41
+ text-align: center;
42
+ }
43
+
44
+ // ─── Token List ─────────────────────────────────────
45
+
46
+ .tokenList {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: var(--space-xs);
50
+ margin-bottom: var(--space-lg);
51
+ }
52
+
53
+ .tokenRow {
54
+ @include surface-inset;
55
+ display: flex;
56
+ align-items: center;
57
+ gap: var(--space-md);
58
+ padding: var(--space-sm) var(--space-md);
59
+ }
60
+
61
+ .tokenBadge {
62
+ @include surface-inset;
63
+ font-size: var(--font-size-xs);
64
+ padding: 2px var(--space-sm);
65
+ color: var(--accent-cyan);
66
+ text-transform: uppercase;
67
+ letter-spacing: 0.5px;
68
+ white-space: nowrap;
69
+ }
70
+
71
+ .tokenName {
72
+ font-weight: var(--font-weight-bold);
73
+ color: var(--text-primary);
74
+ font-size: var(--font-size-sm);
75
+ min-width: 100px;
76
+ }
77
+
78
+ .tokenTarget {
79
+ flex: 1;
80
+ font-size: var(--font-size-sm);
81
+ color: var(--text-secondary);
82
+ overflow: hidden;
83
+ text-overflow: ellipsis;
84
+ white-space: nowrap;
85
+ }
86
+
87
+ .deleteButton {
88
+ background: none;
89
+ border: none;
90
+ color: var(--text-tertiary);
91
+ font-size: var(--font-size-lg);
92
+ cursor: pointer;
93
+ padding: 0 var(--space-xs);
94
+ line-height: 1;
95
+ transition: color var(--transition-fast);
96
+
97
+ &:hover {
98
+ color: var(--accent-red);
99
+ }
100
+ }
101
+
102
+ // ─── Add Form ───────────────────────────────────────
103
+
104
+ .addForm {
105
+ display: flex;
106
+ flex-direction: column;
107
+ gap: var(--space-sm);
108
+ }
109
+
110
+ .formRow {
111
+ display: flex;
112
+ gap: var(--space-sm);
113
+ align-items: center;
114
+ }
115
+
116
+ .input {
117
+ @include input-field;
118
+ flex: 1;
119
+ font-size: var(--font-size-sm);
120
+ }
121
+
122
+ .select {
123
+ @include select-field;
124
+ flex: 0 0 auto;
125
+ min-width: 160px;
126
+ }
127
+
128
+ .addButton {
129
+ @include btn-primary;
130
+ white-space: nowrap;
131
+ }
132
+
133
+ // ---------------------------------------------------------------------------
134
+ // Empty state info message
135
+ // ---------------------------------------------------------------------------
136
+
137
+ .emptyStateInfo {
138
+ font-size: var(--font-size-sm);
139
+ color: var(--text-tertiary);
140
+ padding: var(--space-lg) 0 var(--space-sm);
141
+ text-align: center;
142
+ line-height: var(--line-height);
143
+ }
144
+
145
+ // ---------------------------------------------------------------------------
146
+ // Appearance — theme radio-card selector (T3-style)
147
+ // ---------------------------------------------------------------------------
148
+
149
+ .themeOptions {
150
+ display: flex;
151
+ flex-direction: column;
152
+ gap: var(--space-sm);
153
+ }
154
+
155
+ .themeOption {
156
+ display: flex;
157
+ flex-direction: column;
158
+ align-items: flex-start;
159
+ gap: 2px;
160
+ width: 100%;
161
+ text-align: left;
162
+ padding: var(--space-sm) var(--space-md);
163
+ border-radius: var(--radius-lg);
164
+ border: 1px solid var(--border-subtle);
165
+ background: var(--bg-surface);
166
+ cursor: pointer;
167
+ transition: border-color var(--transition-fast),
168
+ background var(--transition-fast);
169
+ font-family: var(--font-ui);
170
+
171
+ &:hover {
172
+ background: var(--bg-overlay);
173
+ }
174
+ }
175
+
176
+ .themeOptionSelected {
177
+ border-color: var(--accent-green);
178
+ background: var(--accent-green-subtle);
179
+ }
180
+
181
+ .themeOptionHeader {
182
+ display: flex;
183
+ justify-content: space-between;
184
+ align-items: flex-start;
185
+ width: 100%;
186
+ }
187
+
188
+ .themeOptionLabel {
189
+ font-size: var(--font-size-sm);
190
+ font-weight: var(--font-weight-medium);
191
+ color: var(--text-primary);
192
+ display: block;
193
+ }
194
+
195
+ .themeOptionDesc {
196
+ font-size: var(--font-size-xs);
197
+ color: var(--text-tertiary);
198
+ display: block;
199
+ }
200
+
201
+ // ─── Variant Light/Dark Toggle ────────────────────────
202
+
203
+ .variantToggle {
204
+ display: flex;
205
+ gap: 2px;
206
+ flex-shrink: 0;
207
+ margin-left: var(--space-sm);
208
+ }
209
+
210
+ .variantButton {
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: center;
214
+ width: 26px;
215
+ height: 26px;
216
+ border-radius: var(--radius-sm);
217
+ border: 1px solid var(--border-subtle);
218
+ background: transparent;
219
+ color: var(--text-tertiary);
220
+ font-size: 14px;
221
+ cursor: pointer;
222
+ transition: background var(--transition-fast),
223
+ color var(--transition-fast),
224
+ border-color var(--transition-fast);
225
+
226
+ &:hover {
227
+ background: var(--bg-overlay);
228
+ color: var(--text-primary);
229
+ }
230
+ }
231
+
232
+ .variantActive {
233
+ background: var(--accent-green-dim);
234
+ color: var(--accent-green);
235
+ border-color: var(--accent-green);
236
+ }
237
+
238
+ // ─── Swatches ─────────────────────────────────────────
239
+
240
+ .themeSwatches {
241
+ display: flex;
242
+ gap: 4px;
243
+ margin-top: 2px;
244
+ }
245
+
246
+ .themeSwatch {
247
+ width: 14px;
248
+ height: 14px;
249
+ border-radius: 50%;
250
+ border: 1px solid rgba(128, 128, 128, 0.4);
251
+ flex-shrink: 0;
252
+ }
253
+
254
+ // ─── System Preference Toggle ─────────────────────────
255
+
256
+ .systemToggle {
257
+ display: flex;
258
+ align-items: center;
259
+ gap: var(--space-sm);
260
+ margin-top: var(--space-md);
261
+ font-size: var(--font-size-sm);
262
+ color: var(--text-primary);
263
+ cursor: pointer;
264
+
265
+ input[type="checkbox"] {
266
+ accent-color: var(--accent-green);
267
+ width: 16px;
268
+ height: 16px;
269
+ cursor: pointer;
270
+ }
271
+ }
272
+
273
+ .systemToggleHint {
274
+ font-size: var(--font-size-xs);
275
+ color: var(--text-tertiary);
276
+ margin-top: 2px;
277
+ margin-left: 24px;
278
+ }
279
+
280
+ .themeActive {
281
+ font-size: var(--font-size-xs);
282
+ color: var(--text-tertiary);
283
+ margin-top: var(--space-sm);
284
+ }
285
+
286
+ // ---------------------------------------------------------------------------
287
+ // About Panel
288
+ // ---------------------------------------------------------------------------
289
+
290
+ .aboutGrid {
291
+ display: flex;
292
+ flex-direction: column;
293
+ gap: var(--space-sm);
294
+ }
295
+
296
+ .aboutItem {
297
+ @include surface-inset;
298
+ display: flex;
299
+ align-items: center;
300
+ justify-content: space-between;
301
+ padding: var(--space-sm) var(--space-md);
302
+ }
303
+
304
+ .aboutLabel {
305
+ font-size: var(--font-size-sm);
306
+ color: var(--text-tertiary);
307
+ font-weight: var(--font-weight-medium);
308
+ }
309
+
310
+ .aboutValue {
311
+ font-size: var(--font-size-sm);
312
+ color: var(--text-primary);
313
+ display: flex;
314
+ align-items: center;
315
+ gap: var(--space-xs);
316
+ }
317
+
318
+ .aboutDot {
319
+ display: inline-block;
320
+ width: 8px;
321
+ height: 8px;
322
+ border-radius: 50%;
323
+ }
324
+
325
+ .aboutDotConnected {
326
+ background: var(--accent-green);
327
+ }
328
+
329
+ .aboutDotDisconnected {
330
+ background: var(--accent-red);
331
+ }
332
+
333
+ .aboutDotConnecting {
334
+ background: var(--accent-yellow);
335
+ animation: pulse 1.5s ease-in-out infinite;
336
+ }
@@ -0,0 +1,22 @@
1
+ @use '../../styles/mixins' as *;
2
+
3
+ .actionButtons {
4
+ display: flex;
5
+ align-items: center;
6
+ gap: var(--space-sm);
7
+ flex-shrink: 0;
8
+ }
9
+
10
+ .btnPrimary {
11
+ @include btn-primary;
12
+ }
13
+
14
+ .btnDanger {
15
+ @include btn-danger;
16
+ }
17
+
18
+ .btnGhost {
19
+ @include btn-ghost(var(--text-secondary));
20
+ padding: var(--space-xs) var(--space-md);
21
+ font-size: var(--font-size-sm);
22
+ }
@@ -0,0 +1,125 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { expect, fn, userEvent } from "@storybook/test";
3
+ import { TaskActionButtons } from "./TaskActionButtons.js";
4
+ import { makeTask } from "../../test-utils/storybook-helpers.js";
5
+
6
+ const meta: Meta<typeof TaskActionButtons> = {
7
+ title: "App/Panels/TaskActionButtons",
8
+ component: TaskActionButtons,
9
+ tags: ["autodocs"],
10
+ args: {
11
+ task: makeTask({ id: "t-1", status: "not_started" }),
12
+ sessionId: undefined,
13
+ isBlocked: false,
14
+ onStart: fn(),
15
+ onResume: fn(),
16
+ onStop: fn(),
17
+ onPause: fn(),
18
+ onDelete: fn(),
19
+ onEdit: fn(),
20
+ },
21
+ };
22
+
23
+ export default meta;
24
+ type Story = StoryObj<typeof TaskActionButtons>;
25
+
26
+ /** Not-started + unblocked shows Start, Edit, and Delete buttons. */
27
+ export const NotStartedUnblocked: Story = {
28
+ play: async ({ canvas }) => {
29
+ await expect(canvas.getByTestId("task-header-start")).toBeInTheDocument();
30
+ await expect(canvas.getByTestId("task-action-edit")).toBeInTheDocument();
31
+ await expect(canvas.getByTestId("task-action-delete")).toBeInTheDocument();
32
+ },
33
+ };
34
+
35
+ /** Not-started + blocked hides Start, shows Edit and Delete. */
36
+ export const NotStartedBlocked: Story = {
37
+ args: {
38
+ isBlocked: true,
39
+ },
40
+ play: async ({ canvas }) => {
41
+ await expect(canvas.queryByTestId("task-header-start")).toBeNull();
42
+ await expect(canvas.getByTestId("task-action-edit")).toBeInTheDocument();
43
+ await expect(canvas.getByTestId("task-action-delete")).toBeInTheDocument();
44
+ },
45
+ };
46
+
47
+ /** Working status shows Stop and Pause. */
48
+ export const Working: Story = {
49
+ args: {
50
+ task: makeTask({ id: "t-2", status: "working" }),
51
+ sessionId: "sess-1",
52
+ },
53
+ play: async ({ canvas }) => {
54
+ await expect(canvas.getByTestId("task-action-stop")).toBeInTheDocument();
55
+ await expect(canvas.getByTestId("task-action-pause")).toBeInTheDocument();
56
+ await expect(canvas.getByTestId("task-action-pause")).toBeEnabled();
57
+ },
58
+ };
59
+
60
+ /** Working without a session disables the Pause button. */
61
+ export const WorkingNoSession: Story = {
62
+ args: {
63
+ task: makeTask({ id: "t-3", status: "working" }),
64
+ sessionId: undefined,
65
+ },
66
+ play: async ({ canvas }) => {
67
+ await expect(canvas.getByTestId("task-action-stop")).toBeInTheDocument();
68
+ await expect(canvas.getByTestId("task-action-pause")).toBeDisabled();
69
+ },
70
+ };
71
+
72
+ /** Paused status shows Stop, Resume, and Delete. */
73
+ export const Paused: Story = {
74
+ args: {
75
+ task: makeTask({ id: "t-4", status: "paused" }),
76
+ },
77
+ play: async ({ canvas }) => {
78
+ await expect(canvas.getByTestId("task-action-stop")).toBeInTheDocument();
79
+ await expect(canvas.getByTestId("task-action-resume")).toBeInTheDocument();
80
+ await expect(canvas.getByTestId("task-action-delete")).toBeInTheDocument();
81
+ },
82
+ };
83
+
84
+ /** Complete status shows only Delete. */
85
+ export const Complete: Story = {
86
+ args: {
87
+ task: makeTask({ id: "t-5", status: "complete" }),
88
+ },
89
+ play: async ({ canvas }) => {
90
+ await expect(canvas.getByTestId("task-action-delete")).toBeInTheDocument();
91
+ await expect(canvas.queryByTestId("task-header-start")).toBeNull();
92
+ await expect(canvas.queryByTestId("task-action-stop")).toBeNull();
93
+ },
94
+ };
95
+
96
+ /** Failed status shows Retry and Delete. */
97
+ export const Failed: Story = {
98
+ args: {
99
+ task: makeTask({ id: "t-6", status: "failed" }),
100
+ },
101
+ play: async ({ canvas }) => {
102
+ await expect(canvas.getByTestId("task-header-start")).toBeInTheDocument();
103
+ await expect(canvas.getByTestId("task-action-delete")).toBeInTheDocument();
104
+ },
105
+ };
106
+
107
+ /** Clicking Start fires the onStart callback. */
108
+ export const ClickStart: Story = {
109
+ play: async ({ canvas, args }) => {
110
+ await userEvent.click(canvas.getByTestId("task-header-start"));
111
+ await expect(args.onStart).toHaveBeenCalledOnce();
112
+ },
113
+ };
114
+
115
+ /** Clicking Stop fires the onStop callback. */
116
+ export const ClickStop: Story = {
117
+ args: {
118
+ task: makeTask({ id: "t-7", status: "working" }),
119
+ sessionId: "sess-1",
120
+ },
121
+ play: async ({ canvas, args }) => {
122
+ await userEvent.click(canvas.getByTestId("task-action-stop"));
123
+ await expect(args.onStop).toHaveBeenCalledOnce();
124
+ },
125
+ };
@@ -0,0 +1,87 @@
1
+ import type { JSX } from "react";
2
+ import type { TaskData } from "../../hooks/types.js";
3
+ import styles from "./TaskActionButtons.module.scss";
4
+
5
+ /** Props for {@link TaskActionButtons}. */
6
+ export interface TaskActionButtonsProps {
7
+ /** The task whose status drives which buttons are shown. */
8
+ task: TaskData;
9
+ /** Active session id — required to enable the Pause button. */
10
+ sessionId: string | undefined;
11
+ /** Whether the task is blocked by incomplete dependencies. */
12
+ isBlocked: boolean;
13
+ /** Start (or retry) the task. */
14
+ onStart: () => void;
15
+ /** Resume a paused task. */
16
+ onResume: () => void;
17
+ /** Stop the task. */
18
+ onStop: () => void;
19
+ /** Pause the task by killing its session. */
20
+ onPause: () => void;
21
+ /** Request task deletion (typically opens a confirm dialog). */
22
+ onDelete: () => void;
23
+ /** Open the task editor. */
24
+ onEdit: () => void;
25
+ }
26
+
27
+ /**
28
+ * Renders status-appropriate action buttons for a task.
29
+ *
30
+ * Which buttons appear depends on `task.status` and `isBlocked`.
31
+ * Returns `undefined` for unrecognized statuses.
32
+ */
33
+ export function TaskActionButtons({
34
+ task, sessionId, isBlocked,
35
+ onStart, onResume, onStop, onPause, onDelete, onEdit,
36
+ }: TaskActionButtonsProps): JSX.Element | undefined {
37
+ if (task.status === "not_started") {
38
+ if (isBlocked) {
39
+ return (
40
+ <div className={styles.actionButtons} data-testid="task-action-buttons">
41
+ <button onClick={onEdit} className={styles.btnGhost} data-testid="task-action-edit">Edit</button>
42
+ <button onClick={onDelete} className={styles.btnDanger} data-testid="task-action-delete">Delete</button>
43
+ </div>
44
+ );
45
+ }
46
+ return (
47
+ <div className={styles.actionButtons} data-testid="task-action-buttons">
48
+ <button data-testid="task-header-start" onClick={onStart} className={styles.btnPrimary}>Start</button>
49
+ <button onClick={onEdit} className={styles.btnGhost} data-testid="task-action-edit">Edit</button>
50
+ <button onClick={onDelete} className={styles.btnDanger} data-testid="task-action-delete">Delete</button>
51
+ </div>
52
+ );
53
+ }
54
+ if (task.status === "working") {
55
+ return (
56
+ <div className={styles.actionButtons} data-testid="task-action-buttons">
57
+ <button onClick={onStop} className={styles.btnDanger} data-testid="task-action-stop">Stop</button>
58
+ <button onClick={onPause} disabled={!sessionId} className={styles.btnGhost} data-testid="task-action-pause">Pause</button>
59
+ </div>
60
+ );
61
+ }
62
+ if (task.status === "paused") {
63
+ return (
64
+ <div className={styles.actionButtons} data-testid="task-action-buttons">
65
+ <button onClick={onStop} className={styles.btnPrimary} data-testid="task-action-stop">Stop</button>
66
+ <button onClick={onResume} className={styles.btnGhost} data-testid="task-action-resume">Resume</button>
67
+ <button onClick={onDelete} className={styles.btnDanger} data-testid="task-action-delete">Delete</button>
68
+ </div>
69
+ );
70
+ }
71
+ if (task.status === "complete") {
72
+ return (
73
+ <div className={styles.actionButtons} data-testid="task-action-buttons">
74
+ <button onClick={onDelete} className={styles.btnDanger} data-testid="task-action-delete">Delete</button>
75
+ </div>
76
+ );
77
+ }
78
+ if (task.status === "failed") {
79
+ return (
80
+ <div className={styles.actionButtons} data-testid="task-action-buttons">
81
+ <button onClick={onStart} className={styles.btnPrimary} data-testid="task-header-start">Retry</button>
82
+ <button onClick={onDelete} className={styles.btnDanger} data-testid="task-action-delete">Delete</button>
83
+ </div>
84
+ );
85
+ }
86
+ return undefined;
87
+ }