@marimo-team/frontend 0.25.3-dev141 → 0.25.3-dev15
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.
- package/dist/assets/{CellStatus-BP2mavAq.js → CellStatus-DVOHpdeJ.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-t8fH_TNc.js → ConnectedDataExplorerComponent-TprnxZeJ.js} +1 -1
- package/dist/assets/{ErrorBoundary-Gl5nCA8C.js → ErrorBoundary-CM13wrd8.js} +2 -2
- package/dist/assets/JsonOutput-Cx1iyibB.js +11 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-CKcCbG2G.js → LazyAnyLanguageCodeMirror-B4fCknq1.js} +2 -2
- package/dist/assets/MarimoErrorOutput-s_5GOX8k.js +10 -0
- package/dist/assets/{RenderHTML-BbOqmHy3.js → RenderHTML-DX6i99Op.js} +1 -1
- package/dist/assets/{RunButton-CK3LhnP5.js → RunButton-BKoh0zYG.js} +1 -1
- package/dist/assets/{add-cell-with-ai-8UBC0xwR.js → add-cell-with-ai-BpD_790A.js} +11 -11
- package/dist/assets/{add-connection-dialog-DXQnd6eB.js → add-connection-dialog-B1BXCjex.js} +2 -2
- package/dist/assets/{agent-panel-D7kMZLG-.js → agent-panel-CDFUc1uu.js} +5 -5
- package/dist/assets/ai-model-dropdown-i1vfGeVi.js +13 -0
- package/dist/assets/{any-language-editor-BLCAD3yx.js → any-language-editor-BdTWdMCI.js} +1 -1
- package/dist/assets/{app-config-button-BKEG4x9u.js → app-config-button-AdV-QDD7.js} +1 -1
- package/dist/assets/{blob-D5nfNHOo.js → blob-BG8yoQmx.js} +1 -1
- package/dist/assets/{cell-editor-ADVfycpN.js → cell-editor-BKJ06H5F.js} +9 -9
- package/dist/assets/cell-link-8Auigi8P.js +1 -0
- package/dist/assets/{cells-BRkCaSsh.js → cells-C6YGYGdi.js} +56 -56
- package/dist/assets/{chat-display-Dnagy4Nv.js → chat-display-DhgI2MS9.js} +1 -1
- package/dist/assets/{chat-panel-DQ6HkWEF.js → chat-panel-Cau71Ygr.js} +2 -2
- package/dist/assets/{chat-ui-Df8Vcj6n.js → chat-ui-C5ql1Up-.js} +1 -1
- package/dist/assets/code-visibility-BJImdpDi.js +1 -0
- package/dist/assets/coerce-DWjFeXOY.js +1 -0
- package/dist/assets/{column-preview-Cm2D6vyX.js → column-preview-BZ_iNhtJ.js} +1 -1
- package/dist/assets/{command-palette-DTSQ7gOC.js → command-palette-DDC3kBet.js} +1 -1
- package/dist/assets/{common-Cu6CDbuw.js → common-Sl3uthjg.js} +1 -1
- package/dist/assets/{components-CGw16R_N.js → components-3cou6Mka.js} +1 -1
- package/dist/assets/{components-CP_UoFtT.js → components-CskjK6xZ.js} +1 -1
- package/dist/assets/{components-CXfO-F47.js → components-YBmtV0p6.js} +1 -1
- package/dist/assets/{config-VPSq73n8.js → config-CA1V-wjh.js} +1 -1
- package/dist/assets/config-DRIpOKqh.js +1 -0
- package/dist/assets/config-Dy28fDwn.js +1 -0
- package/dist/assets/{datasource-Cq6x_5ML.js → datasource-DfbNb83e.js} +1 -1
- package/dist/assets/{dates-BbFQ2oE4.js → dates-CfmdTL6B.js} +1 -1
- package/dist/assets/{dependency-graph-panel--Kgtktcw.js → dependency-graph-panel-L5cBE5sl.js} +1 -1
- package/dist/assets/{documentation-panel-BHmbeznw.js → documentation-panel-D7S8JIc2.js} +1 -1
- package/dist/assets/{download-DCJXy66H.js → download-C03FOElq.js} +1 -1
- package/dist/assets/edit-page-D_Rg0gQO.js +9 -0
- package/dist/assets/{error-banner-Cd69vvyX.js → error-banner-COZ7SfYV.js} +1 -1
- package/dist/assets/{error-entries-Dk3VZ-OK.js → error-entries-CLnPDv7b.js} +1 -1
- package/dist/assets/{error-panel-BPRYmC5J.js → error-panel-D2xrYLue.js} +1 -1
- package/dist/assets/{errors-DCrsa1nH.js → errors-CNsgAw6m.js} +1 -1
- package/dist/assets/{feedback-button-Bik2-e33.js → feedback-button-DzPunIqU.js} +2 -2
- package/dist/assets/feedback-button-Kla7i5RT.js +1 -0
- package/dist/assets/{file-explorer-panel-BEEK5lcl.js → file-explorer-panel-Uk4_QIJQ.js} +1 -1
- package/dist/assets/{file-name-input-Cdc-TVqO.js → file-name-input-B4fRaQkI.js} +1 -1
- package/dist/assets/{floating-outline-XD9FAV-f.js → floating-outline-B5MaM1JS.js} +1 -1
- package/dist/assets/{gallery-page-Dm6mGwBi.js → gallery-page-BefvdsM7.js} +1 -1
- package/dist/assets/{glide-data-editor-J9CAb70d.js → glide-data-editor-C3eaYlXg.js} +1 -1
- package/dist/assets/{home-page-DMHnsRxm.js → home-page-hmvKlc1w.js} +1 -1
- package/dist/assets/{hooks-93IwHd2u.js → hooks-DzML9nez.js} +1 -1
- package/dist/assets/index-6b4mf8Ai.css +2 -0
- package/dist/assets/index-ptK1gxmo.js +30 -0
- package/dist/assets/{layout-DmcNEu3P.js → layout-Ck1RoL1B.js} +5 -5
- package/dist/assets/{logs-panel-ABM16htT.js → logs-panel-BRytaWaO.js} +1 -1
- package/dist/assets/{markdown-renderer-BG3sp2rs.js → markdown-renderer-DX0Xrrfy.js} +1 -1
- package/dist/assets/{mermaid-a3xYymTy.js → mermaid-C4EiVqcd.js} +1 -1
- package/dist/assets/{name-cell-input-BgEBmqyL.js → name-cell-input-DlpTvPLa.js} +1 -1
- package/dist/assets/{outline-panel-DCXQ3_F6.js → outline-panel-B2WIpz-1.js} +1 -1
- package/dist/assets/{packages-panel-BMGOmZkR.js → packages-panel-CI5ff9b-.js} +1 -1
- package/dist/assets/{panel-accordion-state-C1sdPp0m.js → panel-accordion-state-BqSH5ttk.js} +1 -1
- package/dist/assets/panels-BCcZ_yLK.js +107 -0
- package/dist/assets/{process-output-D0KGq04R.js → process-output-f3C3PD0Z.js} +1 -1
- package/dist/assets/{readonly-code-display-Do50PHI8.js → readonly-code-display-MnMEoYW5.js} +1 -1
- package/dist/assets/{readonly-python-code-DCSMIsTX.js → readonly-python-code-ggs4hAzC.js} +1 -1
- package/dist/assets/{renderShortcut-BkVJQ_Zh.js → renderShortcut-C1JwYcqW.js} +1 -1
- package/dist/assets/{reveal-component-ltaepAqw.js → reveal-component-PiV1eQk9.js} +1 -1
- package/dist/assets/run-page-AfZhtEh1.js +1 -0
- package/dist/assets/{runtime-details-state-CSPobEdR.js → runtime-details-state-CoL-p0MC.js} +1 -1
- package/dist/assets/{schemas-Dv42wLFq.js → schemas-ChRqMOTL.js} +1 -1
- package/dist/assets/{scratchpad-panel-Dwd6W5PE.js → scratchpad-panel-D2rWg4k8.js} +1 -1
- package/dist/assets/{secrets-panel-Bctbtkrp.js → secrets-panel-D7KN4tVs.js} +1 -1
- package/dist/assets/session-panel-CnANhcTo.js +1 -0
- package/dist/assets/{snippets-panel-Bh1oTw4m.js → snippets-panel-ClGHtEKQ.js} +1 -1
- package/dist/assets/state-CbjBtkdd.js +3 -0
- package/dist/assets/{state-XsPO8hNi.js → state-DtGB7xeJ.js} +1 -1
- package/dist/assets/{terminal-Ck_vK-34.js → terminal-wnSHYT8N.js} +1 -1
- package/dist/assets/{tracing-Di6pUmX8.js → tracing-Dz2rYOFL.js} +1 -1
- package/dist/assets/{tracing-panel-PeRXHD8_.js → tracing-panel-DqQY9V91.js} +2 -2
- package/dist/assets/{tree-actions-GM5E_bUs.js → tree-actions-DnUokmva.js} +1 -1
- package/dist/assets/{useAddCell-GR7eEQrT.js → useAddCell-IN24thff.js} +1 -1
- package/dist/assets/{useBoolean-BDD6_xQQ.js → useBoolean-d0Tty94N.js} +1 -1
- package/dist/assets/{useCellActionButton-B-9eG5z_.js → useCellActionButton-DmaFZ4oF.js} +1 -1
- package/dist/assets/{useDeleteCell-2_bMClHd.js → useDeleteCell-fQlM46Y2.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-k3C3M18S.js → useDependencyPanelTab-ImXYINm_.js} +1 -1
- package/dist/assets/{useInstallPackage-iX1eufdl.js → useInstallPackage-BW06eter.js} +1 -1
- package/dist/assets/{useNotebookActions-NHN6A-cN.js → useNotebookActions-DHt3s-ia.js} +1 -1
- package/dist/assets/{useRunCells-B2vUhREg.js → useRunCells-DSJPXE-j.js} +1 -1
- package/dist/assets/{useSplitCell-DEb03htp.js → useSplitCell-DQyMF5gd.js} +1 -1
- package/dist/assets/{useTheme-COhSHkCj.js → useTheme-n8Dj1zH7.js} +1 -1
- package/dist/assets/{vega-component-CnadTgoE.js → vega-component-IouMe13t.js} +1 -1
- package/dist/index.html +34 -35
- package/package.json +5 -2
- package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
- package/src/__tests__/host-imports.test.ts +100 -0
- package/src/__tests__/mount.test.ts +28 -8
- package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
- package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
- package/src/components/data-table/__tests__/export-actions.test.tsx +329 -6
- package/src/components/data-table/context-menu.tsx +125 -26
- package/src/components/data-table/date-filter-inputs.tsx +15 -42
- package/src/components/data-table/export-actions.tsx +192 -116
- package/src/components/data-table/schemas.ts +14 -36
- package/src/components/data-table/utils.ts +18 -0
- package/src/components/editor/Output.tsx +9 -2
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
- package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
- package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
- package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
- package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
- package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +372 -0
- package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
- package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
- package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +548 -0
- package/src/components/editor/errors/send-error-report-button.tsx +69 -0
- package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
- package/src/components/editor/output/MarimoTracebackOutput.tsx +35 -20
- package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
- package/src/components/editor/output/ansi-reduce.ts +6 -0
- package/src/core/attachments/__tests__/toast.test.tsx +58 -0
- package/src/core/attachments/state.ts +21 -0
- package/src/core/attachments/toast.ts +15 -0
- package/src/core/cells/__tests__/cells.test.ts +52 -0
- package/src/core/cells/__tests__/error-report.test.ts +139 -0
- package/src/core/cells/__tests__/session.test.ts +50 -1
- package/src/core/cells/error-report.ts +63 -0
- package/src/core/cells/session.ts +28 -1
- package/src/core/config/pair.ts +5 -3
- package/src/core/edit-app.tsx +2 -2
- package/src/core/host/AGENTS.md +6 -0
- package/src/core/host/__tests__/events.test.ts +46 -0
- package/src/core/host/__tests__/notebook-client.test.ts +191 -0
- package/src/core/host/__tests__/protocol.test.ts +214 -0
- package/src/core/host/connection.ts +81 -0
- package/src/core/host/events.ts +60 -0
- package/src/core/host/notebook-client.ts +226 -0
- package/src/core/host/protocol.ts +1943 -0
- package/src/core/islands/__tests__/bootstrap.test.ts +26 -0
- package/src/core/islands/bootstrap.ts +1 -0
- package/src/core/run-app.tsx +2 -2
- package/src/core/runtime/__tests__/runtime.test.ts +55 -11
- package/src/core/runtime/runtime.ts +14 -1
- package/src/core/runtime/types.ts +2 -0
- package/src/core/websocket/__tests__/{useMarimoKernelConnection.test.ts → connection-state.test.ts} +15 -17
- package/src/core/websocket/__tests__/{useWebSocket.test.ts → createConnectionTransport.test.ts} +1 -1
- package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +140 -0
- package/src/core/websocket/__tests__/{useMarimoKernelConnection.hook.test.tsx → useNotebookSession.hook.test.tsx} +352 -65
- package/src/core/websocket/connection-state.ts +70 -0
- package/src/core/websocket/transports/__tests__/sse.test.ts +1 -4
- package/src/core/websocket/transports/create.ts +31 -0
- package/src/core/websocket/transports/transport.ts +12 -23
- package/src/core/websocket/types.ts +9 -39
- package/src/core/websocket/useNotebookClient.ts +80 -0
- package/src/core/websocket/{useMarimoKernelConnection.tsx → useNotebookSession.tsx} +67 -225
- package/src/mount.tsx +7 -3
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
- package/src/utils/__tests__/dates.test.ts +116 -0
- package/src/utils/dates.ts +94 -0
- package/dist/assets/JsonOutput-D6HIIsCb.js +0 -11
- package/dist/assets/MarimoErrorOutput-D60XkCny.js +0 -6
- package/dist/assets/ai-model-dropdown-B0z6-zhp.js +0 -5
- package/dist/assets/api-BeC_VSGv.js +0 -1
- package/dist/assets/cell-link-LSth_8hT.js +0 -1
- package/dist/assets/code-visibility-B-_GvwR5.js +0 -1
- package/dist/assets/coerce-CpE6kUdX.js +0 -1
- package/dist/assets/config-BOKzA3tF.js +0 -1
- package/dist/assets/config-DX8Y2WbJ.js +0 -1
- package/dist/assets/edit-page-ChcSgpke.js +0 -9
- package/dist/assets/feedback-button-B2gKC5cn.js +0 -1
- package/dist/assets/index-Bcdzex-3.css +0 -2
- package/dist/assets/index-s-M1OXjs.js +0 -29
- package/dist/assets/pair-CaQyK6En.js +0 -1
- package/dist/assets/panels-CxVG8-v2.js +0 -4
- package/dist/assets/run-page-DF3c5cDk.js +0 -1
- package/dist/assets/session-panel-VdDhEBa-.js +0 -1
- package/dist/assets/state-_Qai_QyX.js +0 -3
- package/src/core/websocket/useWebSocket.tsx +0 -88
|
@@ -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 />
|