@deepseek-ai/dsh-experimental-client-ui-forge 0.2.3-alpha.2 → 0.2.3-alpha.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 (350) hide show
  1. package/README.i18n.yaml +10 -10
  2. package/README.md +37 -19
  3. package/README.zh.md +37 -19
  4. package/lib/client.js +22 -17
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +941 -188
  7. package/lib/typert.host.js +894 -175
  8. package/lib/typert.remote-client.d.ts +35 -17
  9. package/lib/typert.remote-client.d.ts.map +1 -1
  10. package/lib/typert.remote-client.js +751 -146
  11. package/lib/types/client/ActionToast.d.ts +1 -1
  12. package/lib/types/client/ActionToast.d.ts.map +1 -1
  13. package/lib/types/client/ActionToast.js.map +1 -1
  14. package/lib/types/client/BaseMenu.d.ts +6 -4
  15. package/lib/types/client/BaseMenu.d.ts.map +1 -1
  16. package/lib/types/client/BaseMenu.js.map +1 -1
  17. package/lib/types/client/BranchPicker.d.ts +84 -0
  18. package/lib/types/client/BranchPicker.d.ts.map +1 -0
  19. package/lib/types/client/BranchPicker.js.map +1 -0
  20. package/lib/types/client/ChangeRequestCard.d.ts +31 -13
  21. package/lib/types/client/ChangeRequestCard.d.ts.map +1 -1
  22. package/lib/types/client/ChangeRequestCard.js.map +1 -1
  23. package/lib/types/client/ChangeRequestOverview.d.ts +28 -6
  24. package/lib/types/client/ChangeRequestOverview.d.ts.map +1 -1
  25. package/lib/types/client/ChangeRequestOverview.js.map +1 -1
  26. package/lib/types/client/ChangeRequestsSection.d.ts +5 -3
  27. package/lib/types/client/ChangeRequestsSection.d.ts.map +1 -1
  28. package/lib/types/client/ChangeRequestsSection.js.map +1 -1
  29. package/lib/types/client/ChangeStatus.d.ts +41 -0
  30. package/lib/types/client/ChangeStatus.d.ts.map +1 -0
  31. package/lib/types/client/ChangeStatus.js.map +1 -0
  32. package/lib/types/client/ChangedFiles.d.ts +1 -1
  33. package/lib/types/client/ChangedFiles.d.ts.map +1 -1
  34. package/lib/types/client/ChangedFiles.js.map +1 -1
  35. package/lib/types/client/ChangesLoading.d.ts +1 -1
  36. package/lib/types/client/ChangesLoading.d.ts.map +1 -1
  37. package/lib/types/client/ChangesTab.d.ts +35 -12
  38. package/lib/types/client/ChangesTab.d.ts.map +1 -1
  39. package/lib/types/client/ChangesTab.js.map +1 -1
  40. package/lib/types/client/ChangesTabTitle.d.ts +1 -1
  41. package/lib/types/client/ChangesTabTitle.d.ts.map +1 -1
  42. package/lib/types/client/ChangesTabTitle.js.map +1 -1
  43. package/lib/types/client/CommitMenu.d.ts +11 -8
  44. package/lib/types/client/CommitMenu.d.ts.map +1 -1
  45. package/lib/types/client/CommitMenu.js.map +1 -1
  46. package/lib/types/client/CopyCommandButton.d.ts +19 -0
  47. package/lib/types/client/CopyCommandButton.d.ts.map +1 -0
  48. package/lib/types/client/CopyCommandButton.js.map +1 -0
  49. package/lib/types/client/DiffFile.d.ts +36 -5
  50. package/lib/types/client/DiffFile.d.ts.map +1 -1
  51. package/lib/types/client/DiffFile.js.map +1 -1
  52. package/lib/types/client/EnvironmentRows.d.ts +6 -6
  53. package/lib/types/client/EnvironmentRows.d.ts.map +1 -1
  54. package/lib/types/client/EnvironmentRows.js.map +1 -1
  55. package/lib/types/client/FileLabel.d.ts +5 -5
  56. package/lib/types/client/FileLabel.d.ts.map +1 -1
  57. package/lib/types/client/FileLabel.js.map +1 -1
  58. package/lib/types/client/HeadMenu.d.ts +35 -0
  59. package/lib/types/client/HeadMenu.d.ts.map +1 -0
  60. package/lib/types/client/HeadMenu.js.map +1 -0
  61. package/lib/types/client/HostSettings.d.ts +33 -0
  62. package/lib/types/client/HostSettings.d.ts.map +1 -0
  63. package/lib/types/client/HostSettings.js.map +1 -0
  64. package/lib/types/client/LensFilter.d.ts +2 -2
  65. package/lib/types/client/LensFilter.d.ts.map +1 -1
  66. package/lib/types/client/LensFilter.js.map +1 -1
  67. package/lib/types/client/ReasonButton.js.map +1 -1
  68. package/lib/types/client/RefreshGlyph.js.map +1 -1
  69. package/lib/types/client/ReviewComposer.d.ts +1 -1
  70. package/lib/types/client/ReviewComposer.d.ts.map +1 -1
  71. package/lib/types/client/ReviewComposer.js.map +1 -1
  72. package/lib/types/client/ReviewControls.d.ts +1 -1
  73. package/lib/types/client/ReviewControls.d.ts.map +1 -1
  74. package/lib/types/client/ReviewControls.js.map +1 -1
  75. package/lib/types/client/ReviewThread.d.ts +1 -1
  76. package/lib/types/client/ReviewThread.d.ts.map +1 -1
  77. package/lib/types/client/ReviewThread.js.map +1 -1
  78. package/lib/types/client/ReviewThreads.d.ts +21 -4
  79. package/lib/types/client/ReviewThreads.d.ts.map +1 -1
  80. package/lib/types/client/ReviewThreads.js.map +1 -1
  81. package/lib/types/client/SessionHoverForge.d.ts +1 -1
  82. package/lib/types/client/SessionHoverForge.d.ts.map +1 -1
  83. package/lib/types/client/SessionHoverForge.js.map +1 -1
  84. package/lib/types/client/SessionRowForge.d.ts +1 -1
  85. package/lib/types/client/SessionRowForge.d.ts.map +1 -1
  86. package/lib/types/client/SessionRowForge.js.map +1 -1
  87. package/lib/types/client/SubmitReview.d.ts +1 -1
  88. package/lib/types/client/SubmitReview.d.ts.map +1 -1
  89. package/lib/types/client/SubmitReview.js.map +1 -1
  90. package/lib/types/client/ThreadList.d.ts +3 -1
  91. package/lib/types/client/ThreadList.d.ts.map +1 -1
  92. package/lib/types/client/ThreadList.js.map +1 -1
  93. package/lib/types/client/ViewOptionsMenu.d.ts +1 -1
  94. package/lib/types/client/ViewOptionsMenu.d.ts.map +1 -1
  95. package/lib/types/client/ViewOptionsMenu.js.map +1 -1
  96. package/lib/types/client/WorktreeNameDialog.d.ts +1 -1
  97. package/lib/types/client/WorktreeNameDialog.d.ts.map +1 -1
  98. package/lib/types/client/WorktreeNameDialog.js.map +1 -1
  99. package/lib/types/client/WorktreeProgress.d.ts +1 -1
  100. package/lib/types/client/WorktreeProgress.d.ts.map +1 -1
  101. package/lib/types/client/WorktreeProgress.js.map +1 -1
  102. package/lib/types/client/WorktreeSettings.d.ts +1 -1
  103. package/lib/types/client/WorktreeSettings.d.ts.map +1 -1
  104. package/lib/types/client/WorktreeSettings.js.map +1 -1
  105. package/lib/types/client/WorktreeToggle.d.ts +1 -1
  106. package/lib/types/client/WorktreeToggle.d.ts.map +1 -1
  107. package/lib/types/client/WorktreeToggle.js.map +1 -1
  108. package/lib/types/client/annotations.d.ts +1 -1
  109. package/lib/types/client/annotations.d.ts.map +1 -1
  110. package/lib/types/client/branch-search.d.ts +1 -1
  111. package/lib/types/client/branch-search.d.ts.map +1 -1
  112. package/lib/types/client/branch-search.js.map +1 -1
  113. package/lib/types/client/changes-address.d.ts +1 -1
  114. package/lib/types/client/changes-address.d.ts.map +1 -1
  115. package/lib/types/client/changes-service.d.ts +1 -1
  116. package/lib/types/client/changes-service.d.ts.map +1 -1
  117. package/lib/types/client/changes-store.d.ts +25 -6
  118. package/lib/types/client/changes-store.d.ts.map +1 -1
  119. package/lib/types/client/changes-store.js.map +1 -1
  120. package/lib/types/client/checkout.d.ts +1 -1
  121. package/lib/types/client/checkout.d.ts.map +1 -1
  122. package/lib/types/client/code-selection.d.ts.map +1 -1
  123. package/lib/types/client/code-selection.js.map +1 -1
  124. package/lib/types/client/forge-copy.d.ts +8 -1
  125. package/lib/types/client/forge-copy.d.ts.map +1 -1
  126. package/lib/types/client/forge-copy.js.map +1 -1
  127. package/lib/types/client/format.d.ts +1 -1
  128. package/lib/types/client/format.d.ts.map +1 -1
  129. package/lib/types/client/format.js.map +1 -1
  130. package/lib/types/client/glyphs.d.ts +36 -1
  131. package/lib/types/client/glyphs.d.ts.map +1 -1
  132. package/lib/types/client/glyphs.js.map +1 -1
  133. package/lib/types/client/highlight-context.d.ts +1 -1
  134. package/lib/types/client/highlight-context.d.ts.map +1 -1
  135. package/lib/types/client/host-settings-form.d.ts +69 -0
  136. package/lib/types/client/host-settings-form.d.ts.map +1 -0
  137. package/lib/types/client/host-settings-form.js.map +1 -0
  138. package/lib/types/client/host-sign-in.d.ts +31 -0
  139. package/lib/types/client/host-sign-in.d.ts.map +1 -0
  140. package/lib/types/client/host-sign-in.js.map +1 -0
  141. package/lib/types/client/index.d.ts +1 -2
  142. package/lib/types/client/index.d.ts.map +1 -1
  143. package/lib/types/client/index.js.map +1 -1
  144. package/lib/types/client/local-writes.d.ts +47 -0
  145. package/lib/types/client/local-writes.d.ts.map +1 -0
  146. package/lib/types/client/local-writes.js.map +1 -0
  147. package/lib/types/client/locales.d.ts +111 -13
  148. package/lib/types/client/locales.d.ts.map +1 -1
  149. package/lib/types/client/locales.js.map +1 -1
  150. package/lib/types/client/minute-clock.d.ts +7 -0
  151. package/lib/types/client/minute-clock.d.ts.map +1 -0
  152. package/lib/types/client/minute-clock.js.map +1 -0
  153. package/lib/types/client/mount.d.ts +15 -1
  154. package/lib/types/client/mount.d.ts.map +1 -1
  155. package/lib/types/client/mount.js.map +1 -1
  156. package/lib/types/client/review-page/ReviewActivity.d.ts +44 -0
  157. package/lib/types/client/review-page/ReviewActivity.d.ts.map +1 -0
  158. package/lib/types/client/review-page/ReviewActivity.js.map +1 -0
  159. package/lib/types/client/review-page/ReviewChat.d.ts +1 -1
  160. package/lib/types/client/review-page/ReviewChat.d.ts.map +1 -1
  161. package/lib/types/client/review-page/ReviewChat.js.map +1 -1
  162. package/lib/types/client/review-page/ReviewDetail.d.ts +26 -9
  163. package/lib/types/client/review-page/ReviewDetail.d.ts.map +1 -1
  164. package/lib/types/client/review-page/ReviewDetail.js.map +1 -1
  165. package/lib/types/client/review-page/ReviewLabels.d.ts +1 -1
  166. package/lib/types/client/review-page/ReviewLabels.d.ts.map +1 -1
  167. package/lib/types/client/review-page/ReviewLabels.js.map +1 -1
  168. package/lib/types/client/review-page/ReviewList.d.ts +10 -8
  169. package/lib/types/client/review-page/ReviewList.d.ts.map +1 -1
  170. package/lib/types/client/review-page/ReviewList.js.map +1 -1
  171. package/lib/types/client/review-page/ReviewNav.d.ts +1 -1
  172. package/lib/types/client/review-page/ReviewNav.d.ts.map +1 -1
  173. package/lib/types/client/review-page/ReviewPage.d.ts +17 -14
  174. package/lib/types/client/review-page/ReviewPage.d.ts.map +1 -1
  175. package/lib/types/client/review-page/ReviewPage.js.map +1 -1
  176. package/lib/types/client/review-page/ReviewSkeleton.d.ts +26 -0
  177. package/lib/types/client/review-page/ReviewSkeleton.d.ts.map +1 -0
  178. package/lib/types/client/review-page/ReviewSkeleton.js.map +1 -0
  179. package/lib/types/client/review-page/ReviewStatus.d.ts +19 -13
  180. package/lib/types/client/review-page/ReviewStatus.d.ts.map +1 -1
  181. package/lib/types/client/review-page/ReviewStatus.js.map +1 -1
  182. package/lib/types/client/review-page/review-activity.d.ts +37 -0
  183. package/lib/types/client/review-page/review-activity.d.ts.map +1 -0
  184. package/lib/types/client/review-page/review-activity.js.map +1 -0
  185. package/lib/types/client/review-page/review-lists.d.ts +48 -13
  186. package/lib/types/client/review-page/review-lists.d.ts.map +1 -1
  187. package/lib/types/client/review-page/review-lists.js.map +1 -1
  188. package/lib/types/client/review-page/review-mount.d.ts +3 -1
  189. package/lib/types/client/review-page/review-mount.d.ts.map +1 -1
  190. package/lib/types/client/review-page/review-mount.js.map +1 -1
  191. package/lib/types/client/review-page/review-store.d.ts +19 -9
  192. package/lib/types/client/review-page/review-store.d.ts.map +1 -1
  193. package/lib/types/client/review-page/review-store.js.map +1 -1
  194. package/lib/types/client/review-queue.d.ts +1 -1
  195. package/lib/types/client/review-queue.d.ts.map +1 -1
  196. package/lib/types/client/review-queue.js.map +1 -1
  197. package/lib/types/client/review-threads.d.ts +15 -8
  198. package/lib/types/client/review-threads.d.ts.map +1 -1
  199. package/lib/types/client/review-threads.js.map +1 -1
  200. package/lib/types/client/review.d.ts +12 -1
  201. package/lib/types/client/review.d.ts.map +1 -1
  202. package/lib/types/client/review.js.map +1 -1
  203. package/lib/types/client/row-form-labels.d.ts +12 -0
  204. package/lib/types/client/row-form-labels.d.ts.map +1 -0
  205. package/lib/types/client/row-form-labels.js.map +1 -0
  206. package/lib/types/client/session-list.d.ts +1 -1
  207. package/lib/types/client/session-list.d.ts.map +1 -1
  208. package/lib/types/client/slots.d.ts +1 -1
  209. package/lib/types/client/slots.d.ts.map +1 -1
  210. package/lib/types/client/source.d.ts +1 -1
  211. package/lib/types/client/source.d.ts.map +1 -1
  212. package/lib/types/client/status.d.ts +7 -6
  213. package/lib/types/client/status.d.ts.map +1 -1
  214. package/lib/types/client/status.js.map +1 -1
  215. package/lib/types/client/thread-state.d.ts +2 -2
  216. package/lib/types/client/thread-state.d.ts.map +1 -1
  217. package/lib/types/client/thread-state.js.map +1 -1
  218. package/lib/types/client/toolbar-fold.d.ts +16 -6
  219. package/lib/types/client/toolbar-fold.d.ts.map +1 -1
  220. package/lib/types/client/toolbar-fold.js.map +1 -1
  221. package/lib/types/client/worktree-settings-form.d.ts +1 -1
  222. package/lib/types/client/worktree-settings-form.d.ts.map +1 -1
  223. package/lib/types/client/worktree-settings-form.js.map +1 -1
  224. package/lib/types/diff.d.ts.map +1 -1
  225. package/lib/types/diff.js.map +1 -1
  226. package/lib/types/git.d.ts +22 -0
  227. package/lib/types/git.d.ts.map +1 -1
  228. package/lib/types/git.js.map +1 -1
  229. package/lib/types/index.d.ts +137 -36
  230. package/lib/types/index.d.ts.map +1 -1
  231. package/lib/types/index.js.map +1 -1
  232. package/lib/types/local-diff.d.ts +81 -23
  233. package/lib/types/local-diff.d.ts.map +1 -1
  234. package/lib/types/local-diff.js.map +1 -1
  235. package/lib/types/local-write.d.ts +44 -0
  236. package/lib/types/local-write.d.ts.map +1 -0
  237. package/lib/types/local-write.js.map +1 -0
  238. package/lib/types/panel.js.map +1 -1
  239. package/lib/types/parse.d.ts +12 -3
  240. package/lib/types/parse.d.ts.map +1 -1
  241. package/lib/types/parse.js.map +1 -1
  242. package/lib/types/restore.d.ts +12 -0
  243. package/lib/types/restore.d.ts.map +1 -0
  244. package/lib/types/restore.js.map +1 -0
  245. package/lib/types/types.d.ts +128 -13
  246. package/lib/types/types.d.ts.map +1 -1
  247. package/lib/types/viewer-lists.d.ts +22 -13
  248. package/lib/types/viewer-lists.d.ts.map +1 -1
  249. package/lib/types/viewer-lists.js.map +1 -1
  250. package/lib/types/worktree.js.map +1 -1
  251. package/package.json +62 -58
  252. package/src/client/ActionToast.tsx +2 -2
  253. package/src/client/BaseMenu.module.css +15 -3
  254. package/src/client/BaseMenu.tsx +25 -88
  255. package/src/client/BranchPicker.tsx +170 -0
  256. package/src/client/ChangeRequestCard.tsx +194 -70
  257. package/src/client/ChangeRequestOverview.tsx +194 -82
  258. package/src/client/ChangeRequestsSection.tsx +45 -14
  259. package/src/client/ChangeStatus.module.css +70 -0
  260. package/src/client/ChangeStatus.tsx +104 -0
  261. package/src/client/ChangedFiles.tsx +22 -9
  262. package/src/client/ChangesLoading.tsx +1 -1
  263. package/src/client/ChangesTab.module.css +181 -33
  264. package/src/client/ChangesTab.tsx +499 -183
  265. package/src/client/ChangesTabTitle.tsx +2 -2
  266. package/src/client/CommitMenu.tsx +83 -42
  267. package/src/client/CopyCommandButton.tsx +25 -0
  268. package/src/client/DiffFile.tsx +147 -29
  269. package/src/client/EnvironmentRows.tsx +34 -28
  270. package/src/client/FileLabel.module.css +16 -18
  271. package/src/client/FileLabel.tsx +16 -32
  272. package/src/client/Forge.module.css +26 -6
  273. package/src/client/HeadMenu.tsx +69 -0
  274. package/src/client/HostSettings.module.css +194 -0
  275. package/src/client/HostSettings.tsx +194 -0
  276. package/src/client/LensFilter.tsx +13 -11
  277. package/src/client/ReasonButton.tsx +1 -1
  278. package/src/client/RefreshGlyph.tsx +1 -1
  279. package/src/client/ReviewComposer.tsx +31 -19
  280. package/src/client/ReviewControls.tsx +18 -9
  281. package/src/client/ReviewThread.tsx +65 -23
  282. package/src/client/ReviewThreads.tsx +133 -38
  283. package/src/client/SessionHoverForge.tsx +2 -2
  284. package/src/client/SessionRowForge.tsx +2 -2
  285. package/src/client/SubmitReview.tsx +7 -5
  286. package/src/client/ThreadList.module.css +4 -3
  287. package/src/client/ThreadList.tsx +11 -8
  288. package/src/client/ViewOptionsMenu.tsx +12 -10
  289. package/src/client/WorktreeNameDialog.tsx +17 -13
  290. package/src/client/WorktreeProgress.tsx +13 -11
  291. package/src/client/WorktreeSettings.tsx +8 -14
  292. package/src/client/WorktreeToggle.tsx +67 -37
  293. package/src/client/annotations.ts +1 -1
  294. package/src/client/branch-search.tsx +2 -2
  295. package/src/client/changes-address.ts +1 -1
  296. package/src/client/changes-service.ts +1 -1
  297. package/src/client/changes-store.ts +57 -10
  298. package/src/client/checkout.ts +1 -1
  299. package/src/client/code-selection.ts +3 -1
  300. package/src/client/forge-copy.ts +11 -1
  301. package/src/client/format.ts +2 -2
  302. package/src/client/glyphs.tsx +72 -5
  303. package/src/client/highlight-context.ts +1 -1
  304. package/src/client/host-settings-form.ts +115 -0
  305. package/src/client/host-sign-in.ts +46 -0
  306. package/src/client/index.ts +1 -2
  307. package/src/client/local-writes.ts +129 -0
  308. package/src/client/locales.ts +881 -97
  309. package/src/client/minute-clock.ts +19 -0
  310. package/src/client/mount.ts +121 -57
  311. package/src/client/review-page/ReviewActivity.tsx +406 -0
  312. package/src/client/review-page/ReviewChat.tsx +48 -19
  313. package/src/client/review-page/ReviewDetail.tsx +246 -78
  314. package/src/client/review-page/ReviewLabels.tsx +2 -2
  315. package/src/client/review-page/ReviewList.tsx +173 -151
  316. package/src/client/review-page/ReviewNav.tsx +1 -1
  317. package/src/client/review-page/ReviewPage.module.css +571 -23
  318. package/src/client/review-page/ReviewPage.tsx +84 -53
  319. package/src/client/review-page/ReviewSkeleton.tsx +108 -0
  320. package/src/client/review-page/ReviewStatus.tsx +74 -44
  321. package/src/client/review-page/review-activity.ts +64 -0
  322. package/src/client/review-page/review-lists.ts +85 -22
  323. package/src/client/review-page/review-mount.ts +24 -7
  324. package/src/client/review-page/review-store.ts +24 -7
  325. package/src/client/review-queue.ts +7 -3
  326. package/src/client/review-threads.ts +24 -12
  327. package/src/client/review.ts +20 -2
  328. package/src/client/row-form-labels.ts +17 -0
  329. package/src/client/session-list.ts +1 -1
  330. package/src/client/slots.ts +1 -1
  331. package/src/client/source.ts +1 -1
  332. package/src/client/status.ts +20 -9
  333. package/src/client/thread-state.ts +8 -7
  334. package/src/client/toolbar-fold.ts +59 -14
  335. package/src/client/worktree-settings-form.ts +1 -1
  336. package/src/diff.ts +8 -5
  337. package/src/git.ts +31 -1
  338. package/src/index.ts +319 -70
  339. package/src/local-diff.ts +151 -48
  340. package/src/local-write.ts +159 -0
  341. package/src/panel.ts +1 -1
  342. package/src/parse.ts +26 -4
  343. package/src/restore.ts +15 -0
  344. package/src/types.ts +121 -17
  345. package/src/viewer-lists.ts +124 -48
  346. package/src/worktree.ts +1 -1
  347. package/lib/types/client/AttentionIndicator.d.ts +0 -22
  348. package/lib/types/client/AttentionIndicator.d.ts.map +0 -1
  349. package/lib/types/client/AttentionIndicator.js.map +0 -1
  350. package/src/client/AttentionIndicator.tsx +0 -37
@@ -8,13 +8,14 @@
8
8
  import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
9
9
  import clsx from 'clsx'
10
10
  import {
11
- Button, IconCheckOutlineRegular, IconChevronDownOutlineRegular, IconEllipsisOutlineRegular, IconRightUpOutlineRegular, MarkdownText,
11
+ Button, IconCheckOutlineRegular, IconChevronDownOutlineRegular, IconEllipsisOutlineRegular, MarkdownText,
12
12
  Menu, Tag, Tooltip, type MarkdownLabels,
13
- } from '@deepseek-ai/dsh-client-ui-primitives'
14
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
13
+ } from '@deepseek-ai/dsh-client-ui-primitives/client'
14
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
15
15
  import type { ForgeReviewComment, ForgeReviewThread, ForgeReviewWrite, ForgeThreadId } from '@deepseek-ai/dsh-experimental-forge/types'
16
16
  import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
17
17
  import { formatAgo } from './format.ts'
18
+ import { ForgeGlyph } from './glyphs.tsx'
18
19
  import { anchorRange, hunkExcerpt, type ThreadPlace } from './review-threads.ts'
19
20
  import { SplitAction } from './ReviewComposer.tsx'
20
21
  import { INPUT_QUOTE_COPY, settleQuote, type QuoteCopy } from './review.ts'
@@ -50,6 +51,8 @@ export interface ThreadActions {
50
51
  readonly quoteCopy?: QuoteCopy | undefined
51
52
  /** Open a URL outside the app. */
52
53
  readonly openLink: (url: string) => void
54
+ /** Forge family of the change request's provider, whose mark the opening action carries; null without a provider. */
55
+ readonly forge: string | null
53
56
  /** Read a file of the change request's repository at a commit. */
54
57
  readonly readText: (commit: string, path: string) => Promise<RemoteResult<string>>
55
58
  /** Report that the input refused a thread. */
@@ -72,6 +75,12 @@ export interface LineThread {
72
75
  readonly place: Extract<ThreadPlace, { readonly kind: 'line' }>
73
76
  }
74
77
 
78
+ /** A host thread shown in its file's outdated section. */
79
+ export interface OutdatedThread {
80
+ readonly thread: ForgeReviewThread
81
+ readonly place: Extract<ThreadPlace, { readonly kind: 'outdated' }>
82
+ }
83
+
75
84
  /** Host threads of one file and the actions their cards share. */
76
85
  export interface FileThreads {
77
86
  /** Threads on lines, which follow the row of their last line. */
@@ -79,18 +88,27 @@ export interface FileThreads {
79
88
  /** Threads on the whole file, shown above its lines. */
80
89
  readonly file: readonly ForgeReviewThread[]
81
90
  /** Threads no longer on the head's lines, shown after them. */
82
- readonly outdated: readonly ForgeReviewThread[]
91
+ readonly outdated: readonly OutdatedThread[]
83
92
  /** Unresolved threads of the file in every place, including threads the chosen commits do not show. */
84
93
  readonly unresolved: number
85
94
  /** Reads, actions, and identities shared by the cards. */
86
95
  readonly actions: ThreadActions
87
96
  }
88
97
 
89
- /** The commit a thread was written on, abbreviated, or null for a file thread. */
98
+ /** The commit a thread was written on, abbreviated, or null when the code host recorded none. */
90
99
  function writtenOn(thread: ForgeReviewThread): string | null {
91
100
  return thread.original === null ? null : thread.original.commit.slice(0, 7)
92
101
  }
93
102
 
103
+ /**
104
+ * Render the tag of an outdated thread: lost when no view can show the lines it was written on, else outdated.
105
+ * @param props - whether the thread is lost, and copy.
106
+ * @returns the tag.
107
+ */
108
+ export function OutdatedTag({ lost, t }: PropsLocale<typeof NS> & { readonly lost: boolean }): ReactNode {
109
+ return <Tag tone={lost ? 'neutral' : 'warning'}>{t(lost ? 'thread.lostTag' : 'thread.outdatedTag')}</Tag>
110
+ }
111
+
94
112
  /**
95
113
  * Build the Markdown chrome copy of comment bodies.
96
114
  * @param t - forge panel copy.
@@ -182,8 +200,13 @@ export function CardMenu({ label, items, select, disabled = false }: {
182
200
  readonly disabled?: boolean
183
201
  }): ReactNode {
184
202
  const [open, setOpen] = useState(false)
185
- return <Menu open={open && !disabled} portal dense align="end" autoFocus onClose={() => { setOpen(false) }} items={items}
186
- onSelect={(id) => { setOpen(false); select(id) }}
203
+ const close = useCallback((): void => { setOpen(false) }, [])
204
+ const choose = useCallback((id: string): void => {
205
+ setOpen(false)
206
+ select(id)
207
+ }, [select])
208
+ return <Menu open={open && !disabled} portal dense align="end" autoFocus onClose={close} items={items}
209
+ onSelect={choose}
187
210
  anchor={<span className={css.menuAnchor}><Tooltip label={label} side="bottom" delayMs={500}>
188
211
  <button type="button" className={css.icon} disabled={disabled} aria-label={label} aria-haspopup="menu" aria-expanded={open && !disabled}
189
212
  onClick={() => { setOpen(value => !value) }}><IconEllipsisOutlineRegular size={14} /></button>
@@ -214,6 +237,20 @@ export function DeleteConfirm({ question, confirmLabel, disabled, error, cancel,
214
237
  /** Tells the card which of its forms hold text the reader is writing, so it does not fold them away. */
215
238
  type Drafting = (form: string, active: boolean) => void
216
239
 
240
+ /** The button that saves the text of a comment being edited, disabled until it differs from the stored one. */
241
+ function SaveEdit({ text, blank, busy, stored, save, t }: PropsLocale<typeof NS> & {
242
+ readonly text: string
243
+ readonly blank: boolean
244
+ readonly busy: boolean
245
+ readonly stored: string
246
+ readonly save: (text: string) => void
247
+ }) {
248
+ const submit = useCallback((): void => { save(text) }, [save, text])
249
+ return <Button size="sm" variant="primary" disabled={busy || blank || text === stored} onClick={submit}>
250
+ {t(busy ? 'thread.saving' : 'thread.save')}
251
+ </Button>
252
+ }
253
+
217
254
  function Comment({ comment, last, actions, labels, now, drafting, t }: {
218
255
  readonly comment: ForgeReviewComment
219
256
  readonly drafting: Drafting
@@ -235,9 +272,15 @@ function Comment({ comment, last, actions, labels, now, drafting, t }: {
235
272
  const editable = writes !== null && comment.viewerCanEdit
236
273
  const deletable = writes !== null && comment.viewerCanDelete
237
274
  const menuLabel = t('thread.commentActions', { author: login ?? t('thread.deletedAuthor') })
238
- const send = async (write: ThreadWrite): Promise<void> => {
275
+ const send = useCallback(async (write: ThreadWrite): Promise<void> => {
239
276
  if (writes !== null && await writing.run(() => writes.write(write))) setMode('view')
240
- }
277
+ }, [writes, writing])
278
+ const selectMode = useCallback((id: string): void => { setMode(id === 'edit' ? 'edit' : 'delete') }, [])
279
+ const cancelDelete = useCallback((): void => { setMode('view') }, [])
280
+ const confirmDelete = useCallback((): void => { void send({ kind: 'delete-comment', comment: comment.id }) }, [comment.id, send])
281
+ const saveEdit = useCallback((text: string): void => {
282
+ void send({ kind: 'edit-comment', comment: comment.id, body: text })
283
+ }, [comment.id, send])
241
284
  return <div className={css.comment} data-forge-thread-comment={comment.id}>
242
285
  <Avatar author={comment.author} />
243
286
  <div className={css.commentMain}>
@@ -251,27 +294,70 @@ function Comment({ comment, last, actions, labels, now, drafting, t }: {
251
294
  {comment.pending && <Tag tone="warning">{t('review.pending')}</Tag>}
252
295
  {(editable || deletable) && mode === 'view' && <>
253
296
  <span className={css.spacer} />
254
- <CardMenu label={menuLabel} select={(id) => { setMode(id === 'edit' ? 'edit' : 'delete') }}
297
+ <CardMenu label={menuLabel} select={selectMode}
255
298
  items={[...editable ? [{ id: 'edit', label: t('review.edit') }] : [], ...deletable ? [{ id: 'delete', label: t('review.remove') }] : []]} />
256
299
  </>}
257
300
  </div>
258
301
  {mode === 'edit'
259
302
  ? <TextForm label={t('thread.editAria')} initial={comment.body} busy={writing.busy} error={writing.error}
260
303
  cancel={{ label: t('review.cancel'), run: () => { setMode('view') } }}>
261
- {(text, blank) => <Button size="sm" variant="primary" disabled={writing.busy || blank || text === comment.body}
262
- onClick={() => { void send({ kind: 'edit-comment', comment: comment.id, body: text }) }}>
263
- {t(writing.busy ? 'thread.saving' : 'thread.save')}
264
- </Button>}
304
+ {(text, blank) => <SaveEdit text={text} blank={blank} busy={writing.busy} stored={comment.body} save={saveEdit} t={t} />}
265
305
  </TextForm>
266
306
  // Raw HTML renders nothing, as GitHub hides comments and unknown tags, and never enters the DOM.
267
307
  : <div className={css.body}><MarkdownText text={comment.body} labels={labels} variant="body" omitHtml /></div>}
268
308
  {mode === 'delete' && <DeleteConfirm question={t(last ? 'thread.deleteLast' : 'thread.deleteConfirm')}
269
309
  confirmLabel={t(writing.busy ? 'thread.deleting' : 'review.remove')} disabled={writing.busy} error={writing.error}
270
- cancel={() => { setMode('view') }} confirm={() => { void send({ kind: 'delete-comment', comment: comment.id }) }} t={t} />}
310
+ cancel={cancelDelete} confirm={confirmDelete} t={t} />}
271
311
  </div>
272
312
  </div>
273
313
  }
274
314
 
315
+ /** The reply action while a review is pending: it adds the reply to that review. */
316
+ function QueueReply({ busy, blank, queue, t }: {
317
+ readonly busy: boolean
318
+ readonly blank: boolean
319
+ readonly queue: () => void
320
+ readonly t: Translate
321
+ }) {
322
+ return (
323
+ <Button size="sm" variant="primary" disabled={busy || blank} onClick={queue}>
324
+ {t(busy ? 'review.publishing' : 'review.queue')}
325
+ </Button>
326
+ )
327
+ }
328
+
329
+ /** The reply action without a pending review: it replies at once, and its menu starts a review with the reply. */
330
+ function ReplyNow({ busy, blank, canReview, reply, queue, t }: {
331
+ readonly busy: boolean
332
+ readonly blank: boolean
333
+ readonly canReview: boolean
334
+ readonly reply: () => void
335
+ readonly queue: () => void
336
+ readonly t: Translate
337
+ }) {
338
+ return (
339
+ <SplitAction disabled={busy || blank} label={t(busy ? 'review.publishing' : 'thread.reply')}
340
+ run={reply} menuLabel={t('thread.replyActions')}
341
+ other={canReview ? t('review.startReview') : undefined} menu={queue} />
342
+ )
343
+ }
344
+
345
+ /** The sending actions of a reply: queue it into the pending review, or reply at once with an option to start one. */
346
+ function ReplyActions({ text, blank, busy, reviewStarted, canReview, send, t }: PropsLocale<typeof NS> & {
347
+ readonly text: string
348
+ readonly blank: boolean
349
+ readonly busy: boolean
350
+ readonly reviewStarted: boolean
351
+ readonly canReview: boolean
352
+ readonly send: (text: string, pending: boolean) => Promise<void>
353
+ }) {
354
+ const queue = useCallback((): void => { void send(text, true) }, [send, text])
355
+ const reply = useCallback((): void => { void send(text, false) }, [send, text])
356
+ return reviewStarted
357
+ ? <QueueReply busy={busy} blank={blank} queue={queue} t={t} />
358
+ : <ReplyNow busy={busy} blank={blank} canReview={canReview} reply={reply} queue={queue} t={t} />
359
+ }
360
+
275
361
  /**
276
362
  * The reply field of a thread. Without a pending review it replies at once, and its menu starts one with the reply; with
277
363
  * one, it adds the reply to it, since GitHub adds every reply of the user to the pending review.
@@ -287,21 +373,16 @@ function Reply({ thread, writes, drafting, t }: PropsLocale<typeof NS> & {
287
373
  return () => { drafting('reply', false) }
288
374
  }, [drafting, open])
289
375
  const writing = useWriting(t)
376
+ const send = useCallback(async (text: string, pending: boolean): Promise<void> => {
377
+ if (await writing.run(() => writes.write({ kind: 'reply', thread: thread.id, body: text, pending }))) setOpen(false)
378
+ }, [thread.id, writes, writing])
290
379
  if (!open) {
291
380
  return <button type="button" className={css.replyPrompt} onClick={() => { setOpen(true) }}>{t('thread.replyPlaceholder')}</button>
292
381
  }
293
- const send = async (text: string, pending: boolean): Promise<void> => {
294
- if (await writing.run(() => writes.write({ kind: 'reply', thread: thread.id, body: text, pending }))) setOpen(false)
295
- }
296
382
  return <TextForm label={t('thread.replyPlaceholder')} initial="" busy={writing.busy} error={writing.error}
297
383
  cancel={{ label: t('review.cancel'), run: () => { setOpen(false) } }}>
298
- {(text, blank) => writes.reviewStarted
299
- ? <Button size="sm" variant="primary" disabled={writing.busy || blank} onClick={() => { void send(text, true) }}>
300
- {t(writing.busy ? 'review.publishing' : 'review.queue')}
301
- </Button>
302
- : <SplitAction disabled={writing.busy || blank} label={t(writing.busy ? 'review.publishing' : 'thread.reply')}
303
- run={() => { void send(text, false) }} menuLabel={t('thread.replyActions')}
304
- other={writes.canReview ? t('review.startReview') : undefined} menu={() => { void send(text, true) }} />}
384
+ {(text, blank) => <ReplyActions text={text} blank={blank} busy={writing.busy} reviewStarted={writes.reviewStarted}
385
+ canReview={writes.canReview} send={send} t={t} />}
305
386
  </TextForm>
306
387
  }
307
388
 
@@ -311,9 +392,12 @@ function Resolution({ thread, writes, t }: PropsLocale<typeof NS> & {
311
392
  readonly writes: ThreadWrites
312
393
  }): ReactNode {
313
394
  const writing = useWriting(t)
395
+ const resolve = useCallback((): void => {
396
+ void writing.run(() => writes.write({ kind: 'resolve', thread: thread.id, resolved: !thread.resolved }))
397
+ }, [thread.id, thread.resolved, writes, writing])
314
398
  return <>
315
399
  <Button size="sm" disabled={writing.busy}
316
- onClick={() => { void writing.run(() => writes.write({ kind: 'resolve', thread: thread.id, resolved: !thread.resolved })) }}>
400
+ onClick={resolve}>
317
401
  {t(thread.resolved ? 'thread.unresolve' : 'thread.resolve')}
318
402
  </Button>
319
403
  {writing.error !== null && <div className={clsx(composerCss.error, css.actionError)} role="alert">{writing.error}</div>}
@@ -351,12 +435,21 @@ export function ThreadCard({ thread, place, actions, t }: PropsLocale<typeof NS>
351
435
  const unfolded = open || !thread.resolved || focused || drafts.size > 0
352
436
  const side = place.kind === 'line' ? place.side : thread.side
353
437
  const original = place.kind === 'outdated' && thread.original !== null ? thread.original : null
438
+ // The file at a commit the code host no longer has cannot be read.
439
+ const lost = place.kind === 'outdated' && place.lost
354
440
  // The composer names an outdated thread by the lines it was written on, as its label does.
355
441
  const range = place.kind === 'line' ? anchorRange(place.side, place) : original !== null ? anchorRange(thread.side, original) : null
356
442
  const commit = writtenOn(thread)
357
443
  const first = thread.comments[0]
358
444
  const url = first?.url ?? null
359
445
  const writes = actions.writes
446
+ const quoteThread = useCallback((): void => {
447
+ settleQuote(actions.addToInput(thread, range), (accepted) => { if (!accepted) actions.inputFailed() })
448
+ }, [actions, range, thread])
449
+ const openOnHost = useCallback((): void => {
450
+ /* v8 ignore next -- the control renders only once the thread has a link */
451
+ if (url !== null) actions.openLink(url)
452
+ }, [actions, url])
360
453
  if (!unfolded) {
361
454
  return <div className={css.folded} data-forge-thread={thread.id} data-side={side}>
362
455
  <IconCheckOutlineRegular size={14} />
@@ -364,22 +457,24 @@ export function ThreadCard({ thread, place, actions, t }: PropsLocale<typeof NS>
364
457
  <button type="button" className={css.link} aria-expanded={false} onClick={() => { setOpen(true) }}>{t('thread.expand')}</button>
365
458
  </div>
366
459
  }
367
- const label = original !== null ? t('thread.originally', { range: anchorRange(thread.side, original) }) : range ?? t('thread.fileLevel')
460
+ // A line thread the code host recorded no commit for has no lines to name; its tag alone heads the card.
461
+ const unplaced = thread.subject === 'file' ? t('thread.fileLevel') : null
462
+ const label = original !== null ? t('thread.originally', { range: anchorRange(thread.side, original) }) : range ?? unplaced
368
463
  return <section className={css.card} data-forge-thread={thread.id} data-side={side}
369
- data-resolved={thread.resolved ? '' : undefined} aria-label={label} tabIndex={-1}>
464
+ data-resolved={thread.resolved ? '' : undefined} aria-label={label ?? t('thread.lostTag')} tabIndex={-1}>
370
465
  <div className={css.header}>
371
- <span className={css.place}>
466
+ {label !== null && <span className={css.place}>
372
467
  {label}
373
468
  {commit !== null && <> · {t('thread.onCommit', { commit })}</>}
374
- </span>
375
- {place.kind === 'outdated' && <Tag tone="warning">{t('thread.outdatedTag')}</Tag>}
469
+ </span>}
470
+ {place.kind === 'outdated' && <OutdatedTag lost={place.lost} t={t} />}
376
471
  {thread.resolved && <Tag tone="success">{t('thread.filter.resolved')}</Tag>}
377
472
  <span className={css.spacer} />
378
473
  {thread.resolved && <button type="button" className={css.link} aria-expanded onClick={() => {
379
474
  setOpen(false)
380
475
  setFoldedAt(actions.focused?.revision ?? null)
381
476
  }}>{t('thread.collapse')}</button>}
382
- {original !== null && thread.side === 'R' && <OriginalFile thread={thread} commit={original.commit} actions={actions} t={t} />}
477
+ {original !== null && thread.side === 'R' && !lost && <OriginalFile thread={thread} commit={original.commit} actions={actions} t={t} />}
383
478
  </div>
384
479
  {place.kind === 'outdated' && thread.diffHunk !== null && original !== null
385
480
  && <Excerpt hunk={thread.diffHunk} side={thread.side} lines={original.endLine - original.startLine + 1} />}
@@ -389,11 +484,11 @@ export function ThreadCard({ thread, place, actions, t }: PropsLocale<typeof NS>
389
484
  </div>
390
485
  {writes !== null && thread.viewerCanReply && <Reply thread={thread} writes={writes} drafting={drafting} t={t} />}
391
486
  <div className={css.actions}>
392
- <Button size="sm" onClick={() => { settleQuote(actions.addToInput(thread, range), (accepted) => { if (!accepted) actions.inputFailed() }) }}>
487
+ <Button size="sm" onClick={quoteThread}>
393
488
  {t((actions.quoteCopy ?? INPUT_QUOTE_COPY).add)}
394
489
  </Button>
395
- {url !== null && <Button size="sm" onClick={() => { actions.openLink(url) }}>
396
- <IconRightUpOutlineRegular size={14} />{t('thread.openOnHost')}
490
+ {url !== null && <Button size="sm" onClick={openOnHost}>
491
+ <ForgeGlyph forge={actions.forge} />{t('thread.openOnHost')}
397
492
  </Button>}
398
493
  {writes !== null && thread.viewerCanResolve && <Resolution thread={thread} writes={writes} t={t} />}
399
494
  </div>
@@ -456,14 +551,14 @@ function OriginalFile({ thread, commit, actions, t }: PropsLocale<typeof NS> & {
456
551
  * @returns the section, or nothing without outdated threads.
457
552
  */
458
553
  export function OutdatedThreads({ threads, actions, t }: PropsLocale<typeof NS> & {
459
- readonly threads: readonly ForgeReviewThread[]
554
+ readonly threads: readonly OutdatedThread[]
460
555
  readonly actions: ThreadActions
461
556
  }): ReactNode {
462
557
  // The section is folded after the jump with this revision, or -1 before any jump, or null while unfolded.
463
558
  const [folded, setFolded] = useState<number | null>(null)
464
559
  if (threads.length === 0) return null
465
560
  const jump = actions.focused
466
- const open = folded === null || (jump !== null && jump.revision !== folded && threads.some(thread => thread.id === jump.id))
561
+ const open = folded === null || (jump !== null && jump.revision !== folded && threads.some(({ thread }) => thread.id === jump.id))
467
562
  return <section className={css.outdated} data-forge-outdated-threads="">
468
563
  <div className={css.outdatedHeader}>
469
564
  <span>{t('thread.outdatedSection', { count: threads.length })}</span>
@@ -473,6 +568,6 @@ export function OutdatedThreads({ threads, actions, t }: PropsLocale<typeof NS>
473
568
  <IconChevronDownOutlineRegular size={12} className={clsx(!open && css.turned)} />
474
569
  </button>
475
570
  </div>
476
- {open && threads.map(thread => <ThreadCard key={thread.id} thread={thread} place={{ kind: 'outdated' }} actions={actions} t={t} />)}
571
+ {open && threads.map(({ thread, place }) => <ThreadCard key={thread.id} thread={thread} place={place} actions={actions} t={t} />)}
477
572
  </section>
478
573
  }
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import type { ReactNode } from 'react'
8
- import { IconBranchOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
9
- import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
8
+ import { IconBranchOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives/client'
9
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
10
10
  // Type-only: pulls the ui-workspace SlotMap merge (the Session row seats).
11
11
  import type {} from '@deepseek-ai/dsh-client-ui-workspace/client'
12
12
  import { branchLabel } from '../branch-name.ts'
@@ -7,8 +7,8 @@
7
7
  */
8
8
 
9
9
  import type { ReactNode } from 'react'
10
- import { IconBranchOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
11
- import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
10
+ import { IconBranchOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives/client'
11
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
12
12
  // Type-only: pulls the ui-workspace SlotMap merge (the Session row seats).
13
13
  import type {} from '@deepseek-ai/dsh-client-ui-workspace/client'
14
14
  import type { ChecksRollup } from '@deepseek-ai/dsh-experimental-forge/types'
@@ -1,9 +1,9 @@
1
1
  /** Centered review submission with a summary, decision, and pending-comment count, and the discarding of a pending review. */
2
2
 
3
- import { useId, useState, useSyncExternalStore, type ReactNode } from 'react'
3
+ import { useCallback, useId, useState, useSyncExternalStore, type ReactNode } from 'react'
4
4
  import clsx from 'clsx'
5
- import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'
6
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
5
+ import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives/client'
6
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
7
7
  import type { ForgePendingReview, ForgeReviewEvent } from '@deepseek-ai/dsh-experimental-forge/types'
8
8
  import type { ReviewQueue } from './review-queue.ts'
9
9
  import type { NS } from './locales.ts'
@@ -56,11 +56,13 @@ export function SubmitReview({
56
56
  || (state.event === 'comment' && state.body.trim() === '' && count === 0)
57
57
  const notice = state.error !== null ? t(state.error === 'load' ? 'review.loadFailed' : 'review.saveFailed')
58
58
  : blocked ? t('review.browserDrafts', { count: state.comments.length }) : stale ? t('review.stale') : error
59
+ const startDiscard = useCallback((): void => { setConfirming(true) }, [])
60
+ const cancelDiscard = useCallback((): void => { setConfirming(false) }, [])
59
61
  return <Modal open onClose={close} title={t('review.submit')} closeLabel={t('review.close')}
60
62
  className={clsx(css.modal)} contentClassName={clsx(css.content)}
61
63
  footer={<>
62
64
  {discard !== undefined && <Button variant="outline" className={clsx(css.discard)} disabled={locked || confirming}
63
- onClick={() => { setConfirming(true) }}>{t('review.discard')}</Button>}
65
+ onClick={startDiscard}>{t('review.discard')}</Button>}
64
66
  <Button variant="outline" onClick={close}>{t('review.cancel')}</Button>
65
67
  <Button variant="primary" disabled={locked || confirming || blocked || stale || empty || refused || state.error !== null} onClick={submit}>
66
68
  {t(busy && !confirming ? 'review.submitting' : 'review.submit')}
@@ -70,7 +72,7 @@ export function SubmitReview({
70
72
  <div className={css.count}>{t('review.drafts', { count })}</div>
71
73
  {discard !== undefined && confirming && <div className={css.confirm} role="group" aria-label={t('review.discard')}>
72
74
  <span className={css.confirmText}>{t('review.discardConfirm', { count })}</span>
73
- <Button size="sm" variant="outline" disabled={busy} onClick={() => { setConfirming(false) }}>{t('review.cancel')}</Button>
75
+ <Button size="sm" variant="outline" disabled={busy} onClick={cancelDiscard}>{t('review.cancel')}</Button>
74
76
  <Button size="sm" variant="primary" disabled={busy} onClick={discard}>{t(busy ? 'review.discarding' : 'review.discard')}</Button>
75
77
  </div>}
76
78
  <div className={css.summary}>
@@ -1,7 +1,8 @@
1
1
  /* The thread list docks at the end of the changes body in a view at least 1040px wide, which leaves the code about
2
2
  480px beside the file tree and the list; it floats over the files with a scrim behind it in a narrower view, and
3
- takes the files' whole width below 480px. The queries name no container, since CSS Modules rename a container name
4
- per file; the nearest inline-size container is the changes view. */
3
+ takes the files' whole width below 760px, where the view shows no file tree and the floating list would cover half
4
+ of the code. The queries name no container, since CSS Modules rename a container name per file; the nearest
5
+ inline-size container is the changes view. */
5
6
  .scrim { display: none; }
6
7
 
7
8
  .pane {
@@ -199,7 +200,7 @@
199
200
  }
200
201
  }
201
202
 
202
- @container (max-width: 479px) {
203
+ @container (max-width: 759px) {
203
204
  .scrim { display: none; }
204
205
 
205
206
  .pane {
@@ -4,14 +4,15 @@
4
4
  * a narrower one floats it over them, and the narrowest gives it their whole width.
5
5
  */
6
6
 
7
- import { useLayoutEffect, useMemo, useRef, type KeyboardEvent, type ReactNode } from 'react'
8
- import { IconChevronLeftOutlineRegular, IconCloseOutlineRegular, IconRightUpOutlineRegular, Tag, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'
9
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
7
+ import { useCallback, useLayoutEffect, useMemo, useRef, type KeyboardEvent, type ReactNode } from 'react'
8
+ import { IconChevronLeftOutlineRegular, IconCloseOutlineRegular, Tag, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives/client'
9
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
10
10
  import type { ForgeReviewThread } from '@deepseek-ai/dsh-experimental-forge/types'
11
11
  import type { ForgeDiffFile } from '../types.ts'
12
12
  import { FileLabel } from './FileLabel.tsx'
13
+ import { ForgeGlyph } from './glyphs.tsx'
13
14
  import { SegmentedChoice } from './ReviewControls.tsx'
14
- import { Avatar } from './ReviewThreads.tsx'
15
+ import { Avatar, OutdatedTag } from './ReviewThreads.tsx'
15
16
  import { anchorRange, inFileOrder, passesFilter, THREAD_FILTERS, type ThreadFilter, type ThreadPlace } from './review-threads.ts'
16
17
  import type { NS } from './locales.ts'
17
18
  import type { PlacedThread } from './thread-state.ts'
@@ -41,6 +42,8 @@ export interface ThreadListProps extends PropsLocale<typeof NS> {
41
42
  readonly open: (entry: PlacedThread, covering: boolean) => void
42
43
  /** Open a URL outside the app. */
43
44
  readonly openLink: (url: string) => void
45
+ /** Forge family of the change request's provider, whose mark the opening action carries; null without a provider. */
46
+ readonly forge: string | null
44
47
  /** Close the list at the reader's request. */
45
48
  readonly close: () => void
46
49
  }
@@ -84,7 +87,7 @@ function Item({ entry, open, t }: {
84
87
  <span className={css.meta}>{meta(thread, place, t)}</span>
85
88
  <span className={css.excerpt}>{plainExcerpt(first?.body ?? '')}</span>
86
89
  <span className={css.tags}>
87
- {place.kind === 'outdated' && <Tag tone="warning">{t('thread.outdatedTag')}</Tag>}
90
+ {place.kind === 'outdated' && <OutdatedTag lost={place.lost} t={t} />}
88
91
  {place.kind === 'elsewhere' && <Tag tone="neutral">{t('thread.elsewhereTag')}</Tag>}
89
92
  {thread.resolved && <Tag tone="success">{t('thread.filter.resolved')}</Tag>}
90
93
  {first?.author?.bot === true && <Tag tone="outline">{t('thread.bot')}</Tag>}
@@ -99,7 +102,7 @@ function Item({ entry, open, t }: {
99
102
  * @returns the list pane and the scrim behind it where it floats over the files.
100
103
  */
101
104
  export function ThreadList(props: ThreadListProps): ReactNode {
102
- const { entries, files, filter, t } = props
105
+ const { entries, files, filter, open: openThread, t } = props
103
106
  const threads = useMemo(() => entries.map(entry => entry.thread), [entries])
104
107
  const counts = useMemo(() => Object.fromEntries(THREAD_FILTERS.map(item => [item,
105
108
  threads.filter(thread => passesFilter(thread, item)).length])) as Record<ThreadFilter, number>, [threads])
@@ -128,7 +131,7 @@ export function ThreadList(props: ThreadListProps): ReactNode {
128
131
  event.stopPropagation()
129
132
  props.close()
130
133
  }
131
- const open = (entry: PlacedThread): void => { props.open(entry, covers(pane.current)) }
134
+ const open = useCallback((entry: PlacedThread): void => { openThread(entry, covers(pane.current)) }, [openThread])
132
135
  return <>
133
136
  <div className={css.scrim} aria-hidden="true" onClick={props.close} />
134
137
  <aside ref={pane} className={css.pane} tabIndex={-1} aria-label={t('thread.listAria', { count: threads.length })} data-forge-thread-list=""
@@ -157,7 +160,7 @@ export function ThreadList(props: ThreadListProps): ReactNode {
157
160
  <div className={css.footer}>
158
161
  {props.truncated && <>{t('thread.truncated', { count: threads.length })}{' · '}</>}
159
162
  <button type="button" className={css.link} onClick={() => { props.openLink(props.url) }}>
160
- <IconRightUpOutlineRegular size={14} />{t('thread.openAll')}
163
+ <ForgeGlyph forge={props.forge} />{t('thread.openAll')}
161
164
  </button>
162
165
  </div>
163
166
  </aside>
@@ -1,9 +1,9 @@
1
1
  /** The changes toolbar's More menu, which holds the view controls a narrow toolbar folds out of its row. */
2
2
 
3
- import { useState, type ReactNode } from 'react'
3
+ import { useCallback, useState, type ReactNode } from 'react'
4
4
  import clsx from 'clsx'
5
- import { IconEllipsisOutlineRegular, Menu, Tooltip, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'
6
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
5
+ import { IconEllipsisOutlineRegular, Menu, Tooltip, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives/client'
6
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
7
7
  import type { NS } from './locales.ts'
8
8
  import { foldOf } from './toolbar-fold.ts'
9
9
  import { lensEntries, lensOfRow, NO_LENS, type LensChoice } from './LensFilter.tsx'
@@ -56,7 +56,7 @@ export function ViewOptionsMenu({ options, visible, t }: PropsLocale<typeof NS>
56
56
  }
57
57
  const selected = [options.split && 'split', options.wrap && 'wrap', options.hideTests === true && 'tests', options.lenses.length > 0 && NO_LENS]
58
58
  .filter(item => item !== false)
59
- const run = (id: string): void => {
59
+ const run = useCallback((id: string): void => {
60
60
  const lens = lensOfRow(id)
61
61
  if (lens !== undefined) {
62
62
  options.chooseLens(lens)
@@ -71,14 +71,16 @@ export function ViewOptionsMenu({ options, visible, t }: PropsLocale<typeof NS>
71
71
  /* v8 ignore next -- the menu offers only the rows above */
72
72
  default: break
73
73
  }
74
- }
74
+ }, [options])
75
+ const close = useCallback((): void => { setFold(null) }, [])
76
+ const select = useCallback((id: string): void => {
77
+ setFold(null)
78
+ run(id)
79
+ }, [run])
75
80
  return (
76
81
  <Menu open={open} portal dense align="end" autoFocus items={entries} selectedIds={selected}
77
- onClose={() => { setFold(null) }}
78
- onSelect={(id) => {
79
- setFold(null)
80
- run(id)
81
- }}
82
+ onClose={close}
83
+ onSelect={select}
82
84
  anchor={(
83
85
  <Tooltip label={t('diff.moreOptions')} side="bottom" delayMs={500}>
84
86
  <button type="button" className={clsx(css.tool, css.more)} aria-label={t('diff.moreOptions')}
@@ -1,9 +1,9 @@
1
1
  /** Dialog that names the new branch of a requested worktree, from the New Session option or after a failed attempt. */
2
2
 
3
- import { useId, useState, type ReactNode } from 'react'
3
+ import { useCallback, useId, useState, type ChangeEvent, type KeyboardEvent, type ReactNode } from 'react'
4
4
  import clsx from 'clsx'
5
- import { Button, Input, Modal } from '@deepseek-ai/dsh-client-ui-primitives'
6
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
5
+ import { Button, Input, Modal } from '@deepseek-ai/dsh-client-ui-primitives/client'
6
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
7
7
  import { branchLabel, branchNameProblem } from '../branch-name.ts'
8
8
  import type { NS } from './locales.ts'
9
9
  import css from './WorktreeNameDialog.module.css'
@@ -53,7 +53,7 @@ export function WorktreeNameDialog({ mode, initial, prefix, from, named, submit,
53
53
  const problem = blank ? null : branchNameProblem(value)
54
54
  const error = problem !== null ? t(`branchName.${problem}`) : refusal?.name === value ? refusal.text : null
55
55
  const retry = mode === 'retry'
56
- const send = (name: string | null): void => {
56
+ const send = useCallback((name: string | null): void => {
57
57
  setBusy(true)
58
58
  void submit(name).then((result) => {
59
59
  setBusy(false)
@@ -61,18 +61,26 @@ export function WorktreeNameDialog({ mode, initial, prefix, from, named, submit,
61
61
  else if (name !== null && result === 'branch-exists') setRefusal({ name, text: t('branchName.exists', { name }) })
62
62
  else if (name !== null && result === 'invalid-name') setRefusal({ name, text: t('branchName.invalid') })
63
63
  })
64
- }
64
+ }, [close, submit, t])
65
65
  const confirmable = !busy && error === null && !blank
66
66
  const base = from === null ? null : branchLabel(from)
67
67
  const hint = blank && prefix !== '' ? t('nameDialog.prefixOnly') : base === null ? t('nameDialog.hintHead') : t('nameDialog.hint', { branch: base })
68
+ const sendGenerated = useCallback((): void => { send(null) }, [send])
69
+ const sendValue = useCallback((): void => { send(value) }, [send, value])
70
+ const changeValue = useCallback((event: ChangeEvent<HTMLInputElement>): void => { setValue(event.target.value) }, [])
71
+ const pressEnter = useCallback((event: KeyboardEvent<HTMLInputElement>): void => {
72
+ if (event.key !== 'Enter' || event.nativeEvent.isComposing) return
73
+ event.preventDefault()
74
+ if (confirmable) send(value)
75
+ }, [confirmable, send, value])
68
76
  return (
69
77
  <Modal open onClose={close} title={t(retry ? 'nameDialog.retryTitle' : 'nameDialog.title')} closeLabel={t('nameDialog.close')}
70
78
  footer={<>
71
79
  {named && !retry && (
72
- <Button variant="outline" className={css.auto} disabled={busy} onClick={() => { send(null) }}>{t('nameDialog.auto')}</Button>
80
+ <Button variant="outline" className={css.auto} disabled={busy} onClick={sendGenerated}>{t('nameDialog.auto')}</Button>
73
81
  )}
74
82
  <Button variant="outline" onClick={close}>{t('nameDialog.cancel')}</Button>
75
- <Button variant="primary" disabled={!confirmable} onClick={() => { send(value) }}>
83
+ <Button variant="primary" disabled={!confirmable} onClick={sendValue}>
76
84
  {t(retry ? 'nameDialog.retry' : 'nameDialog.confirm')}
77
85
  </Button>
78
86
  </>}>
@@ -80,12 +88,8 @@ export function WorktreeNameDialog({ mode, initial, prefix, from, named, submit,
80
88
  <label className={css.label} htmlFor={fieldId}>{t('nameDialog.field')}</label>
81
89
  <Input id={fieldId} data-modal-autofocus className={clsx(css.field, error !== null && css.invalid)} value={value}
82
90
  spellCheck={false} autoCapitalize="off" autoComplete="off" aria-invalid={error !== null} aria-describedby={messageId}
83
- onChange={(event) => { setValue(event.target.value) }}
84
- onKeyDown={(event) => {
85
- if (event.key !== 'Enter' || event.nativeEvent.isComposing) return
86
- event.preventDefault()
87
- if (confirmable) send(value)
88
- }} />
91
+ onChange={changeValue}
92
+ onKeyDown={pressEnter} />
89
93
  <p id={messageId} className={clsx(css.message, error !== null && css.error)} role={error === null ? undefined : 'alert'}>{error ?? hint}</p>
90
94
  </div>
91
95
  </Modal>