@marimo-team/frontend 0.25.3-dev52 → 0.25.3-dev57
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-RQxLjC9P.js → CellStatus-cD3S0wEA.js} +1 -1
- package/dist/assets/{ErrorBoundary-DzEMMFh0.js → ErrorBoundary-DJhsFCsX.js} +2 -2
- package/dist/assets/JsonOutput-Pm6OCP3J.js +11 -0
- package/dist/assets/{MarimoErrorOutput-BT8Qy5wh.js → MarimoErrorOutput-DlEjLCZ-.js} +1 -1
- package/dist/assets/{RenderHTML-PyMU3fBB.js → RenderHTML-CfQ6i3QV.js} +1 -1
- package/dist/assets/RunButton-DvuvkgrG.js +1 -0
- package/dist/assets/{add-cell-with-ai-CEQ8jvcR.js → add-cell-with-ai-BhmuohAY.js} +1 -1
- package/dist/assets/{add-connection-dialog-D9fnw-j0.js → add-connection-dialog-D7EYSraq.js} +1 -1
- package/dist/assets/{agent-panel-DkTYXm6j.js → agent-panel-GFhlWVub.js} +1 -1
- package/dist/assets/ai-model-dropdown-YT1HiXiK.js +13 -0
- package/dist/assets/{app-config-button-BZzwY1BU.js → app-config-button-C_whRVO8.js} +1 -1
- package/dist/assets/{blob-DmUUV8Xf.js → blob-e6VlOmQP.js} +1 -1
- package/dist/assets/{cell-editor-C6xeN3x0.js → cell-editor-3cVIcyHK.js} +2 -2
- package/dist/assets/{cell-link-BNDZZ97N.js → cell-link-DFqfW-Ym.js} +1 -1
- package/dist/assets/{cells-0e2dpq3z.js → cells-T9_Y4Jlv.js} +1 -1
- package/dist/assets/{chat-display-D6TNcsmz.js → chat-display-BtaARI-N.js} +1 -1
- package/dist/assets/{chat-panel-CN45Q9wF.js → chat-panel-eT2lfQrB.js} +1 -1
- package/dist/assets/chat-ui-nNFa2LdU.js +4 -0
- package/dist/assets/{column-preview-D7sTOokc.js → column-preview-C6uXRJry.js} +1 -1
- package/dist/assets/{command-palette-CP5KmR-S.js → command-palette-OZPTmtR-.js} +1 -1
- package/dist/assets/{common-GvwCMUGF.js → common-DeeLgjWQ.js} +1 -1
- package/dist/assets/{components-nnFZuekV.js → components-DyAF3_Nf.js} +1 -1
- package/dist/assets/{datasource-BpMPWJoj.js → datasource-gqFgG9Qd.js} +1 -1
- package/dist/assets/{dependency-graph-panel-lyJ3aygI.js → dependency-graph-panel-BFFxLgR6.js} +1 -1
- package/dist/assets/{documentation-panel-CTUWNQQy.js → documentation-panel-BBpGbT-f.js} +1 -1
- package/dist/assets/{download-Csw35OD4.js → download-C8Gw-D0Y.js} +1 -1
- package/dist/assets/{edit-page-Dwf3-IB6.js → edit-page-B0lN_Rib.js} +6 -6
- package/dist/assets/{error-entries-D3H6JH3A.js → error-entries-uyqOG5tg.js} +1 -1
- package/dist/assets/{error-panel-CgpCPUEO.js → error-panel-Cli5zPWi.js} +1 -1
- package/dist/assets/{feedback-button-BEBY1q2a.js → feedback-button-CvrwBGr7.js} +1 -1
- package/dist/assets/feedback-button-DknbRCN_.js +1 -0
- package/dist/assets/file-explorer-panel-BSU5ultY.js +1 -0
- package/dist/assets/{file-name-input-DrtIQ1VP.js → file-name-input-CDrRlIiX.js} +1 -1
- package/dist/assets/{floating-outline-Dtc8YhnE.js → floating-outline-GQD9km0W.js} +1 -1
- package/dist/assets/{gallery-page-DL4SSfun.js → gallery-page-CxmV1JLF.js} +1 -1
- package/dist/assets/{glide-data-editor-BTlU9F_s.js → glide-data-editor-B1kpoetH.js} +1 -1
- package/dist/assets/{home-page-BOmrrw3X.js → home-page-KnJyha6O.js} +1 -1
- package/dist/assets/{hooks-DRNEKPFW.js → hooks-w6zKs3CJ.js} +1 -1
- package/dist/assets/index-Bu8_lPMx.js +30 -0
- package/dist/assets/{input-ByHt6aoV.js → input-BZdRe7pb.js} +1 -1
- package/dist/assets/{layout-DY2TXsTM.js → layout-sYdHI-lW.js} +5 -5
- package/dist/assets/{logs-panel-9f0amGf0.js → logs-panel-CdUc5vtA.js} +1 -1
- package/dist/assets/{markdown-renderer-BRDCZeXA.js → markdown-renderer-pKc_bFac.js} +1 -1
- package/dist/assets/{name-cell-input-13mN6CiO.js → name-cell-input-csH3Cy54.js} +1 -1
- package/dist/assets/{outline-panel-DxC82nfD.js → outline-panel-DhsHYTuo.js} +1 -1
- package/dist/assets/packages-panel-lkNX6Oov.js +1 -0
- package/dist/assets/{panel-accordion-state-D_2i5aDC.js → panel-accordion-state-Bco6nsUI.js} +1 -1
- package/dist/assets/panels-B2UqDbHy.js +107 -0
- package/dist/assets/{process-output-DlZH3EId.js → process-output-B2-bT4cq.js} +1 -1
- package/dist/assets/{readonly-code-display-C8kpTYRT.js → readonly-code-display-Dsp6vWPh.js} +1 -1
- package/dist/assets/{readonly-python-code-XeDpkiXX.js → readonly-python-code-B81AjzXM.js} +1 -1
- package/dist/assets/{reveal-component-DgYlZOla.js → reveal-component-CrQRQhW4.js} +1 -1
- package/dist/assets/{run-page-C_A8W1eR.js → run-page-BGzpa3D9.js} +1 -1
- package/dist/assets/{runtime-details-state-BeyT-Z-4.js → runtime-details-state-CznIe40L.js} +1 -1
- package/dist/assets/{scratchpad-panel-Fb-8g4-S.js → scratchpad-panel-ClLxdqdK.js} +1 -1
- package/dist/assets/{secrets-panel-CmLZsNfp.js → secrets-panel-Dh3v7XPE.js} +1 -1
- package/dist/assets/{session-panel-Cl85FUT5.js → session-panel-C7-wmZhc.js} +1 -1
- package/dist/assets/{snippets-panel-1hl_ey1w.js → snippets-panel-BARpOPyS.js} +1 -1
- package/dist/assets/{state-CbjD81T1.js → state-BRYi026f.js} +1 -1
- package/dist/assets/{state-ClkxCKxQ.js → state-Bye6rCo4.js} +1 -1
- package/dist/assets/{switch-1h011wlH.js → switch-IoWE8PbW.js} +1 -1
- package/dist/assets/{terminal-D__Z_QZ0.js → terminal-Bhcn_y1N.js} +1 -1
- package/dist/assets/{tracing-DcFczEy0.js → tracing-BW2ZVnXs.js} +1 -1
- package/dist/assets/{tracing-panel-EWvfWPFQ.js → tracing-panel-UKdh_YXC.js} +2 -2
- package/dist/assets/{tree-actions-Dof5VISm.js → tree-actions-Cb-nUK1F.js} +1 -1
- package/dist/assets/{useAddCell-CqnFgwhm.js → useAddCell-Bielffe0.js} +1 -1
- package/dist/assets/{useCellActionButton--Sq8PDBs.js → useCellActionButton-Cu34Zs6x.js} +1 -1
- package/dist/assets/useDebounce-k9QTpQ9-.js +1 -0
- package/dist/assets/useDelayElapsed-BlsDT4TV.js +1 -0
- package/dist/assets/{useDeleteCell-DNTqIwU8.js → useDeleteCell-BV4VemCv.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-C4_EiuVH.js → useDependencyPanelTab-BEGqRiWi.js} +1 -1
- package/dist/assets/{useInstallPackage-DDjpV5RE.js → useInstallPackage-C7neMPwh.js} +1 -1
- package/dist/assets/{useNotebookActions-C00MOhyT.js → useNotebookActions-OLol05t9.js} +1 -1
- package/dist/assets/{useRunCells-DqLsZnRn.js → useRunCells-BFeZMi7f.js} +1 -1
- package/dist/assets/{useSplitCell-Daxc689Z.js → useSplitCell-DllkNFke.js} +1 -1
- package/dist/assets/useStateForKey-CGMJQT8x.js +1 -0
- package/dist/assets/{write-secret-modal-usRSi1bb.js → write-secret-modal-7DzehGyr.js} +1 -1
- package/dist/index.html +27 -25
- package/package.json +1 -1
- package/src/components/app-config/ai-config.tsx +1 -1
- package/src/components/data-table/__tests__/export-actions.test.tsx +17 -0
- package/src/components/data-table/charts/charts.tsx +14 -19
- package/src/components/data-table/export-actions.tsx +5 -3
- package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +24 -0
- package/src/components/editor/actions/pair-with-agent-modal.tsx +18 -15
- package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
- package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
- package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +30 -1
- package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
- package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
- package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
- package/src/components/editor/file-tree/file-explorer.tsx +10 -5
- package/src/components/editor/file-tree/use-file-search.ts +35 -21
- package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
- package/src/components/icons/large-spinner.tsx +3 -14
- package/src/core/network/useConnectionNotice.ts +8 -2
- package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
- package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
- package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
- package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
- package/src/hooks/__tests__/useScript.test.tsx +77 -0
- package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
- package/src/hooks/useDebounce.ts +5 -8
- package/src/hooks/useDeepCompareMemoize.ts +1 -1
- package/src/hooks/useDelayElapsed.ts +14 -10
- package/src/hooks/useInternalStateWithSync.ts +6 -6
- package/src/hooks/useScript.ts +67 -70
- package/src/hooks/useStateForKey.ts +93 -0
- package/src/plugins/impl/DataTablePlugin.tsx +14 -15
- package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
- package/src/plugins/impl/SliderPlugin.tsx +6 -8
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +117 -1
- package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
- package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
- package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
- package/src/plugins/impl/chat/chat-ui.tsx +10 -9
- package/dist/assets/JsonOutput-9IONH7hu.js +0 -11
- package/dist/assets/RunButton-2p2uCp9U.js +0 -1
- package/dist/assets/ai-model-dropdown-Cv9fEAp9.js +0 -13
- package/dist/assets/chat-ui-BGl1jPPe.js +0 -4
- package/dist/assets/feedback-button-B8idT199.js +0 -1
- package/dist/assets/file-explorer-panel-MnNgzxxE.js +0 -1
- package/dist/assets/index-BdCbOYjS.js +0 -30
- package/dist/assets/packages-panel-Bi_mcFbl.js +0 -1
- package/dist/assets/panels-C-ygF1Rv.js +0 -107
- package/dist/assets/useDebounce-B_ccBZTp.js +0 -1
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-Bu8_lPMx.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-B0Z9INg1.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/react-DVplv7_D.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BrajqUja.js">
|
|
@@ -111,12 +111,12 @@
|
|
|
111
111
|
<link rel="modulepreload" crossorigin href="./assets/arrays-0R2reF2y.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="./assets/once-6KNTRW0u.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="./assets/numbers-CsZVw3Dc.js">
|
|
114
|
-
<link rel="modulepreload" crossorigin href="./assets/useDebounce-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="./assets/input-
|
|
114
|
+
<link rel="modulepreload" crossorigin href="./assets/useDebounce-k9QTpQ9-.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="./assets/input-BZdRe7pb.js">
|
|
116
116
|
<link rel="modulepreload" crossorigin href="./assets/use-toast-Wu434mLr.js">
|
|
117
117
|
<link rel="modulepreload" crossorigin href="./assets/requests-lt0JK8Jt.js">
|
|
118
118
|
<link rel="modulepreload" crossorigin href="./assets/uuid-k9DpjH68.js">
|
|
119
|
-
<link rel="modulepreload" crossorigin href="./assets/write-secret-modal-
|
|
119
|
+
<link rel="modulepreload" crossorigin href="./assets/write-secret-modal-7DzehGyr.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/plus-C5silF6g.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-DcgaW8fn.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-uBIymjUX.js">
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/useTheme-DLtPc-39.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-DhhdOGGd.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/purify.es--06brOip.js">
|
|
142
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
142
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-T9_Y4Jlv.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/coerce-DWjFeXOY.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/get-DjNf4SIX.js">
|
|
145
145
|
<link rel="modulepreload" crossorigin href="./assets/_hasPath-BmRQipI0.js">
|
|
@@ -154,40 +154,40 @@
|
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/copy-KlhazlhB.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-D9Dr-k4J.js">
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/chunk-YOKDWASO-BIpRENEC.js">
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-pKc_bFac.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/copy-Djr5m5ac.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-8-a5vovc.js">
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/blob-
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-BFeZMi7f.js">
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-CfQ6i3QV.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/blob-e6VlOmQP.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/kbd-pdKBv96t.js">
|
|
164
|
-
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-
|
|
164
|
+
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-C7neMPwh.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/share-BZW3tzEX.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/events-CbeVJ6OD.js">
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
168
|
-
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/state-BRYi026f.js">
|
|
168
|
+
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-DJhsFCsX.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-eAtVhbNZ.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-DS6umAnH.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/html-to-image-D_0rd3_B.js">
|
|
172
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/switch-
|
|
172
|
+
<link rel="modulepreload" crossorigin href="./assets/download-C8Gw-D0Y.js">
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/switch-IoWE8PbW.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/tabs-CY8E4r9U.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/table-DG7Ap4H4.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-CxVozGAC.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-Qw1f8Jhy.js">
|
|
178
|
-
<link rel="modulepreload" crossorigin href="./assets/tree-actions-
|
|
178
|
+
<link rel="modulepreload" crossorigin href="./assets/tree-actions-Cb-nUK1F.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-63DyBLHQ.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/external-link-UrX9KO36.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/spinner-DyNE-o8o.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/message-circle-C3rKm8_a.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/hat-glasses-C8RhSVii.js">
|
|
184
184
|
<link rel="modulepreload" crossorigin href="./assets/package-GSoSTiIK.js">
|
|
185
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
186
|
-
<link rel="modulepreload" crossorigin href="./assets/error-entries-
|
|
185
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-gqFgG9Qd.js">
|
|
186
|
+
<link rel="modulepreload" crossorigin href="./assets/error-entries-uyqOG5tg.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/alert-DTaqCu_d.js">
|
|
188
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
190
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
188
|
+
<link rel="modulepreload" crossorigin href="./assets/state-Bye6rCo4.js">
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-DFqfW-Ym.js">
|
|
190
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-DlEjLCZ-.js">
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/useDateFormatter-DA-62E-Y.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/en-US-Buu61juQ.js">
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/isValid-q_Ad80ug.js">
|
|
@@ -206,7 +206,8 @@
|
|
|
206
206
|
<link rel="modulepreload" crossorigin href="./assets/formats-zylfwejq.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/table-vrvqpuKJ.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Dbe0MrFr.js">
|
|
209
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
209
|
+
<link rel="modulepreload" crossorigin href="./assets/useStateForKey-CGMJQT8x.js">
|
|
210
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-Pm6OCP3J.js">
|
|
210
211
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-C4_v6fQW.js">
|
|
211
212
|
<link rel="modulepreload" crossorigin href="./assets/square-function-_W_Lo0P4.js">
|
|
212
213
|
<link rel="modulepreload" crossorigin href="./assets/spec-uCpVvaAR.js">
|
|
@@ -220,11 +221,11 @@
|
|
|
220
221
|
<link rel="modulepreload" crossorigin href="./assets/file-icons-CdJgUy-I.js">
|
|
221
222
|
<link rel="modulepreload" crossorigin href="./assets/globe-UdPdIbF7.js">
|
|
222
223
|
<link rel="modulepreload" crossorigin href="./assets/esm-CI_o7NhW.js">
|
|
223
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
224
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
224
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-Bielffe0.js">
|
|
225
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-B81AjzXM.js">
|
|
225
226
|
<link rel="modulepreload" crossorigin href="./assets/data-grid-types-DgHVN_Zz.js">
|
|
226
227
|
<link rel="modulepreload" crossorigin href="./assets/glide-utils-HFqhvWHI.js">
|
|
227
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
228
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-C6uXRJry.js">
|
|
228
229
|
<link rel="modulepreload" crossorigin href="./assets/square-BPmgQFnh.js">
|
|
229
230
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-DmIqR8sY.js">
|
|
230
231
|
<link rel="modulepreload" crossorigin href="./assets/prop-types-Djf4O40e.js">
|
|
@@ -235,8 +236,9 @@
|
|
|
235
236
|
<link rel="modulepreload" crossorigin href="./assets/bundle.esm-D3tw5rqW.js">
|
|
236
237
|
<link rel="modulepreload" crossorigin href="./assets/icons-CiZ_8zS-.js">
|
|
237
238
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-DFIVN9dn.js">
|
|
239
|
+
<link rel="modulepreload" crossorigin href="./assets/useDelayElapsed-BlsDT4TV.js">
|
|
238
240
|
<link rel="modulepreload" crossorigin href="./assets/pathUtils-DPmlLd-r.js">
|
|
239
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
241
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-GQD9km0W.js">
|
|
240
242
|
<link rel="stylesheet" crossorigin href="./assets/cells-0PFKL3SH.css">
|
|
241
243
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DjIHoF9Z.css">
|
|
242
244
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-B0GmlMnR.css">
|
package/package.json
CHANGED
|
@@ -1850,7 +1850,7 @@ export const AddModelForm: React.FC<{
|
|
|
1850
1850
|
id={modelNameInputId}
|
|
1851
1851
|
value={modelName}
|
|
1852
1852
|
onChange={(e) => setModelName(e.target.value)}
|
|
1853
|
-
placeholder="gpt-
|
|
1853
|
+
placeholder="gpt-5.6-sol"
|
|
1854
1854
|
className="text-xs mb-0"
|
|
1855
1855
|
/>
|
|
1856
1856
|
</div>
|
|
@@ -531,6 +531,23 @@ describe("ExportActions dialog", () => {
|
|
|
531
531
|
expect(downloadByURL).not.toHaveBeenCalled();
|
|
532
532
|
});
|
|
533
533
|
|
|
534
|
+
it("does not revive an earlier source failure when switching back", async () => {
|
|
535
|
+
downloadAs.mockRejectedValueOnce(new Error("First source failed"));
|
|
536
|
+
const { rerenderExportActions } = renderExportActions({
|
|
537
|
+
metadataSource: "first",
|
|
538
|
+
});
|
|
539
|
+
await openDialog();
|
|
540
|
+
fireEvent.click(screen.getByRole("button", { name: "Download CSV" }));
|
|
541
|
+
expect(await screen.findByRole("alert")).toHaveTextContent(
|
|
542
|
+
"First source failed",
|
|
543
|
+
);
|
|
544
|
+
|
|
545
|
+
rerenderExportActions({ metadataSource: "second" });
|
|
546
|
+
expect(screen.queryByRole("alert")).not.toBeInTheDocument();
|
|
547
|
+
rerenderExportActions({ metadataSource: "first" });
|
|
548
|
+
expect(screen.queryByRole("alert")).not.toBeInTheDocument();
|
|
549
|
+
});
|
|
550
|
+
|
|
534
551
|
async function startGeoParquetInstall(strictMode = false) {
|
|
535
552
|
const getExportMetadata = vi.fn().mockResolvedValue(geometryMetadata);
|
|
536
553
|
downloadAs.mockResolvedValueOnce({
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
XIcon,
|
|
14
14
|
} from "lucide-react";
|
|
15
15
|
import type { JSX } from "react";
|
|
16
|
-
import React, { useMemo,
|
|
17
|
-
import { type UseFormReturn, useForm } from "react-hook-form";
|
|
16
|
+
import React, { useMemo, useState } from "react";
|
|
17
|
+
import { type UseFormReturn, useForm, useWatch } from "react-hook-form";
|
|
18
18
|
import useResizeObserver from "use-resize-observer";
|
|
19
19
|
import { PythonIcon } from "@/components/editor/cell/code/icons";
|
|
20
20
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
@@ -103,16 +103,14 @@ export const TablePanel: React.FC<TablePanelProps> = ({
|
|
|
103
103
|
|
|
104
104
|
const [selectedTab, setSelectedTab] = useState(DEFAULT_TAB_NAME);
|
|
105
105
|
const [tabCounter, setTabCounter] = useState(tabs.length);
|
|
106
|
-
const prevDisplayHeader =
|
|
106
|
+
const [prevDisplayHeader, setPrevDisplayHeader] = useState(displayHeader);
|
|
107
|
+
|
|
108
|
+
if (displayHeader !== prevDisplayHeader) {
|
|
109
|
+
setPrevDisplayHeader(displayHeader);
|
|
110
|
+
}
|
|
107
111
|
|
|
108
112
|
// Auto-create a default chart tab when chart builder opens with no tabs
|
|
109
|
-
if (
|
|
110
|
-
displayHeader &&
|
|
111
|
-
!prevDisplayHeader.current &&
|
|
112
|
-
tabs.length === 0 &&
|
|
113
|
-
cellId
|
|
114
|
-
) {
|
|
115
|
-
prevDisplayHeader.current = displayHeader;
|
|
113
|
+
if (displayHeader && !prevDisplayHeader && tabs.length === 0 && cellId) {
|
|
116
114
|
const tabName = getChartTabName(0, NEW_CHART_TYPE);
|
|
117
115
|
const newTabs = new Map(tabsMap);
|
|
118
116
|
newTabs.set(cellId, [
|
|
@@ -122,7 +120,6 @@ export const TablePanel: React.FC<TablePanelProps> = ({
|
|
|
122
120
|
setTabCounter(1);
|
|
123
121
|
setSelectedTab(tabName);
|
|
124
122
|
}
|
|
125
|
-
prevDisplayHeader.current = displayHeader;
|
|
126
123
|
|
|
127
124
|
if (!displayHeader || (tabs.length === 0 && !displayHeader)) {
|
|
128
125
|
return dataTable;
|
|
@@ -320,9 +317,10 @@ export const ChartPanel: React.FC<{
|
|
|
320
317
|
saveChartType,
|
|
321
318
|
getDataUrl,
|
|
322
319
|
fieldTypes,
|
|
323
|
-
hasSchema
|
|
320
|
+
hasSchema: providedHasSchema,
|
|
324
321
|
isLargeDataset,
|
|
325
322
|
}) => {
|
|
323
|
+
const hasSchema = providedHasSchema ?? Boolean(fieldTypes?.length);
|
|
326
324
|
const { theme } = useTheme();
|
|
327
325
|
const form = useForm<ChartSchemaType>({
|
|
328
326
|
defaultValues: chartConfig ?? getChartDefaults(),
|
|
@@ -370,16 +368,13 @@ export const ChartPanel: React.FC<{
|
|
|
370
368
|
// Re-run when the data table changes
|
|
371
369
|
}, [tableData, renderLargeCharts, csvFieldTypes]);
|
|
372
370
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const memoizedFormValues = useMemo(() => {
|
|
377
|
-
return structuredClone(formValues);
|
|
378
|
-
}, [formValues]);
|
|
371
|
+
// useWatch returns a new object only when a value changes. It is typed as
|
|
372
|
+
// deeply partial, but the form always starts from complete defaults.
|
|
373
|
+
const formValues = useWatch({ control: form.control }) as ChartSchemaType;
|
|
379
374
|
|
|
380
375
|
const specWithoutData = createSpecWithoutData(
|
|
381
376
|
selectedChartType,
|
|
382
|
-
|
|
377
|
+
formValues,
|
|
383
378
|
theme,
|
|
384
379
|
"container",
|
|
385
380
|
CHART_HEIGHT,
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
GetExportMetadata,
|
|
25
25
|
} from "./schemas";
|
|
26
26
|
import { useAsyncData } from "@/hooks/useAsyncData";
|
|
27
|
+
import { useStateForKey } from "@/hooks/useStateForKey";
|
|
27
28
|
import { logNever } from "@/utils/assertNever";
|
|
28
29
|
import { cn } from "@/utils/cn";
|
|
29
30
|
import { copyToClipboard } from "@/utils/copy";
|
|
@@ -354,7 +355,6 @@ interface ExportContext {
|
|
|
354
355
|
export const ExportActions: React.FC<ExportActionProps> = (props) => {
|
|
355
356
|
const { getExportMetadata, metadataSource } = props;
|
|
356
357
|
const [exportDialogOpen, setExportDialogOpen] = React.useState(false);
|
|
357
|
-
const [failure, setFailure] = React.useState<ExportFailure | null>(null);
|
|
358
358
|
const [settings, setSettings] =
|
|
359
359
|
React.useState<ExportSettings>(DEFAULT_SETTINGS);
|
|
360
360
|
const [exportContext, setExportContext] = React.useState<ExportContext>(
|
|
@@ -363,6 +363,10 @@ export const ExportActions: React.FC<ExportActionProps> = (props) => {
|
|
|
363
363
|
if (exportContext.source !== metadataSource) {
|
|
364
364
|
setExportContext({ source: metadataSource });
|
|
365
365
|
}
|
|
366
|
+
const [failure, setFailure] = useStateForKey<ExportFailure | null>(
|
|
367
|
+
exportContext,
|
|
368
|
+
() => null,
|
|
369
|
+
);
|
|
366
370
|
const mounted = React.useRef(false);
|
|
367
371
|
const isCurrentContext = useEvent(
|
|
368
372
|
(context: ExportContext) => mounted.current && context === exportContext,
|
|
@@ -416,7 +420,6 @@ export const ExportActions: React.FC<ExportActionProps> = (props) => {
|
|
|
416
420
|
}, []);
|
|
417
421
|
React.useEffect(() => {
|
|
418
422
|
latestActionId.current += 1;
|
|
419
|
-
setFailure(null);
|
|
420
423
|
}, [metadataSource]);
|
|
421
424
|
const policy = useAtomValue(downloadSizeLimitAtom);
|
|
422
425
|
const overLimit = !!(
|
|
@@ -452,7 +455,6 @@ export const ExportActions: React.FC<ExportActionProps> = (props) => {
|
|
|
452
455
|
setExportDialogOpen(open);
|
|
453
456
|
if (!open) {
|
|
454
457
|
latestActionId.current += 1;
|
|
455
|
-
setFailure(null);
|
|
456
458
|
setExpandedFormat(null);
|
|
457
459
|
setSettings(DEFAULT_SETTINGS);
|
|
458
460
|
setGeometryColumn(null);
|
|
@@ -314,6 +314,30 @@ describe("PairWithAgentModal", () => {
|
|
|
314
314
|
expect(screen.getByRole("tabpanel")).not.toHaveTextContent("--notebook");
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
+
it("reverifies the target when host mode is enabled again for the same Session", async () => {
|
|
318
|
+
await act(async () => {
|
|
319
|
+
render(<PairWithAgentModal onClose={vi.fn()} />, { wrapper });
|
|
320
|
+
});
|
|
321
|
+
expect(screen.getByRole("tabpanel")).toHaveTextContent(NOTEBOOK_ID);
|
|
322
|
+
act(() =>
|
|
323
|
+
store.set(pairConfigAtom, { ...PAIR_CONFIG, hostEnabled: false }),
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
const pending = new Deferred<Response>();
|
|
327
|
+
vi.mocked(fetch).mockImplementation((url) =>
|
|
328
|
+
String(url).endsWith("/api/sessions")
|
|
329
|
+
? pending.promise
|
|
330
|
+
: responseFor(url),
|
|
331
|
+
);
|
|
332
|
+
act(() => store.set(pairConfigAtom, PAIR_CONFIG));
|
|
333
|
+
expect(screen.getByRole("button", { name: "Copy command" })).toBeDisabled();
|
|
334
|
+
expect(screen.getByRole("tabpanel")).not.toHaveTextContent(NOTEBOOK_ID);
|
|
335
|
+
|
|
336
|
+
await act(async () => pending.resolve(await responseFor("/api/sessions")));
|
|
337
|
+
expect(screen.getByRole("button", { name: "Copy command" })).toBeEnabled();
|
|
338
|
+
expect(screen.getByRole("tabpanel")).toHaveTextContent(NOTEBOOK_ID);
|
|
339
|
+
});
|
|
340
|
+
|
|
317
341
|
it("keeps copying disabled when Notebook verification fails", async () => {
|
|
318
342
|
vi.mocked(fetch).mockImplementation((url) =>
|
|
319
343
|
String(url).endsWith("/api/sessions")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
4
|
-
import React, { useEffect, useState } from "react";
|
|
4
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { useAtomValue } from "jotai";
|
|
6
6
|
import { Button } from "@/components/ui/button";
|
|
7
7
|
import {
|
|
@@ -53,21 +53,20 @@ export const PairWithAgentModal: React.FC<{
|
|
|
53
53
|
const config = useAtomValue(pairConfigAtom);
|
|
54
54
|
const hostEnabled = config?.hostEnabled ?? false;
|
|
55
55
|
const stableSessionId = useAtomValue(stableSessionIdAtom);
|
|
56
|
+
const lookupIdentity = useMemo(
|
|
57
|
+
() => ({ hostEnabled, stableSessionId }),
|
|
58
|
+
[hostEnabled, stableSessionId],
|
|
59
|
+
);
|
|
56
60
|
const [lookup, setLookup] = useState<
|
|
57
61
|
{
|
|
58
|
-
|
|
59
|
-
} & (
|
|
60
|
-
| { status: "ready"; notebookId: string | null }
|
|
61
|
-
| { status: "loading" | "error" }
|
|
62
|
-
)
|
|
62
|
+
identity: typeof lookupIdentity;
|
|
63
|
+
} & ({ status: "ready"; notebookId: string | null } | { status: "error" })
|
|
63
64
|
>();
|
|
64
65
|
useEffect(() => {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
const { hostEnabled, stableSessionId: sessionId } = lookupIdentity;
|
|
67
|
+
if (!hostEnabled || !sessionId) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
|
-
const sessionId = stableSessionId;
|
|
70
|
-
setLookup({ sessionId, status: "loading" });
|
|
71
70
|
let cancelled = false;
|
|
72
71
|
API.get<Record<string, { session_id: string; notebook_id: string | null }>>(
|
|
73
72
|
"/sessions",
|
|
@@ -79,22 +78,26 @@ export const PairWithAgentModal: React.FC<{
|
|
|
79
78
|
);
|
|
80
79
|
setLookup(
|
|
81
80
|
session
|
|
82
|
-
? {
|
|
83
|
-
|
|
81
|
+
? {
|
|
82
|
+
identity: lookupIdentity,
|
|
83
|
+
status: "ready",
|
|
84
|
+
notebookId: session.notebook_id,
|
|
85
|
+
}
|
|
86
|
+
: { identity: lookupIdentity, status: "error" },
|
|
84
87
|
);
|
|
85
88
|
}
|
|
86
89
|
})
|
|
87
90
|
.catch(() => {
|
|
88
91
|
if (!cancelled) {
|
|
89
|
-
setLookup({
|
|
92
|
+
setLookup({ identity: lookupIdentity, status: "error" });
|
|
90
93
|
}
|
|
91
94
|
});
|
|
92
95
|
return () => {
|
|
93
96
|
cancelled = true;
|
|
94
97
|
};
|
|
95
|
-
}, [
|
|
98
|
+
}, [lookupIdentity]);
|
|
96
99
|
const currentLookup =
|
|
97
|
-
lookup?.
|
|
100
|
+
lookup?.identity === lookupIdentity ? lookup : undefined;
|
|
98
101
|
const verified = !hostEnabled || currentLookup?.status === "ready";
|
|
99
102
|
const notebookId =
|
|
100
103
|
hostEnabled && currentLookup?.status === "ready"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { act, renderHook } from "@testing-library/react";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { useShouldShowInterrupt } from "../useShouldShowInterrupt";
|
|
6
|
+
|
|
7
|
+
describe("useShouldShowInterrupt", () => {
|
|
8
|
+
beforeEach(() => vi.useFakeTimers());
|
|
9
|
+
afterEach(() => vi.useRealTimers());
|
|
10
|
+
|
|
11
|
+
it("waits for each run and hides immediately when it stops", () => {
|
|
12
|
+
const { result, rerender } = renderHook(useShouldShowInterrupt, {
|
|
13
|
+
initialProps: false,
|
|
14
|
+
});
|
|
15
|
+
expect(result.current).toBe(false);
|
|
16
|
+
rerender(true);
|
|
17
|
+
expect(result.current).toBe(false);
|
|
18
|
+
act(() => vi.advanceTimersByTime(200));
|
|
19
|
+
expect(result.current).toBe(true);
|
|
20
|
+
rerender(false);
|
|
21
|
+
expect(result.current).toBe(false);
|
|
22
|
+
rerender(true);
|
|
23
|
+
expect(result.current).toBe(false);
|
|
24
|
+
act(() => vi.advanceTimersByTime(199));
|
|
25
|
+
expect(result.current).toBe(false);
|
|
26
|
+
act(() => vi.advanceTimersByTime(1));
|
|
27
|
+
expect(result.current).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("cancels the delay for a short run", () => {
|
|
31
|
+
const { result, rerender } = renderHook(useShouldShowInterrupt, {
|
|
32
|
+
initialProps: true,
|
|
33
|
+
});
|
|
34
|
+
act(() => vi.advanceTimersByTime(100));
|
|
35
|
+
rerender(false);
|
|
36
|
+
act(() => vi.advanceTimersByTime(200));
|
|
37
|
+
expect(result.current).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
import {
|
|
2
|
+
import { useDelayElapsed } from "@/hooks/useDelayElapsed";
|
|
3
3
|
|
|
4
4
|
const DELAY_MS = 200;
|
|
5
5
|
|
|
@@ -10,17 +10,7 @@ const DELAY_MS = 200;
|
|
|
10
10
|
export function useShouldShowInterrupt(running: boolean) {
|
|
11
11
|
// Start a timer when the run starts.
|
|
12
12
|
// After 200ms, show the interrupt button to avoid flickering.
|
|
13
|
-
const
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!running) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
setHasRunLongEnough(false);
|
|
19
|
-
const timeout = setTimeout(() => {
|
|
20
|
-
setHasRunLongEnough(true);
|
|
21
|
-
}, DELAY_MS);
|
|
22
|
-
return () => clearTimeout(timeout);
|
|
23
|
-
}, [running]);
|
|
13
|
+
const hasRunLongEnough = useDelayElapsed(running ? DELAY_MS : 0);
|
|
24
14
|
|
|
25
15
|
return running && hasRunLongEnough;
|
|
26
16
|
}
|
|
@@ -18,7 +18,10 @@ import type {
|
|
|
18
18
|
DependencyTreeNode,
|
|
19
19
|
DependencyTreeResponse,
|
|
20
20
|
} from "@/core/network/types";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
invalidatePackageData,
|
|
23
|
+
withPackageInvalidation,
|
|
24
|
+
} from "@/core/packages/package-data";
|
|
22
25
|
import { useInstallPackages } from "@/core/packages/useInstallPackage";
|
|
23
26
|
import { sandboxAtom, sandboxSyncAtom } from "@/core/packages/sandbox-state";
|
|
24
27
|
import { store } from "@/core/state/jotai";
|
|
@@ -143,6 +146,32 @@ describe("PackagesPanel", () => {
|
|
|
143
146
|
expect(screen.queryByText("cycle")).not.toBeInTheDocument();
|
|
144
147
|
});
|
|
145
148
|
|
|
149
|
+
it("collapses expanded nodes when the dependency tree is refreshed", async () => {
|
|
150
|
+
const { client } = renderPanel(
|
|
151
|
+
{ kind: "sandbox", backend: "pixi" },
|
|
152
|
+
populatedTree,
|
|
153
|
+
);
|
|
154
|
+
fireEvent.click(await screen.findByRole("treeitem", { name: /polars/ }));
|
|
155
|
+
expect(screen.getByText("already in tree")).toBeInTheDocument();
|
|
156
|
+
|
|
157
|
+
vi.mocked(client.getDependencyTree).mockResolvedValue({
|
|
158
|
+
tree: structuredClone(populatedTree),
|
|
159
|
+
context: { kind: "sandbox", backend: "pixi" },
|
|
160
|
+
});
|
|
161
|
+
act(() => invalidatePackageData());
|
|
162
|
+
|
|
163
|
+
await waitFor(() =>
|
|
164
|
+
expect(client.getDependencyTree).toHaveBeenCalledTimes(2),
|
|
165
|
+
);
|
|
166
|
+
await waitFor(() =>
|
|
167
|
+
expect(screen.queryByText("already in tree")).not.toBeInTheDocument(),
|
|
168
|
+
);
|
|
169
|
+
expect(screen.getByRole("treeitem", { name: /polars/ })).toHaveAttribute(
|
|
170
|
+
"aria-expanded",
|
|
171
|
+
"false",
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
|
|
146
175
|
it("keeps the configured package manager changeable outside a sandbox", async () => {
|
|
147
176
|
const { getPackageList } = renderPanel({
|
|
148
177
|
kind: "package-manager",
|
|
@@ -31,6 +31,7 @@ import { usePackageAction } from "@/core/packages/usePackageAction";
|
|
|
31
31
|
import { usePackageDependencies } from "@/core/packages/usePackageDependencies";
|
|
32
32
|
import { useInstallPackages } from "@/core/packages/useInstallPackage";
|
|
33
33
|
import { isWasm } from "@/core/wasm/utils";
|
|
34
|
+
import { useStateForKey } from "@/hooks/useStateForKey";
|
|
34
35
|
import { ErrorBanner } from "@/plugins/impl/common/error-banner";
|
|
35
36
|
import { cn } from "@/utils/cn";
|
|
36
37
|
import { copyToClipboard } from "@/utils/copy";
|
|
@@ -440,15 +441,11 @@ const DependencyTree: React.FC<{
|
|
|
440
441
|
error?: Error | null;
|
|
441
442
|
sandboxBackend: "uv" | "pixi" | null;
|
|
442
443
|
}> = ({ tree, error, sandboxBackend }) => {
|
|
443
|
-
const [expandedNodes, setExpandedNodes] =
|
|
444
|
-
|
|
444
|
+
const [expandedNodes, setExpandedNodes] = useStateForKey(
|
|
445
|
+
tree,
|
|
446
|
+
() => new Set<string>(),
|
|
445
447
|
);
|
|
446
448
|
|
|
447
|
-
// Reset tree to collapsed state when tree data changes (including refetches)
|
|
448
|
-
React.useEffect(() => {
|
|
449
|
-
setExpandedNodes(new Set());
|
|
450
|
-
}, [tree]);
|
|
451
|
-
|
|
452
449
|
if (error) {
|
|
453
450
|
return <ErrorBanner error={error} />;
|
|
454
451
|
}
|
|
@@ -137,5 +137,11 @@ describe("FileExplorer upload destination", () => {
|
|
|
137
137
|
}),
|
|
138
138
|
).toBeVisible();
|
|
139
139
|
expect(screen.queryByText(".hidden")).not.toBeInTheDocument();
|
|
140
|
+
|
|
141
|
+
fireEvent.click(screen.getByTestId("file-explorer-hidden-files-button"));
|
|
142
|
+
expect(await screen.findByText(".hidden")).toBeVisible();
|
|
143
|
+
expect(
|
|
144
|
+
screen.getByRole("button", { name: "Upload files to workspace" }),
|
|
145
|
+
).toBeVisible();
|
|
140
146
|
});
|
|
141
147
|
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { act, renderHook, waitFor } from "@testing-library/react";
|
|
4
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import type { EditRequests } from "@/core/network/types";
|
|
6
|
+
import { Deferred } from "@/utils/Deferred";
|
|
7
|
+
import { RequestingTree } from "../requesting-tree";
|
|
8
|
+
import { useFileSearch } from "../use-file-search";
|
|
9
|
+
|
|
10
|
+
const sendSearchFiles = vi.hoisted(() =>
|
|
11
|
+
vi.fn<EditRequests["sendSearchFiles"]>(),
|
|
12
|
+
);
|
|
13
|
+
vi.mock("@/core/network/requests", () => ({
|
|
14
|
+
useRequestClient: () => ({ sendSearchFiles }),
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
describe("useFileSearch", () => {
|
|
18
|
+
let tree: RequestingTree;
|
|
19
|
+
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
sendSearchFiles.mockReset();
|
|
22
|
+
tree = new RequestingTree({
|
|
23
|
+
getRoots: vi.fn().mockResolvedValue({
|
|
24
|
+
roots: [{ path: "/root", name: "workspace", isPrimary: true }],
|
|
25
|
+
}),
|
|
26
|
+
listFiles: vi.fn().mockResolvedValue({ files: [], root: "/root" }),
|
|
27
|
+
createFileOrFolder: vi.fn(),
|
|
28
|
+
deleteFileOrFolder: vi.fn(),
|
|
29
|
+
copyFileOrFolder: vi.fn(),
|
|
30
|
+
renameFileOrFolder: vi.fn(),
|
|
31
|
+
});
|
|
32
|
+
await tree.initialize(() => undefined);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("derives loading for a refetch and a changed hidden-file filter", async () => {
|
|
36
|
+
sendSearchFiles.mockResolvedValue({
|
|
37
|
+
files: [],
|
|
38
|
+
query: "file",
|
|
39
|
+
totalFound: 0,
|
|
40
|
+
});
|
|
41
|
+
const { result, rerender } = renderHook(
|
|
42
|
+
({ showHiddenFiles }) =>
|
|
43
|
+
useFileSearch({ query: "file", tree, showHiddenFiles }),
|
|
44
|
+
{ initialProps: { showHiddenFiles: false } },
|
|
45
|
+
);
|
|
46
|
+
await waitFor(() => expect(result.current.state.status).toBe("success"));
|
|
47
|
+
|
|
48
|
+
const pending = new Deferred<
|
|
49
|
+
Awaited<ReturnType<EditRequests["sendSearchFiles"]>>
|
|
50
|
+
>();
|
|
51
|
+
sendSearchFiles.mockReturnValue(pending.promise);
|
|
52
|
+
act(() => result.current.refetch());
|
|
53
|
+
expect(result.current.state.status).toBe("loading");
|
|
54
|
+
await act(async () =>
|
|
55
|
+
pending.resolve({ files: [], query: "file", totalFound: 0 }),
|
|
56
|
+
);
|
|
57
|
+
expect(result.current.state.status).toBe("success");
|
|
58
|
+
|
|
59
|
+
sendSearchFiles.mockReturnValue(new Promise(() => undefined));
|
|
60
|
+
rerender({ showHiddenFiles: true });
|
|
61
|
+
expect(result.current.state.status).toBe("loading");
|
|
62
|
+
await waitFor(() =>
|
|
63
|
+
expect(sendSearchFiles).toHaveBeenLastCalledWith(
|
|
64
|
+
expect.objectContaining({ includeHidden: true }),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("keeps superseded scans serial and ignores their results", async () => {
|
|
70
|
+
const first = new Deferred<
|
|
71
|
+
Awaited<ReturnType<EditRequests["sendSearchFiles"]>>
|
|
72
|
+
>();
|
|
73
|
+
sendSearchFiles
|
|
74
|
+
.mockReturnValueOnce(first.promise)
|
|
75
|
+
.mockResolvedValue({ files: [], query: "file", totalFound: 0 });
|
|
76
|
+
const { result } = renderHook(() =>
|
|
77
|
+
useFileSearch({ query: "file", tree, showHiddenFiles: false }),
|
|
78
|
+
);
|
|
79
|
+
await waitFor(() => expect(sendSearchFiles).toHaveBeenCalledOnce());
|
|
80
|
+
|
|
81
|
+
act(() => result.current.refetch());
|
|
82
|
+
expect(sendSearchFiles).toHaveBeenCalledOnce();
|
|
83
|
+
expect(result.current.state.status).toBe("loading");
|
|
84
|
+
await act(async () =>
|
|
85
|
+
first.resolve({ files: [], query: "file", totalFound: 0 }),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
expect(sendSearchFiles).toHaveBeenCalledTimes(2);
|
|
89
|
+
expect(result.current.state.status).toBe("success");
|
|
90
|
+
});
|
|
91
|
+
});
|