@adecore/agents-react 0.53.3 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/dist/agents/AgentIcon.js +1 -1
  2. package/dist/agents/AgentModelLabel.js +1 -1
  3. package/dist/agents/accounts.js +1 -1
  4. package/dist/chat/attachments.js +1 -1
  5. package/dist/chat/forks.js +1 -1
  6. package/dist/chat/logic/limit.js +1 -1
  7. package/dist/chat/logic/scrubber.js +1 -1
  8. package/dist/chat/logic/selection-switch.d.ts +6 -0
  9. package/dist/chat/logic/selection-switch.js +42 -0
  10. package/dist/chat/logic/timeline-target.d.ts +1 -1
  11. package/dist/chat/logic/timeline.d.ts +6 -1
  12. package/dist/chat/logic/timeline.js +16 -2
  13. package/dist/chat/logic/tool-looks.js +1 -1
  14. package/dist/chat/logic/tools.js +1 -1
  15. package/dist/chat/logic/workflow.js +1 -1
  16. package/dist/chat/preferences.js +1 -1
  17. package/dist/chat/runtime-modes.js +1 -1
  18. package/dist/chat/send-key.js +1 -1
  19. package/dist/chat/stash.js +2 -2
  20. package/dist/chat/subagent-list.js +1 -1
  21. package/dist/chat/ui/AccountPill.js +3 -3
  22. package/dist/chat/ui/BookmarkMarker.js +6 -6
  23. package/dist/chat/ui/BookmarkSubmenu.js +5 -5
  24. package/dist/chat/ui/ChatActivity.js +15 -14
  25. package/dist/chat/ui/CodeBlock.js +9 -7
  26. package/dist/chat/ui/Composer.js +13 -13
  27. package/dist/chat/ui/ComposerInput.d.ts +1 -1
  28. package/dist/chat/ui/ComposerInput.js +35 -18
  29. package/dist/chat/ui/DiffPool.js +1 -1
  30. package/dist/chat/ui/EditDiff.js +2 -2
  31. package/dist/chat/ui/GoalDock.js +5 -5
  32. package/dist/chat/ui/ImageView.js +4 -4
  33. package/dist/chat/ui/LimitState.js +12 -12
  34. package/dist/chat/ui/Markdown.d.ts +1 -1
  35. package/dist/chat/ui/Markdown.js +11 -10
  36. package/dist/chat/ui/MermaidBlock.js +7 -6
  37. package/dist/chat/ui/MessageActions.js +7 -7
  38. package/dist/chat/ui/ModelMarks.js +2 -2
  39. package/dist/chat/ui/Pickers.d.ts +1 -1
  40. package/dist/chat/ui/Pickers.js +32 -27
  41. package/dist/chat/ui/PromptComposer.d.ts +1 -1
  42. package/dist/chat/ui/PromptComposer.js +5 -5
  43. package/dist/chat/ui/PromptEditor.js +3 -3
  44. package/dist/chat/ui/QuoteButton.js +2 -2
  45. package/dist/chat/ui/ReferenceChip.js +3 -3
  46. package/dist/chat/ui/ReferenceTrail.js +2 -2
  47. package/dist/chat/ui/ResumeCompactionDock.js +3 -3
  48. package/dist/chat/ui/RunSettings.js +11 -11
  49. package/dist/chat/ui/Scrubber.js +4 -4
  50. package/dist/chat/ui/SessionLine.js +2 -2
  51. package/dist/chat/ui/ShellCommand.d.ts +1 -1
  52. package/dist/chat/ui/ShellCommand.js +2 -2
  53. package/dist/chat/ui/SubagentControls.js +3 -3
  54. package/dist/chat/ui/SubagentInfo.js +5 -5
  55. package/dist/chat/ui/SubagentStopButton.js +2 -2
  56. package/dist/chat/ui/SubagentTimeline.js +18 -16
  57. package/dist/chat/ui/Timeline.js +231 -145
  58. package/dist/chat/ui/TimelineMenu.js +7 -7
  59. package/dist/chat/ui/UnifiedDiff.js +2 -2
  60. package/dist/chat/ui/VisualDialogs.js +1 -1
  61. package/dist/chat/ui/VisualFrame.js +4 -4
  62. package/dist/chat/ui/WorkflowAgentLine.d.ts +1 -1
  63. package/dist/chat/ui/WorkflowAgentLine.js +3 -3
  64. package/dist/chat/ui/chip-clipboard.d.ts +1 -1
  65. package/dist/chat/ui/composer/ComposerControls.d.ts +1 -1
  66. package/dist/chat/ui/composer/ComposerControls.js +4 -4
  67. package/dist/chat/ui/composer/ComposerMenu.js +5 -4
  68. package/dist/chat/ui/composer/DraftParts.js +2 -2
  69. package/dist/chat/ui/composer/QueuedMessages.js +2 -2
  70. package/dist/chat/ui/composer/chip-paste.d.ts +1 -1
  71. package/dist/chat/ui/composer/chips.d.ts +1 -1
  72. package/dist/chat/ui/composer/chips.js +2 -2
  73. package/dist/chat/ui/composer/key-handler.js +1 -1
  74. package/dist/chat/ui/composer/placeholder.js +1 -1
  75. package/dist/chat/ui/composer/use-composer-menus.d.ts +1 -1
  76. package/dist/chat/ui/composer/use-composer-menus.js +1 -1
  77. package/dist/chat/ui/composer/use-composer-submit.d.ts +1 -1
  78. package/dist/chat/ui/composer/use-draft-files.d.ts +2 -2
  79. package/dist/chat/ui/composer/use-draft-files.js +1 -1
  80. package/dist/chat/ui/composer/use-effort-stepper.js +1 -1
  81. package/dist/chat/ui/composer/use-prompt-menus.d.ts +2 -2
  82. package/dist/chat/ui/composer/use-prompt-menus.js +1 -1
  83. package/dist/chat/ui/diff/ApprovalReview.js +2 -2
  84. package/dist/chat/ui/diff/DiffOmitted.js +1 -1
  85. package/dist/chat/ui/diff/DiffStack.js +2 -2
  86. package/dist/chat/ui/diff/EditorEditDiff.d.ts +1 -1
  87. package/dist/chat/ui/diff/EditorEditDiff.js +5 -5
  88. package/dist/chat/ui/diff/EditorPatchDiff.d.ts +1 -1
  89. package/dist/chat/ui/diff/EditorPatchDiff.js +1 -1
  90. package/dist/chat/ui/diff/LegacyEditDiff.js +47 -31
  91. package/dist/chat/ui/diff/LegacyUnifiedDiff.js +93 -69
  92. package/dist/chat/ui/diff/RawDiff.js +54 -35
  93. package/dist/chat/ui/diff/syntax-runtime.d.ts +1 -1
  94. package/dist/chat/ui/highlighter.d.ts +1 -1
  95. package/dist/chat/ui/highlighter.js +1 -1
  96. package/dist/chat/ui/icons.js +1 -1
  97. package/dist/chat/ui/intelligent-ui/UiBlockFrame.d.ts +1 -1
  98. package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +4 -4
  99. package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +2 -2
  100. package/dist/chat/ui/intelligent-ui/UiReply.d.ts +2 -2
  101. package/dist/chat/ui/intelligent-ui/UiReply.js +8 -8
  102. package/dist/chat/ui/intelligent-ui/node-text.d.ts +1 -1
  103. package/dist/chat/ui/intelligent-ui/render-context.d.ts +1 -1
  104. package/dist/chat/ui/intelligent-ui/renderers/chart.js +28 -15
  105. package/dist/chat/ui/intelligent-ui/renderers/choices.js +4 -4
  106. package/dist/chat/ui/intelligent-ui/renderers/content.js +6 -6
  107. package/dist/chat/ui/intelligent-ui/renderers/data.js +104 -87
  108. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +3 -3
  109. package/dist/chat/ui/intelligent-ui/renderers/links.js +2 -2
  110. package/dist/chat/ui/intelligent-ui/renderers/map-view.js +4 -4
  111. package/dist/chat/ui/intelligent-ui/renderers/map.js +3 -3
  112. package/dist/chat/ui/intelligent-ui/renderers/structure.js +2 -2
  113. package/dist/chat/ui/intelligent-ui/renderers/text.js +5 -5
  114. package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
  115. package/dist/chat/ui/intelligent-ui/use-ui-links.d.ts +1 -1
  116. package/dist/chat/ui/intelligent-ui/use-ui-links.js +2 -2
  117. package/dist/chat/ui/intelligent-ui/use-ui-queries.js +1 -1
  118. package/dist/chat/ui/reference-icons.d.ts +1 -1
  119. package/dist/chat/ui/reference-icons.js +2 -2
  120. package/dist/chat/ui/reply-context.d.ts +1 -1
  121. package/dist/chat/ui/rows/ForksRow.js +3 -3
  122. package/dist/chat/ui/rows/GeneratedImageRow.js +5 -5
  123. package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
  124. package/dist/chat/ui/rows/MessageRows.js +151 -22
  125. package/dist/chat/ui/rows/Rows.js +39 -21
  126. package/dist/chat/ui/rows/SubagentRow.js +16 -16
  127. package/dist/chat/ui/rows/TaskRow.js +3 -3
  128. package/dist/chat/ui/rows/VisualRow.js +2 -2
  129. package/dist/chat/ui/rows/WorkRows.d.ts +2 -2
  130. package/dist/chat/ui/rows/WorkRows.js +37 -25
  131. package/dist/chat/ui/rows/WorkflowRow.js +8 -8
  132. package/dist/chat/ui/use-diff-source-tokens.js +1 -1
  133. package/dist/chat/ui/visual-theme.d.ts +1 -1
  134. package/dist/chat/ui/visual-theme.js +2 -2
  135. package/dist/chat/workflow-list.js +1 -1
  136. package/dist/host.d.ts +4 -4
  137. package/dist/host.js +1 -1
  138. package/dist/lazy.js +1 -1
  139. package/dist/locales/en/agent-chat.d.ts +4 -0
  140. package/dist/locales/en/agent-chat.js +4 -0
  141. package/dist/locales/nl/agent-chat.d.ts +4 -0
  142. package/dist/locales/nl/agent-chat.js +4 -0
  143. package/dist/port-transport.js +1 -1
  144. package/dist/prompts/logic/subjects.d.ts +1 -1
  145. package/dist/prompts/ui/ApprovalBody.js +16 -7
  146. package/dist/prompts/ui/PromptActions.js +2 -2
  147. package/dist/prompts/ui/PromptCard.js +5 -4
  148. package/dist/prompts/ui/PromptView.js +1 -1
  149. package/dist/prompts/ui/QuestionBody.js +4 -4
  150. package/dist/providers/AccountDetail.js +4 -4
  151. package/dist/providers/AccountOrderList.js +2 -2
  152. package/dist/providers/AccountVariables.js +3 -3
  153. package/dist/providers/AddAccountForm.js +6 -6
  154. package/dist/providers/CliDetail.js +8 -8
  155. package/dist/providers/InstallPage.js +3 -3
  156. package/dist/providers/ProviderList.js +2 -2
  157. package/dist/providers/ProvidersPane.d.ts +1 -1
  158. package/dist/providers/ProvidersPane.js +5 -5
  159. package/dist/providers/install-steps.d.ts +1 -1
  160. package/dist/settings/sections.d.ts +2 -2
  161. package/dist/state/chats.js +1 -1
  162. package/dist/state/usage.js +2 -2
  163. package/dist/theme.css +4 -4
  164. package/dist/transport.d.ts +1 -1
  165. package/dist/usage/LimitsList.js +4 -4
  166. package/dist/usage/UsageBreakdown.js +5 -5
  167. package/dist/usage/UsageChart.js +1 -1
  168. package/dist/usage/UsageDialog.js +1 -1
  169. package/dist/usage/UsageLimits.js +6 -6
  170. package/dist/usage/UsageLimitsCard.js +2 -2
  171. package/dist/usage/UsagePage.js +200 -189
  172. package/dist/usage/UsagePane.js +2 -2
  173. package/dist/usage/UsageSummary.js +1 -1
  174. package/dist/usage/UsageTiles.js +1 -1
  175. package/dist/usage/limit-groups.js +2 -2
  176. package/dist/usage/summary.js +1 -1
  177. package/package.json +9 -8
  178. package/src/agents/AgentIcon.tsx +1 -1
  179. package/src/agents/AgentModelLabel.tsx +2 -2
  180. package/src/agents/ProviderLogo.tsx +1 -1
  181. package/src/agents/accounts.ts +1 -1
  182. package/src/agents/option-words.ts +1 -1
  183. package/src/chat/attachments.ts +1 -1
  184. package/src/chat/bookmarks.ts +1 -1
  185. package/src/chat/drafts.ts +1 -1
  186. package/src/chat/forks.ts +1 -1
  187. package/src/chat/logic/fork.ts +1 -1
  188. package/src/chat/logic/limit.ts +1 -1
  189. package/src/chat/logic/scrubber.ts +1 -1
  190. package/src/chat/logic/selection-switch.ts +47 -0
  191. package/src/chat/logic/timeline-copy.ts +1 -1
  192. package/src/chat/logic/timeline-target.ts +1 -1
  193. package/src/chat/logic/timeline.ts +28 -4
  194. package/src/chat/logic/tool-looks.ts +1 -1
  195. package/src/chat/logic/tools.ts +1 -1
  196. package/src/chat/logic/workflow.ts +1 -1
  197. package/src/chat/pending-prompts.ts +1 -1
  198. package/src/chat/preferences.ts +1 -1
  199. package/src/chat/reading-width.ts +1 -1
  200. package/src/chat/runtime-modes.ts +1 -1
  201. package/src/chat/send-key.ts +1 -1
  202. package/src/chat/stash.ts +2 -2
  203. package/src/chat/subagent-conversation.ts +1 -1
  204. package/src/chat/subagent-list.ts +1 -1
  205. package/src/chat/subagent-view.ts +1 -1
  206. package/src/chat/thumbnails.ts +1 -1
  207. package/src/chat/ui/AccountPill.tsx +4 -4
  208. package/src/chat/ui/BookmarkMarker.tsx +6 -6
  209. package/src/chat/ui/BookmarkSubmenu.tsx +5 -5
  210. package/src/chat/ui/ChatActivity.tsx +15 -15
  211. package/src/chat/ui/CodeBlock.tsx +10 -8
  212. package/src/chat/ui/Composer.tsx +13 -13
  213. package/src/chat/ui/ComposerInput.tsx +10 -2
  214. package/src/chat/ui/DiffPool.tsx +1 -1
  215. package/src/chat/ui/EditDiff.tsx +3 -4
  216. package/src/chat/ui/GoalDock.tsx +6 -6
  217. package/src/chat/ui/ImageView.tsx +4 -4
  218. package/src/chat/ui/LimitState.tsx +13 -13
  219. package/src/chat/ui/Markdown.tsx +12 -12
  220. package/src/chat/ui/MermaidBlock.tsx +6 -6
  221. package/src/chat/ui/MessageActions.tsx +7 -7
  222. package/src/chat/ui/ModelMarks.tsx +2 -2
  223. package/src/chat/ui/Pickers.tsx +10 -10
  224. package/src/chat/ui/PromptComposer.tsx +6 -6
  225. package/src/chat/ui/PromptEditor.tsx +4 -4
  226. package/src/chat/ui/QuoteButton.tsx +2 -2
  227. package/src/chat/ui/ReferenceChip.tsx +3 -3
  228. package/src/chat/ui/ReferenceTrail.tsx +2 -2
  229. package/src/chat/ui/ResumeCompactionDock.tsx +3 -3
  230. package/src/chat/ui/RunSettings.tsx +13 -13
  231. package/src/chat/ui/Scrubber.tsx +4 -4
  232. package/src/chat/ui/SessionLine.tsx +2 -2
  233. package/src/chat/ui/ShellCommand.tsx +2 -2
  234. package/src/chat/ui/SubagentControls.tsx +3 -3
  235. package/src/chat/ui/SubagentInfo.tsx +5 -5
  236. package/src/chat/ui/SubagentStopButton.tsx +3 -3
  237. package/src/chat/ui/SubagentTimeline.tsx +20 -17
  238. package/src/chat/ui/Timeline.tsx +232 -143
  239. package/src/chat/ui/TimelineMenu.tsx +7 -7
  240. package/src/chat/ui/UnifiedDiff.tsx +3 -3
  241. package/src/chat/ui/VisualDialogs.tsx +2 -2
  242. package/src/chat/ui/VisualFrame.tsx +4 -4
  243. package/src/chat/ui/WorkflowAgentLine.tsx +4 -4
  244. package/src/chat/ui/chip-clipboard.ts +1 -1
  245. package/src/chat/ui/composer/ComposerControls.tsx +4 -4
  246. package/src/chat/ui/composer/ComposerMenu.tsx +6 -6
  247. package/src/chat/ui/composer/DraftParts.tsx +2 -2
  248. package/src/chat/ui/composer/QueuedMessages.tsx +2 -2
  249. package/src/chat/ui/composer/chip-paste.ts +1 -1
  250. package/src/chat/ui/composer/chips.ts +2 -2
  251. package/src/chat/ui/composer/key-handler.ts +2 -2
  252. package/src/chat/ui/composer/placeholder.ts +1 -1
  253. package/src/chat/ui/composer/use-chat-controls.ts +1 -1
  254. package/src/chat/ui/composer/use-compaction-offer.ts +1 -1
  255. package/src/chat/ui/composer/use-composer-menus.ts +2 -2
  256. package/src/chat/ui/composer/use-composer-submit.ts +2 -2
  257. package/src/chat/ui/composer/use-draft-files.ts +3 -3
  258. package/src/chat/ui/composer/use-effort-stepper.ts +2 -2
  259. package/src/chat/ui/composer/use-pending-requests.ts +1 -1
  260. package/src/chat/ui/composer/use-prompt-menus.ts +3 -3
  261. package/src/chat/ui/composer/use-take-back.ts +1 -1
  262. package/src/chat/ui/diff/ApprovalReview.tsx +3 -3
  263. package/src/chat/ui/diff/DiffOmitted.tsx +1 -1
  264. package/src/chat/ui/diff/DiffStack.tsx +2 -2
  265. package/src/chat/ui/diff/EditorEditDiff.tsx +5 -5
  266. package/src/chat/ui/diff/EditorPatchDiff.tsx +1 -1
  267. package/src/chat/ui/diff/LegacyDiffPool.tsx +1 -1
  268. package/src/chat/ui/diff/LegacyEditDiff.tsx +18 -9
  269. package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +24 -13
  270. package/src/chat/ui/diff/RawDiff.tsx +8 -5
  271. package/src/chat/ui/diff/syntax-runtime.ts +1 -1
  272. package/src/chat/ui/highlighter.ts +1 -1
  273. package/src/chat/ui/icons.tsx +2 -2
  274. package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +5 -5
  275. package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +2 -2
  276. package/src/chat/ui/intelligent-ui/UiReply.tsx +18 -18
  277. package/src/chat/ui/intelligent-ui/node-text.ts +1 -1
  278. package/src/chat/ui/intelligent-ui/render-context.ts +1 -1
  279. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +15 -7
  280. package/src/chat/ui/intelligent-ui/renderers/choices.tsx +4 -4
  281. package/src/chat/ui/intelligent-ui/renderers/content.tsx +7 -7
  282. package/src/chat/ui/intelligent-ui/renderers/data.tsx +8 -7
  283. package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +3 -3
  284. package/src/chat/ui/intelligent-ui/renderers/links.tsx +4 -4
  285. package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +4 -4
  286. package/src/chat/ui/intelligent-ui/renderers/map.tsx +5 -5
  287. package/src/chat/ui/intelligent-ui/renderers/structure.tsx +3 -3
  288. package/src/chat/ui/intelligent-ui/renderers/text.tsx +5 -5
  289. package/src/chat/ui/intelligent-ui/tones.ts +1 -1
  290. package/src/chat/ui/intelligent-ui/use-ui-links.ts +2 -2
  291. package/src/chat/ui/intelligent-ui/use-ui-queries.ts +1 -1
  292. package/src/chat/ui/reference-icons.ts +2 -2
  293. package/src/chat/ui/reply-context.ts +1 -1
  294. package/src/chat/ui/rows/ForksRow.tsx +3 -3
  295. package/src/chat/ui/rows/GeneratedImageRow.tsx +7 -7
  296. package/src/chat/ui/rows/MessageRows.tsx +57 -33
  297. package/src/chat/ui/rows/RowContainer.tsx +1 -1
  298. package/src/chat/ui/rows/Rows.tsx +7 -4
  299. package/src/chat/ui/rows/SubagentRow.tsx +16 -16
  300. package/src/chat/ui/rows/TaskRow.tsx +4 -4
  301. package/src/chat/ui/rows/VisualRow.tsx +2 -2
  302. package/src/chat/ui/rows/WorkRows.tsx +44 -32
  303. package/src/chat/ui/rows/WorkflowRow.tsx +9 -9
  304. package/src/chat/ui/rows/row-rhythm.ts +1 -1
  305. package/src/chat/ui/use-diff-source-tokens.ts +1 -1
  306. package/src/chat/ui/visual-theme.ts +2 -2
  307. package/src/chat/workflow-list.ts +1 -1
  308. package/src/host.ts +6 -6
  309. package/src/lazy.tsx +1 -1
  310. package/src/locales/en/agent-chat.ts +4 -0
  311. package/src/locales/nl/agent-chat.ts +4 -0
  312. package/src/port-transport.ts +1 -1
  313. package/src/prompts/logic/subjects.ts +1 -1
  314. package/src/prompts/ui/ApprovalBody.tsx +19 -9
  315. package/src/prompts/ui/PromptActions.tsx +2 -2
  316. package/src/prompts/ui/PromptCard.tsx +4 -4
  317. package/src/prompts/ui/PromptView.tsx +1 -1
  318. package/src/prompts/ui/QuestionBody.tsx +5 -5
  319. package/src/providers/AccountDetail.tsx +5 -5
  320. package/src/providers/AccountOrderList.tsx +2 -2
  321. package/src/providers/AccountVariables.tsx +4 -4
  322. package/src/providers/AddAccountForm.tsx +7 -7
  323. package/src/providers/CliDetail.tsx +9 -9
  324. package/src/providers/InstallPage.tsx +4 -4
  325. package/src/providers/ProviderList.tsx +4 -4
  326. package/src/providers/ProvidersPane.tsx +7 -7
  327. package/src/providers/account-actions.ts +1 -1
  328. package/src/providers/install-steps.ts +1 -1
  329. package/src/providers/parts.tsx +1 -1
  330. package/src/providers/provider-abilities.ts +1 -1
  331. package/src/providers/provider-groups.ts +1 -1
  332. package/src/providers/variables.ts +1 -1
  333. package/src/settings/sections.ts +2 -2
  334. package/src/state/chats.ts +2 -2
  335. package/src/state/provider-accounts.ts +1 -1
  336. package/src/state/providers.ts +1 -1
  337. package/src/state/usage.ts +2 -2
  338. package/src/theme.css +4 -4
  339. package/src/transport.ts +1 -1
  340. package/src/usage/LimitsList.tsx +5 -5
  341. package/src/usage/UsageBreakdown.tsx +6 -6
  342. package/src/usage/UsageChart.tsx +2 -2
  343. package/src/usage/UsageDialog.tsx +2 -2
  344. package/src/usage/UsageLimits.tsx +7 -7
  345. package/src/usage/UsageLimitsCard.tsx +2 -2
  346. package/src/usage/UsagePage.tsx +5 -5
  347. package/src/usage/UsagePane.tsx +2 -2
  348. package/src/usage/UsageSummary.tsx +2 -2
  349. package/src/usage/UsageTiles.tsx +1 -1
  350. package/src/usage/limit-groups.ts +2 -2
  351. package/src/usage/limits.ts +1 -1
  352. package/src/usage/summary.ts +1 -1
  353. package/dist/chat/logic/json.d.ts +0 -1
  354. package/dist/chat/logic/json.js +0 -4
  355. package/src/chat/logic/json.ts +0 -4
@@ -1,10 +1,10 @@
1
- import { useState } from 'react';
2
- import type { TFunction } from 'i18next';
3
- import clsx from 'clsx';
4
- import { useTranslation } from 'react-i18next';
5
1
  import type { UiProps } from '@adecore/intelligent-ui';
6
- import { Button, SegmentBar, Tooltip, useMeasuredWidth } from '@adecore/ui';
2
+ import { Button, ScrollArea, SegmentBar, Tooltip, useMeasuredWidth } from '@adecore/ui';
7
3
  import { formatNumber, formatRounded } from '@adecore/ui/format';
4
+ import clsx from 'clsx';
5
+ import type { TFunction } from 'i18next';
6
+ import { useState } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
8
  import { useBlockLocal } from '../block-local';
9
9
  import {
10
10
  UI_CHART_CHARACTER,
@@ -20,9 +20,9 @@ import {
20
20
  type UiChartValues
21
21
  } from '../chart-data';
22
22
  import { uiWithUnit } from '../node-text';
23
- import { useTruncated } from '../use-truncated';
24
23
  import type { UiRenderContext, UiRendererProps } from '../render-context';
25
24
  import { UiFallbackPart } from '../UiFallbackPart';
25
+ import { useTruncated } from '../use-truncated';
26
26
 
27
27
  type ChartKind = UiProps<'Chart'>['kind'];
28
28
 
@@ -168,7 +168,15 @@ function ValuesTable({ values, unit, shown }: { values: UiChartValues; unit: str
168
168
  );
169
169
 
170
170
  // A table grows to its widest cell whatever width it is given, so it is hidden inside a block that clips.
171
- return <div className={shown ? 'max-h-80 w-full overflow-auto rounded-md border border-border-soft' : 'sr-only'}>{table}</div>;
171
+ if (!shown) {
172
+ return <div className="sr-only">{table}</div>;
173
+ }
174
+
175
+ return (
176
+ <ScrollArea axis="both" className="max-h-80 w-full rounded-md border border-border-soft">
177
+ {table}
178
+ </ScrollArea>
179
+ );
172
180
  }
173
181
 
174
182
  /* The values of one category beside the pointer. */
@@ -1,9 +1,9 @@
1
- import { useId, useState } from 'react';
2
- import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
- import { Check } from 'lucide-react';
5
1
  import { uiChoiceLabel, type UiProps } from '@adecore/intelligent-ui';
6
2
  import { DisabledReason, formatShortcut, Icon, KEY_SHORTCUTS, Spinner, Tooltip } from '@adecore/ui';
3
+ import clsx from 'clsx';
4
+ import { Check } from 'lucide-react';
5
+ import { useId, useState } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { useChatHost } from '../../../../host';
8
8
  import type { UiRendererProps } from '../render-context';
9
9
  import { UiFallbackPart } from '../UiFallbackPart';
@@ -1,19 +1,19 @@
1
- import clsx from 'clsx';
2
- import { createContext, useContext, useId, useState, type ReactNode } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import { Box } from 'lucide-react';
5
1
  import type { UiProps } from '@adecore/intelligent-ui';
6
2
  import { ErrorBoundary, Icon, Pill, PreviewCard, Tooltip, Wipe } from '@adecore/ui';
7
3
  import { formatNumber } from '@adecore/ui/format';
4
+ import clsx from 'clsx';
5
+ import { Box } from 'lucide-react';
6
+ import { createContext, useContext, useId, useState, type ReactNode } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
8
  import { useChatHost } from '../../../../host';
9
- import { CodeBlock } from '../../CodeBlock';
9
+ import { useHostAttachmentUrl } from '../../../../host-hooks';
10
10
  import { CodeStreamingContext } from '../../code-streaming';
11
+ import { CodeBlock } from '../../CodeBlock';
12
+ import { DisplayImage } from '../../DisplayImage';
11
13
  import { ImageGroup, ImageThumb } from '../../ImageView';
12
14
  import { uiChildrenOf, uiNodeLabel, uiNodeText, uiUrlDomain } from '../node-text';
13
15
  import type { UiRendererProps } from '../render-context';
14
16
  import { useTruncated } from '../use-truncated';
15
- import { useHostAttachmentUrl } from '../../../../host-hooks';
16
- import { DisplayImage } from '../../DisplayImage';
17
17
 
18
18
  // The number of every source by its node id, which the list counts in its own order.
19
19
  const SourceNumbers = createContext<ReadonlyMap<string, number>>(new Map());
@@ -1,10 +1,10 @@
1
- import { createContext, useContext } from 'react';
2
- import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
- import { ArrowDown, ArrowRight, ArrowUp } from 'lucide-react';
5
1
  import type { UiProps } from '@adecore/intelligent-ui';
6
- import { Button, Icon, KeyValueList, Pill, Tooltip } from '@adecore/ui';
2
+ import { Button, Icon, KeyValueList, Pill, ScrollArea, Tooltip } from '@adecore/ui';
7
3
  import { formatBytes, formatDuration, formatMoment, formatNumber, formatPercent, formatRounded } from '@adecore/ui/format';
4
+ import clsx from 'clsx';
5
+ import { ArrowDown, ArrowRight, ArrowUp } from 'lucide-react';
6
+ import { createContext, useContext } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
8
  import { useBlockLocal } from '../block-local';
9
9
  import { uiChildrenOf, uiWithUnit } from '../node-text';
10
10
  import type { UiLiveValue, UiRendererProps } from '../render-context';
@@ -173,7 +173,8 @@ export function TableRenderer({ node, context }: UiRendererProps<UiProps<'Table'
173
173
 
174
174
  return (
175
175
  <div className="flex flex-col items-start gap-1.5">
176
- <div className="chat-ui-flat max-h-80 w-full overflow-auto rounded-xl bg-ui-tile px-1.5 pb-1.5">
176
+ {/* Flat on both parts: a section drops the frame's ground and the viewport's padding. */}
177
+ <ScrollArea axis="both" className="chat-ui-flat max-h-80 w-full rounded-xl bg-ui-tile" viewportClassName="chat-ui-flat px-1.5 pb-1.5">
177
178
  <table
178
179
  aria-label={t('blocks.table.label', { columns: columns.map((column) => column.title).join(', ') })}
179
180
  className={clsx(
@@ -223,7 +224,7 @@ export function TableRenderer({ node, context }: UiRendererProps<UiProps<'Table'
223
224
  ))}
224
225
  </tbody>
225
226
  </table>
226
- </div>
227
+ </ScrollArea>
227
228
  {!all && rows.length > UI_TABLE_ROWS && (
228
229
  <Button size="xs" variant="secondary" onClick={() => setAll(true)}>
229
230
  {t('blocks.table.showAll', { total: formatNumber(rows.length) })}
@@ -1,9 +1,9 @@
1
- import { createContext, useContext, useId, type MouseEvent, type ReactNode } from 'react';
2
- import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
1
  import type { UiProps } from '@adecore/intelligent-ui';
5
2
  import { Button, Checkbox, Input, Segmented, Select, Slider, Switch, Tooltip } from '@adecore/ui';
6
3
  import { formatNumber } from '@adecore/ui/format';
4
+ import clsx from 'clsx';
5
+ import { createContext, useContext, useId, type MouseEvent, type ReactNode } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { uiChildrenOf, uiNodeLabel, uiOwnLabel, uiWithUnit } from '../node-text';
8
8
  import type { UiRendererProps } from '../render-context';
9
9
  import { useTruncated } from '../use-truncated';
@@ -1,9 +1,9 @@
1
- import type { ReactNode } from 'react';
2
- import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
- import { FileDiff, GitCommitHorizontal, SquareDashed } from 'lucide-react';
5
1
  import type { UiProps } from '@adecore/intelligent-ui';
6
2
  import { FileIcon, Icon, Tooltip } from '@adecore/ui';
3
+ import clsx from 'clsx';
4
+ import { FileDiff, GitCommitHorizontal, SquareDashed } from 'lucide-react';
5
+ import type { ReactNode } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { CHIP_IN_MESSAGE } from '../../chips';
8
8
  import { uiReasonText } from '../node-text';
9
9
  import type { UiLink, UiLinkTarget, UiRenderContext, UiRendererProps } from '../render-context';
@@ -1,13 +1,13 @@
1
1
  import 'maplibre-gl/dist/maplibre-gl.css';
2
- import { useEffect, useRef, useState } from 'react';
3
- import { Map as MapLibreMap, Marker, setWorkerUrl } from 'maplibre-gl';
2
+ import { ButtonGroup, IconButton } from '@adecore/ui';
4
3
  import { Maximize, Minus, Plus } from 'lucide-react';
4
+ import { Map as MapLibreMap, Marker, setWorkerUrl } from 'maplibre-gl';
5
+ import { useEffect, useRef, useState } from 'react';
5
6
  import { useTranslation } from 'react-i18next';
6
- import { ButtonGroup, IconButton } from '@adecore/ui';
7
7
  import { useChatHost, type UiMapSource } from '../../../../host';
8
+ import { useHostCodeMode } from '../../../../host-hooks';
8
9
  import { watchTheme } from '../../theme-watch';
9
10
  import { baseMapStyle, boundsOf, localizedTextField, mapFitOptions, spreadOverlaps, type MapColors, type MapPoint } from './map-style';
10
- import { useHostCodeMode } from '../../../../host-hooks';
11
11
 
12
12
  /*
13
13
  * What the view is drawing: `base` by the source's choice, `offline` and `unavailable` as a fallback from tiles that
@@ -1,21 +1,21 @@
1
- import { useId, useState, type ReactNode } from 'react';
2
- import type { TFunction } from 'i18next';
3
- import clsx from 'clsx';
4
- import { useTranslation } from 'react-i18next';
5
1
  import type { UiProps, UiViewNode } from '@adecore/intelligent-ui';
6
2
  import { Button, LazyBoundary, Spinner } from '@adecore/ui';
3
+ import clsx from 'clsx';
4
+ import type { TFunction } from 'i18next';
5
+ import { useId, useState, type ReactNode } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { useChatHost, type UiMapSource } from '../../../../host';
8
8
  import { useHostMapSource } from '../../../../host-hooks';
9
9
  import { lazyNamed } from '../../../../lazy';
10
10
  import { DiffFallbackBoundary } from '../../diff/DiffFallbackBoundary';
11
11
  import { uiChildrenOf, uiNodeLabel } from '../node-text';
12
12
  import type { UiPlacePoint, UiRendererProps } from '../render-context';
13
- import { placePoint } from './place-point';
14
13
  import { useInView } from '../use-in-view';
15
14
  import { useLater } from '../use-later';
16
15
  import { bindingOf, PENDING } from './binding';
17
16
  import { useMapSlot } from './map-slots';
18
17
  import type { MapMarker, MapViewStatus } from './map-view';
18
+ import { placePoint } from './place-point';
19
19
 
20
20
  // MapLibre and its stylesheet load with the first map that is drawn, never with the chat.
21
21
  const MapView = lazyNamed(() => import('./map-view'), 'MapView');
@@ -1,8 +1,8 @@
1
- import { createContext, useContext, useId } from 'react';
2
- import clsx from 'clsx';
3
- import { ChevronRight } from 'lucide-react';
4
1
  import type { UiProps } from '@adecore/intelligent-ui';
5
2
  import { Icon, Tabs } from '@adecore/ui';
3
+ import clsx from 'clsx';
4
+ import { ChevronRight } from 'lucide-react';
5
+ import { createContext, useContext, useId } from 'react';
6
6
  import { useBlockLocal } from '../block-local';
7
7
  import { uiChildrenOf } from '../node-text';
8
8
  import type { UiRendererProps } from '../render-context';
@@ -1,12 +1,12 @@
1
- import { useContext } from 'react';
2
- import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
- import { Circle, CircleCheck, CircleDot, CircleMinus, CircleX, type LucideIcon } from 'lucide-react';
5
1
  import { parseUiEventTime, type UiProps } from '@adecore/intelligent-ui';
6
2
  import { Icon, Meter, Pill, Spinner } from '@adecore/ui';
7
3
  import { formatNumber, formatPercent } from '@adecore/ui/format';
8
- import { UiHeadContext, type UiRenderContext, type UiRendererProps } from '../render-context';
4
+ import clsx from 'clsx';
5
+ import { Circle, CircleCheck, CircleDot, CircleMinus, CircleX, type LucideIcon } from 'lucide-react';
6
+ import { useContext } from 'react';
7
+ import { useTranslation } from 'react-i18next';
9
8
  import { uiEventTime, uiNodeLabel } from '../node-text';
9
+ import { UiHeadContext, type UiRenderContext, type UiRendererProps } from '../render-context';
10
10
  import { UI_STEP_PILL, UI_TONE_FILL, UI_TONE_ICONS, UI_TONE_PILL, UI_TONE_SURFACE, UI_TONE_TEXT } from '../tones';
11
11
 
12
12
  type StepState = UiProps<'Step'>['state'];
@@ -1,6 +1,6 @@
1
- import { CircleCheck, Info, MessageCircle, OctagonAlert, TriangleAlert, type LucideIcon } from 'lucide-react';
2
1
  import type { UiTone } from '@adecore/intelligent-ui';
3
2
  import type { PillProps } from '@adecore/ui';
3
+ import { CircleCheck, Info, MessageCircle, OctagonAlert, TriangleAlert, type LucideIcon } from 'lucide-react';
4
4
 
5
5
  /* Every tone has an icon of its own, so color is never the only thing that tells two apart. */
6
6
  export const UI_TONE_ICONS: Readonly<Record<UiTone, LucideIcon>> = {
@@ -1,7 +1,7 @@
1
- import { useEffect, useRef, useState } from 'react';
2
1
  import type { ChatUiLinkReading, ChatUiQueryState } from '@adecore/agent-contracts';
3
- import { uiLinkTargets, type UiLinkTarget } from '@adecore/intelligent-ui/links';
4
2
  import { uiInputValues, UI_HOST_LIMITS, type UiBlock, UiState } from '@adecore/intelligent-ui';
3
+ import { uiLinkTargets, type UiLinkTarget } from '@adecore/intelligent-ui/links';
4
+ import { useEffect, useRef, useState } from 'react';
5
5
  import { useChatHost } from '../../../host';
6
6
  import type { UiRenderContext } from './render-context';
7
7
 
@@ -1,6 +1,6 @@
1
- import { useEffect, useMemo, useRef, useState } from 'react';
2
1
  import type { ChatUiQueryReading, ChatUiQueryState } from '@adecore/agent-contracts';
3
2
  import { uiInputValues, UI_CATALOG_VERSION, UI_HOST_LIMITS, UiState, type UiBlock, type UiViewNode, type UiNode } from '@adecore/intelligent-ui';
3
+ import { useEffect, useMemo, useRef, useState } from 'react';
4
4
  import { useChatHost } from '../../../host';
5
5
  import type { UiLiveValue, UiLiveStatus, UiRenderContext } from './render-context';
6
6
 
@@ -1,4 +1,4 @@
1
- import { createElement, type ComponentType, type ReactNode } from 'react';
1
+ import { Icon } from '@adecore/ui';
2
2
  import {
3
3
  Database,
4
4
  FileText,
@@ -15,7 +15,7 @@ import {
15
15
  Workflow,
16
16
  type LucideIcon
17
17
  } from 'lucide-react';
18
- import { Icon } from '@adecore/ui';
18
+ import { createElement, type ComponentType, type ReactNode } from 'react';
19
19
  import type { ReferenceIconProps } from '../../host';
20
20
  import type { ReferableKind } from '../chat-references';
21
21
 
@@ -1,6 +1,6 @@
1
+ import type { ChatInfo } from '@adecore/agent-contracts';
1
2
  import { createContext } from 'react';
2
3
  import type { UiReplyTarget } from '../logic/timeline-target';
3
- import type { ChatInfo } from '@adecore/agent-contracts';
4
4
 
5
5
  export const ReplyContext = createContext<{ provider: ChatInfo['provider']; chatId?: string } | null>(null);
6
6
 
@@ -1,9 +1,9 @@
1
- import { useTranslation } from 'react-i18next';
1
+ import { Icon, Menu } from '@adecore/ui';
2
2
  import { ChevronRight, GitFork } from 'lucide-react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { useHostChatPlace } from '../../../host-hooks';
3
5
  import { useForkIdsAfter } from '../../forks';
4
6
  import { ROW_GUTTER } from '../icons';
5
- import { Icon, Menu } from '@adecore/ui';
6
- import { useHostChatPlace } from '../../../host-hooks';
7
7
 
8
8
  const LINE = '-mx-1 mb-0.5 flex h-7 items-center gap-2 rounded-md px-1 text-xs text-text-muted';
9
9
  const LINK = `${LINE} hover:bg-surface-hover hover:text-text data-[popup-open]:bg-surface-hover data-[popup-open]:text-text`;
@@ -1,11 +1,12 @@
1
- import { useEffect, useState } from 'react';
2
- import type { TFunction } from 'i18next';
3
- import clsx from 'clsx';
4
- import { Trans, useTranslation } from 'react-i18next';
5
- import { Check, Copy, Ellipsis, ExternalLink, FolderDown, ImageIcon, Maximize2 } from 'lucide-react';
6
1
  import type { ChatAttachment, ChatToolItem } from '@adecore/agent-contracts';
7
2
  import { Button, ButtonGroup, copyText, ErrorBoundary, FileIcon, Icon, IconButton, Menu, Surface } from '@adecore/ui';
3
+ import clsx from 'clsx';
4
+ import type { TFunction } from 'i18next';
5
+ import { Check, Copy, Ellipsis, ExternalLink, FolderDown, ImageIcon, Maximize2 } from 'lucide-react';
6
+ import { useEffect, useState } from 'react';
7
+ import { Trans, useTranslation } from 'react-i18next';
8
8
  import { useChatHost } from '../../../host';
9
+ import { useHostAttachmentUrl } from '../../../host-hooks';
9
10
  import { useChatScope } from '../../../scope';
10
11
  import { useCurrentItem } from '../../../state/chats';
11
12
  import { formatBytes } from '../../attachments';
@@ -14,10 +15,9 @@ import { toolStartedAt } from '../../logic/tools';
14
15
  import { CHIP_IN_MESSAGE, MENTION_TONE } from '../chips';
15
16
  import { useFileLinkCwd, useOpenFileLink } from '../file-links';
16
17
  import { HostMenuItems } from '../HostMenuItems';
17
- import { ImageThumb } from '../ImageView';
18
18
  import { ROW_GUTTER } from '../icons';
19
+ import { ImageThumb } from '../ImageView';
19
20
  import { RunningFor, WorkRow } from './WorkRows';
20
- import { useHostAttachmentUrl } from '../../../host-hooks';
21
21
 
22
22
  const SAVED_FLASH_MS = 2000;
23
23
 
@@ -1,6 +1,19 @@
1
- import { useContext, useState, type ReactNode } from 'react';
1
+ import type {
2
+ ChatApprovalItem,
3
+ ChatAttachment,
4
+ ChatAssistantItem,
5
+ ChatNoteMessage,
6
+ ChatQuestionItem,
7
+ ChatThinkingItem,
8
+ ChatToolItem,
9
+ ChatUiChoiceOrigin,
10
+ ChatUserItem,
11
+ ModelSelection
12
+ } from '@adecore/agent-contracts';
13
+ import { WAITING_NOTE_PREFIX } from '@adecore/agent-contracts';
14
+ import { Icon, IconButton, MiddleTruncate, Tooltip, useTickingText } from '@adecore/ui';
15
+ import { formatAgo, formatElapsedShort, formatMoment, formatTokens } from '@adecore/ui/format';
2
16
  import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
17
  import {
5
18
  Bot,
6
19
  Brain,
@@ -16,46 +29,35 @@ import {
16
29
  TriangleAlert,
17
30
  X
18
31
  } from 'lucide-react';
19
- import type {
20
- ChatApprovalItem,
21
- ChatAttachment,
22
- ChatAssistantItem,
23
- ChatNoteMessage,
24
- ChatQuestionItem,
25
- ChatThinkingItem,
26
- ChatToolItem,
27
- ChatUiChoiceOrigin,
28
- ChatUserItem
29
- } from '@adecore/agent-contracts';
30
- import { WAITING_NOTE_PREFIX } from '@adecore/agent-contracts';
31
- import { fileBadge, formatBytes, isImageAttachment } from '../../attachments';
32
- import { useChatRow, useCurrentItem } from '../../../state/chats';
32
+ import { useContext, useState, type ReactNode } from 'react';
33
+ import { useTranslation } from 'react-i18next';
34
+ import { useChatHost, type CommandLookSent, type ReplyAuthor } from '../../../host';
35
+ import { useHostAttachmentUrl, useHostChatPlace, useHostReplyAuthor, useHostStreaming } from '../../../host-hooks';
33
36
  import { useChatScope } from '../../../scope';
34
- import { splitQuote } from '../../quote';
35
- import { jumpToTimelineItem } from '../../timeline-scroll';
37
+ import { useChatRow, useCurrentItem } from '../../../state/chats';
36
38
  import { useProviders } from '../../../state/providers';
39
+ import { fileBadge, formatBytes, isImageAttachment } from '../../attachments';
37
40
  import { referenceTokens } from '../../chat-references';
41
+ import { selectionSwitchText } from '../../logic/selection-switch';
42
+ import { thoughtLine, thoughtPreview } from '../../logic/thought';
43
+ import { toolStartedAt, toolSummary, toolSummaryIsPath } from '../../logic/tools';
38
44
  import { presentReferences } from '../../mentions';
39
- import { ReferenceChip } from '../ReferenceChip';
40
- import { ReferenceLookupContext } from '../reference-lookup';
45
+ import { splitQuote } from '../../quote';
46
+ import { jumpToTimelineItem } from '../../timeline-scroll';
47
+ import { copySelectionWithChips } from '../chip-clipboard';
48
+ import { REFERENCE_TONE, TOKEN_IN_MESSAGE } from '../chips';
49
+ import { FadingWords } from '../FadingWords';
50
+ import { useOpenForFind } from '../find-reveal';
51
+ import { ROW_GUTTER } from '../icons';
41
52
  import { ImageGroup, ImageThumb } from '../ImageView';
53
+ import { UiReply } from '../intelligent-ui/UiReply';
42
54
  import { Markdown, MessageMarkdown, ReplyMarkdown } from '../Markdown';
43
- import { FadingWords } from '../FadingWords';
44
55
  import { settledBlocksText } from '../markdown-blocks';
56
+ import { ReferenceLookupContext } from '../reference-lookup';
57
+ import { ReferenceChip } from '../ReferenceChip';
45
58
  import { WHOLE_FADE_CLASS } from '../rehype-fade';
46
- import { useRevealedText } from '../reveal';
47
- import { formatAgo, formatElapsedShort, formatMoment, formatTokens } from '@adecore/ui/format';
48
- import { Icon, IconButton, MiddleTruncate, Tooltip, useTickingText } from '@adecore/ui';
49
- import { thoughtLine, thoughtPreview } from '../../logic/thought';
50
- import { toolStartedAt, toolSummary, toolSummaryIsPath } from '../../logic/tools';
51
- import { ROW_GUTTER } from '../icons';
52
- import { useOpenForFind } from '../find-reveal';
53
59
  import { ReplyContext, UiReplyNavigationContext } from '../reply-context';
54
- import { UiReply } from '../intelligent-ui/UiReply';
55
- import { useChatHost, type CommandLookSent, type ReplyAuthor } from '../../../host';
56
- import { useHostAttachmentUrl, useHostChatPlace, useHostReplyAuthor, useHostStreaming } from '../../../host-hooks';
57
- import { REFERENCE_TONE, TOKEN_IN_MESSAGE } from '../chips';
58
- import { copySelectionWithChips } from '../chip-clipboard';
60
+ import { useRevealedText } from '../reveal';
59
61
  import { useReferenceLookup } from '../thread-references';
60
62
  import { RunningFor, ToolBody } from './WorkRows';
61
63
 
@@ -717,6 +719,28 @@ export function CompactionRow({ preTokens }: { preTokens: number | null }) {
717
719
  );
718
720
  }
719
721
 
722
+ /* A solid line where the model or effort changed, so a reader can tell which answers came from which. */
723
+ export function SelectionSwitchRow({ chatId, from, to }: { chatId: string; from: ModelSelection; to: ModelSelection }) {
724
+ const { t } = useTranslation('agent-chat');
725
+ const provider = useChatRow(chatId, (row) => row?.info.provider);
726
+ const models = useProviders((s) => s.providers.find((entry) => entry.kind === provider)?.models);
727
+ const text = selectionSwitchText(from, to, models);
728
+
729
+ if (text === null) {
730
+ return null;
731
+ }
732
+
733
+ return (
734
+ <div className="flex items-center gap-3 pb-3 text-xs text-text-faint">
735
+ <span className="grow border-t border-border" />
736
+ <Tooltip label={t('rows.selectionSwitch.summary')}>
737
+ <span>{t('rows.selectionSwitch.label', { from: text.from, to: text.to })}</span>
738
+ </Tooltip>
739
+ <span className="grow border-t border-border" />
740
+ </div>
741
+ );
742
+ }
743
+
720
744
  const DECISION_ICON: Record<Exclude<ChatApprovalItem['decision'], 'pending'>, ReactNode> = {
721
745
  allow: <Icon icon={Check} size={12} />,
722
746
  'allow-always': <Icon icon={Check} size={12} />,
@@ -1,5 +1,5 @@
1
- import type { ReactNode, Ref } from 'react';
2
1
  import clsx from 'clsx';
2
+ import type { ReactNode, Ref } from 'react';
3
3
  import { useChatHost } from '../../../host';
4
4
  import type { TimelineRow } from '../../logic/timeline';
5
5
  import { rowPosition, rowRhythm, saidToChat } from './row-rhythm';
@@ -1,8 +1,11 @@
1
- import { useTranslation } from 'react-i18next';
2
1
  import { ErrorBoundary } from '@adecore/ui';
2
+ import { useTranslation } from 'react-i18next';
3
3
  import type { ThreadCard } from '../../../host';
4
+ import { isImageGeneration } from '../../logic/generated-image';
4
5
  import type { TimelineRow } from '../../logic/timeline';
5
6
  import type { SubagentStep } from '../../subagent-view';
7
+ import { ForksRow } from './ForksRow';
8
+ import { GeneratedImageRow } from './GeneratedImageRow';
6
9
  import {
7
10
  AgentTurnRow,
8
11
  ApprovalHistoryRow,
@@ -12,14 +15,12 @@ import {
12
15
  NoteRow,
13
16
  QuestionHistoryRow,
14
17
  ReportRow,
18
+ SelectionSwitchRow,
15
19
  SentByAgentRow,
16
20
  SentMessageRow,
17
21
  ThinkingRow,
18
22
  UserRow
19
23
  } from './MessageRows';
20
- import { isImageGeneration } from '../../logic/generated-image';
21
- import { ForksRow } from './ForksRow';
22
- import { GeneratedImageRow } from './GeneratedImageRow';
23
24
  import { SubagentBranchRow } from './SubagentRow';
24
25
  import { VisualRow } from './VisualRow';
25
26
  import { WorkflowRow } from './WorkflowRow';
@@ -116,6 +117,8 @@ export function Row({ row, chatId, toggleGroup, toggleTurn, toggleSubagent, open
116
117
  return <SentByAgentRow chatId={chatId} id={row.id} tool={row.tool} sent={row.sent} />;
117
118
  case 'compaction':
118
119
  return <CompactionRow preTokens={row.preTokens} />;
120
+ case 'selection-switch':
121
+ return <SelectionSwitchRow chatId={chatId} from={row.from} to={row.to} />;
119
122
  case 'working':
120
123
  return <WorkingRow startedAt={row.startedAt} {...(row.tool === undefined ? {} : { tool: row.tool })} />;
121
124
  case 'app-card':
@@ -1,24 +1,24 @@
1
- import { useLayoutEffect, useRef, useState } from 'react';
1
+ import type { ChatAssistantItem, ChatItem, ChatSubagentItem } from '@adecore/agent-contracts';
2
+ import { Icon, ScrollArea, useNow } from '@adecore/ui';
3
+ import { formatElapsedShort } from '@adecore/ui/format';
2
4
  import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
5
  import { Bot, ChevronDown } from 'lucide-react';
5
- import type { ChatAssistantItem, ChatItem, ChatSubagentItem } from '@adecore/agent-contracts';
6
+ import { useLayoutEffect, useRef, useState } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { type SubagentTask } from '../../../host';
9
+ import { useHostHidesToolCalls, useHostTask } from '../../../host-hooks';
10
+ import { useChatScope } from '../../../scope';
11
+ import { useCurrentItem } from '../../../state/chats';
12
+ import { isImageGeneration } from '../../logic/generated-image';
6
13
  import type { SubagentBranch } from '../../logic/timeline';
7
- import { formatElapsedShort } from '@adecore/ui/format';
8
- import { Icon, useNow } from '@adecore/ui';
14
+ import { entryTimeOf, statusWordOf, taskIdOf } from '../../subagent-list';
15
+ import { useSubagentSupport } from '../../subagent-support';
16
+ import { canOpenSubagent, crumbOf, type SubagentStep } from '../../subagent-view';
9
17
  import { useOpenForFind } from '../find-reveal';
10
18
  import { Markdown } from '../Markdown';
11
- import { TaskRow } from './TaskRow';
12
- import { isImageGeneration } from '../../logic/generated-image';
13
19
  import { GeneratedImageRow } from './GeneratedImageRow';
20
+ import { TaskRow } from './TaskRow';
14
21
  import { RunningFor, ToggleLine, WorkLiveRow, WorkRow } from './WorkRows';
15
- import { entryTimeOf, statusWordOf, taskIdOf } from '../../subagent-list';
16
- import { useSubagentSupport } from '../../subagent-support';
17
- import { canOpenSubagent, crumbOf, type SubagentStep } from '../../subagent-view';
18
- import { type SubagentTask } from '../../../host';
19
- import { useChatScope } from '../../../scope';
20
- import { useCurrentItem } from '../../../state/chats';
21
- import { useHostHidesToolCalls, useHostTask } from '../../../host-hooks';
22
22
 
23
23
  // The work of a long-running agent scrolls inside its row instead of pushing the thread away.
24
24
  const CHILDREN_MAX_PX = 320;
@@ -106,12 +106,12 @@ function SubagentWork({ chatId, item, work }: { chatId: string; item: ChatSubage
106
106
  }
107
107
 
108
108
  return (
109
- <div ref={scroller} className="ml-6 overflow-y-auto" style={{ maxHeight: CHILDREN_MAX_PX }}>
109
+ <ScrollArea viewportRef={scroller} className="ml-6" style={{ maxHeight: CHILDREN_MAX_PX }}>
110
110
  {item.itemsTruncated && <div className="pb-1 text-xs text-text-faint">{t('rows.subagent.truncated')}</div>}
111
111
  {shown.map((child) => (
112
112
  <ChildRow key={child.id} chatId={chatId} item={child} />
113
113
  ))}
114
- </div>
114
+ </ScrollArea>
115
115
  );
116
116
  }
117
117
 
@@ -1,9 +1,9 @@
1
- import clsx from 'clsx';
2
- import { useTranslation } from 'react-i18next';
3
- import { Bot, ChevronRight } from 'lucide-react';
4
1
  import type { ChatSubagentItem } from '@adecore/agent-contracts';
5
- import { formatElapsedShort, formatMoment } from '@adecore/ui/format';
6
2
  import { Icon, useNow, useTickingText } from '@adecore/ui';
3
+ import { formatElapsedShort, formatMoment } from '@adecore/ui/format';
4
+ import clsx from 'clsx';
5
+ import { Bot, ChevronRight } from 'lucide-react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { AgentIcon } from '../../../agents/AgentIcon';
8
8
  import { modelName, shortModelName } from '../../../agents/model-name';
9
9
  import type { SubagentTask } from '../../../host';
@@ -1,7 +1,7 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { Ellipsis, Maximize2, Trash2 } from 'lucide-react';
3
1
  import type { ChatVisual } from '@adecore/agent-contracts';
4
2
  import { ButtonGroup, ErrorBoundary, Icon, IconButton, Menu, Surface } from '@adecore/ui';
3
+ import { Ellipsis, Maximize2, Trash2 } from 'lucide-react';
4
+ import { useTranslation } from 'react-i18next';
5
5
  import { useChatHost } from '../../../host';
6
6
  import { useChatScope } from '../../../scope';
7
7
  import { useVisualDialog } from '../../visuals';