@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,46 +1,48 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from 'react';
3
- import { useTranslation } from 'react-i18next';
2
+ import { ContextMenu, EmptyState, ErrorBoundary, Icon, ScrollArea, SectionLabel } from '@adecore/ui';
4
3
  import { defaultRangeExtractor, useVirtualizer } from '@tanstack/react-virtual';
5
4
  import clsx from 'clsx';
6
5
  import { LoaderCircle } from 'lucide-react';
6
+ import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { AgentIcon } from '../../agents/AgentIcon.js';
9
+ import { useModelName } from '../../agents/model-name.js';
10
+ import { useChatHost } from '../../host.js';
11
+ import { useHostContextSources, useHostHidesFolder, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks.js';
12
+ import { useChatScope } from '../../scope.js';
13
+ import { useChatRow, useChats } from '../../state/chats.js';
7
14
  import { useForkedTurns } from '../forks.js';
8
15
  import { bookmarkRows } from '../logic/bookmarks.js';
9
- import { deriveTimelineRows, findSubagentBranch } from '../logic/timeline.js';
16
+ import { forkRefusal } from '../logic/fork.js';
17
+ import { SCRUBBER_MIN_TICKS, STRIP_INSET_PX, STRIP_WIDTH_PX, messagesInView, stepMessage, threadPaddingLeft, STRIP_CLEARANCE_PX, tickOfRow, ticksOf, ticksWithHits, EARLIER_ROW } from '../logic/scrubber.js';
10
18
  import { timedRowsOf, withTimedRows } from '../logic/thread-cards.js';
11
- import { openFromMain, useSubagentTrail } from '../subagent-view.js';
12
- import { registerItemJumper, registerMessageStepper, registerTimeline, registerTurnJumper, setTimelineAtEnd, wantsEarlier } from '../timeline-scroll.js';
13
- import { useTimelineFlash } from '../timeline-flash.js';
19
+ import { deriveTimelineRows, findSubagentBranch } from '../logic/timeline.js';
20
+ import { EMPTY_TARGET, readTimelineTarget, revealUiReplyBlock, uiReplyJump, withCurrentText } from '../logic/timeline-target.js';
14
21
  import { useChatPreferences } from '../preferences.js';
15
22
  import { readingMeasure, readingWidthStyle } from '../reading-width.js';
16
- import { SCRUBBER_MIN_TICKS, STRIP_INSET_PX, STRIP_WIDTH_PX, messagesInView, stepMessage, threadPaddingLeft, STRIP_CLEARANCE_PX, tickOfRow, ticksOf, ticksWithHits, EARLIER_ROW } from '../logic/scrubber.js';
17
- import { EMPTY_TARGET, readTimelineTarget, revealUiReplyBlock, uiReplyJump, withCurrentText } from '../logic/timeline-target.js';
18
- import { forkRefusal } from '../logic/fork.js';
19
- import { UiReplyNavigationContext } from './reply-context.js';
20
- import { FindRevealContext } from './find-reveal.js';
23
+ import { openFromMain, useSubagentTrail } from '../subagent-view.js';
24
+ import { useTimelineFlash } from '../timeline-flash.js';
25
+ import { registerItemJumper, registerMessageStepper, registerTimeline, registerTurnJumper, setTimelineAtEnd, wantsEarlier } from '../timeline-scroll.js';
21
26
  import { BookmarkMarker } from './BookmarkMarker.js';
27
+ import { FileLinkContext } from './file-links.js';
28
+ import { FindRevealContext } from './find-reveal.js';
22
29
  import { MessageActions } from './MessageActions.js';
30
+ import { QuoteTakerContext } from './quote-selection.js';
31
+ import { QuoteButton } from './QuoteButton.js';
32
+ import { UiReplyNavigationContext } from './reply-context.js';
33
+ import { ReplyHeader } from './rows/MessageRows.js';
34
+ import { FOLLOW_THRESHOLD_PX, replyHeader } from './rows/row-rhythm.js';
35
+ import { RowContainer } from './rows/RowContainer.js';
36
+ import { Row } from './rows/Rows.js';
23
37
  import { Scrubber } from './Scrubber.js';
24
38
  import { TimelineMenuPopup } from './TimelineMenu.js';
25
- import { VisualDialogs } from './VisualDialogs.js';
26
- import { FOLLOW_THRESHOLD_PX, replyHeader } from './rows/row-rhythm.js';
27
- import { QuoteButton } from './QuoteButton.js';
28
- import { QuoteTakerContext } from './quote-selection.js';
29
39
  import { useToggleSet } from './useToggleSet.js';
40
+ import { VisualDialogs } from './VisualDialogs.js';
30
41
  import { WelcomeGreeting } from './Welcome.js';
31
- import { Row } from './rows/Rows.js';
32
- import { RowContainer } from './rows/RowContainer.js';
33
- import { ReplyHeader } from './rows/MessageRows.js';
34
- import { useChatRow, useChats } from '../../state/chats.js';
35
- import { useChatHost } from '../../host.js';
36
- import { useChatScope } from '../../scope.js';
37
- import { FileLinkContext } from './file-links.js';
38
- import { AgentIcon } from '../../agents/AgentIcon.js';
39
- import { useModelName } from '../../agents/model-name.js';
40
- import { ContextMenu, EmptyState, ErrorBoundary, Icon, SectionLabel } from '@adecore/ui';
41
- import { useHostContextSources, useHostHidesFolder, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks.js';
42
42
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
43
43
  const ESTIMATED_ROW_PX = 56;
44
+ // A wheel that counts in lines rather than pixels moves this far per line.
45
+ const WHEEL_LINE_PX = 16;
44
46
  // How long a jump waits for a thread that is still loading before it calls the item missing.
45
47
  const JUMP_THREAD_WAIT_MS = 8000;
46
48
  /* A jump puts its row at the top and stops following the end, so the reader stays where they landed. */
@@ -50,6 +52,31 @@ function showRowAtTop(virtualizer, followRef, index) {
50
52
  align: 'start'
51
53
  });
52
54
  }
55
+ /* What of the composer's height covers the thread: all of it while it fits, none in a welcome or once it fills the frame. */
56
+ function coveredBy(composerHeight, frameHeight, welcome) {
57
+ return !welcome && composerHeight < frameHeight - FOLLOW_THRESHOLD_PX ? composerHeight : 0;
58
+ }
59
+ /* Whether a wheel over `target` moves a scroller between it and `boundary`, such as a long draft. */
60
+ function scrollsWithin(target, boundary, deltaX, deltaY) {
61
+ for (let element = target; element !== null; element = element.parentElement) {
62
+ const {
63
+ overflowX,
64
+ overflowY
65
+ } = getComputedStyle(element);
66
+ const scrollsY = (overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight;
67
+ const scrollsX = (overflowX === 'auto' || overflowX === 'scroll') && element.scrollWidth > element.clientWidth;
68
+ if (scrollsY && (deltaY < 0 ? element.scrollTop > 0 : deltaY > 0 && element.scrollTop + element.clientHeight < element.scrollHeight)) {
69
+ return true;
70
+ }
71
+ if (scrollsX && (deltaX < 0 ? element.scrollLeft > 0 : deltaX > 0 && element.scrollLeft + element.clientWidth < element.scrollWidth)) {
72
+ return true;
73
+ }
74
+ if (element === boundary) {
75
+ return false;
76
+ }
77
+ }
78
+ return false;
79
+ }
53
80
  /*
54
81
  * A thread before its first message: which model answers, what the lines into this node let it read,
55
82
  * and the folder it works in, so a first question can lean on all three.
@@ -467,6 +494,7 @@ export function Timeline({
467
494
  } = useSubagentTrail(chatId);
468
495
  const frameRef = useRef(null);
469
496
  const composerRef = useRef(null);
497
+ const spacerRef = useRef(null);
470
498
  const [composerHeight, setComposerHeight] = useState(0);
471
499
  const [frame, setFrame] = useState({
472
500
  width: 0,
@@ -557,20 +585,46 @@ export function Timeline({
557
585
  measure();
558
586
  return () => observer.disconnect();
559
587
  }, []);
588
+ const coverRef = useRef({
589
+ frameHeight: frame.height,
590
+ welcome
591
+ });
592
+ coverRef.current = {
593
+ frameHeight: frame.height,
594
+ welcome
595
+ };
560
596
  useLayoutEffect(() => {
561
597
  const element_0 = composerRef.current;
562
598
  if (element_0 === null) {
563
599
  return;
564
600
  }
565
- const measure_0 = () => setComposerHeight(element_0.offsetHeight);
601
+ // The composer lies outside the scroller, so the space under the thread follows its height here,
602
+ // before the page paints, and the end with it; the state is drawn only after that paint.
603
+ const measure_0 = () => {
604
+ const height = element_0.offsetHeight;
605
+ const spacer = spacerRef.current;
606
+ const scroller = scrollRef.current;
607
+ if (spacer !== null && scroller !== null) {
608
+ spacer.style.height = `${coveredBy(height, coverRef.current.frameHeight, coverRef.current.welcome)}px`;
609
+ if (followRef.current) {
610
+ scroller.scrollTop = scroller.scrollHeight;
611
+ scrollGeometry.current = {
612
+ top: scroller.scrollTop,
613
+ height: scroller.scrollHeight,
614
+ viewport: scroller.clientHeight
615
+ };
616
+ }
617
+ }
618
+ setComposerHeight(height);
619
+ };
566
620
  const observer_0 = new ResizeObserver(measure_0);
567
621
  observer_0.observe(element_0);
568
622
  measure_0();
569
623
  return () => observer_0.disconnect();
570
624
  }, []);
571
- // Oversized prompts scroll in full instead of sticking with their top outside the viewport.
572
- const stickyComposer = !welcome && composerHeight < frame.height - FOLLOW_THRESHOLD_PX;
573
- const coveredHeight = stickyComposer ? composerHeight : 0;
625
+ // A composer that would leave too little of the thread covers the frame and scrolls by itself.
626
+ const coveredHeight = coveredBy(composerHeight, frame.height, welcome);
627
+ const fillsFrame = !welcome && coveredHeight === 0 && composerHeight > 0;
574
628
  const coveredHeightRef = useRef(coveredHeight);
575
629
  coveredHeightRef.current = coveredHeight;
576
630
  // The composer pages through the thread with PageUp and PageDown; this is the element it moves.
@@ -639,7 +693,7 @@ export function Timeline({
639
693
  if (!followRef.current || element_2 === null) {
640
694
  return;
641
695
  }
642
- // The composer is in the scroll flow, so its measured height is part of this end position.
696
+ // The space under the thread is the composer's height, so that height is part of this end position.
643
697
  element_2.scrollTop = element_2.scrollHeight;
644
698
  scrollGeometry.current = {
645
699
  top: element_2.scrollTop,
@@ -648,9 +702,9 @@ export function Timeline({
648
702
  };
649
703
  }, [rows.length, totalSize, composerHeight, frame.height]);
650
704
  /*
651
- * A height that changes after the first paint (the composer taking its draft, a row measured again) is
652
- * seen by an observer before the page paints, but the state it sets is drawn after that paint. The
653
- * end is pinned here as well, so the page never paints the thread with its end out of view.
705
+ * A row measured again after the first paint is seen by an observer before the page paints, but the
706
+ * state it sets is drawn after that paint. The end is pinned here as well, so the page never paints
707
+ * the thread with its end out of view.
654
708
  */
655
709
  useLayoutEffect(() => {
656
710
  const content = contentRef.current;
@@ -893,8 +947,8 @@ export function Timeline({
893
947
  let frame_0 = 0;
894
948
  let attempts = 0;
895
949
  const reveal = () => {
896
- const scroller = scrollRef.current;
897
- if (scroller && revealUiReplyBlock(scroller, landing.target)) {
950
+ const scroller_0 = scrollRef.current;
951
+ if (scroller_0 && revealUiReplyBlock(scroller_0, landing.target)) {
898
952
  useTimelineFlash.getState().flash(keyOf(chatId), landing.target.itemId, false, landing.target);
899
953
  setLanding(null);
900
954
  } else if (++attempts < 30) {
@@ -1000,121 +1054,153 @@ export function Timeline({
1000
1054
  style: readingWidthStyle(readingWidth),
1001
1055
  "data-file-cwd": info?.cwd ?? '',
1002
1056
  "data-file-scope-id": scope.id,
1003
- children: [searching && chatFind.bar, /*#__PURE__*/_jsxs(ContextMenu.Root, {
1004
- children: [/*#__PURE__*/_jsx("div", {
1005
- ref: scrollRef
1006
- // No CSS scroll-padding here: Chromium counts the sticky composer's caret as hidden behind
1007
- // it and scrolls the thread toward the end on every keystroke.
1008
- ,
1009
- className: "chat-scroll min-h-0 grow overflow-auto"
1010
- // The thread keeps its reader in place itself when a page goes in above.
1011
- ,
1012
- style: {
1013
- overflowAnchor: 'none'
1014
- },
1015
- onScrollCapture: e => {
1016
- const el = e.currentTarget;
1017
- // Capture the reader's movement before virtualization remeasures rows and shifts the scroll offset.
1018
- const previous = scrollGeometry.current;
1019
- const layoutChanged = previous.height !== el.scrollHeight || previous.viewport !== el.clientHeight;
1020
- const atEnd = el.scrollHeight - el.scrollTop - el.clientHeight < FOLLOW_THRESHOLD_PX;
1021
- if (!layoutChanged && el.scrollTop < previous.top) {
1022
- followRef.current = false;
1023
- } else if (atEnd) {
1024
- followRef.current = true;
1025
- }
1026
- scrollGeometry.current = {
1027
- top: el.scrollTop,
1028
- height: el.scrollHeight,
1029
- viewport: el.clientHeight
1030
- };
1031
- setTimelineAtEnd(chatId, followRef.current);
1032
- if (wantsEarlier(el)) {
1033
- loadEarlier();
1034
- }
1035
- followStrip(el);
1036
- },
1037
- children: /*#__PURE__*/_jsxs("div", {
1038
- ref: contentRef,
1039
- className: clsx('relative flex min-h-full flex-col', welcome && 'justify-center'),
1040
- children: [/*#__PURE__*/_jsx(ContextMenu.Trigger, {
1041
- ref: threadRef,
1042
- className: clsx('chat-thread flex flex-col px-4 pt-4', !welcome && 'grow'),
1043
- style: {
1044
- paddingLeft,
1045
- '--chat-wide-inset': `${2 * (showsScrubber ? STRIP_CLEARANCE_PX : paddingLeft) - paddingLeft}px`
1046
- },
1047
- inert: overlay ? true : undefined,
1048
- onContextMenu: e_0 => setTarget(readTimelineTarget(e_0.target, threadRef.current, withCurrentText(rows, fullItems()))),
1049
- children: loadingHistory ? /*#__PURE__*/_jsxs("div", {
1050
- className: "flex grow items-center justify-center gap-2 text-sm text-text-muted",
1051
- role: "status",
1052
- children: [/*#__PURE__*/_jsx(Icon, {
1053
- icon: LoaderCircle,
1054
- size: 16,
1055
- className: "animate-spin"
1056
- }), /*#__PURE__*/_jsx("span", {
1057
- children: t('timeline.loading')
1058
- })]
1059
- }) : welcome ? /*#__PURE__*/_jsx(WelcomeGreeting, {
1060
- chatId: chatId
1061
- }) : empty ? /*#__PURE__*/_jsx(EmptyThread, {
1062
- chatId: chatId
1063
- }) : /*#__PURE__*/_jsx("div", {
1064
- className: "relative w-full shrink-0",
1057
+ children: [searching && chatFind.bar, /*#__PURE__*/_jsxs("div", {
1058
+ className: clsx('relative flex min-h-0 grow flex-col', welcome && 'justify-center'),
1059
+ children: [/*#__PURE__*/_jsxs(ContextMenu.Root, {
1060
+ children: [/*#__PURE__*/_jsx(ScrollArea
1061
+ // Only down: wide content such as code and diffs scrolls in its own box, so a thread never moves sideways.
1062
+ , {
1063
+ axis: "y",
1064
+ viewportRef: scrollRef,
1065
+ className: clsx(!welcome && 'grow'),
1066
+ viewportClassName: "chat-scroll",
1067
+ coveredBottom: coveredHeight
1068
+ // The thread keeps its reader in place itself when a page goes in above.
1069
+ ,
1070
+ style: {
1071
+ overflowAnchor: 'none'
1072
+ },
1073
+ onScrollCapture: e => {
1074
+ const el = e.currentTarget;
1075
+ // Capture the reader's movement before virtualization remeasures rows and shifts the scroll offset.
1076
+ const previous = scrollGeometry.current;
1077
+ const layoutChanged = previous.height !== el.scrollHeight || previous.viewport !== el.clientHeight;
1078
+ const atEnd = el.scrollHeight - el.scrollTop - el.clientHeight < FOLLOW_THRESHOLD_PX;
1079
+ if (!layoutChanged && el.scrollTop < previous.top) {
1080
+ followRef.current = false;
1081
+ } else if (atEnd) {
1082
+ followRef.current = true;
1083
+ }
1084
+ scrollGeometry.current = {
1085
+ top: el.scrollTop,
1086
+ height: el.scrollHeight,
1087
+ viewport: el.clientHeight
1088
+ };
1089
+ setTimelineAtEnd(chatId, followRef.current);
1090
+ if (wantsEarlier(el)) {
1091
+ loadEarlier();
1092
+ }
1093
+ followStrip(el);
1094
+ },
1095
+ children: /*#__PURE__*/_jsxs("div", {
1096
+ ref: contentRef,
1097
+ className: "relative flex min-h-full flex-col",
1098
+ children: [/*#__PURE__*/_jsx(ContextMenu.Trigger, {
1099
+ ref: threadRef,
1100
+ className: clsx('chat-thread flex flex-col px-4 pt-4', !welcome && 'grow'),
1065
1101
  style: {
1066
- height: totalSize,
1067
- visibility: initialLayout ? 'hidden' : undefined
1102
+ paddingLeft,
1103
+ '--chat-wide-inset': `${2 * (showsScrubber ? STRIP_CLEARANCE_PX : paddingLeft) - paddingLeft}px`
1068
1104
  },
1069
- children: /*#__PURE__*/_jsx(UiReplyNavigationContext.Provider, {
1070
- value: uiNavigation,
1071
- children: /*#__PURE__*/_jsx(FindRevealContext.Provider, {
1072
- value: chatFind.reveal,
1073
- children: virtualRows.map(virtualRow_1 => {
1074
- const row_15 = rows[virtualRow_1.index];
1075
- return /*#__PURE__*/_jsx(ThreadRow, {
1076
- row: row_15,
1077
- previous: virtualRow_1.index > 0 ? rows[virtualRow_1.index - 1] : null,
1078
- index: virtualRow_1.index,
1079
- top: virtualRow_1.start,
1080
- measure: virtualizer.measureElement,
1081
- chatId: chatId,
1082
- flashNonce: flash !== null && flashedRow === row_15.id ? flash.nonce : null,
1083
- bookmark: marks.get(row_15.id) ?? null,
1084
- toggleGroup: groups.toggle,
1085
- toggleTurn: turns.toggle,
1086
- toggleSubagent: subagents.toggle,
1087
- openSubagent: openSubagent,
1088
- openConversation: openConversation
1089
- }, row_15.id);
1105
+ inert: overlay ? true : undefined,
1106
+ onContextMenu: e_0 => setTarget(readTimelineTarget(e_0.target, threadRef.current, withCurrentText(rows, fullItems()))),
1107
+ children: loadingHistory ? /*#__PURE__*/_jsxs("div", {
1108
+ className: "flex grow items-center justify-center gap-2 text-sm text-text-muted",
1109
+ role: "status",
1110
+ children: [/*#__PURE__*/_jsx(Icon, {
1111
+ icon: LoaderCircle,
1112
+ size: 16,
1113
+ className: "animate-spin"
1114
+ }), /*#__PURE__*/_jsx("span", {
1115
+ children: t('timeline.loading')
1116
+ })]
1117
+ }) : welcome ? /*#__PURE__*/_jsx(WelcomeGreeting, {
1118
+ chatId: chatId
1119
+ }) : empty ? /*#__PURE__*/_jsx(EmptyThread, {
1120
+ chatId: chatId
1121
+ }) : /*#__PURE__*/_jsx("div", {
1122
+ className: "relative w-full shrink-0",
1123
+ style: {
1124
+ height: totalSize,
1125
+ visibility: initialLayout ? 'hidden' : undefined
1126
+ },
1127
+ children: /*#__PURE__*/_jsx(UiReplyNavigationContext.Provider, {
1128
+ value: uiNavigation,
1129
+ children: /*#__PURE__*/_jsx(FindRevealContext.Provider, {
1130
+ value: chatFind.reveal,
1131
+ children: virtualRows.map(virtualRow_1 => {
1132
+ const row_15 = rows[virtualRow_1.index];
1133
+ return /*#__PURE__*/_jsx(ThreadRow, {
1134
+ row: row_15,
1135
+ previous: virtualRow_1.index > 0 ? rows[virtualRow_1.index - 1] : null,
1136
+ index: virtualRow_1.index,
1137
+ top: virtualRow_1.start,
1138
+ measure: virtualizer.measureElement,
1139
+ chatId: chatId,
1140
+ flashNonce: flash !== null && flashedRow === row_15.id ? flash.nonce : null,
1141
+ bookmark: marks.get(row_15.id) ?? null,
1142
+ toggleGroup: groups.toggle,
1143
+ toggleTurn: turns.toggle,
1144
+ toggleSubagent: subagents.toggle,
1145
+ openSubagent: openSubagent,
1146
+ openConversation: openConversation
1147
+ }, row_15.id);
1148
+ })
1090
1149
  })
1091
1150
  })
1092
1151
  })
1093
- })
1094
- }), /*#__PURE__*/_jsx(QuoteButton, {
1095
- thread: threadRef,
1096
- frame: contentRef,
1097
- taker: quoteTakerRef
1098
- }), /*#__PURE__*/_jsx("div", {
1099
- ref: composerRef
1100
- // The card is translucent so the thread shows through it, but the pb-3 strip under it must stay opaque.
1101
- ,
1102
- className: clsx('relative z-10 shrink-0', composer && 'px-3 pb-3 pt-3 bg-[linear-gradient(to_bottom,transparent_calc(100%-12px),var(--surface)_calc(100%-12px))]'),
1103
- style: {
1104
- position: stickyComposer ? 'sticky' : 'relative',
1105
- bottom: 0
1106
- },
1107
- children: /*#__PURE__*/_jsx(QuoteTakerContext.Provider, {
1108
- value: registerQuoteTaker,
1109
- children: composer
1110
- })
1111
- })]
1152
+ }), /*#__PURE__*/_jsx(QuoteButton, {
1153
+ thread: threadRef,
1154
+ frame: contentRef,
1155
+ taker: quoteTakerRef
1156
+ }), /*#__PURE__*/_jsx("div", {
1157
+ ref: spacerRef,
1158
+ className: "shrink-0",
1159
+ style: {
1160
+ height: coveredHeight
1161
+ },
1162
+ "aria-hidden": true
1163
+ })]
1164
+ })
1165
+ }), /*#__PURE__*/_jsx(TimelineMenuPopup, {
1166
+ target: target,
1167
+ thread: threadRef,
1168
+ chatId: onMainAgent ? chatId : null,
1169
+ column: frame.column
1170
+ })]
1171
+ }), /*#__PURE__*/_jsx("div", {
1172
+ className: "isolate shrink-0",
1173
+ style: welcome ? {
1174
+ position: 'relative'
1175
+ } : fillsFrame ? {
1176
+ position: 'absolute',
1177
+ inset: 0,
1178
+ overflowY: 'auto'
1179
+ } : {
1180
+ position: 'absolute',
1181
+ insetInline: 0,
1182
+ bottom: 0
1183
+ },
1184
+ onWheel: e_1 => {
1185
+ const scroller_1 = scrollRef.current;
1186
+ // A wheel over the composer moves the thread it lies over, as it did inside the scroller.
1187
+ if (scroller_1 === null || coveredHeight === 0 || e_1.ctrlKey || scrollsWithin(e_1.target, e_1.currentTarget, e_1.deltaX, e_1.deltaY)) {
1188
+ return;
1189
+ }
1190
+ const unit = e_1.deltaMode === 1 ? WHEEL_LINE_PX : e_1.deltaMode === 2 ? scroller_1.clientHeight : 1;
1191
+ scroller_1.scrollTop += e_1.deltaY * unit;
1192
+ scroller_1.scrollLeft += e_1.deltaX * unit;
1193
+ },
1194
+ children: /*#__PURE__*/_jsx("div", {
1195
+ ref: composerRef
1196
+ // The card is translucent so the thread shows through it, but the pb-3 strip under it must stay opaque.
1197
+ ,
1198
+ className: clsx(composer && 'px-3 pb-3 pt-3 bg-[linear-gradient(to_bottom,transparent_calc(100%-12px),var(--surface)_calc(100%-12px))]'),
1199
+ children: /*#__PURE__*/_jsx(QuoteTakerContext.Provider, {
1200
+ value: registerQuoteTaker,
1201
+ children: composer
1202
+ })
1112
1203
  })
1113
- }), /*#__PURE__*/_jsx(TimelineMenuPopup, {
1114
- target: target,
1115
- thread: threadRef,
1116
- chatId: onMainAgent ? chatId : null,
1117
- column: frame.column
1118
1204
  })]
1119
1205
  }), drawsVisuals && /*#__PURE__*/_jsx(VisualDialogs, {
1120
1206
  chatId: chatId
@@ -1,18 +1,18 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useTranslation } from 'react-i18next';
2
+ import { ContextMenu, copyText, DisabledReason, EDIT_SHORTCUTS, Icon, Kbd, selectAllWithin } from '@adecore/ui';
3
3
  import { BookmarkPlus, BookmarkX, Braces, Copy, Eye, FileText, GitFork, MessageSquare, MoveHorizontal, Pencil, Scan } from 'lucide-react';
4
- import { placeBookmark, removeBookmark, useBookmarkNaming } from '../bookmarks.js';
5
- import { rememberReadingWidth, useChatPreferences } from '../preferences.js';
6
- import { CHAT_READING_WIDTHS, readingWidthLabel } from '../reading-width.js';
7
- import { forkRefusal, turnIdOfRow } from '../logic/fork.js';
8
- import { markdownOf, messageTextOf } from '../logic/timeline-copy.js';
4
+ import { useTranslation } from 'react-i18next';
9
5
  import { useChatHost } from '../../host.js';
10
6
  import { useChatScope } from '../../scope.js';
11
7
  import { useChatRow } from '../../state/chats.js';
8
+ import { placeBookmark, removeBookmark, useBookmarkNaming } from '../bookmarks.js';
9
+ import { forkRefusal, turnIdOfRow } from '../logic/fork.js';
10
+ import { markdownOf, messageTextOf } from '../logic/timeline-copy.js';
11
+ import { rememberReadingWidth, useChatPreferences } from '../preferences.js';
12
+ import { CHAT_READING_WIDTHS, readingWidthLabel } from '../reading-width.js';
12
13
  import { copyWithChips, rowClipboardChips } from './chip-clipboard.js';
13
14
  import { useFileLinkCwd, useFileLinkScopeId, useOpenFileLink } from './file-links.js';
14
15
  import { useReferenceLookup } from './thread-references.js';
15
- import { ContextMenu, copyText, DisabledReason, EDIT_SHORTCUTS, Icon, Kbd, selectAllWithin } from '@adecore/ui';
16
16
  /* The menu behind a right-click in a thread, mostly for copying: a whole message, a code block or an answer's markdown. */
17
17
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
18
  export function TimelineMenuPopup(t0) {
@@ -1,13 +1,13 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { LazyBoundary } from '@adecore/ui';
3
3
  import { useTranslation } from 'react-i18next';
4
+ import { useChatHost } from '../../host.js';
4
5
  import { lazyNamed } from '../../lazy.js';
5
6
  import { diffSourceBudget, legacyDiffBudget, patchSourceBudget } from './diff/diff-source-budget.js';
7
+ import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary.js';
6
8
  import { DiffOmitted } from './diff/DiffOmitted.js';
7
9
  import { DiffUnavailable } from './diff/DiffUnavailable.js';
8
10
  import { RawDiff } from './diff/RawDiff.js';
9
- import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary.js';
10
- import { useChatHost } from '../../host.js';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  const LegacyUnifiedDiff = lazyNamed(() => import('./diff/LegacyUnifiedDiff.js'), 'default', {
13
13
  prefetch: false
@@ -1,7 +1,7 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { CloseButton, Dialog, ErrorBoundary, PromptDialog } from '@adecore/ui';
2
3
  import { useState } from 'react';
3
4
  import { useTranslation } from 'react-i18next';
4
- import { CloseButton, Dialog, ErrorBoundary, PromptDialog } from '@adecore/ui';
5
5
  import { useChatScope } from '../../scope.js';
6
6
  import { useChatRow } from '../../state/chats.js';
7
7
  import { useVisualDialog } from '../visuals.js';
@@ -1,13 +1,13 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import clsx from 'clsx';
5
2
  import { VISUAL_LIMITS, visualThemeFragment } from '@adecore/agent-contracts/visual';
6
3
  import { Spinner, useMeasuredWidth } from '@adecore/ui';
4
+ import clsx from 'clsx';
5
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { useChatHost } from '../../host.js';
8
8
  import { useChatScope } from '../../scope.js';
9
- import { DEFAULT_HEIGHT_PX, initialVisualContentHeight, rememberVisualHeight } from '../logic/visual-height.js';
10
9
  import { imageDocumentForDisplay } from '../image-display.js';
10
+ import { DEFAULT_HEIGHT_PX, initialVisualContentHeight, rememberVisualHeight } from '../logic/visual-height.js';
11
11
  import { VisualBridge } from '../visual-bridge.js';
12
12
  import { VisualViewportController } from '../visual-viewport.js';
13
13
  import { useVisualTheme } from './visual-theme.js';
@@ -1,5 +1,5 @@
1
- import type { Ref } from 'react';
2
1
  import { type AgentKind } from '@adecore/agent-contracts';
2
+ import type { Ref } from 'react';
3
3
  import { type WorkflowAgentView } from '../logic/workflow.js';
4
4
  import type { SubagentStep } from '../subagent-view.js';
5
5
  export declare function WorkflowAgentLine({ view, provider, onOpen, selected, className, ref }: {
@@ -1,9 +1,9 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import clsx from 'clsx';
3
- import { Bot, ChevronRight, X } from 'lucide-react';
4
2
  import { workflowAgentRef } from '@adecore/agent-contracts';
5
- import { formatElapsedShort } from '@adecore/ui/format';
6
3
  import { Icon, useTickingText } from '@adecore/ui';
4
+ import { formatElapsedShort } from '@adecore/ui/format';
5
+ import clsx from 'clsx';
6
+ import { Bot, ChevronRight, X } from 'lucide-react';
7
7
  import { AgentIcon } from '../../agents/AgentIcon.js';
8
8
  import { workflowAgentPreview, workflowAgentTime } from '../logic/workflow.js';
9
9
  import { ROW_GUTTER } from './icons.js';
@@ -1,6 +1,6 @@
1
1
  import type { ChatAssistantItem, ChatUserItem } from '@adecore/agent-contracts';
2
- import { type ClipboardChips } from '../mentions.js';
3
2
  import type { TimelineRow } from '../logic/timeline.js';
3
+ import { type ClipboardChips } from '../mentions.js';
4
4
  import type { ReferenceLookup } from './reference-lookup.js';
5
5
  export declare function messageClipboardChips(item: ChatUserItem | ChatAssistantItem, text: string, lookup: Pick<ReferenceLookup, 'items' | 'referenced'>): ClipboardChips;
6
6
  export declare function rowClipboardChips(row: TimelineRow, text: string, lookup: Pick<ReferenceLookup, 'items' | 'referenced'>): ClipboardChips;
@@ -1,6 +1,6 @@
1
- import { type Ref } from 'react';
2
1
  import { type ChatInfo } from '@adecore/agent-contracts';
3
2
  import { type Shortcut } from '@adecore/ui';
3
+ import { type Ref } from 'react';
4
4
  import { type ComposerSendAction, type ComposerSendDraft } from '../../../host.js';
5
5
  import type { StashedPrompt } from '../../stash.js';
6
6
  import type { ChatControls } from './use-chat-controls.js';
@@ -1,10 +1,10 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useRef, useState } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import clsx from 'clsx';
5
- import { ArrowUp, ChevronDown, Play, Plus, Square } from 'lucide-react';
6
2
  import { holdsConversation } from '@adecore/agent-contracts';
7
3
  import { Button, ErrorBoundary, Icon, Menu, Tooltip } from '@adecore/ui';
4
+ import clsx from 'clsx';
5
+ import { ArrowUp, ChevronDown, Play, Plus, Square } from 'lucide-react';
6
+ import { useRef, useState } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
8
  import { useChatHost } from '../../../host.js';
9
9
  import { useChatScope } from '../../../scope.js';
10
10
  import { useProviders } from '../../../state/providers.js';
@@ -1,8 +1,8 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useTranslation } from 'react-i18next';
2
+ import { FileIcon, Icon, Menu, MiddleTruncate, ScrollArea } from '@adecore/ui';
3
3
  import clsx from 'clsx';
4
4
  import { SquareSlash, Zap } from 'lucide-react';
5
- import { FileIcon, Icon, Menu, MiddleTruncate } from '@adecore/ui';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { useChatHost } from '../../../host.js';
7
7
  import { referenceGlyph } from '../reference-icons.js';
8
8
  import { optionIdOf } from './menu-aria.js';
@@ -320,8 +320,9 @@ function ReferenceMenu(t0) {
320
320
  const key = item.section?.id ?? item.group;
321
321
  groups.set(key, [...(groups.get(key) ?? []), item]);
322
322
  }
323
- t1 = /*#__PURE__*/_jsx("div", {
324
- className: "max-h-96 overflow-y-auto border-b border-border px-1.5 py-1.5",
323
+ t1 = /*#__PURE__*/_jsx(ScrollArea, {
324
+ className: "max-h-96 border-b border-border",
325
+ viewportClassName: "px-1.5 py-1.5",
325
326
  children: referenceMatches.length > 0 ? /*#__PURE__*/_jsx("div", {
326
327
  id: listId,
327
328
  role: "listbox",
@@ -1,7 +1,7 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useTranslation } from 'react-i18next';
3
- import { Paperclip, X } from 'lucide-react';
4
2
  import { Icon, IconButton, Tooltip } from '@adecore/ui';
3
+ import { Paperclip, X } from 'lucide-react';
4
+ import { useTranslation } from 'react-i18next';
5
5
  import { useChatScope } from '../../../scope.js';
6
6
  import { formatBytes, isImageAttachment, uploadBytes } from '../../attachments.js';
7
7
  import { jumpToTimelineItem } from '../../timeline-scroll.js';