@stigmer/react 3.1.2 → 3.1.4

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 (285) hide show
  1. package/composer/SessionComposer.d.ts +37 -5
  2. package/composer/SessionComposer.d.ts.map +1 -1
  3. package/composer/SessionComposer.js +13 -5
  4. package/composer/SessionComposer.js.map +1 -1
  5. package/execution/ArtifactApplyButton.d.ts +25 -0
  6. package/execution/ArtifactApplyButton.d.ts.map +1 -0
  7. package/execution/ArtifactApplyButton.js +21 -0
  8. package/execution/ArtifactApplyButton.js.map +1 -0
  9. package/execution/ArtifactContentBody.d.ts +36 -0
  10. package/execution/ArtifactContentBody.d.ts.map +1 -0
  11. package/execution/ArtifactContentBody.js +62 -0
  12. package/execution/ArtifactContentBody.js.map +1 -0
  13. package/execution/ArtifactDocument.d.ts +48 -0
  14. package/execution/ArtifactDocument.d.ts.map +1 -0
  15. package/execution/ArtifactDocument.js +89 -0
  16. package/execution/ArtifactDocument.js.map +1 -0
  17. package/execution/ArtifactPreviewModal.d.ts +9 -9
  18. package/execution/ArtifactPreviewModal.d.ts.map +1 -1
  19. package/execution/ArtifactPreviewModal.js +18 -145
  20. package/execution/ArtifactPreviewModal.js.map +1 -1
  21. package/execution/ArtifactRow.d.ts +49 -0
  22. package/execution/ArtifactRow.d.ts.map +1 -0
  23. package/execution/ArtifactRow.js +56 -0
  24. package/execution/ArtifactRow.js.map +1 -0
  25. package/execution/ArtifactsWidget.d.ts +6 -9
  26. package/execution/ArtifactsWidget.d.ts.map +1 -1
  27. package/execution/ArtifactsWidget.js +15 -19
  28. package/execution/ArtifactsWidget.js.map +1 -1
  29. package/execution/FileChangeProgressBar.d.ts +47 -0
  30. package/execution/FileChangeProgressBar.d.ts.map +1 -0
  31. package/execution/FileChangeProgressBar.js +49 -0
  32. package/execution/FileChangeProgressBar.js.map +1 -0
  33. package/execution/FileChangesView.d.ts.map +1 -1
  34. package/execution/FileChangesView.js +19 -4
  35. package/execution/FileChangesView.js.map +1 -1
  36. package/execution/FileReviewAtoms.d.ts +27 -0
  37. package/execution/FileReviewAtoms.d.ts.map +1 -0
  38. package/execution/FileReviewAtoms.js +64 -0
  39. package/execution/FileReviewAtoms.js.map +1 -0
  40. package/execution/FileReviewCard.d.ts +2 -2
  41. package/execution/FileReviewCard.d.ts.map +1 -1
  42. package/execution/FileReviewCard.js +32 -62
  43. package/execution/FileReviewCard.js.map +1 -1
  44. package/execution/MessageEntry.d.ts +0 -9
  45. package/execution/MessageEntry.d.ts.map +1 -1
  46. package/execution/MessageEntry.js +1 -11
  47. package/execution/MessageEntry.js.map +1 -1
  48. package/execution/MessageThread.d.ts +3 -4
  49. package/execution/MessageThread.d.ts.map +1 -1
  50. package/execution/MessageThread.js +25 -11
  51. package/execution/MessageThread.js.map +1 -1
  52. package/execution/PlanArtifactCard.d.ts +16 -10
  53. package/execution/PlanArtifactCard.d.ts.map +1 -1
  54. package/execution/PlanArtifactCard.js +31 -7
  55. package/execution/PlanArtifactCard.js.map +1 -1
  56. package/execution/PlanCompletionCard.d.ts +4 -4
  57. package/execution/PlanCompletionCard.d.ts.map +1 -1
  58. package/execution/PlanCompletionCard.js +4 -4
  59. package/execution/PlanCompletionCard.js.map +1 -1
  60. package/execution/PlanStreamingCard.d.ts +7 -2
  61. package/execution/PlanStreamingCard.d.ts.map +1 -1
  62. package/execution/PlanStreamingCard.js +11 -6
  63. package/execution/PlanStreamingCard.js.map +1 -1
  64. package/execution/index.d.ts +12 -2
  65. package/execution/index.d.ts.map +1 -1
  66. package/execution/index.js +6 -1
  67. package/execution/index.js.map +1 -1
  68. package/execution/use-build-from-plan-hotkey.d.ts +1 -1
  69. package/execution/use-build-from-plan-hotkey.js +1 -1
  70. package/execution/useArtifactContent.d.ts +6 -1
  71. package/execution/useArtifactContent.d.ts.map +1 -1
  72. package/execution/useArtifactContent.js +7 -2
  73. package/execution/useArtifactContent.js.map +1 -1
  74. package/execution/useArtifactCopy.d.ts +51 -0
  75. package/execution/useArtifactCopy.d.ts.map +1 -0
  76. package/execution/useArtifactCopy.js +75 -0
  77. package/execution/useArtifactCopy.js.map +1 -0
  78. package/execution/useArtifactDownload.d.ts.map +1 -1
  79. package/execution/useArtifactDownload.js +17 -5
  80. package/execution/useArtifactDownload.js.map +1 -1
  81. package/execution/useArtifactInspection.d.ts +85 -0
  82. package/execution/useArtifactInspection.d.ts.map +1 -0
  83. package/execution/useArtifactInspection.js +143 -0
  84. package/execution/useArtifactInspection.js.map +1 -0
  85. package/execution/useCreateAgentExecution.d.ts +16 -3
  86. package/execution/useCreateAgentExecution.d.ts.map +1 -1
  87. package/execution/useCreateAgentExecution.js +1 -0
  88. package/execution/useCreateAgentExecution.js.map +1 -1
  89. package/index.d.ts +4 -4
  90. package/index.d.ts.map +1 -1
  91. package/index.js +3 -3
  92. package/index.js.map +1 -1
  93. package/internal/MermaidDiagram.d.ts +47 -0
  94. package/internal/MermaidDiagram.d.ts.map +1 -0
  95. package/internal/MermaidDiagram.js +118 -0
  96. package/internal/MermaidDiagram.js.map +1 -0
  97. package/internal/file-tree/FileTreeNode.d.ts.map +1 -1
  98. package/internal/file-tree/FileTreeNode.js +2 -2
  99. package/internal/file-tree/FileTreeNode.js.map +1 -1
  100. package/internal/markdown-components.d.ts.map +1 -1
  101. package/internal/markdown-components.js +34 -0
  102. package/internal/markdown-components.js.map +1 -1
  103. package/internal/mermaid-loader.d.ts +26 -0
  104. package/internal/mermaid-loader.d.ts.map +1 -0
  105. package/internal/mermaid-loader.js +34 -0
  106. package/internal/mermaid-loader.js.map +1 -0
  107. package/internal/mermaid-theme-css.d.ts +41 -0
  108. package/internal/mermaid-theme-css.d.ts.map +1 -0
  109. package/internal/mermaid-theme-css.js +179 -0
  110. package/internal/mermaid-theme-css.js.map +1 -0
  111. package/internal/slug.d.ts +9 -5
  112. package/internal/slug.d.ts.map +1 -1
  113. package/internal/slug.js +10 -6
  114. package/internal/slug.js.map +1 -1
  115. package/library/detect-plan-artifact.d.ts +27 -9
  116. package/library/detect-plan-artifact.d.ts.map +1 -1
  117. package/library/detect-plan-artifact.js +26 -6
  118. package/library/detect-plan-artifact.js.map +1 -1
  119. package/library/index.d.ts +1 -1
  120. package/library/index.d.ts.map +1 -1
  121. package/library/index.js +1 -1
  122. package/library/index.js.map +1 -1
  123. package/package.json +5 -4
  124. package/session/PlanEditor.js +1 -1
  125. package/session/PlanEditor.js.map +1 -1
  126. package/session/SessionViewer.d.ts.map +1 -1
  127. package/session/SessionViewer.js +122 -30
  128. package/session/SessionViewer.js.map +1 -1
  129. package/session/artifact-document.d.ts +13 -0
  130. package/session/artifact-document.d.ts.map +1 -0
  131. package/session/artifact-document.js +22 -0
  132. package/session/artifact-document.js.map +1 -0
  133. package/session/facets/ArtifactsTab.d.ts +30 -4
  134. package/session/facets/ArtifactsTab.d.ts.map +1 -1
  135. package/session/facets/ArtifactsTab.js +32 -10
  136. package/session/facets/ArtifactsTab.js.map +1 -1
  137. package/session/index.d.ts +2 -1
  138. package/session/index.d.ts.map +1 -1
  139. package/session/index.js +4 -1
  140. package/session/index.js.map +1 -1
  141. package/session/plan-document.d.ts +14 -2
  142. package/session/plan-document.d.ts.map +1 -1
  143. package/session/plan-document.js +14 -3
  144. package/session/plan-document.js.map +1 -1
  145. package/session/usePlanDraft.d.ts +1 -1
  146. package/session/useSessionArtifacts.d.ts +17 -0
  147. package/session/useSessionArtifacts.d.ts.map +1 -1
  148. package/session/useSessionArtifacts.js +16 -5
  149. package/session/useSessionArtifacts.js.map +1 -1
  150. package/session/useSessionConversation.d.ts +26 -3
  151. package/session/useSessionConversation.d.ts.map +1 -1
  152. package/session/useSessionConversation.js +51 -6
  153. package/session/useSessionConversation.js.map +1 -1
  154. package/session/useSessionPageFlow.d.ts.map +1 -1
  155. package/session/useSessionPageFlow.js +1 -0
  156. package/session/useSessionPageFlow.js.map +1 -1
  157. package/session/useSessionPanel.d.ts +20 -0
  158. package/session/useSessionPanel.d.ts.map +1 -1
  159. package/session/useSessionPanel.js +13 -0
  160. package/session/useSessionPanel.js.map +1 -1
  161. package/session/useSessionRailViews.d.ts +13 -1
  162. package/session/useSessionRailViews.d.ts.map +1 -1
  163. package/session/useSessionRailViews.js +5 -3
  164. package/session/useSessionRailViews.js.map +1 -1
  165. package/src/composer/SessionComposer.tsx +76 -7
  166. package/src/composer/__tests__/SessionComposer-editing.test.tsx +128 -0
  167. package/src/execution/ArtifactApplyButton.tsx +79 -0
  168. package/src/execution/ArtifactContentBody.tsx +255 -0
  169. package/src/execution/ArtifactDocument.tsx +344 -0
  170. package/src/execution/ArtifactPreviewModal.tsx +49 -415
  171. package/src/execution/ArtifactRow.tsx +165 -0
  172. package/src/execution/ArtifactsWidget.tsx +24 -33
  173. package/src/execution/FileChangeProgressBar.tsx +121 -0
  174. package/src/execution/FileChangesView.tsx +18 -4
  175. package/src/execution/FileReviewAtoms.tsx +89 -0
  176. package/src/execution/FileReviewCard.tsx +57 -90
  177. package/src/execution/MessageEntry.tsx +0 -62
  178. package/src/execution/MessageThread.tsx +29 -15
  179. package/src/execution/PlanArtifactCard.tsx +130 -52
  180. package/src/execution/PlanCompletionCard.tsx +5 -5
  181. package/src/execution/PlanStreamingCard.tsx +15 -11
  182. package/src/execution/__tests__/ArtifactContentBody.test.tsx +131 -0
  183. package/src/execution/__tests__/ArtifactDocument.test.tsx +100 -0
  184. package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +6 -6
  185. package/src/execution/__tests__/ArtifactRow.test.tsx +139 -0
  186. package/src/execution/__tests__/ArtifactsWidget.test.tsx +78 -0
  187. package/src/execution/__tests__/FileChangeProgressBar.test.tsx +125 -0
  188. package/src/execution/__tests__/FileReviewCard.test.tsx +66 -7
  189. package/src/execution/__tests__/MessageThread.test.tsx +1 -1
  190. package/src/execution/__tests__/PlanArtifactCard.test.tsx +52 -18
  191. package/src/execution/__tests__/PlanCompletionCard.test.tsx +2 -2
  192. package/src/execution/__tests__/PlanStreamingCard.test.tsx +11 -4
  193. package/src/execution/__tests__/buildThreadItems-plan-completion.test.ts +104 -8
  194. package/src/execution/__tests__/message-entry.test.tsx +56 -39
  195. package/src/execution/__tests__/useArtifactCopy.test.tsx +90 -0
  196. package/src/execution/__tests__/useArtifactDownload.test.tsx +2 -0
  197. package/src/execution/__tests__/useArtifactInspection.test.tsx +151 -0
  198. package/src/execution/__tests__/useCreateAgentExecution.test.tsx +35 -0
  199. package/src/execution/index.ts +20 -2
  200. package/src/execution/use-build-from-plan-hotkey.ts +1 -1
  201. package/src/execution/useArtifactContent.ts +7 -0
  202. package/src/execution/useArtifactCopy.ts +109 -0
  203. package/src/execution/useArtifactDownload.ts +17 -5
  204. package/src/execution/useArtifactInspection.ts +252 -0
  205. package/src/execution/useCreateAgentExecution.ts +17 -3
  206. package/src/index.ts +17 -2
  207. package/src/internal/MermaidDiagram.tsx +164 -0
  208. package/src/internal/__tests__/a11y/mermaid-theme.a11y.test.tsx +122 -0
  209. package/src/internal/__tests__/markdown-components.test.tsx +93 -1
  210. package/src/internal/__tests__/mermaid-diagram.test.tsx +282 -0
  211. package/src/internal/file-tree/FileTreeNode.tsx +13 -2
  212. package/src/internal/markdown-components.tsx +36 -1
  213. package/src/internal/mermaid-loader.ts +44 -0
  214. package/src/internal/mermaid-theme-css.ts +178 -0
  215. package/src/internal/slug.ts +10 -6
  216. package/src/library/__tests__/detect-plan-artifact.test.ts +21 -0
  217. package/src/library/detect-plan-artifact.ts +32 -10
  218. package/src/library/index.ts +2 -0
  219. package/src/session/PlanEditor.tsx +1 -1
  220. package/src/session/SessionViewer.tsx +227 -51
  221. package/src/session/__tests__/PlanEditor.test.tsx +4 -4
  222. package/src/session/__tests__/PlanStreamingDocument.test.tsx +1 -1
  223. package/src/session/__tests__/SessionViewer-artifactTabs.test.tsx +210 -0
  224. package/src/session/__tests__/SessionViewer-editResubmit.test.tsx +233 -0
  225. package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +57 -0
  226. package/src/session/__tests__/useSessionArtifacts.test.ts +57 -0
  227. package/src/session/__tests__/useSessionConversation.test.tsx +216 -1
  228. package/src/session/__tests__/useSessionPanel.test.ts +70 -1
  229. package/src/session/artifact-document.ts +23 -0
  230. package/src/session/facets/ArtifactsTab.tsx +66 -18
  231. package/src/session/facets/__tests__/ArtifactsTab.test.tsx +111 -47
  232. package/src/session/index.ts +5 -1
  233. package/src/session/plan-document.ts +14 -3
  234. package/src/session/usePlanDraft.ts +1 -1
  235. package/src/session/useSessionArtifacts.ts +16 -5
  236. package/src/session/useSessionConversation.ts +80 -10
  237. package/src/session/useSessionPageFlow.ts +1 -0
  238. package/src/session/useSessionPanel.ts +41 -0
  239. package/src/session/useSessionRailViews.tsx +21 -1
  240. package/src/workspace/EditorTabs.tsx +38 -9
  241. package/src/workspace/ExplorerTree.tsx +10 -4
  242. package/src/workspace/FileViewer.tsx +27 -6
  243. package/src/workspace/WorkspaceContentSearch.tsx +44 -20
  244. package/src/workspace/WorkspaceEditor.tsx +19 -16
  245. package/src/workspace/WorkspaceFileSearch.tsx +51 -28
  246. package/src/workspace/WorkspaceSurface.tsx +106 -48
  247. package/src/workspace/__tests__/EditorTabs.test.tsx +4 -2
  248. package/src/workspace/__tests__/ExplorerTree.test.tsx +52 -0
  249. package/src/workspace/__tests__/FileViewer.test.tsx +18 -0
  250. package/src/workspace/__tests__/WorkspaceContentSearch.test.tsx +38 -5
  251. package/src/workspace/__tests__/WorkspaceEditor-initialPanel.test.tsx +19 -0
  252. package/src/workspace/__tests__/WorkspaceFileSearch.test.tsx +27 -6
  253. package/src/workspace/__tests__/WorkspaceSurface.test.tsx +70 -0
  254. package/src/workspace/__tests__/a11y/harness.tsx +140 -0
  255. package/src/workspace/__tests__/a11y/mock-capabilities.ts +138 -0
  256. package/src/workspace/__tests__/a11y/workspace-editor.a11y.test.tsx +65 -0
  257. package/src/workspace/__tests__/a11y/workspace-explorer-search.a11y.test.tsx +112 -0
  258. package/src/workspace/__tests__/a11y/workspace-viewer-tabs.a11y.test.tsx +69 -0
  259. package/styles.css +1 -1
  260. package/workspace/EditorTabs.d.ts +21 -3
  261. package/workspace/EditorTabs.d.ts.map +1 -1
  262. package/workspace/EditorTabs.js +18 -6
  263. package/workspace/EditorTabs.js.map +1 -1
  264. package/workspace/ExplorerTree.js +8 -4
  265. package/workspace/ExplorerTree.js.map +1 -1
  266. package/workspace/FileViewer.d.ts.map +1 -1
  267. package/workspace/FileViewer.js +19 -8
  268. package/workspace/FileViewer.js.map +1 -1
  269. package/workspace/WorkspaceContentSearch.d.ts.map +1 -1
  270. package/workspace/WorkspaceContentSearch.js +23 -2
  271. package/workspace/WorkspaceContentSearch.js.map +1 -1
  272. package/workspace/WorkspaceEditor.d.ts.map +1 -1
  273. package/workspace/WorkspaceEditor.js +8 -10
  274. package/workspace/WorkspaceEditor.js.map +1 -1
  275. package/workspace/WorkspaceFileSearch.d.ts.map +1 -1
  276. package/workspace/WorkspaceFileSearch.js +23 -3
  277. package/workspace/WorkspaceFileSearch.js.map +1 -1
  278. package/workspace/WorkspaceSurface.d.ts.map +1 -1
  279. package/workspace/WorkspaceSurface.js +54 -18
  280. package/workspace/WorkspaceSurface.js.map +1 -1
  281. package/execution/ArtifactCard.d.ts +0 -81
  282. package/execution/ArtifactCard.d.ts.map +0 -1
  283. package/execution/ArtifactCard.js +0 -130
  284. package/execution/ArtifactCard.js.map +0 -1
  285. package/src/execution/ArtifactCard.tsx +0 -320
@@ -33,19 +33,16 @@ export interface ArtifactsWidgetProps {
33
33
  * a file-explorer-like view of the conversation's output — no
34
34
  * execution/turn concepts are exposed.
35
35
  *
36
- * Composes {@link ArtifactCard} (summary + detection badges) with
37
- * {@link ArtifactPreviewModal} (full content review + Apply/Push CTA).
38
- * The card's "Preview" action opens the modal; the modal is the sole
39
- * location for Apply/Push actions (review-before-apply pattern).
36
+ * The panel-less counterpart of the session panel's Artifacts facet: it
37
+ * renders the same dense {@link ArtifactRow} list, but having no editor pane
38
+ * to open document tabs into a click opens the {@link ArtifactPreviewModal}
39
+ * (the review-before-apply popup, and the sole home of the Apply/Push CTA).
40
+ * This is the embeddable path a platform builder drops into their own sidebar.
40
41
  *
41
42
  * Returns `null` when the executions list is empty or no execution
42
43
  * has artifacts, matching the conditional-render pattern of
43
44
  * {@link ExecutionProgress} and {@link UsageWidget}.
44
45
  *
45
- * Renders without card chrome — each {@link ArtifactCard} provides its
46
- * own border and padding. The consumer controls the container styling
47
- * (or places the widget directly in a flex/grid layout).
48
- *
49
46
  * All visual properties flow through `--stgm-*` tokens.
50
47
  *
51
48
  * @example
@@ -62,7 +59,7 @@ export interface ArtifactsWidgetProps {
62
59
  * />
63
60
  * ```
64
61
  *
65
- * @see {@link ArtifactCard} — compact summary card per artifact
62
+ * @see {@link ArtifactRow} — the dense row rendered per artifact
66
63
  * @see {@link ArtifactPreviewModal} — full preview with Apply/Push CTA
67
64
  * @see {@link useSessionArtifacts} — headless session-level artifact aggregation hook
68
65
  * @see {@link useExecutionArtifacts} — headless single-execution artifact extraction hook
@@ -1 +1 @@
1
- {"version":3,"file":"ArtifactsWidget.d.ts","sourceRoot":"","sources":["../../src/execution/ArtifactsWidget.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAQlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC3D,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,GAAG,EACH,SAAS,EACT,SAAS,GACV,EAAE,oBAAoB,kDAkEtB"}
1
+ {"version":3,"file":"ArtifactsWidget.d.ts","sourceRoot":"","sources":["../../src/execution/ArtifactsWidget.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AASlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC3D,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,GAAG,EACH,SAAS,EACT,SAAS,GACV,EAAE,oBAAoB,kDA2DtB"}
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useMemo, useState } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
- import { useSessionArtifacts, } from "../session/useSessionArtifacts.js";
6
- import { ArtifactCard } from "./ArtifactCard.js";
5
+ import { useSessionArtifacts, artifactKey, } from "../session/useSessionArtifacts.js";
6
+ import { ArtifactRow } from "./ArtifactRow.js";
7
7
  import { ArtifactPreviewModal } from "./ArtifactPreviewModal.js";
8
8
  /**
9
9
  * Right-sidebar widget that surfaces all artifacts produced during a
@@ -14,19 +14,16 @@ import { ArtifactPreviewModal } from "./ArtifactPreviewModal.js";
14
14
  * a file-explorer-like view of the conversation's output — no
15
15
  * execution/turn concepts are exposed.
16
16
  *
17
- * Composes {@link ArtifactCard} (summary + detection badges) with
18
- * {@link ArtifactPreviewModal} (full content review + Apply/Push CTA).
19
- * The card's "Preview" action opens the modal; the modal is the sole
20
- * location for Apply/Push actions (review-before-apply pattern).
17
+ * The panel-less counterpart of the session panel's Artifacts facet: it
18
+ * renders the same dense {@link ArtifactRow} list, but having no editor pane
19
+ * to open document tabs into a click opens the {@link ArtifactPreviewModal}
20
+ * (the review-before-apply popup, and the sole home of the Apply/Push CTA).
21
+ * This is the embeddable path a platform builder drops into their own sidebar.
21
22
  *
22
23
  * Returns `null` when the executions list is empty or no execution
23
24
  * has artifacts, matching the conditional-render pattern of
24
25
  * {@link ExecutionProgress} and {@link UsageWidget}.
25
26
  *
26
- * Renders without card chrome — each {@link ArtifactCard} provides its
27
- * own border and padding. The consumer controls the container styling
28
- * (or places the widget directly in a flex/grid layout).
29
- *
30
27
  * All visual properties flow through `--stgm-*` tokens.
31
28
  *
32
29
  * @example
@@ -43,25 +40,24 @@ import { ArtifactPreviewModal } from "./ArtifactPreviewModal.js";
43
40
  * />
44
41
  * ```
45
42
  *
46
- * @see {@link ArtifactCard} — compact summary card per artifact
43
+ * @see {@link ArtifactRow} — the dense row rendered per artifact
47
44
  * @see {@link ArtifactPreviewModal} — full preview with Apply/Push CTA
48
45
  * @see {@link useSessionArtifacts} — headless session-level artifact aggregation hook
49
46
  * @see {@link useExecutionArtifacts} — headless single-execution artifact extraction hook
50
47
  */
51
48
  export function ArtifactsWidget({ executions, org, onApplied, className, }) {
52
49
  const { artifacts, hasArtifacts, artifactCount } = useSessionArtifacts(executions);
53
- // Store the dedup key (sandboxPath or name) instead of a snapshot of
54
- // the full entry. The actual entry is derived from the live artifacts
55
- // list on every render, so the preview modal always reflects the
56
- // latest artifact version even when a newer execution publishes an
57
- // updated artifact for the same path while the modal is open.
50
+ // Store the artifact identity (not a snapshot of the full entry). The entry is
51
+ // re-derived from the live artifacts list on every render, so the modal always
52
+ // reflects the latest artifact version even when a newer execution publishes
53
+ // an updated artifact for the same path while the modal is open.
58
54
  const [previewKey, setPreviewKey] = useState(null);
59
55
  const previewEntry = useMemo(() => previewKey !== null
60
- ? artifacts.find((e) => (e.artifact.sandboxPath || e.artifact.name) === previewKey) ?? null
56
+ ? artifacts.find((e) => artifactKey(e.artifact) === previewKey) ?? null
61
57
  : null, [previewKey, artifacts]);
62
- const handlePreview = useCallback((entry) => setPreviewKey(entry.artifact.sandboxPath || entry.artifact.name), []);
58
+ const handleOpen = useCallback((entry) => setPreviewKey(artifactKey(entry.artifact)), []);
63
59
  if (!hasArtifacts)
64
60
  return null;
65
- return (_jsxs("section", { "aria-label": "Artifacts", className: cn(className), children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx("h3", { className: "text-sm font-medium text-foreground", children: "Artifacts" }), _jsx("span", { className: "inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-muted px-1.5 text-xs tabular-nums text-muted-foreground", children: artifactCount })] }), _jsx("div", { role: "list", className: "space-y-2", children: artifacts.map((entry) => (_jsx("div", { role: "listitem", children: _jsx(ArtifactCard, { artifact: entry.artifact, executionId: entry.executionId, org: org, hasNameCollision: entry.hasNameCollision, onPreview: () => handlePreview(entry) }) }, entry.artifact.storageKey))) }), previewEntry && (_jsx(ArtifactPreviewModal, { artifact: previewEntry.artifact, executionId: previewEntry.executionId, org: org, isTerminal: previewEntry.isTerminal, open: true, onClose: () => setPreviewKey(null), onApplied: onApplied }))] }));
61
+ return (_jsxs("section", { "aria-label": "Artifacts", className: cn(className), children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx("h3", { className: "text-sm font-medium text-foreground", children: "Artifacts" }), _jsx("span", { className: "inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-muted px-1.5 text-xs tabular-nums text-muted-foreground", children: artifactCount })] }), _jsx("ul", { role: "list", className: "flex flex-col", children: artifacts.map((entry) => (_jsx(ArtifactRow, { artifact: entry.artifact, executionId: entry.executionId, hasNameCollision: entry.hasNameCollision, onOpen: () => handleOpen(entry) }, artifactKey(entry.artifact)))) }), previewEntry && (_jsx(ArtifactPreviewModal, { artifact: previewEntry.artifact, executionId: previewEntry.executionId, org: org, isTerminal: previewEntry.isTerminal, open: true, onClose: () => setPreviewKey(null), onApplied: onApplied }))] }));
66
62
  }
67
63
  //# sourceMappingURL=ArtifactsWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArtifactsWidget.js","sourceRoot":"","sources":["../../src/execution/ArtifactsWidget.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACL,mBAAmB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AA4BjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,GAAG,EACH,SAAS,EACT,SAAS,GACY;IACrB,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,GAC9C,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAElC,qEAAqE;IACrE,uEAAuE;IACvE,iEAAiE;IACjE,qEAAqE;IACrE,8DAA8D;IAC9D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElE,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CACH,UAAU,KAAK,IAAI;QACjB,CAAC,CAAC,SAAS,CAAC,IAAI,CACZ,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC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EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAC3E,EAAE,CACH,CAAC;IAEF,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAE/B,OAAO,CACL,iCAAoB,WAAW,EAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,aACtD,eAAK,SAAS,EAAC,8BAA8B,aAC3C,aAAI,SAAS,EAAC,qCAAqC,0BAAe,EAClE,eAAM,SAAS,EAAC,iIAAiI,YAC9I,aAAa,GACT,IACH,EAEN,aAAI,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,eAAe,YACtC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACxB,KAAC,WAAW,IAEV,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAJ1B,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAKhC,CACH,CAAC,GACC,EAEJ,YAAY,IAAI,CACf,KAAC,oBAAoB,IACnB,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,WAAW,EAAE,YAAY,CAAC,WAAW,EACrC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,YAAY,CAAC,UAAU,EACnC,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,SAAS,EAAE,SAAS,GACpB,CACH,IACO,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { FileChangeProgress } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
2
+ /** Props for {@link FileChangeProgressBar}. */
3
+ export interface FileChangeProgressBarProps {
4
+ /**
5
+ * The transient mid-run progress snapshot for the active turn (DD-32). Feed
6
+ * this from `useSessionConversation().fileChangeProgress`. Renders nothing when
7
+ * undefined or when no files have changed yet — the server clears it once the
8
+ * turn's change set leaves CAPTURING, so the bar disappears exactly when the
9
+ * decision surface ({@link FileReviewDock}) takes over.
10
+ */
11
+ readonly progress: FileChangeProgress | undefined;
12
+ /** Additional CSS class names for the root container. */
13
+ readonly className?: string;
14
+ }
15
+ /**
16
+ * The live "N files changed so far" strip for a turn that is still running.
17
+ *
18
+ * WHY IT EXISTS. The transcript streams per-edit tool rows, but a change made by
19
+ * a shell command (a `sed`, a build step) has no tool row, and there is no
20
+ * running net-of-many-edits rollup until the turn ends. This bar fills that gap:
21
+ * a compact, NON-INTERACTIVE count of the workspace delta accumulating during
22
+ * the turn, pinned above the composer where the {@link FileReviewDock} will later
23
+ * appear. The two are mutually exclusive per turn (progress shows while CAPTURING;
24
+ * the dock shows once AWAITING_REVIEW), so the bar hands off cleanly to the dock.
25
+ *
26
+ * NEVER A DECISION SURFACE. Progress is non-authoritative and carries no file
27
+ * bodies — it is never reviewable or decidable. The reviewed diff is the
28
+ * turn-boundary candidate ({@link FileReviewDock} / the stamped transcript rows).
29
+ * A secret-like path is surfaced by name with its counts withheld (zeroed), so
30
+ * `FileLineStats` renders nothing for it.
31
+ *
32
+ * A11Y. Only the summary count is an `aria-live` region — the per-file list is
33
+ * not — so a screen reader hears "3 files changing" as the count moves, not a
34
+ * per-file barrage on every ~2s refresh.
35
+ *
36
+ * Purely presentational (headless-first, DD-003): the data lives in
37
+ * `useSessionConversation().fileChangeProgress`. `SessionViewer` mounts it above
38
+ * the dock by default.
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * const conv = useSessionConversation(sessionId);
43
+ * <FileChangeProgressBar progress={conv.fileChangeProgress} />
44
+ * ```
45
+ */
46
+ export declare const FileChangeProgressBar: import("react").NamedExoticComponent<FileChangeProgressBarProps>;
47
+ //# sourceMappingURL=FileChangeProgressBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileChangeProgressBar.d.ts","sourceRoot":"","sources":["../../src/execution/FileChangeProgressBar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oEAAoE,CAAC;AAK7G,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAClD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,qBAAqB,kEAmEhC,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { memo, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { FileKindBadge, FileLineStats } from "./FileReviewAtoms.js";
6
+ import { FilePathLink } from "./FilePathLink.js";
7
+ /**
8
+ * The live "N files changed so far" strip for a turn that is still running.
9
+ *
10
+ * WHY IT EXISTS. The transcript streams per-edit tool rows, but a change made by
11
+ * a shell command (a `sed`, a build step) has no tool row, and there is no
12
+ * running net-of-many-edits rollup until the turn ends. This bar fills that gap:
13
+ * a compact, NON-INTERACTIVE count of the workspace delta accumulating during
14
+ * the turn, pinned above the composer where the {@link FileReviewDock} will later
15
+ * appear. The two are mutually exclusive per turn (progress shows while CAPTURING;
16
+ * the dock shows once AWAITING_REVIEW), so the bar hands off cleanly to the dock.
17
+ *
18
+ * NEVER A DECISION SURFACE. Progress is non-authoritative and carries no file
19
+ * bodies — it is never reviewable or decidable. The reviewed diff is the
20
+ * turn-boundary candidate ({@link FileReviewDock} / the stamped transcript rows).
21
+ * A secret-like path is surfaced by name with its counts withheld (zeroed), so
22
+ * `FileLineStats` renders nothing for it.
23
+ *
24
+ * A11Y. Only the summary count is an `aria-live` region — the per-file list is
25
+ * not — so a screen reader hears "3 files changing" as the count moves, not a
26
+ * per-file barrage on every ~2s refresh.
27
+ *
28
+ * Purely presentational (headless-first, DD-003): the data lives in
29
+ * `useSessionConversation().fileChangeProgress`. `SessionViewer` mounts it above
30
+ * the dock by default.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * const conv = useSessionConversation(sessionId);
35
+ * <FileChangeProgressBar progress={conv.fileChangeProgress} />
36
+ * ```
37
+ */
38
+ export const FileChangeProgressBar = memo(function FileChangeProgressBar({ progress, className, }) {
39
+ const [expanded, setExpanded] = useState(false);
40
+ if (!progress || progress.filesChanged === 0)
41
+ return null;
42
+ const { filesChanged, linesAdded, linesRemoved, entries } = progress;
43
+ const hiddenCount = filesChanged - entries.length;
44
+ return (_jsxs("div", { role: "region", "aria-label": "File changes in progress", "data-cursor-target": "file-change-progress-bar", className: cn("border-t border-border-muted px-4 py-2", className), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("button", { type: "button", onClick: () => setExpanded((prev) => !prev), "aria-expanded": expanded, className: "flex min-w-0 flex-1 items-center gap-2 text-left text-xs text-muted-foreground hover:text-foreground", children: [_jsx("span", { "aria-hidden": "true", className: cn("shrink-0 transition-transform", expanded && "rotate-90"), children: "\u25B8" }), _jsxs("span", { "aria-live": "polite", className: "min-w-0 truncate", children: [filesChanged, " ", filesChanged === 1 ? "file" : "files", " changing\u2026"] })] }), _jsx(FileLineStats, { linesAdded: linesAdded, linesRemoved: linesRemoved })] }), expanded && (_jsxs("ul", { className: "mt-2 max-h-[30vh] space-y-1 overflow-y-auto", children: [entries.map((entry) => {
45
+ const path = entry.pathAfter || entry.pathBefore;
46
+ return (_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(FileKindBadge, { kind: entry.kind }), _jsx(FilePathLink, { path: path, dirDisplay: "dim", className: "min-w-0 flex-1 text-xs" }), _jsx(FileLineStats, { linesAdded: entry.linesAdded, linesRemoved: entry.linesRemoved })] }, path));
47
+ }), hiddenCount > 0 && (_jsxs("li", { className: "text-xs text-muted-foreground-faint", children: ["\u2026 and ", hiddenCount, " more"] }))] }))] }));
48
+ });
49
+ //# sourceMappingURL=FileChangeProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileChangeProgressBar.js","sourceRoot":"","sources":["../../src/execution/FileChangeProgressBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,SAAS,qBAAqB,CAAC,EACvE,QAAQ,EACR,SAAS,GACkB;IAC3B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE1D,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;IACrE,MAAM,WAAW,GAAG,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAElD,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,gBACF,0BAA0B,wBAClB,0BAA0B,EAC7C,SAAS,EAAE,EAAE,CAAC,wCAAwC,EAAE,SAAS,CAAC,aAElE,eAAK,SAAS,EAAC,yBAAyB,aACtC,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,mBAC5B,QAAQ,EACvB,SAAS,EAAC,sGAAsG,aAEhH,8BACc,MA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mB;IAClC,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,SAAS,EACT,aAAa,EACb,OAAe,EACf,YAAmB,EACnB,SAAgB,GACjB,EAAE,mBAAmB,2CA+DrB"}
@@ -65,7 +65,14 @@ export function FileChangeDiff({ change, className, bodyClassName, bounded = fal
65
65
  if (change.captureLevel === FileChangeCaptureLevel.HUNK_ONLY) {
66
66
  return { additions: change.linesAdded, deletions: change.linesRemoved };
67
67
  }
68
- return countHunks(hunks);
68
+ // Whole-file: count the rendered hunks (what the user actually sees). When
69
+ // there are none to count — the body is offloaded/loading/truncated — fall
70
+ // back to the capture-time counts, which are computed with the same diff
71
+ // algorithm and so agree with the hunks whenever both exist.
72
+ const computed = countHunks(hunks);
73
+ if (computed.additions > 0 || computed.deletions > 0)
74
+ return computed;
75
+ return { additions: change.linesAdded, deletions: change.linesRemoved };
69
76
  }, [change.captureLevel, change.linesAdded, change.linesRemoved, hunks]);
70
77
  const showStatsRow = showStats && (stats.additions > 0 || stats.deletions > 0);
71
78
  return (_jsxs("div", { className: cn("flex flex-col gap-1.5", className), "data-cursor-target": "file-diff", children: [(showFileName || showStatsRow) && (_jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [showFileName &&
@@ -128,8 +135,11 @@ function countHunks(hunks) {
128
135
  * Projects a {@link FileChange} into a {@link FileDiffEntry} for the file list.
129
136
  *
130
137
  * Counts: hunk-only uses the runner's authoritative numbers; whole-file inline
131
- * is derived from the content; an offloaded whole-file side has no synchronous
132
- * content, so its count stays 0 until the file is opened and fetched.
138
+ * is derived from the content (identical to the runner's capture-time counts by
139
+ * construction same diff algorithm). A whole-file side with no synchronous
140
+ * content (offloaded / binary) falls back to the runner's capture-time
141
+ * `linesAdded`/`linesRemoved` — zero when no count exists, which the list
142
+ * renders as no stat.
133
143
  */
134
144
  function toFileDiffEntry(change) {
135
145
  const changeType = change.changeType === FileChangeType.CREATE
@@ -151,7 +161,12 @@ function toFileDiffEntry(change) {
151
161
  const { additions, deletions } = countHunks(computeDiff(before, after));
152
162
  return { path: change.path, changeType, additions, deletions };
153
163
  }
154
- return { path: change.path, changeType, additions: 0, deletions: 0 };
164
+ return {
165
+ path: change.path,
166
+ changeType,
167
+ additions: change.linesAdded,
168
+ deletions: change.linesRemoved,
169
+ };
155
170
  }
156
171
  /** Inline text of a side, or null when absent/offloaded/binary. */
157
172
  function inlineSide(side) {
@@ -1 +1 @@
1
- {"version":3,"file":"FileChangesView.js","sourceRoot":"","sources":["../../src/execution/FileChangesView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,sBAAsB,EACtB,cAAc,GACf,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,eAAe,E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AM,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACtC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QACxE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IACjE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,UAAU;QACV,SAAS,EAAE,MAAM,CAAC,UAAU;QAC5B,SAAS,EAAE,MAAM,CAAC,YAAY;KAC/B,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,SAAS,UAAU,CACjB,IAA0B;IAE1B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { FileChangeKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
2
+ /**
3
+ * Shared presentational atoms for the file-review surfaces — the single source
4
+ * for the `+N −M` stat and the change-kind marker, so the review card, the
5
+ * compact list, and the mid-run progress bar can never drift in how they render
6
+ * a file's magnitude or kind.
7
+ */
8
+ /**
9
+ * The `+N −M` stat for one file (or a whole set), in the same visual vocabulary
10
+ * as the tool-row diff stats. Renders nothing when both counts are zero — the
11
+ * honest signal that no count exists (binary or secret-withheld changes, records
12
+ * captured before counts were stamped) — rather than a misleading `+0 −0`.
13
+ */
14
+ export declare function FileLineStats({ linesAdded, linesRemoved, }: {
15
+ readonly linesAdded: number;
16
+ readonly linesRemoved: number;
17
+ }): import("react/jsx-runtime").JSX.Element | null;
18
+ /**
19
+ * The single-letter change-kind marker — the same M/A/D visual vocabulary as
20
+ * the version-history `DiffFileList`, extended with R for captured renames.
21
+ * The letter itself is the non-color channel; the full word is exposed to
22
+ * assistive tech. An UNSPECIFIED kind renders nothing rather than guessing.
23
+ */
24
+ export declare function FileKindBadge({ kind }: {
25
+ kind: FileChangeKind;
26
+ }): import("react/jsx-runtime").JSX.Element | null;
27
+ //# sourceMappingURL=FileReviewAtoms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReviewAtoms.d.ts","sourceRoot":"","sources":["../../src/execution/FileReviewAtoms.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAG9F;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,YAAY,GACb,EAAE;IACD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,kDAYA;AAmCD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,kDAW/D"}
@@ -0,0 +1,64 @@
1
+ "use client";
2
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
+ import { FileChangeKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
4
+ import { cn } from "@stigmer/theme";
5
+ /**
6
+ * Shared presentational atoms for the file-review surfaces — the single source
7
+ * for the `+N −M` stat and the change-kind marker, so the review card, the
8
+ * compact list, and the mid-run progress bar can never drift in how they render
9
+ * a file's magnitude or kind.
10
+ */
11
+ /**
12
+ * The `+N −M` stat for one file (or a whole set), in the same visual vocabulary
13
+ * as the tool-row diff stats. Renders nothing when both counts are zero — the
14
+ * honest signal that no count exists (binary or secret-withheld changes, records
15
+ * captured before counts were stamped) — rather than a misleading `+0 −0`.
16
+ */
17
+ export function FileLineStats({ linesAdded, linesRemoved, }) {
18
+ if (linesAdded === 0 && linesRemoved === 0)
19
+ return null;
20
+ return (_jsxs("span", { className: "shrink-0 text-xs tabular-nums", "aria-label": `${linesAdded} added, ${linesRemoved} removed`, "data-cursor-target": "file-review-line-stats", children: [_jsxs("span", { className: "text-diff-added-fg", children: ["+", linesAdded] }), " ", _jsxs("span", { className: "text-diff-removed-fg", children: ["-", linesRemoved] })] }));
21
+ }
22
+ /** The kind letter, tone, and a11y name for each wire {@link FileChangeKind}. */
23
+ const KIND_BADGE = {
24
+ [FileChangeKind.ADD]: {
25
+ letter: "A",
26
+ colorClass: "text-diff-added-fg",
27
+ label: "added",
28
+ },
29
+ [FileChangeKind.MODIFY]: {
30
+ letter: "M",
31
+ colorClass: "text-diff-hunk-header-fg",
32
+ label: "modified",
33
+ },
34
+ [FileChangeKind.DELETE]: {
35
+ letter: "D",
36
+ colorClass: "text-diff-removed-fg",
37
+ label: "deleted",
38
+ },
39
+ [FileChangeKind.RENAME]: {
40
+ letter: "R",
41
+ colorClass: "text-diff-hunk-header-fg",
42
+ label: "renamed",
43
+ },
44
+ // A binary change is a modification whose diff is not text; the letter stays
45
+ // M and the binary-ness is told by the row's "Keep anyway" + reason note.
46
+ [FileChangeKind.BINARY_CHANGE]: {
47
+ letter: "M",
48
+ colorClass: "text-diff-hunk-header-fg",
49
+ label: "modified (binary)",
50
+ },
51
+ };
52
+ /**
53
+ * The single-letter change-kind marker — the same M/A/D visual vocabulary as
54
+ * the version-history `DiffFileList`, extended with R for captured renames.
55
+ * The letter itself is the non-color channel; the full word is exposed to
56
+ * assistive tech. An UNSPECIFIED kind renders nothing rather than guessing.
57
+ */
58
+ export function FileKindBadge({ kind }) {
59
+ const badge = KIND_BADGE[kind];
60
+ if (!badge)
61
+ return null;
62
+ return (_jsx("span", { className: cn("shrink-0 font-mono text-[10px] font-bold", badge.colorClass), "aria-label": badge.label, children: badge.letter }));
63
+ }
64
+ //# sourceMappingURL=FileReviewAtoms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReviewAtoms.js","sourceRoot":"","sources":["../../src/execution/FileReviewAtoms.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,UAAU,EACV,YAAY,GAIb;IACC,IAAI,UAAU,KAAK,CAAC,IAAI,YAAY,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,CACL,gBACE,SAAS,EAAC,+BAA+B,gBAC7B,GAAG,UAAU,WAAW,YAAY,UAAU,wBACvC,wBAAwB,aAE3C,gBAAM,SAAS,EAAC,oBAAoB,kBAAG,UAAU,IAAQ,EAAC,GAAG,EAC7D,gBAAM,SAAS,EAAC,sBAAsB,kBAAG,YAAY,IAAQ,IACxD,CACR,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,GAEZ;IACF,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,oBAAoB;QAChC,KAAK,EAAE,OAAO;KACf;IACD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,0BAA0B;QACtC,KAAK,EAAE,UAAU;KAClB;IACD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,sBAAsB;QAClC,KAAK,EAAE,SAAS;KACjB;IACD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,0BAA0B;QACtC,KAAK,EAAE,SAAS;KACjB;IACD,6EAA6E;IAC7E,0EAA0E;IAC1E,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE;QAC9B,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,0BAA0B;QACtC,KAAK,EAAE,mBAAmB;KAC3B;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAA4B;IAC9D,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CAAC,0CAA0C,EAAE,KAAK,CAAC,UAAU,CAAC,gBAC/D,KAAK,CAAC,KAAK,YAEtB,KAAK,CAAC,MAAM,GACR,CACR,CAAC;AACJ,CAAC"}
@@ -29,8 +29,8 @@ export interface FileReviewCardProps {
29
29
  *
30
30
  * `MessageThread` passes `false`: the transcript's stamped edit rows already
31
31
  * show every diff in place, so the expanded body collapses to a compact file
32
- * list (kind letter + path + per-file controls) and the card stays purely
33
- * the decision surface. Decision semantics — digests, scopes,
32
+ * list (kind letter + linked path + `+N −M` + per-file controls) and the card
33
+ * stays purely the decision surface. Decision semantics — digests, scopes,
34
34
  * acknowledgments — are identical in both modes; this is presentation only
35
35
  * (opt-in with a backward-compatible default, DD-011).
36
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"FileReviewCard.d.ts","sourceRoot":"","sources":["../../src/execution/FileReviewCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EAGL,kBAAkB,EAGnB,MAAM,8DAA8D,CAAC;AAQtE,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAc/E,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,wEAAw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,OAAO,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtD;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACrD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,cAAc,2DA0UzB,CAAC"}
@@ -1,14 +1,15 @@
1
1
  "use client";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { memo, useCallback, useEffect, useId, useMemo, useState } from "react";
4
4
  import { FileCaptureClass, FileChangeKind, FileDecisionAction, FileDecisionOrigin, FileDecisionScope, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
5
5
  import { toDisplayFileChange } from "@stigmer/sdk";
6
6
  import { cn } from "@stigmer/theme";
7
7
  import { FileChangeDiff } from "./FileChangesView.js";
8
+ import { FileKindBadge, FileLineStats } from "./FileReviewAtoms.js";
9
+ import { FilePathLink } from "./FilePathLink.js";
8
10
  import { DiffSummary } from "../version-history/DiffSummary.js";
9
11
  import { DecisionButton } from "../internal/DecisionButton.js";
10
12
  import { InCardDecisionError } from "../internal/InCardDecisionError.js";
11
- import { splitDisplayPath } from "./file-path-resolver.js";
12
13
  import { fileDecisionKey } from "./useFileReview.js";
13
14
  import { changeSetReviewability, deriveEffectiveVerdicts, fileReviewability, } from "./file-review-status.js";
14
15
  /** A stable empty set so the default `submittingDecisionKeys` keeps a constant ref. */
@@ -101,10 +102,16 @@ export const FileReviewCard = memo(function FileReviewCard({ fileChangeSet, onSu
101
102
  const showBulkControls = total > 1 || !incomplete;
102
103
  // The bar starts expanded exactly when the collapsed bar cannot honestly carry
103
104
  // the decision: an incomplete set (binary acknowledgment / blocked files need
104
- // their per-file context) or a review already in progress. A complete set and
105
- // a settled record start collapsed the transcript's stamped rows already
106
- // show what changed, and the expander reveals the per-file detail on demand.
107
- const [expanded, setExpanded] = useState(() => interactive && (incomplete || decidedCount > 0));
105
+ // their per-file context), a review already in progress, or a multi-file set
106
+ // in compact-list mode its honest decision surface includes the per-file
107
+ // Keep/Discard controls, which must be visible without hunting behind the
108
+ // expander (the docked strip bounds the height, so expanding is cheap there).
109
+ // Diff-rich mode (`showDiffs`) deliberately stays collapsed for a complete
110
+ // multi-file set: its expanded body is every full diff with no height cap
111
+ // (the workflow file-review list), where "Review" is the act of opening it.
112
+ // A settled record always starts collapsed — the transcript's stamped rows
113
+ // already show what changed, and the expander reveals detail on demand.
114
+ const [expanded, setExpanded] = useState(() => interactive && (incomplete || decidedCount > 0 || (total > 1 && !showDiffs)));
108
115
  const bodyId = useId();
109
116
  const wholeSetSubmitting = submittingDecisionKeys.has(setId);
110
117
  const wholeSetError = decisionErrors.get(setId) ?? null;
@@ -145,14 +152,18 @@ export const FileReviewCard = memo(function FileReviewCard({ fileChangeSet, onSu
145
152
  fileReviewability(change).kind === "binary",
146
153
  });
147
154
  }, [onSubmit]);
155
+ // The set's aggregate `+N −M`, summed from the capture-time per-file counts
156
+ // (linesAdded/linesRemoved are stamped by the runner with the same diff
157
+ // algorithm the renderers use — see CapturedFileChange). A file with no
158
+ // counts (binary, secret-withheld, or a record predating the fields)
159
+ // contributes zero; when NO file has counts the aggregate is hidden rather
160
+ // than shown as a dishonest "+0 −0".
148
161
  const totals = useMemo(() => {
149
162
  let additions = 0;
150
163
  let deletions = 0;
151
164
  for (const c of changes) {
152
- if (c.kind === FileChangeKind.ADD)
153
- additions += 1;
154
- else if (c.kind === FileChangeKind.DELETE)
155
- deletions += 1;
165
+ additions += c.linesAdded;
166
+ deletions += c.linesRemoved;
156
167
  }
157
168
  return { additions, deletions };
158
169
  }, [changes]);
@@ -189,7 +200,7 @@ export const FileReviewCard = memo(function FileReviewCard({ fileChangeSet, onSu
189
200
  // historical record, so a neutral group without the warning accent.
190
201
  role: interactive ? "alert" : "group", "aria-label": interactive
191
202
  ? `Review ${total} file change${total === 1 ? "" : "s"}`
192
- : `${total} file change${total === 1 ? "" : "s"}`, className: cn("rounded-lg border border-border-prominent", interactive && "border-l-2 border-l-warning", className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 px-2.5 py-1.5 text-xs", children: [_jsx("span", { className: "shrink-0 font-medium text-foreground", children: interactive ? "Review file changes" : "File changes" }), _jsx("span", { className: "min-w-0 flex-1 truncate text-muted-foreground", children: summary }), interactive && showBulkControls && (_jsxs(_Fragment, { children: [_jsx(DecisionButton, { label: labels.approve, variant: "primary", onClick: () => handleBulk(FileDecisionAction.APPROVE), isActive: activeAction === FileDecisionAction.APPROVE, isSubmitting: wholeSetSubmitting, disabled: incomplete && !binaryOnly, ariaDescribedby: incomplete ? incompleteNoticeId : undefined, cursorTarget: "file-review-approve" }), _jsx(DecisionButton, { label: labels.reject, variant: "danger", onClick: () => handleBulk(FileDecisionAction.REJECT), isActive: activeAction === FileDecisionAction.REJECT, isSubmitting: wholeSetSubmitting, cursorTarget: "file-review-reject" })] })), _jsxs("button", { type: "button", "aria-expanded": expanded, "aria-controls": bodyId, onClick: () => setExpanded((v) => !v), "data-cursor-target": "file-review-expander", className: cn("inline-flex shrink-0 items-center gap-1 rounded-md border border-border px-2 py-1", "text-xs font-medium text-muted-foreground transition-colors", "hover:bg-accent-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: [expanded ? "Hide" : !interactive ? "Show" : showDiffs ? "Review" : "Files", _jsx(ExpanderChevron, { expanded: expanded })] })] }), interactive && incomplete && showBulkControls && (_jsx("p", { id: incompleteNoticeId, className: "px-2.5 pb-1.5 text-[11px] italic text-muted-foreground", children: incompleteNotice(showPerFile, blockSummary, binaryOnly) })), interactive && wholeSetError && (_jsx("div", { className: "px-2.5 pb-1.5", children: _jsx(InCardDecisionError, { error: wholeSetError, leadIn: "submit decision", cursorTarget: "file-review-error" }) })), expanded && (_jsxs("div", { id: bodyId, className: "space-y-2 border-t border-border-muted px-3 py-2.5", children: [showDiffs && (_jsx(DiffSummary, { fileCount: total, additions: totals.additions, deletions: totals.deletions })), !interactive
203
+ : `${total} file change${total === 1 ? "" : "s"}`, className: cn("rounded-lg border border-border-prominent", interactive && "border-l-2 border-l-warning", className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 px-2.5 py-1.5 text-xs", children: [_jsx("span", { className: "shrink-0 font-medium text-foreground", children: interactive ? "Review file changes" : "File changes" }), _jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { className: "min-w-0 truncate text-muted-foreground", children: summary }), _jsx(FileLineStats, { linesAdded: totals.additions, linesRemoved: totals.deletions })] }), interactive && showBulkControls && (_jsxs(_Fragment, { children: [_jsx(DecisionButton, { label: labels.approve, variant: "primary", onClick: () => handleBulk(FileDecisionAction.APPROVE), isActive: activeAction === FileDecisionAction.APPROVE, isSubmitting: wholeSetSubmitting, disabled: incomplete && !binaryOnly, ariaDescribedby: incomplete ? incompleteNoticeId : undefined, cursorTarget: "file-review-approve" }), _jsx(DecisionButton, { label: labels.reject, variant: "danger", onClick: () => handleBulk(FileDecisionAction.REJECT), isActive: activeAction === FileDecisionAction.REJECT, isSubmitting: wholeSetSubmitting, cursorTarget: "file-review-reject" })] })), _jsxs("button", { type: "button", "aria-expanded": expanded, "aria-controls": bodyId, onClick: () => setExpanded((v) => !v), "data-cursor-target": "file-review-expander", className: cn("inline-flex shrink-0 items-center gap-1 rounded-md border border-border px-2 py-1", "text-xs font-medium text-muted-foreground transition-colors", "hover:bg-accent-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: [expanded ? "Hide" : !interactive ? "Show" : showDiffs ? "Review" : "Files", _jsx(ExpanderChevron, { expanded: expanded })] })] }), interactive && incomplete && showBulkControls && (_jsx("p", { id: incompleteNoticeId, className: "px-2.5 pb-1.5 text-[11px] italic text-muted-foreground", children: incompleteNotice(showPerFile, blockSummary, binaryOnly) })), interactive && wholeSetError && (_jsx("div", { className: "px-2.5 pb-1.5", children: _jsx(InCardDecisionError, { error: wholeSetError, leadIn: "submit decision", cursorTarget: "file-review-error" }) })), expanded && (_jsxs("div", { id: bodyId, className: "space-y-2 border-t border-border-muted px-3 py-2.5", children: [showDiffs && (_jsx(DiffSummary, { fileCount: total, additions: totals.additions, deletions: totals.deletions })), !interactive
193
204
  ? // Settled: every file paired with its committed EFFECTIVE
194
205
  // verdict (a bulk decision covers files without their own), no
195
206
  // controls — a record of what changed and how it was decided.
@@ -287,65 +298,24 @@ function CapturedChangeDiff({ change }) {
287
298
  // FileListRow — one file as a compact list line (list mode)
288
299
  // ---------------------------------------------------------------------------
289
300
  /**
290
- * One file of the change set as a compact, deliberately inert list line: kind
291
- * letter, path, provenance badge, and an optional trailing slot (the verdict
301
+ * One file of the change set as a compact list line: kind letter, linked path,
302
+ * `+N −M` stats, provenance badge, and an optional trailing slot (the verdict
292
303
  * control while reviewing; the committed verdict once settled).
293
304
  *
294
- * The path is plain text — not `FilePathLink` — because the list is an
295
- * inventory of what the decision covers, not a navigation surface: the diffs
296
- * live on the transcript's stamped edit rows. The full path stays available on
297
- * hover via `title`. A rename shows its source path so the move reads in one
298
- * line.
305
+ * The path renders through `FilePathLink` — the platform-wide path idiom — so
306
+ * a reviewer can jump from the list to the file itself (the session viewer
307
+ * routes the click into the panel's diff-first viewer; GitHub/copy is the
308
+ * fallback) without leaving the decision surface. Deciding and navigating
309
+ * coexist: the link stops click propagation, so opening a file never fights
310
+ * the row's Keep/Discard controls. A rename shows its source path so the move
311
+ * reads in one line.
299
312
  */
300
313
  function FileListRow({ change, trailing, }) {
301
314
  const path = change.pathAfter || change.pathBefore;
302
- const { dir, base } = splitDisplayPath(path);
303
315
  const renamedFrom = change.kind === FileChangeKind.RENAME && change.pathBefore !== change.pathAfter
304
316
  ? change.pathBefore
305
317
  : "";
306
- return (_jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", "data-cursor-target": "file-review-list-row", children: [_jsx(FileKindBadge, { kind: change.kind }), _jsxs("span", { className: "flex min-w-0 flex-1 items-center font-mono text-xs text-foreground", title: path, children: [renamedFrom && (_jsxs("span", { className: "min-w-0 truncate text-muted-foreground-faint", children: [renamedFrom, "\u00A0\u2192\u00A0"] })), dir && (_jsx("span", { className: "min-w-0 truncate text-muted-foreground-faint", children: dir })), _jsx("span", { className: "shrink-0", children: base })] }), _jsx(CaptureBadge, { change: change }), trailing] }));
307
- }
308
- /** The kind letter, tone, and a11y name for each wire {@link FileChangeKind}. */
309
- const KIND_BADGE = {
310
- [FileChangeKind.ADD]: {
311
- letter: "A",
312
- colorClass: "text-diff-added-fg",
313
- label: "added",
314
- },
315
- [FileChangeKind.MODIFY]: {
316
- letter: "M",
317
- colorClass: "text-diff-hunk-header-fg",
318
- label: "modified",
319
- },
320
- [FileChangeKind.DELETE]: {
321
- letter: "D",
322
- colorClass: "text-diff-removed-fg",
323
- label: "deleted",
324
- },
325
- [FileChangeKind.RENAME]: {
326
- letter: "R",
327
- colorClass: "text-diff-hunk-header-fg",
328
- label: "renamed",
329
- },
330
- // A binary change is a modification whose diff is not text; the letter stays
331
- // M and the binary-ness is told by the row's "Keep anyway" + reason note.
332
- [FileChangeKind.BINARY_CHANGE]: {
333
- letter: "M",
334
- colorClass: "text-diff-hunk-header-fg",
335
- label: "modified (binary)",
336
- },
337
- };
338
- /**
339
- * The single-letter change-kind marker — the same M/A/D visual vocabulary as
340
- * the version-history `DiffFileList`, extended with R for captured renames.
341
- * The letter itself is the non-color channel; the full word is exposed to
342
- * assistive tech. An UNSPECIFIED kind renders nothing rather than guessing.
343
- */
344
- function FileKindBadge({ kind }) {
345
- const badge = KIND_BADGE[kind];
346
- if (!badge)
347
- return null;
348
- return (_jsx("span", { className: cn("shrink-0 font-mono text-[10px] font-bold", badge.colorClass), "aria-label": badge.label, children: badge.letter }));
318
+ return (_jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", "data-cursor-target": "file-review-list-row", children: [_jsx(FileKindBadge, { kind: change.kind }), renamedFrom && (_jsxs("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground-faint", children: [renamedFrom, "\u00A0\u2192\u00A0"] })), _jsx(FilePathLink, { path: path, dirDisplay: "dim", className: "min-w-0 flex-1 text-xs" }), _jsx(FileLineStats, { linesAdded: change.linesAdded, linesRemoved: change.linesRemoved }), _jsx(CaptureBadge, { change: change }), trailing] }));
349
319
  }
350
320
  /**
351
321
  * A change's committed verdict as a static badge: APPROVE reads "Kept" (the