@deepseek-ai/dsh-experimental-client-ui-forge 0.2.3-alpha.2 → 0.2.3-alpha.3

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 (315) hide show
  1. package/README.i18n.yaml +8 -8
  2. package/README.md +29 -12
  3. package/README.zh.md +29 -12
  4. package/lib/client.js +21 -16
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +874 -170
  7. package/lib/typert.host.js +831 -156
  8. package/lib/typert.remote-client.d.ts +29 -11
  9. package/lib/typert.remote-client.d.ts.map +1 -1
  10. package/lib/typert.remote-client.js +727 -134
  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/AttentionIndicator.d.ts +1 -1
  15. package/lib/types/client/AttentionIndicator.d.ts.map +1 -1
  16. package/lib/types/client/BaseMenu.d.ts +6 -4
  17. package/lib/types/client/BaseMenu.d.ts.map +1 -1
  18. package/lib/types/client/BaseMenu.js.map +1 -1
  19. package/lib/types/client/BranchPicker.d.ts +84 -0
  20. package/lib/types/client/BranchPicker.d.ts.map +1 -0
  21. package/lib/types/client/BranchPicker.js.map +1 -0
  22. package/lib/types/client/ChangeRequestCard.d.ts +21 -12
  23. package/lib/types/client/ChangeRequestCard.d.ts.map +1 -1
  24. package/lib/types/client/ChangeRequestCard.js.map +1 -1
  25. package/lib/types/client/ChangeRequestOverview.d.ts +12 -6
  26. package/lib/types/client/ChangeRequestOverview.d.ts.map +1 -1
  27. package/lib/types/client/ChangeRequestOverview.js.map +1 -1
  28. package/lib/types/client/ChangeRequestsSection.d.ts +5 -3
  29. package/lib/types/client/ChangeRequestsSection.d.ts.map +1 -1
  30. package/lib/types/client/ChangeRequestsSection.js.map +1 -1
  31. package/lib/types/client/ChangedFiles.d.ts +1 -1
  32. package/lib/types/client/ChangedFiles.d.ts.map +1 -1
  33. package/lib/types/client/ChangedFiles.js.map +1 -1
  34. package/lib/types/client/ChangesLoading.d.ts +1 -1
  35. package/lib/types/client/ChangesLoading.d.ts.map +1 -1
  36. package/lib/types/client/ChangesTab.d.ts +15 -7
  37. package/lib/types/client/ChangesTab.d.ts.map +1 -1
  38. package/lib/types/client/ChangesTab.js.map +1 -1
  39. package/lib/types/client/ChangesTabTitle.d.ts +1 -1
  40. package/lib/types/client/ChangesTabTitle.d.ts.map +1 -1
  41. package/lib/types/client/ChangesTabTitle.js.map +1 -1
  42. package/lib/types/client/CommitMenu.d.ts +3 -3
  43. package/lib/types/client/CommitMenu.d.ts.map +1 -1
  44. package/lib/types/client/CommitMenu.js.map +1 -1
  45. package/lib/types/client/DiffFile.d.ts +16 -2
  46. package/lib/types/client/DiffFile.d.ts.map +1 -1
  47. package/lib/types/client/DiffFile.js.map +1 -1
  48. package/lib/types/client/EnvironmentRows.d.ts +6 -6
  49. package/lib/types/client/EnvironmentRows.d.ts.map +1 -1
  50. package/lib/types/client/EnvironmentRows.js.map +1 -1
  51. package/lib/types/client/FileLabel.js.map +1 -1
  52. package/lib/types/client/HeadMenu.d.ts +35 -0
  53. package/lib/types/client/HeadMenu.d.ts.map +1 -0
  54. package/lib/types/client/HeadMenu.js.map +1 -0
  55. package/lib/types/client/HostSettings.d.ts +33 -0
  56. package/lib/types/client/HostSettings.d.ts.map +1 -0
  57. package/lib/types/client/HostSettings.js.map +1 -0
  58. package/lib/types/client/LensFilter.d.ts +2 -2
  59. package/lib/types/client/LensFilter.d.ts.map +1 -1
  60. package/lib/types/client/LensFilter.js.map +1 -1
  61. package/lib/types/client/ReasonButton.js.map +1 -1
  62. package/lib/types/client/RefreshGlyph.js.map +1 -1
  63. package/lib/types/client/ReviewComposer.d.ts +1 -1
  64. package/lib/types/client/ReviewComposer.d.ts.map +1 -1
  65. package/lib/types/client/ReviewComposer.js.map +1 -1
  66. package/lib/types/client/ReviewControls.d.ts +1 -1
  67. package/lib/types/client/ReviewControls.d.ts.map +1 -1
  68. package/lib/types/client/ReviewControls.js.map +1 -1
  69. package/lib/types/client/ReviewThread.d.ts +1 -1
  70. package/lib/types/client/ReviewThread.d.ts.map +1 -1
  71. package/lib/types/client/ReviewThread.js.map +1 -1
  72. package/lib/types/client/ReviewThreads.d.ts +4 -2
  73. package/lib/types/client/ReviewThreads.d.ts.map +1 -1
  74. package/lib/types/client/ReviewThreads.js.map +1 -1
  75. package/lib/types/client/SessionHoverForge.d.ts +1 -1
  76. package/lib/types/client/SessionHoverForge.d.ts.map +1 -1
  77. package/lib/types/client/SessionHoverForge.js.map +1 -1
  78. package/lib/types/client/SessionRowForge.d.ts +1 -1
  79. package/lib/types/client/SessionRowForge.d.ts.map +1 -1
  80. package/lib/types/client/SessionRowForge.js.map +1 -1
  81. package/lib/types/client/SubmitReview.d.ts +1 -1
  82. package/lib/types/client/SubmitReview.d.ts.map +1 -1
  83. package/lib/types/client/SubmitReview.js.map +1 -1
  84. package/lib/types/client/ThreadList.d.ts +3 -1
  85. package/lib/types/client/ThreadList.d.ts.map +1 -1
  86. package/lib/types/client/ThreadList.js.map +1 -1
  87. package/lib/types/client/ViewOptionsMenu.d.ts +1 -1
  88. package/lib/types/client/ViewOptionsMenu.d.ts.map +1 -1
  89. package/lib/types/client/ViewOptionsMenu.js.map +1 -1
  90. package/lib/types/client/WorktreeNameDialog.d.ts +1 -1
  91. package/lib/types/client/WorktreeNameDialog.d.ts.map +1 -1
  92. package/lib/types/client/WorktreeNameDialog.js.map +1 -1
  93. package/lib/types/client/WorktreeProgress.d.ts +1 -1
  94. package/lib/types/client/WorktreeProgress.d.ts.map +1 -1
  95. package/lib/types/client/WorktreeProgress.js.map +1 -1
  96. package/lib/types/client/WorktreeSettings.d.ts +1 -1
  97. package/lib/types/client/WorktreeSettings.d.ts.map +1 -1
  98. package/lib/types/client/WorktreeSettings.js.map +1 -1
  99. package/lib/types/client/WorktreeToggle.d.ts +1 -1
  100. package/lib/types/client/WorktreeToggle.d.ts.map +1 -1
  101. package/lib/types/client/WorktreeToggle.js.map +1 -1
  102. package/lib/types/client/annotations.d.ts +1 -1
  103. package/lib/types/client/annotations.d.ts.map +1 -1
  104. package/lib/types/client/branch-search.d.ts +1 -1
  105. package/lib/types/client/branch-search.d.ts.map +1 -1
  106. package/lib/types/client/branch-search.js.map +1 -1
  107. package/lib/types/client/changes-address.d.ts +1 -1
  108. package/lib/types/client/changes-address.d.ts.map +1 -1
  109. package/lib/types/client/changes-service.d.ts +1 -1
  110. package/lib/types/client/changes-service.d.ts.map +1 -1
  111. package/lib/types/client/changes-store.d.ts +18 -2
  112. package/lib/types/client/changes-store.d.ts.map +1 -1
  113. package/lib/types/client/changes-store.js.map +1 -1
  114. package/lib/types/client/checkout.d.ts +1 -1
  115. package/lib/types/client/checkout.d.ts.map +1 -1
  116. package/lib/types/client/code-selection.d.ts.map +1 -1
  117. package/lib/types/client/code-selection.js.map +1 -1
  118. package/lib/types/client/forge-copy.d.ts +8 -1
  119. package/lib/types/client/forge-copy.d.ts.map +1 -1
  120. package/lib/types/client/forge-copy.js.map +1 -1
  121. package/lib/types/client/format.d.ts +1 -1
  122. package/lib/types/client/format.d.ts.map +1 -1
  123. package/lib/types/client/format.js.map +1 -1
  124. package/lib/types/client/glyphs.d.ts +23 -1
  125. package/lib/types/client/glyphs.d.ts.map +1 -1
  126. package/lib/types/client/glyphs.js.map +1 -1
  127. package/lib/types/client/highlight-context.d.ts +1 -1
  128. package/lib/types/client/highlight-context.d.ts.map +1 -1
  129. package/lib/types/client/host-settings-form.d.ts +69 -0
  130. package/lib/types/client/host-settings-form.d.ts.map +1 -0
  131. package/lib/types/client/host-settings-form.js.map +1 -0
  132. package/lib/types/client/host-sign-in.d.ts +31 -0
  133. package/lib/types/client/host-sign-in.d.ts.map +1 -0
  134. package/lib/types/client/host-sign-in.js.map +1 -0
  135. package/lib/types/client/local-writes.d.ts +47 -0
  136. package/lib/types/client/local-writes.d.ts.map +1 -0
  137. package/lib/types/client/local-writes.js.map +1 -0
  138. package/lib/types/client/locales.d.ts +106 -9
  139. package/lib/types/client/locales.d.ts.map +1 -1
  140. package/lib/types/client/locales.js.map +1 -1
  141. package/lib/types/client/mount.d.ts +15 -1
  142. package/lib/types/client/mount.d.ts.map +1 -1
  143. package/lib/types/client/mount.js.map +1 -1
  144. package/lib/types/client/review-page/ReviewActivity.d.ts +44 -0
  145. package/lib/types/client/review-page/ReviewActivity.d.ts.map +1 -0
  146. package/lib/types/client/review-page/ReviewActivity.js.map +1 -0
  147. package/lib/types/client/review-page/ReviewChat.d.ts +1 -1
  148. package/lib/types/client/review-page/ReviewChat.d.ts.map +1 -1
  149. package/lib/types/client/review-page/ReviewChat.js.map +1 -1
  150. package/lib/types/client/review-page/ReviewDetail.d.ts +23 -9
  151. package/lib/types/client/review-page/ReviewDetail.d.ts.map +1 -1
  152. package/lib/types/client/review-page/ReviewDetail.js.map +1 -1
  153. package/lib/types/client/review-page/ReviewLabels.d.ts +1 -1
  154. package/lib/types/client/review-page/ReviewLabels.d.ts.map +1 -1
  155. package/lib/types/client/review-page/ReviewLabels.js.map +1 -1
  156. package/lib/types/client/review-page/ReviewList.d.ts +10 -8
  157. package/lib/types/client/review-page/ReviewList.d.ts.map +1 -1
  158. package/lib/types/client/review-page/ReviewList.js.map +1 -1
  159. package/lib/types/client/review-page/ReviewNav.d.ts +1 -1
  160. package/lib/types/client/review-page/ReviewNav.d.ts.map +1 -1
  161. package/lib/types/client/review-page/ReviewPage.d.ts +15 -12
  162. package/lib/types/client/review-page/ReviewPage.d.ts.map +1 -1
  163. package/lib/types/client/review-page/ReviewPage.js.map +1 -1
  164. package/lib/types/client/review-page/ReviewSkeleton.d.ts +26 -0
  165. package/lib/types/client/review-page/ReviewSkeleton.d.ts.map +1 -0
  166. package/lib/types/client/review-page/ReviewSkeleton.js.map +1 -0
  167. package/lib/types/client/review-page/ReviewStatus.d.ts +5 -3
  168. package/lib/types/client/review-page/ReviewStatus.d.ts.map +1 -1
  169. package/lib/types/client/review-page/ReviewStatus.js.map +1 -1
  170. package/lib/types/client/review-page/review-activity.d.ts +37 -0
  171. package/lib/types/client/review-page/review-activity.d.ts.map +1 -0
  172. package/lib/types/client/review-page/review-activity.js.map +1 -0
  173. package/lib/types/client/review-page/review-lists.d.ts +48 -13
  174. package/lib/types/client/review-page/review-lists.d.ts.map +1 -1
  175. package/lib/types/client/review-page/review-lists.js.map +1 -1
  176. package/lib/types/client/review-page/review-mount.d.ts +3 -1
  177. package/lib/types/client/review-page/review-mount.d.ts.map +1 -1
  178. package/lib/types/client/review-page/review-mount.js.map +1 -1
  179. package/lib/types/client/review-page/review-store.d.ts +18 -8
  180. package/lib/types/client/review-page/review-store.d.ts.map +1 -1
  181. package/lib/types/client/review-page/review-store.js.map +1 -1
  182. package/lib/types/client/review-queue.d.ts +1 -1
  183. package/lib/types/client/review-queue.d.ts.map +1 -1
  184. package/lib/types/client/review-queue.js.map +1 -1
  185. package/lib/types/client/review-threads.d.ts +1 -1
  186. package/lib/types/client/review-threads.d.ts.map +1 -1
  187. package/lib/types/client/review.d.ts +12 -1
  188. package/lib/types/client/review.d.ts.map +1 -1
  189. package/lib/types/client/review.js.map +1 -1
  190. package/lib/types/client/row-form-labels.d.ts +12 -0
  191. package/lib/types/client/row-form-labels.d.ts.map +1 -0
  192. package/lib/types/client/row-form-labels.js.map +1 -0
  193. package/lib/types/client/session-list.d.ts +1 -1
  194. package/lib/types/client/session-list.d.ts.map +1 -1
  195. package/lib/types/client/slots.d.ts +1 -1
  196. package/lib/types/client/slots.d.ts.map +1 -1
  197. package/lib/types/client/source.d.ts +1 -1
  198. package/lib/types/client/source.d.ts.map +1 -1
  199. package/lib/types/client/status.d.ts +7 -0
  200. package/lib/types/client/status.d.ts.map +1 -1
  201. package/lib/types/client/status.js.map +1 -1
  202. package/lib/types/client/worktree-settings-form.d.ts +1 -1
  203. package/lib/types/client/worktree-settings-form.d.ts.map +1 -1
  204. package/lib/types/client/worktree-settings-form.js.map +1 -1
  205. package/lib/types/diff.d.ts.map +1 -1
  206. package/lib/types/diff.js.map +1 -1
  207. package/lib/types/git.d.ts +22 -0
  208. package/lib/types/git.d.ts.map +1 -1
  209. package/lib/types/git.js.map +1 -1
  210. package/lib/types/index.d.ts +113 -25
  211. package/lib/types/index.d.ts.map +1 -1
  212. package/lib/types/index.js.map +1 -1
  213. package/lib/types/local-diff.d.ts +81 -23
  214. package/lib/types/local-diff.d.ts.map +1 -1
  215. package/lib/types/local-diff.js.map +1 -1
  216. package/lib/types/local-write.d.ts +44 -0
  217. package/lib/types/local-write.d.ts.map +1 -0
  218. package/lib/types/local-write.js.map +1 -0
  219. package/lib/types/parse.d.ts +12 -3
  220. package/lib/types/parse.d.ts.map +1 -1
  221. package/lib/types/parse.js.map +1 -1
  222. package/lib/types/restore.d.ts +12 -0
  223. package/lib/types/restore.d.ts.map +1 -0
  224. package/lib/types/restore.js.map +1 -0
  225. package/lib/types/types.d.ts +106 -8
  226. package/lib/types/types.d.ts.map +1 -1
  227. package/lib/types/viewer-lists.d.ts +22 -13
  228. package/lib/types/viewer-lists.d.ts.map +1 -1
  229. package/lib/types/viewer-lists.js.map +1 -1
  230. package/package.json +60 -58
  231. package/src/client/ActionToast.tsx +2 -2
  232. package/src/client/AttentionIndicator.tsx +1 -1
  233. package/src/client/BaseMenu.module.css +12 -3
  234. package/src/client/BaseMenu.tsx +25 -88
  235. package/src/client/BranchPicker.tsx +161 -0
  236. package/src/client/ChangeRequestCard.tsx +138 -44
  237. package/src/client/ChangeRequestOverview.tsx +21 -9
  238. package/src/client/ChangeRequestsSection.tsx +12 -6
  239. package/src/client/ChangedFiles.tsx +2 -2
  240. package/src/client/ChangesLoading.tsx +1 -1
  241. package/src/client/ChangesTab.module.css +95 -16
  242. package/src/client/ChangesTab.tsx +190 -72
  243. package/src/client/ChangesTabTitle.tsx +2 -2
  244. package/src/client/CommitMenu.tsx +7 -5
  245. package/src/client/DiffFile.tsx +67 -11
  246. package/src/client/EnvironmentRows.tsx +21 -17
  247. package/src/client/FileLabel.tsx +1 -1
  248. package/src/client/Forge.module.css +28 -1
  249. package/src/client/HeadMenu.tsx +69 -0
  250. package/src/client/HostSettings.module.css +194 -0
  251. package/src/client/HostSettings.tsx +192 -0
  252. package/src/client/LensFilter.tsx +2 -2
  253. package/src/client/ReasonButton.tsx +1 -1
  254. package/src/client/RefreshGlyph.tsx +1 -1
  255. package/src/client/ReviewComposer.tsx +2 -2
  256. package/src/client/ReviewControls.tsx +10 -3
  257. package/src/client/ReviewThread.tsx +2 -2
  258. package/src/client/ReviewThreads.tsx +7 -4
  259. package/src/client/SessionHoverForge.tsx +2 -2
  260. package/src/client/SessionRowForge.tsx +2 -2
  261. package/src/client/SubmitReview.tsx +2 -2
  262. package/src/client/ThreadList.tsx +6 -3
  263. package/src/client/ViewOptionsMenu.tsx +2 -2
  264. package/src/client/WorktreeNameDialog.tsx +2 -2
  265. package/src/client/WorktreeProgress.tsx +2 -2
  266. package/src/client/WorktreeSettings.tsx +4 -11
  267. package/src/client/WorktreeToggle.tsx +2 -2
  268. package/src/client/annotations.ts +1 -1
  269. package/src/client/branch-search.tsx +2 -2
  270. package/src/client/changes-address.ts +1 -1
  271. package/src/client/changes-service.ts +1 -1
  272. package/src/client/changes-store.ts +49 -5
  273. package/src/client/checkout.ts +1 -1
  274. package/src/client/code-selection.ts +3 -1
  275. package/src/client/forge-copy.ts +11 -1
  276. package/src/client/format.ts +2 -2
  277. package/src/client/glyphs.tsx +50 -5
  278. package/src/client/highlight-context.ts +1 -1
  279. package/src/client/host-settings-form.ts +115 -0
  280. package/src/client/host-sign-in.ts +46 -0
  281. package/src/client/local-writes.ts +129 -0
  282. package/src/client/locales.ts +841 -65
  283. package/src/client/mount.ts +56 -7
  284. package/src/client/review-page/ReviewActivity.tsx +405 -0
  285. package/src/client/review-page/ReviewChat.tsx +2 -2
  286. package/src/client/review-page/ReviewDetail.tsx +201 -64
  287. package/src/client/review-page/ReviewLabels.tsx +2 -2
  288. package/src/client/review-page/ReviewList.tsx +153 -136
  289. package/src/client/review-page/ReviewNav.tsx +1 -1
  290. package/src/client/review-page/ReviewPage.module.css +490 -13
  291. package/src/client/review-page/ReviewPage.tsx +44 -21
  292. package/src/client/review-page/ReviewSkeleton.tsx +108 -0
  293. package/src/client/review-page/ReviewStatus.tsx +14 -9
  294. package/src/client/review-page/review-activity.ts +64 -0
  295. package/src/client/review-page/review-lists.ts +85 -22
  296. package/src/client/review-page/review-mount.ts +24 -7
  297. package/src/client/review-page/review-store.ts +24 -7
  298. package/src/client/review-queue.ts +7 -3
  299. package/src/client/review-threads.ts +1 -1
  300. package/src/client/review.ts +20 -2
  301. package/src/client/row-form-labels.ts +17 -0
  302. package/src/client/session-list.ts +1 -1
  303. package/src/client/slots.ts +1 -1
  304. package/src/client/source.ts +1 -1
  305. package/src/client/status.ts +20 -0
  306. package/src/client/worktree-settings-form.ts +1 -1
  307. package/src/diff.ts +8 -5
  308. package/src/git.ts +31 -1
  309. package/src/index.ts +241 -50
  310. package/src/local-diff.ts +151 -48
  311. package/src/local-write.ts +159 -0
  312. package/src/parse.ts +26 -4
  313. package/src/restore.ts +15 -0
  314. package/src/types.ts +97 -12
  315. package/src/viewer-lists.ts +124 -48
@@ -0,0 +1,192 @@
1
+ /** A provider row's page on the Plugins page: the hosts the provider serves, each with its sign-in state. */
2
+ import { useEffect, useId, useRef, useState, type ReactNode } from 'react'
3
+ import {
4
+ Button, IconRefreshOutlineRegular, IconTrashOutlineRegular, SettingsForm, StateDot, Tooltip, type StateDotState,
5
+ } from '@deepseek-ai/dsh-client-ui-primitives/client'
6
+ import type { SnapshotStore } from '@deepseek-ai/dsh-client-store'
7
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
8
+ import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
9
+ import { assertNever } from '@deepseek-ai/dsh-util-values'
10
+ import type { ForgePanelKey, NS } from './locales.ts'
11
+ import type { HostFormActions, HostFormState, HostProblem } from './host-settings-form.ts'
12
+ import type { HostSignIn } from './host-sign-in.ts'
13
+ import { rowFormLabels } from './row-form-labels.ts'
14
+ import css from './HostSettings.module.css'
15
+
16
+ /** The forge family of a provider row that has a host page. */
17
+ export type HostForge = 'github' | 'gitlab'
18
+
19
+ /** Registration-side face of a provider row's host page. */
20
+ export interface HostSettingsInjected extends HostFormActions {
21
+ readonly hooks: {
22
+ /** The saved and staged host lists. */
23
+ readonly hostForm: SnapshotStore<HostFormState>
24
+ /** Sign-in state by saved host. */
25
+ readonly signIn: SnapshotStore<ReadonlyMap<string, HostSignIn>>
26
+ }
27
+ /** Which provider the row mounts. */
28
+ readonly forge: HostForge
29
+ /** Read the sign-in state of the saved hosts; `visibly` shows each host as being checked until its read answers. */
30
+ readonly checkSignIn: (hosts: readonly string[], visibly: boolean) => void
31
+ /** Copy a sign-in command and report the outcome. */
32
+ readonly copyCommand: (command: string) => void
33
+ }
34
+
35
+ export type HostSettingsProps = PropsRuntime<'plugins.row.config'> & PropsLocale<typeof NS> & InjectFace<HostSettingsInjected>
36
+
37
+ type Translate = HostSettingsProps['t']
38
+
39
+ /** What differs between the two rows' pages. */
40
+ interface ForgeCopy {
41
+ /** Key of what the provider's hosts call a change request. */
42
+ readonly noun: ForgePanelKey
43
+ /** The CLI the provider signs in with. */
44
+ readonly cli: string
45
+ /** A host name the field shows as its placeholder and a refusal names as an example. */
46
+ readonly example: string
47
+ /** Key of the refusal of a host the other provider serves. */
48
+ readonly taken: ForgePanelKey
49
+ }
50
+
51
+ const FORGES: Record<HostForge, ForgeCopy> = {
52
+ github: { noun: 'noun.pullRequest', cli: 'gh', example: 'github.example.com', taken: 'hosts.taken.gitlab' },
53
+ gitlab: { noun: 'noun.mergeRequest', cli: 'glab', example: 'gitlab.example.com', taken: 'hosts.taken.github' },
54
+ }
55
+
56
+ const STATES: Record<HostSignIn['state'], { readonly dot: StateDotState; readonly key: ForgePanelKey }> = {
57
+ ready: { dot: 'done', key: 'hosts.state.ready' },
58
+ unauthenticated: { dot: 'warning', key: 'hosts.state.unauthenticated' },
59
+ unavailable: { dot: 'error', key: 'hosts.state.unavailable' },
60
+ checking: { dot: 'ongoing', key: 'hosts.state.checking' },
61
+ }
62
+
63
+ const CHECKING: HostSignIn = { state: 'checking' }
64
+
65
+ function problemText(problem: HostProblem, forge: HostForge, t: Translate): string {
66
+ switch (problem.kind) {
67
+ case 'invalid': return t('hosts.invalid', { example: FORGES[forge].example })
68
+ case 'duplicate': return t('hosts.duplicate', { host: problem.host })
69
+ case 'taken': return t(FORGES[forge].taken, { host: problem.host })
70
+ /* v8 ignore next -- closed union. */
71
+ default: return assertNever(problem, 'HostProblem')
72
+ }
73
+ }
74
+
75
+ /**
76
+ * One host of the list: its name, its sign-in state once saved, and its removal. A host that needs sign-in shows the
77
+ * provider's command to copy; a host that could not be checked shows why.
78
+ */
79
+ function HostRow({ host, signIn, removable, disabled, onRemove, onCopy, t }: {
80
+ readonly host: string
81
+ /** The sign-in state of a saved host, or undefined for a host a save would add. */
82
+ readonly signIn: HostSignIn | undefined
83
+ /** Whether another host would remain. */
84
+ readonly removable: boolean
85
+ readonly disabled: boolean
86
+ readonly onRemove: (host: string) => void
87
+ readonly onCopy: (command: string) => void
88
+ readonly t: Translate
89
+ }): ReactNode {
90
+ const command = signIn?.state === 'unauthenticated' ? signIn.signIn?.command : undefined
91
+ const reason = signIn !== undefined && signIn.state !== 'checking' && signIn.state !== 'ready' && command === undefined ? signIn.message : null
92
+ return (
93
+ <li className={css.host} data-forge-host={host}>
94
+ <div className={css.row}>
95
+ <span className={css.name}>{host}</span>
96
+ {signIn === undefined
97
+ ? <span className={css.unsaved}>{t('hosts.state.unsaved')}</span>
98
+ : (
99
+ <span className={css.state} data-state={signIn.state}>
100
+ <StateDot state={STATES[signIn.state].dot} />
101
+ {t(STATES[signIn.state].key)}
102
+ </span>
103
+ )}
104
+ <Tooltip label={removable ? t('hosts.remove', { host }) : t('hosts.keepOne')} side="bottom" delayMs={500}>
105
+ <button type="button" className={css.iconButton} aria-label={t('hosts.remove', { host })} aria-disabled={removable ? undefined : true}
106
+ disabled={disabled} onClick={() => { if (removable) onRemove(host) }}>
107
+ <IconTrashOutlineRegular size={14} />
108
+ </button>
109
+ </Tooltip>
110
+ </div>
111
+ {command !== undefined && (
112
+ <div className={css.command}>
113
+ <code className={css.commandText}>{command}</code>
114
+ <Button size="sm" aria-label={t('signin.copy')} onClick={() => { onCopy(command) }}>{t('signin.copyShort')}</Button>
115
+ </div>
116
+ )}
117
+ {reason !== null && reason !== '' && <p className={css.reason}>{reason}</p>}
118
+ </li>
119
+ )
120
+ }
121
+
122
+ /**
123
+ * Render a provider row's configuration: the hosts it serves, staged until one save, and the sign-in state of each
124
+ * saved host, read when the page shows, after a save, and when the window regains focus. The summary view names the list.
125
+ * @param props - the Plugins page view, the staged list with its actions, the sign-in states, and copy.
126
+ * @returns the row page's form, or the summary line.
127
+ */
128
+ export function HostSettings(props: HostSettingsProps): ReactNode {
129
+ const { t, forge, view } = props
130
+ const labelId = useId()
131
+ const messageId = useId()
132
+ const state = props.useHostForm(value => value)
133
+ const signIn = props.useSignIn(value => value)
134
+ const [text, setText] = useState('')
135
+ const [problem, setProblem] = useState<HostProblem>()
136
+ // The effect reads the latest list and check through refs, so it runs again only when the saved hosts change.
137
+ const saved = useRef(state.saved)
138
+ saved.current = state.saved
139
+ const checkSignIn = useRef(props.checkSignIn)
140
+ checkSignIn.current = props.checkSignIn
141
+ const shown = view === 'page' && state.available
142
+ const savedKey = state.saved.join('\n')
143
+ useEffect(() => {
144
+ if (!shown) return
145
+ const again = (): void => { checkSignIn.current(saved.current, false) }
146
+ again()
147
+ window.addEventListener('focus', again)
148
+ return () => { window.removeEventListener('focus', again) }
149
+ }, [shown, savedKey])
150
+ if (view === 'summary') return t('hosts.title')
151
+ const disabled = !state.writable || state.saving
152
+ const add = (): void => {
153
+ const refused = props.add(text)
154
+ setProblem(refused)
155
+ if (refused === undefined) setText('')
156
+ }
157
+ return (
158
+ <SettingsForm labels={rowFormLabels(t, 'hosts.unavailable')} state={state} onSave={props.save} onDiscard={props.discard}>
159
+ <div className={css.field}>
160
+ <div className={css.head}>
161
+ <span className={css.label} id={labelId}>{t('hosts.title')}</span>
162
+ <Tooltip label={t('hosts.recheck')} side="bottom" delayMs={500}>
163
+ <button type="button" className={css.iconButton} aria-label={t('hosts.recheck')} onClick={() => { props.checkSignIn(state.saved, true) }}>
164
+ <IconRefreshOutlineRegular size={14} />
165
+ </button>
166
+ </Tooltip>
167
+ </div>
168
+ <ul className={css.hosts} aria-labelledby={labelId}>
169
+ {state.draft.map(host => (
170
+ <HostRow key={host} host={host} signIn={state.saved.includes(host) ? signIn.get(host) ?? CHECKING : undefined}
171
+ removable={state.draft.length > 1} disabled={disabled} onRemove={props.remove} onCopy={props.copyCommand} t={t} />
172
+ ))}
173
+ </ul>
174
+ <div className={css.addRow}>
175
+ <input className={css.input} type="text" value={text} placeholder={FORGES[forge].example} aria-label={t('hosts.addLabel')}
176
+ aria-invalid={problem === undefined ? undefined : true} aria-describedby={messageId} disabled={disabled}
177
+ autoComplete="off" autoCapitalize="none" spellCheck={false}
178
+ onChange={(event) => { setText(event.target.value); setProblem(undefined) }}
179
+ onKeyDown={(event) => {
180
+ if (event.key !== 'Enter' || event.nativeEvent.isComposing) return
181
+ event.preventDefault()
182
+ add()
183
+ }} />
184
+ <Button variant="outline" className={css.add} disabled={disabled || text.trim() === ''} onClick={add}>{t('hosts.add')}</Button>
185
+ </div>
186
+ {problem === undefined
187
+ ? <p id={messageId} className={css.hint}>{t('hosts.hint', { noun: t(FORGES[forge].noun), cli: FORGES[forge].cli })}</p>
188
+ : <p id={messageId} className={css.invalid} role="alert">{problemText(problem, forge, t)}</p>}
189
+ </div>
190
+ </SettingsForm>
191
+ )
192
+ }
@@ -1,8 +1,8 @@
1
1
  /** The changes toolbar's filter lens menu: the Host's lenses with the files each keeps among the shown files. */
2
2
 
3
3
  import { useState, type ReactNode } from 'react'
4
- import { IconChevronDownOutlineRegular, IconLayersOutlineRegular, IconLoadingOutlineRegular, Menu, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'
5
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
4
+ import { IconChevronDownOutlineRegular, IconLayersOutlineRegular, IconLoadingOutlineRegular, Menu, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives/client'
5
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
6
6
  import type { LensRun } from './lens-filter.ts'
7
7
  import type { NS } from './locales.ts'
8
8
  import css from './LensFilter.module.css'
@@ -1,7 +1,7 @@
1
1
  /** The info button of a status row that failed, whose tooltip gives the failure's reason. */
2
2
 
3
3
  import type { ReactNode } from 'react'
4
- import { IconInfoOutlineRegular, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'
4
+ import { IconInfoOutlineRegular, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives/client'
5
5
  import css from './Forge.module.css'
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /** Refresh glyph that turns while a refresh runs. */
2
2
 
3
3
  import { useState, type ReactNode } from 'react'
4
- import { IconRefreshOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
4
+ import { IconRefreshOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives/client'
5
5
  import css from './RefreshGlyph.module.css'
6
6
 
7
7
  /** Props of the refresh glyph. */
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { useEffect, useRef, useState, type ReactNode } from 'react'
4
4
  import clsx from 'clsx'
5
- import { Button, IconChevronDownOutlineRegular, Menu, MenuItemButton } from '@deepseek-ai/dsh-client-ui-primitives'
6
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
5
+ import { Button, IconChevronDownOutlineRegular, Menu, MenuItemButton } from '@deepseek-ai/dsh-client-ui-primitives/client'
6
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
7
7
  import type { RemovedRecord, ReviewQueue } from './review-queue.ts'
8
8
  import { INPUT_QUOTE_COPY, reviewRange, settleQuote, type QuoteCopy, type ReviewSelection, type ReviewSource } from './review.ts'
9
9
  import type { NS } from './locales.ts'
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import { useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'
8
- import { IconChevronDownOutlineRegular, Menu, Switch, Tooltip, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'
9
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
8
+ import { IconChevronDownOutlineRegular, Menu, Switch, Tooltip, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives/client'
9
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
10
10
  import type { ChangesLens } from './changes-store.ts'
11
11
  import type { ForgePanelKey, NS } from './locales.ts'
12
12
  import css from './ReviewControls.module.css'
@@ -14,6 +14,13 @@ import css from './ReviewControls.module.css'
14
14
  /** Lenses in display order. */
15
15
  export const LENSES: readonly ChangesLens[] = ['all', 'interface', 'implementation', 'test']
16
16
 
17
+ /**
18
+ * Inert attribute for the measuring copies. React 18 forwards `inert` only as a string, and React 19
19
+ * treats an empty string as false; a non-empty string sets the attribute under both. Typed `object`
20
+ * because React 18's DOM types omit `inert` and React 19's declare it boolean.
21
+ */
22
+ const INERT: object = { inert: 'inert' }
23
+
17
24
  const LENS_LABEL: Record<ChangesLens, ForgePanelKey> = {
18
25
  all: 'lens.all',
19
26
  interface: 'lens.interface',
@@ -154,7 +161,7 @@ export function LensControl({ lens, counts, hideTests, choose, t, need }: LensPr
154
161
  }, [key])
155
162
  return <div ref={root} className={css.lensFit}>
156
163
  <SegmentedChoice label={t('lens.aria')} value={lens} choose={choose} segments={segments} sizing="content" counted={counted} />
157
- <div className={css.measures} aria-hidden="true" {...{ inert: '' }}>
164
+ <div className={css.measures} aria-hidden="true" {...INERT}>
158
165
  <div ref={withCounts}><SegmentedChoice label="" value={lens} choose={choose} segments={segments} sizing="content" /></div>
159
166
  <div ref={labelsOnly}><SegmentedChoice label="" value={lens} choose={choose} segments={segments} sizing="content" counted={false} /></div>
160
167
  </div>
@@ -1,8 +1,8 @@
1
1
  /** Inline comment records and the editing of comment drafts kept in the browser at their captured code location. */
2
2
 
3
3
  import { useCallback, useState, useSyncExternalStore, type ReactNode } from 'react'
4
- import { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives'
5
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
4
+ import { Button, Tag } from '@deepseek-ai/dsh-client-ui-primitives/client'
5
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
6
6
  import type { ReviewActions } from './ReviewComposer.tsx'
7
7
  import { CardMenu, DeleteConfirm } from './ReviewThreads.tsx'
8
8
  import { EMPTY_FILE_REVIEW, type FileReviewState, type ReviewThread as Thread } from './review-queue.ts'
@@ -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. */
@@ -393,7 +396,7 @@ export function ThreadCard({ thread, place, actions, t }: PropsLocale<typeof NS>
393
396
  {t((actions.quoteCopy ?? INPUT_QUOTE_COPY).add)}
394
397
  </Button>
395
398
  {url !== null && <Button size="sm" onClick={() => { actions.openLink(url) }}>
396
- <IconRightUpOutlineRegular size={14} />{t('thread.openOnHost')}
399
+ <ForgeGlyph forge={actions.forge} />{t('thread.openOnHost')}
397
400
  </Button>}
398
401
  {writes !== null && thread.viewerCanResolve && <Resolution thread={thread} writes={writes} t={t} />}
399
402
  </div>
@@ -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'
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { 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'
@@ -5,11 +5,12 @@
5
5
  */
6
6
 
7
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'
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
15
  import { Avatar } from './ReviewThreads.tsx'
15
16
  import { anchorRange, inFileOrder, passesFilter, THREAD_FILTERS, type ThreadFilter, type ThreadPlace } from './review-threads.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
  }
@@ -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>
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { 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'
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { useId, useState, 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'
@@ -7,8 +7,8 @@
7
7
  import { useState, type ReactNode } from 'react'
8
8
  import {
9
9
  Button, IconBranchOutlineRegular, IconCheckOutlineRegular, IconChevronRightOutlineRegular, IconCloseOutlineRegular, StateDot,
10
- } from '@deepseek-ai/dsh-client-ui-primitives'
11
- import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
10
+ } from '@deepseek-ai/dsh-client-ui-primitives/client'
11
+ import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
12
12
  import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
13
13
  import { assertNever } from '@deepseek-ai/dsh-util-values'
14
14
  import { branchLabel } from '../branch-name.ts'
@@ -1,22 +1,15 @@
1
1
  /** The worktree service's row page on the Plugins page: the archive cleanup switch. */
2
2
  import { useId } from 'react'
3
- import { SettingsForm, Switch } from '@deepseek-ai/dsh-client-ui-primitives'
4
- import type { SettingsFormLabels } from '@deepseek-ai/dsh-client-ui-primitives'
5
- import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
3
+ import { SettingsForm, Switch } from '@deepseek-ai/dsh-client-ui-primitives/client'
4
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
6
5
  import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
7
6
  import type { NS } from './locales.ts'
7
+ import { rowFormLabels } from './row-form-labels.ts'
8
8
  import type { WorktreeSettingsInjected } from './worktree-settings-form.ts'
9
9
  import css from './WorktreeSettings.module.css'
10
10
 
11
11
  export type WorktreeSettingsProps = PropsRuntime<'plugins.row.config'> & PropsLocale<typeof NS> & InjectFace<WorktreeSettingsInjected>
12
12
 
13
- function formLabels(t: WorktreeSettingsProps['t']): SettingsFormLabels {
14
- return {
15
- unavailable: t('settings.unavailable'), readOnly: t('settings.readOnly'), saveFailed: t('settings.saveFailed'),
16
- save: t('settings.save'), saving: t('settings.saving'),
17
- }
18
- }
19
-
20
13
  /**
21
14
  * Render the worktree row's configuration: one switch that keeps every
22
15
  * checkout when its Session is archived. The summary view names the switch.
@@ -29,7 +22,7 @@ export function WorktreeSettings(props: WorktreeSettingsProps) {
29
22
  const state = props.useWorktreeForm(value => value)
30
23
  if (props.view === 'summary') return t('settings.retainOnArchive.title')
31
24
  const disabled = !state.writable || state.saving
32
- return <SettingsForm labels={formLabels(t)} state={state} onSave={props.save} onDiscard={props.discard}>
25
+ return <SettingsForm labels={rowFormLabels(t, 'settings.unavailable')} state={state} onSave={props.save} onDiscard={props.discard}>
33
26
  <div className={css.row}>
34
27
  <div className={css.text}>
35
28
  <label className={css.title} htmlFor={id}>{t('settings.retainOnArchive.title')}</label>
@@ -5,8 +5,8 @@ import clsx from 'clsx'
5
5
  import {
6
6
  IconBranchOutlineRegular, IconCheckOutlineRegular, IconChevronDownOutlineRegular, IconEditOutlineRegular, IconPlusOutlineRegular,
7
7
  Menu, MenuItemButton, Tooltip,
8
- } from '@deepseek-ai/dsh-client-ui-primitives'
9
- import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
8
+ } from '@deepseek-ai/dsh-client-ui-primitives/client'
9
+ import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
10
10
  import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
11
11
  import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
12
12
  import { branchLabel, LOCAL_REF_PREFIX, REMOTE_REF_PREFIX } from '../branch-name.ts'
@@ -3,7 +3,7 @@
3
3
  * file's lines.
4
4
  */
5
5
 
6
- import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots'
6
+ import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots/client'
7
7
  import type { ChangesTarget } from './changes-address.ts'
8
8
  import type { ForgeAnnotationSource, ForgeLineAnnotation } from './changes-service.ts'
9
9
 
@@ -1,8 +1,8 @@
1
1
  /** The search shared by the branch pickers: the query, the listing it read, and the status a menu shows instead of rows. */
2
2
 
3
3
  import { useCallback, useEffect, useState, type ReactNode } from 'react'
4
- import { Button, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'
5
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
4
+ import { Button, StateDot } from '@deepseek-ai/dsh-client-ui-primitives/client'
5
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
6
6
  import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
7
7
  import type { NS } from './locales.ts'
8
8
 
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { SidebarRightTabDefinition } from '@deepseek-ai/dsh-client-ui-sidebar-right/client'
10
- import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'
10
+ import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots/client'
11
11
  import type { SessionId } from '@deepseek-ai/dsh-session/types'
12
12
  import type { NS } from './locales.ts'
13
13
  import { numberOf } from './status.ts'
@@ -3,7 +3,7 @@
3
3
  * changes tab's addresses and kinds, opening a view, the titles of Host lenses, and line annotation sources.
4
4
  */
5
5
 
6
- import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots'
6
+ import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots/client'
7
7
  import type { SessionId } from '@deepseek-ai/dsh-session/types'
8
8
  import type { ForgeExtensionState, ForgeLensId } from '../types.ts'
9
9
  import { changesAddress, parseChangesAddress, type ChangesParams, type ChangesTarget } from './changes-address.ts'
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Choices of each changes tab: the local scope, the base branch of the
3
- * `branch` scope, the commits shown, the review layer, whether test files
2
+ * Choices of each changes tab: the local scope, what local changes show in place of the Session's own checkout,
3
+ * the base branch of the `branch` scope, the commits shown, the review layer, whether test files
4
4
  * hide, the side-by-side view, line wrapping, and the navigation it last
5
5
  * applied. One bucket per tab, so two views in one Session keep their own
6
6
  * choices; the bucket ends with the tab record's signal.
@@ -9,6 +9,19 @@
9
9
  import { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-store'
10
10
  import type { ForgeBaseBranch, ForgeCommitRange, ForgeFileLayer, ForgeLocalScope } from '../types.ts'
11
11
 
12
+ /** The branch local changes show in place of the Session's checked-out one. */
13
+ export interface ChangesHead {
14
+ /** Full ref name of the branch. */
15
+ readonly ref: string
16
+ /** The ref without its prefix, which the picker shows. */
17
+ readonly name: string
18
+ /**
19
+ * Top-level directory of the worktree that has the branch checked out, as last listed or read; null when none has,
20
+ * so the branch has the `branch` scope alone.
21
+ */
22
+ readonly worktree: string | null
23
+ }
24
+
12
25
  /** Files a changes tab shows: every file, or the files of one review layer. */
13
26
  export type ChangesLens = 'all' | ForgeFileLayer
14
27
 
@@ -16,6 +29,8 @@ export type ChangesLens = 'all' | ForgeFileLayer
16
29
  export interface ChangesTabState {
17
30
  /** Local changes shown; a change request view ignores it. */
18
31
  scope: ForgeLocalScope['kind']
32
+ /** What local changes show in place of the Session's own checkout, or null for that checkout. */
33
+ head: ChangesHead | null
19
34
  /** Branch the `branch` scope compares with, or null for the automatic fork point; other scopes keep it. */
20
35
  base: ForgeBaseBranch | null
21
36
  /** Commits shown instead of the whole change request or `branch` scope, or null for all of them. */
@@ -49,6 +64,8 @@ function bucket(state: ChangesState, tabId: string): ChangesTabState {
49
64
  export type ChangesActions = {
50
65
  navigated: (draft: ChangesState, tabId: string, revision: number) => void
51
66
  scoped: (draft: ChangesState, tabId: string, scope: ForgeLocalScope['kind']) => void
67
+ headed: (draft: ChangesState, tabId: string, head: ChangesHead | null) => void
68
+ rooted: (draft: ChangesState, tabId: string, worktree: string | null) => void
52
69
  based: (draft: ChangesState, tabId: string, base: ForgeBaseBranch | null) => void
53
70
  committed: (draft: ChangesState, tabId: string, commits: ForgeCommitRange | null) => void
54
71
  lensed: (draft: ChangesState, tabId: string, lens: ChangesLens) => void
@@ -62,8 +79,8 @@ export type ChangesActions = {
62
79
  /** The changes store's actions, also part of the review page's store, whose changes view writes the same choices. */
63
80
  export const changesActions: ChangesActions = {
64
81
  /**
65
- * Apply a navigation; the first one seeds the `branch` scope with the automatic fork point, every commit and file,
66
- * no filter lens, test files shown, two columns, and wrapped lines.
82
+ * Apply a navigation; the first one seeds the `branch` scope of the Session's own checkout with the automatic fork point,
83
+ * every commit and file, no filter lens, test files shown, two columns, and wrapped lines.
67
84
  * @param d - draft state.
68
85
  * @param tabId - the tab being drawn.
69
86
  * @param revision - the navigation revision being applied.
@@ -72,7 +89,7 @@ export const changesActions: ChangesActions = {
72
89
  const tab = d.byTab[tabId]
73
90
  if (tab === undefined) {
74
91
  d.byTab[tabId] = {
75
- scope: 'branch', base: null, commits: null, lens: 'all', filterLens: null, hideTests: false, split: true, wrap: true, navigated: revision,
92
+ scope: 'branch', head: null, base: null, commits: null, lens: 'all', filterLens: null, hideTests: false, split: true, wrap: true, navigated: revision,
76
93
  }
77
94
  } else tab.navigated = revision
78
95
  },
@@ -87,6 +104,33 @@ export const changesActions: ChangesActions = {
87
104
  tab.scope = scope
88
105
  tab.commits = null
89
106
  },
107
+ /**
108
+ * Show local changes of another branch, compared with its automatic fork point and with all of its commits. A
109
+ * branch that no worktree has checked out has no working tree, so choosing one shows the `branch` scope.
110
+ * @param d - draft state.
111
+ * @param tabId - the tab being drawn.
112
+ * @param head - the branch, or null for the Session's own checkout.
113
+ */
114
+ headed: (d, tabId: string, head: ChangesHead | null) => {
115
+ const tab = bucket(d, tabId)
116
+ tab.head = head
117
+ tab.base = null
118
+ tab.commits = null
119
+ if (head !== null && head.worktree === null) tab.scope = 'branch'
120
+ },
121
+ /**
122
+ * Record where the shown branch's worktree is now, as a read found it; without one the tab shows the `branch`
123
+ * scope. A tab that shows the Session's own checkout is unchanged.
124
+ * @param d - draft state.
125
+ * @param tabId - the tab being drawn.
126
+ * @param worktree - top-level directory of the worktree, or null when no worktree has the branch checked out.
127
+ */
128
+ rooted: (d, tabId: string, worktree: string | null) => {
129
+ const tab = bucket(d, tabId)
130
+ if (tab.head === null) return
131
+ tab.head = { ...tab.head, worktree }
132
+ if (worktree === null) tab.scope = 'branch'
133
+ },
90
134
  /**
91
135
  * Compare the `branch` scope with another branch, showing all of its commits.
92
136
  * @param d - draft state.
@@ -1,6 +1,6 @@
1
1
  /** What the panel's checkout row says about the checkout the Session works in. */
2
2
 
3
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'
3
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'
4
4
  import { abbreviateHomePath } from '@deepseek-ai/dsh-util-workspace-path'
5
5
  import { branchLabel } from '../branch-name.ts'
6
6
  import type { ForgePanelState } from '../types.ts'