@marimo-team/islands 0.25.2-dev99 → 0.25.3-dev10

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 (205) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BZmqc_F0.js → ConnectedDataExplorerComponent-CNMliVzw.js} +15 -15
  2. package/dist/{ErrorBoundary-CXkr_IcB.js → ErrorBoundary-BsqSMK9Y.js} +12 -12
  3. package/dist/{ImageComparisonComponent-Cpfz30OZ.js → ImageComparisonComponent-uU8FSKZE.js} +3 -3
  4. package/dist/{Plot-CTyjbQDT.js → Plot-DdYOe1UK.js} +2 -2
  5. package/dist/{abnfDiagram-VCTEODGH-C_Lmaa2j.js → abnfDiagram-VCTEODGH-D-Ez91gV.js} +3 -3
  6. package/dist/{any-language-editor-BFzqhOBR.js → any-language-editor-DZ_YTVus.js} +7 -7
  7. package/dist/{architectureDiagram-5GKGNRK7-BKMataHB.js → architectureDiagram-5GKGNRK7-CTpcNtO8.js} +5 -5
  8. package/dist/assets/__vite-browser-external-BXYkiFsk.js +1 -0
  9. package/dist/assets/worker-HPY9fbhz.js +114 -0
  10. package/dist/{blockDiagram-I7D4REHJ-BeHOjyDk.js → blockDiagram-I7D4REHJ-Cg25UrxT.js} +9 -9
  11. package/dist/{button-BtsM2UqM.js → button-CvjkwdSk.js} +5 -5
  12. package/dist/{c4Diagram-7LVT6UL2-Bao10t_O.js → c4Diagram-7LVT6UL2-BxFgrnNV.js} +7 -7
  13. package/dist/{capabilities-A5jrzjCJ.js → capabilities-CQ5IjhzL.js} +1 -1
  14. package/dist/{channel-BxCkvUgE.js → channel-CPObtJXj.js} +1 -1
  15. package/dist/{chat-ui-CwOWzoSO.js → chat-ui-0lKdOoQ3.js} +1588 -1396
  16. package/dist/{check-CNP79M3A.js → check-EDwSwP89.js} +1 -1
  17. package/dist/{chunk-4HAMMTFA-CH7Gpamd.js → chunk-4HAMMTFA-D4eFPyFh.js} +5 -5
  18. package/dist/{chunk-75Z2AOVW-AI7CvgKn.js → chunk-75Z2AOVW-D7gxIs2Q.js} +1 -1
  19. package/dist/{chunk-DU6HZSFF-BSvuTkX4.js → chunk-DU6HZSFF-BwiyaNpg.js} +1 -1
  20. package/dist/{chunk-F27PBJKO-CLshwT9T.js → chunk-F27PBJKO-ufseIn5y.js} +1 -1
  21. package/dist/{chunk-GMAD6QVW-wnHcn-lH.js → chunk-GMAD6QVW-BhaJx0X3.js} +3 -3
  22. package/dist/{chunk-GVQU2GXP-7O2p8hut.js → chunk-GVQU2GXP-Cwbt-lF0.js} +2 -2
  23. package/dist/{chunk-IMKFNOWR-Bu0Vh_Yi.js → chunk-IMKFNOWR-DGxi-zeo.js} +5 -5
  24. package/dist/{chunk-L3NEJ4N5-B9_Alrxb.js → chunk-L3NEJ4N5-n-zgIVSy.js} +5 -5
  25. package/dist/{chunk-OSK3NFVY-PeQPH2fD.js → chunk-OSK3NFVY-DXa-Cxbn.js} +6 -6
  26. package/dist/{chunk-P2QGCYS3-D9twiFuU.js → chunk-P2QGCYS3-B_Zd3-X0.js} +1 -1
  27. package/dist/{chunk-POPQ4Y6H-BUiNs18s.js → chunk-POPQ4Y6H-hYOXbYH_.js} +1 -1
  28. package/dist/{chunk-PWAF6VOD-D8S9NPCy.js → chunk-PWAF6VOD-CQw5qATZ.js} +1 -1
  29. package/dist/{chunk-SHT3W25Y-B2dyNZ31.js → chunk-SHT3W25Y-CV9J3rAB.js} +7 -7
  30. package/dist/{chunk-SVP7TREG-D7UPvB10.js → chunk-SVP7TREG-BL-9Fqgg.js} +2 -2
  31. package/dist/{chunk-TICWLB2K-BNaGoadd.js → chunk-TICWLB2K-Cu_XMjDM.js} +5 -5
  32. package/dist/{chunk-YOKDWASO-DrWbKnxA.js → chunk-YOKDWASO-DPZk8vhS.js} +6 -6
  33. package/dist/classDiagram-ZZMXUADV-BXXV13Hq.js +30 -0
  34. package/dist/classDiagram-v2-VYDZK3BY-B7FXJ1Cp.js +30 -0
  35. package/dist/{code-visibility-pPjYsRTH.js → code-visibility-CXQvUXHT.js} +18 -18
  36. package/dist/{common-CkvBp0B4.js → common-CuD-CAC-.js} +6128 -7136
  37. package/dist/{compiler-runtime-Cj8ZWiNS.js → compiler-runtime-CldRdSsv.js} +2 -2
  38. package/dist/{copy-icon-BY7jgcaV.js → copy-icon-Ft7t9bqz.js} +6 -6
  39. package/dist/{cynefinDiagram-5FMLGOSQ-CCDn4Z9e.js → cynefinDiagram-5FMLGOSQ-CH96rwba.js} +3 -3
  40. package/dist/{dagre-GXQ25YYZ-BJiUO_SV.js → dagre-GXQ25YYZ-BD3PmpFY.js} +10 -10
  41. package/dist/{data-grid-overlay-editor-L6ELxFAh.js → data-grid-overlay-editor-DgeyYmC1.js} +7 -7
  42. package/dist/{data-grid-types-BucVmDDp.js → data-grid-types-BH_r7g7l.js} +1 -1
  43. package/dist/{diagram-S7CK7UJ4-BZfxFNRR.js → diagram-S7CK7UJ4-BsSJJldB.js} +4 -4
  44. package/dist/{diagram-UQ7AKVKN-1xcsiIMg.js → diagram-UQ7AKVKN-muQtNZc4.js} +3 -3
  45. package/dist/{diagram-VSXAHHWV-DPAWJ9Nw.js → diagram-VSXAHHWV-BJWcVVJY.js} +2 -2
  46. package/dist/{diagram-VX7I27RA-DmRsnHYY.js → diagram-VX7I27RA-CdhuZAqR.js} +5 -5
  47. package/dist/{diagram-Z3DM3KII--b49ryKx.js → diagram-Z3DM3KII-BD8mXjOj.js} +3 -3
  48. package/dist/{dialog-CmExhUDI.js → dialog-CEBFZNyc.js} +6 -6
  49. package/dist/{dist-CcyKTBTF.js → dist-DpBpA_n1.js} +2 -2
  50. package/dist/{dropdown-menu-Cz4TdOJh.js → dropdown-menu-CP_qCYHC.js} +139 -139
  51. package/dist/{ebnfDiagram-PWID7BFC-rSwVyh4y.js → ebnfDiagram-PWID7BFC-BIN1sweE.js} +3 -3
  52. package/dist/{erDiagram-RLTQ6QDP-Bfd3iAoC.js → erDiagram-RLTQ6QDP-Ctp5cfoN.js} +12 -12
  53. package/dist/{error-banner-D30nA9nE.js → error-banner-D-WCIiMt.js} +16 -11
  54. package/dist/{cells-DZi0ioak.js → error-entries-DSvFWT_M.js} +6171 -5075
  55. package/dist/{esm-DAVrGVKP.js → esm-AMFssoNp.js} +4 -4
  56. package/dist/{feedback-button-D-pV0Qji.js → feedback-button-DZMj9PF3.js} +119 -120
  57. package/dist/flowDiagram-HODETNUW-3EfLrlFb.js +16 -0
  58. package/dist/{formats-DhhbdyAH.js → formats-CeOmU1MU.js} +6 -6
  59. package/dist/{ganttDiagram-EL5Y4UJY-B4m_YsKa.js → ganttDiagram-EL5Y4UJY-BQT16JSc.js} +2 -2
  60. package/dist/{gitGraphDiagram-WWUBYQGX-QRBbvWXh.js → gitGraphDiagram-WWUBYQGX-D5nSIzdE.js} +2 -2
  61. package/dist/{glide-data-editor-D6CfYwdr.js → glide-data-editor-g_L8FLAC.js} +60 -60
  62. package/dist/{glide-utils-BVJ4fkxX.js → glide-utils-DJyqh0EM.js} +4 -4
  63. package/dist/{globals-BwK9YGrX.js → globals-CYGlmBXb.js} +3 -3
  64. package/dist/{highlighted-body-KPVGNVTW-Ad3MKZ18.js → highlighted-body-KPVGNVTW-zwjq21tf.js} +4 -4
  65. package/dist/{html-to-image-Cn1_16-x.js → html-to-image-B8s5SgGm.js} +37 -37
  66. package/dist/{infoDiagram-27XIBGKW-DVQFYvhg.js → infoDiagram-27XIBGKW-DipQoHxl.js} +2 -2
  67. package/dist/{ishikawaDiagram-5VMMS53U-viPND-nm.js → ishikawaDiagram-5VMMS53U-DgFMjSGz.js} +3 -3
  68. package/dist/{journeyDiagram-3NMN7TZE-BeeJdJo3.js → journeyDiagram-3NMN7TZE-BaLqn-dZ.js} +2 -2
  69. package/dist/{jsx-runtime-DgDPJV9S.js → jsx-runtime-3BD1kT0s.js} +1 -1
  70. package/dist/{kanban-definition-UXKFOSKX-Dcl_ECO9.js → kanban-definition-UXKFOSKX-w1ACVjgl.js} +9 -9
  71. package/dist/{katex-BNCmKUol.js → katex-BIdZGsyO.js} +141 -116
  72. package/dist/{label-DQO1jFjf.js → label-BDKF3Afc.js} +10 -10
  73. package/dist/{loader-Cm-ATtou.js → loader-BQOfjTIJ.js} +1 -1
  74. package/dist/main.js +623 -590
  75. package/dist/{mermaid-BfhcnSj-.js → mermaid-CHo49Yv-.js} +56 -56
  76. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +2 -0
  77. package/dist/{mhchem-BEc7A1or.js → mhchem-CdWPJK6g.js} +1 -1
  78. package/dist/{mindmap-definition-YA3MSWOX-BdxxhF-5.js → mindmap-definition-YA3MSWOX-CrT0KSfX.js} +11 -11
  79. package/dist/{number-overlay-editor-tMylyldi.js → number-overlay-editor-9VRv-pdj.js} +5 -5
  80. package/dist/{pegDiagram-XKGWAZYB-Du5p2s0w.js → pegDiagram-XKGWAZYB-BqvywNJA.js} +3 -3
  81. package/dist/{pieDiagram-E7YTZNPT-DJg-SOIq.js → pieDiagram-E7YTZNPT-BfxJ_XCc.js} +3 -3
  82. package/dist/{process-output-CUG57KRp.js → process-output-CKRXyszb.js} +5 -5
  83. package/dist/{quadrantDiagram-AXDQQJYC-keLfFx9f.js → quadrantDiagram-AXDQQJYC-Ccw0xMjN.js} +1 -1
  84. package/dist/{railroadDiagram-O6MQD6OU-C0ojm-6_.js → railroadDiagram-O6MQD6OU-8vFLVTPu.js} +3 -3
  85. package/dist/{react-dom-BUgJ-ab_.js → react-dom-DUmH0GXv.js} +29 -21
  86. package/dist/{react-ofJbxM4x.js → react-sHtZdjeP.js} +103 -94
  87. package/dist/{react-vega-ewj7q_U5.js → react-vega-BED0DjiB.js} +3 -3
  88. package/dist/{requirementDiagram-BXWQKSXE-CNwNBmI3.js → requirementDiagram-BXWQKSXE-a_MxGvxe.js} +11 -11
  89. package/dist/{reveal-component-LXUMcqWX.js → reveal-component-C87mv9Mn.js} +906 -878
  90. package/dist/{sankeyDiagram-P5KCCOFB-Bh4EsJox.js → sankeyDiagram-P5KCCOFB-ELvOcnZH.js} +1 -1
  91. package/dist/{select-Bs-nmvm6.js → select-BButFi-d.js} +11 -11
  92. package/dist/{sequenceDiagram-WJ2MYXX4-DQaW5qBG.js → sequenceDiagram-WJ2MYXX4-CXFMnxGh.js} +4 -4
  93. package/dist/{spec-DVsoMvYT.js → spec-BwarBpUJ.js} +4 -4
  94. package/dist/{stateDiagram-D77RDMKH-BDa515QC.js → stateDiagram-D77RDMKH-DQeA_CwI.js} +13 -13
  95. package/dist/stateDiagram-v2-MP3YSRHH-BxxQucm1.js +30 -0
  96. package/dist/style.css +1 -1
  97. package/dist/{swimlanes-42K2YHIH-M4IdGi8J.js → swimlanes-42K2YHIH-Do6L-cYg.js} +10 -10
  98. package/dist/swimlanesDiagram-VR7AAH4N-DUzPvSVU.js +30 -0
  99. package/dist/{swiper-component-CpN-hewZ.js → swiper-component-DKntyn8p.js} +5 -5
  100. package/dist/{timeline-definition-24CTP7MA-DH-kvakg.js → timeline-definition-24CTP7MA-D3c46WM5.js} +3 -3
  101. package/dist/{toDate-vEi5kTfY.js → toDate-vIXljnsr.js} +43 -42
  102. package/dist/{toast-DfEpJedt.js → toast-B9UMEi8u.js} +9 -9
  103. package/dist/{tooltip-CuNWg2ay.js → tooltip-BO1REbqs.js} +7 -7
  104. package/dist/{use-restore-focus-kmgwrL8q.js → use-restore-focus-BEM7sFWl.js} +2042 -1827
  105. package/dist/{use-vega-container-remeasure-4DwJbPWu.js → use-vega-container-remeasure-Bz4PZMtt.js} +2 -2
  106. package/dist/{useAsyncData-rkAlR_vh.js → useAsyncData-Deh5kszT.js} +3 -3
  107. package/dist/{useDateFormatter-C-tz65rD.js → useDateFormatter-D8XruNGG.js} +4 -4
  108. package/dist/{useDeepCompareMemoize-BlHFBj5_.js → useDeepCompareMemoize-DXwzRINI.js} +2 -2
  109. package/dist/{useIframeCapabilities-C1Bt04Iz.js → useIframeCapabilities-DBETvvPl.js} +2 -2
  110. package/dist/{useLifecycle-B68iY077.js → useLifecycle-j7D9uD1o.js} +6 -6
  111. package/dist/{useTheme-BwSgeAFb.js → useTheme-CRnjkku0.js} +7 -7
  112. package/dist/{vega-component-C-bPttRN.js → vega-component-DTG6zxaY.js} +14 -14
  113. package/dist/{vega-embed-container-sSR5hAsy.js → vega-embed-container-BNHE18G9.js} +5 -5
  114. package/dist/{vennDiagram-4TSXK5OY-d5g7XeiI.js → vennDiagram-4TSXK5OY-BSZD8JcZ.js} +3 -3
  115. package/dist/{wardleyDiagram-VM6X3IG4-BfX3bSzR.js → wardleyDiagram-VM6X3IG4-48cUWkfA.js} +3 -3
  116. package/dist/{xychartDiagram-S5SC5T6Z-C1QsLZg7.js → xychartDiagram-S5SC5T6Z-CswYgYeu.js} +5 -5
  117. package/package.json +25 -22
  118. package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
  119. package/src/__tests__/host-imports.test.ts +100 -0
  120. package/src/__tests__/mount.test.ts +8 -8
  121. package/src/components/data-table/__tests__/column_formatting.test.ts +30 -0
  122. package/src/components/data-table/__tests__/columns.test.tsx +70 -0
  123. package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
  124. package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
  125. package/src/components/data-table/__tests__/export-actions.test.tsx +329 -6
  126. package/src/components/data-table/column-formatting/feature.ts +20 -1
  127. package/src/components/data-table/columns.tsx +25 -18
  128. package/src/components/data-table/context-menu.tsx +125 -26
  129. package/src/components/data-table/date-filter-inputs.tsx +15 -42
  130. package/src/components/data-table/export-actions.tsx +192 -116
  131. package/src/components/data-table/schemas.ts +14 -36
  132. package/src/components/data-table/utils.ts +18 -0
  133. package/src/components/editor/Output.tsx +9 -2
  134. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
  135. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
  136. package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
  137. package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
  138. package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
  139. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +372 -0
  140. package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
  141. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
  142. package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
  143. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +4 -3
  144. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +548 -0
  145. package/src/components/editor/errors/send-error-report-button.tsx +69 -0
  146. package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
  147. package/src/components/editor/output/MarimoTracebackOutput.tsx +35 -20
  148. package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
  149. package/src/components/editor/output/ansi-reduce.ts +6 -0
  150. package/src/components/editor/output/console/ConsoleOutput.tsx +5 -3
  151. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +18 -0
  152. package/src/components/storage/__tests__/storage-file-viewer.test.tsx +2 -1
  153. package/src/core/attachments/__tests__/toast.test.tsx +58 -0
  154. package/src/core/attachments/state.ts +21 -0
  155. package/src/core/attachments/toast.ts +15 -0
  156. package/src/core/cells/__tests__/cells.test.ts +52 -0
  157. package/src/core/cells/__tests__/document-roundtrip.test.ts +16 -0
  158. package/src/core/cells/__tests__/error-report.test.ts +139 -0
  159. package/src/core/cells/__tests__/session.test.ts +50 -1
  160. package/src/core/cells/error-report.ts +63 -0
  161. package/src/core/cells/session.ts +28 -1
  162. package/src/core/codemirror/copilot/__tests__/completion-integration.test.ts +447 -0
  163. package/src/core/codemirror/copilot/__tests__/inline-completion.test.ts +395 -0
  164. package/src/core/codemirror/copilot/__tests__/language-server.test.ts +511 -2
  165. package/src/core/codemirror/copilot/__tests__/rpc-cancellation.test.ts +201 -0
  166. package/src/core/codemirror/copilot/extension.ts +22 -11
  167. package/src/core/codemirror/copilot/language-server.ts +109 -60
  168. package/src/core/codemirror/language/__tests__/sql.test.ts +4 -3
  169. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +138 -26
  170. package/src/core/codemirror/language/embedded/embedded-python.ts +47 -13
  171. package/src/core/codemirror/language/embedded/latex.ts +20 -13
  172. package/src/core/config/pair.ts +5 -3
  173. package/src/core/datasets/__tests__/data-source-discovery.test.ts +18 -11
  174. package/src/core/host/AGENTS.md +6 -0
  175. package/src/core/host/__tests__/protocol.test.ts +214 -0
  176. package/src/core/host/protocol.ts +1943 -0
  177. package/src/core/islands/__tests__/bootstrap.test.ts +26 -0
  178. package/src/core/islands/bootstrap.ts +1 -0
  179. package/src/core/islands/bridge.ts +2 -2
  180. package/src/core/kernel/messages.ts +4 -7
  181. package/src/core/network/__tests__/api.test.ts +114 -1
  182. package/src/core/network/api.ts +3 -2
  183. package/src/core/wasm/bridge.ts +2 -2
  184. package/src/core/wasm/worker/types.ts +2 -2
  185. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +193 -0
  186. package/src/core/websocket/useMarimoKernelConnection.tsx +9 -0
  187. package/src/css/katex-css.test.ts +1 -1
  188. package/src/css/katex.min.css +6 -1
  189. package/src/hooks/__tests__/useEventListener.test.tsx +45 -1
  190. package/src/hooks/useEventListener.ts +6 -1
  191. package/src/mount.tsx +3 -3
  192. package/src/plugins/impl/NumberPlugin.tsx +20 -3
  193. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
  194. package/src/plugins/impl/__tests__/NumberPlugin.test.tsx +159 -1
  195. package/src/utils/__tests__/dates.test.ts +116 -0
  196. package/src/utils/dates.ts +94 -0
  197. package/dist/assets/__vite-browser-external-BqAtzd2P.js +0 -1
  198. package/dist/assets/worker-Bf8dt6S-.js +0 -109
  199. package/dist/classDiagram-ZZMXUADV-Bbo2n384.js +0 -30
  200. package/dist/classDiagram-v2-VYDZK3BY-xR8cGP0r.js +0 -30
  201. package/dist/error-entries-BovkFYNy.js +0 -56
  202. package/dist/flowDiagram-HODETNUW-D7IBKS12.js +0 -16
  203. package/dist/mermaid-HWGCJPDP-DYCzSILp.js +0 -2
  204. package/dist/stateDiagram-v2-MP3YSRHH-ChNddepZ.js +0 -30
  205. package/dist/swimlanesDiagram-VR7AAH4N-FUSwmzEp.js +0 -30
@@ -0,0 +1,237 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { useAtomValue } from "jotai";
4
+ import {
5
+ BotIcon,
6
+ CheckIcon,
7
+ Loader2Icon,
8
+ UnplugIcon,
9
+ XIcon,
10
+ } from "lucide-react";
11
+ import { useCallback, useEffect, useRef, useState } from "react";
12
+ import { Button } from "@/components/ui/button";
13
+ import {
14
+ Popover,
15
+ PopoverContent,
16
+ PopoverTrigger,
17
+ } from "@/components/ui/popover";
18
+ import {
19
+ type Attachment,
20
+ agentAttachmentsAtom,
21
+ attachmentLabel,
22
+ } from "@/core/attachments/state";
23
+ import { agentToast } from "@/core/attachments/toast";
24
+ import { pairConfigAtom } from "@/core/config/pair";
25
+ import { stableSessionIdAtom } from "@/core/kernel/session";
26
+ import { API } from "@/core/network/api";
27
+ import { useTimeAgo } from "@/hooks/useFormatting";
28
+ import { FooterItem } from "../footer-item";
29
+
30
+ export function AttachmentStatus() {
31
+ const hostEnabled = useAtomValue(pairConfigAtom)?.hostEnabled;
32
+ const agents = useAtomValue(agentAttachmentsAtom);
33
+ const [open, setOpen] = useState(false);
34
+ const previous = useRef(new Set<string>());
35
+ const automatic = useRef(false);
36
+ const pointerInside = useRef(false);
37
+ const timeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
38
+
39
+ const stopTimer = useCallback(() => clearTimeout(timeout.current), []);
40
+ const startTimer = useCallback(() => {
41
+ stopTimer();
42
+ timeout.current = setTimeout(() => setOpen(false), 3000);
43
+ }, [stopTimer]);
44
+ const preserveEditorFocus = (event: Event) => {
45
+ if (automatic.current) {
46
+ event.preventDefault();
47
+ }
48
+ };
49
+
50
+ useEffect(() => {
51
+ if (!open) {
52
+ pointerInside.current = false;
53
+ }
54
+ const current = new Set(
55
+ hostEnabled ? agents.map((agent) => agent.identity ?? agent.id) : [],
56
+ );
57
+ const connected = [...current].some((id) => !previous.current.has(id));
58
+ for (const id of current) {
59
+ previous.current.add(id);
60
+ }
61
+ if (current.size === 0) {
62
+ stopTimer();
63
+ setOpen(false);
64
+ } else if (connected) {
65
+ if (open && !automatic.current) {
66
+ return;
67
+ }
68
+ automatic.current = true;
69
+ setOpen(true);
70
+ if (!pointerInside.current) {
71
+ startTimer();
72
+ }
73
+ }
74
+ }, [agents, hostEnabled, open, startTimer, stopTimer]);
75
+
76
+ useEffect(() => stopTimer, [stopTimer]);
77
+
78
+ if (!hostEnabled || agents.length === 0) {
79
+ return null;
80
+ }
81
+ const identities = new Set(agents.map((agent) => agent.identity ?? agent.id));
82
+ const label =
83
+ identities.size === 1
84
+ ? `${attachmentLabel(agents[0])} connected`
85
+ : `${identities.size} agents connected`;
86
+
87
+ return (
88
+ <Popover
89
+ open={open}
90
+ onOpenChange={(nextOpen) => {
91
+ automatic.current = false;
92
+ stopTimer();
93
+ setOpen(nextOpen);
94
+ }}
95
+ >
96
+ <PopoverTrigger asChild={true}>
97
+ <FooterItem
98
+ asChild={true}
99
+ tooltip={label}
100
+ selected={open}
101
+ data-testid="footer-attachment-status"
102
+ aria-label={label}
103
+ >
104
+ <button type="button">
105
+ <span className="flex items-center gap-1.5">
106
+ <BotIcon className="w-4 h-4" />
107
+ <span className="max-w-48 truncate">{label}</span>
108
+ </span>
109
+ </button>
110
+ </FooterItem>
111
+ </PopoverTrigger>
112
+ <PopoverContent
113
+ className="w-80 p-0 text-sm"
114
+ side="top"
115
+ align="start"
116
+ onOpenAutoFocus={preserveEditorFocus}
117
+ onCloseAutoFocus={preserveEditorFocus}
118
+ onPointerEnter={() => {
119
+ pointerInside.current = true;
120
+ stopTimer();
121
+ }}
122
+ onPointerLeave={() => {
123
+ pointerInside.current = false;
124
+ if (automatic.current) {
125
+ startTimer();
126
+ }
127
+ }}
128
+ onFocusCapture={() => {
129
+ automatic.current = false;
130
+ stopTimer();
131
+ }}
132
+ >
133
+ <h4 className="font-medium px-4 py-3 border-b">{label}</h4>
134
+ <div className="max-h-72 overflow-auto divide-y">
135
+ {agents.map((attachment) => (
136
+ <AttachmentStatusItem key={attachment.id} attachment={attachment} />
137
+ ))}
138
+ </div>
139
+ <p className="px-4 py-3 border-t text-xs text-muted-foreground">
140
+ Disconnect removes the notebook connection. The agent session keeps
141
+ running.
142
+ </p>
143
+ </PopoverContent>
144
+ </Popover>
145
+ );
146
+ }
147
+
148
+ function AttachmentStatusItem({ attachment }: { attachment: Attachment }) {
149
+ const stableSessionId = useAtomValue(stableSessionIdAtom);
150
+ const [state, setState] = useState<"idle" | "confirming" | "disconnecting">(
151
+ "idle",
152
+ );
153
+ const confirming = state !== "idle";
154
+ const disconnecting = state === "disconnecting";
155
+ const disconnectButton = useRef<HTMLButtonElement>(null);
156
+ const timeAgo = useTimeAgo();
157
+ const label = attachmentLabel(attachment);
158
+ const disconnectLabel = disconnecting
159
+ ? `Disconnecting ${label}`
160
+ : confirming
161
+ ? `Confirm disconnect ${label}`
162
+ : `Disconnect ${label}`;
163
+
164
+ const disconnect = async () => {
165
+ if (disconnecting || !stableSessionId) {
166
+ return;
167
+ }
168
+ setState("disconnecting");
169
+ try {
170
+ await API.post(
171
+ `/pair/notebooks/${encodeURIComponent(stableSessionId)}/attachments/detach`,
172
+ { attachment_id: attachment.id },
173
+ );
174
+ } catch {
175
+ agentToast({ variant: "danger", title: `Could not disconnect ${label}` });
176
+ } finally {
177
+ setState("idle");
178
+ }
179
+ };
180
+
181
+ return (
182
+ <div className="flex items-start gap-3 px-4 py-3">
183
+ <div className="min-w-0 flex-1">
184
+ <h5 className="font-medium">{label}</h5>
185
+ <p className="text-xs text-muted-foreground mt-1">
186
+ Connected {timeAgo(attachment.since)}
187
+ </p>
188
+ <p
189
+ className="text-xs font-mono text-muted-foreground truncate mt-1"
190
+ title={attachment.id}
191
+ >
192
+ {attachment.id}
193
+ </p>
194
+ </div>
195
+ <div className="flex shrink-0 items-center gap-1">
196
+ {confirming && (
197
+ <span className="text-xs text-muted-foreground">
198
+ {disconnecting ? "Disconnecting…" : "Disconnect?"}
199
+ </span>
200
+ )}
201
+ <Button
202
+ ref={disconnectButton}
203
+ size="icon"
204
+ variant="outlineDestructive"
205
+ disabled={disconnecting || !stableSessionId}
206
+ onClick={confirming ? disconnect : () => setState("confirming")}
207
+ aria-label={disconnectLabel}
208
+ title={disconnectLabel}
209
+ aria-busy={disconnecting}
210
+ >
211
+ {disconnecting ? (
212
+ <Loader2Icon className="size-3.5 animate-spin" aria-hidden={true} />
213
+ ) : confirming ? (
214
+ <CheckIcon className="size-3.5" aria-hidden={true} />
215
+ ) : (
216
+ <UnplugIcon className="size-3.5" aria-hidden={true} />
217
+ )}
218
+ </Button>
219
+ {confirming && (
220
+ <Button
221
+ size="icon"
222
+ variant="outline"
223
+ disabled={disconnecting}
224
+ onClick={() => {
225
+ setState("idle");
226
+ disconnectButton.current?.focus();
227
+ }}
228
+ aria-label={`Cancel disconnect ${label}`}
229
+ title={`Cancel disconnect ${label}`}
230
+ >
231
+ <XIcon className="size-3.5" aria-hidden={true} />
232
+ </Button>
233
+ )}
234
+ </div>
235
+ </div>
236
+ );
237
+ }
@@ -12,6 +12,7 @@ import { ShowInKioskMode } from "../../kiosk-mode";
12
12
  import { panelLayoutAtom, useChromeActions, useChromeState } from "../state";
13
13
  import { FooterItem } from "./footer-item";
14
14
  import { AIStatusIcon } from "./footer-items/ai-status";
15
+ import { AttachmentStatus } from "./footer-items/attachment-status";
15
16
  import {
16
17
  BackendConnectionStatus,
17
18
  connectionStatusAtom,
@@ -107,6 +108,7 @@ export const Footer: React.FC = () => {
107
108
 
108
109
  <div className="flex items-center shrink-0 min-w-0">
109
110
  <MachineStats />
111
+ <AttachmentStatus />
110
112
  <AIStatusIcon />
111
113
  <CopilotStatusIcon />
112
114
  <RTCStatus />
@@ -10,6 +10,7 @@ import {
10
10
  import { Provider } from "jotai";
11
11
  import type React from "react";
12
12
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
13
+ import { requestId } from "@/__tests__/branded";
13
14
  import { MockRequestClient } from "@/__mocks__/requests";
14
15
  import { ModalProvider } from "@/components/modal/ImperativeModal";
15
16
  import { TooltipProvider } from "@/components/ui/tooltip";
@@ -129,7 +130,7 @@ describe("NotebookMenuDropdown", () => {
129
130
  }));
130
131
  invalidateDataSourceDiscovery();
131
132
  vi.spyOn(DiscoverDataSources, "request").mockResolvedValue({
132
- request_id: "request-id",
133
+ request_id: requestId("request-id"),
133
134
  sources: [],
134
135
  });
135
136
  });
@@ -142,7 +143,7 @@ describe("NotebookMenuDropdown", () => {
142
143
 
143
144
  it("shows detected databases in the add connection submenu", async () => {
144
145
  vi.mocked(DiscoverDataSources.request).mockResolvedValue({
145
- request_id: "request-id",
146
+ request_id: requestId("request-id"),
146
147
  sources: [POSTGRES_SOURCE],
147
148
  });
148
149
 
@@ -172,7 +173,7 @@ describe("NotebookMenuDropdown", () => {
172
173
 
173
174
  it("shows detected storage in the add remote storage submenu", async () => {
174
175
  vi.mocked(DiscoverDataSources.request).mockResolvedValue({
175
- request_id: "request-id",
176
+ request_id: requestId("request-id"),
176
177
  sources: [S3_SOURCE],
177
178
  });
178
179