@marimo-team/islands 0.24.1-dev99 → 0.24.2-dev1
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/{ConnectedDataExplorerComponent-D9EG584s.js → ConnectedDataExplorerComponent-qIKbwYin.js} +12 -12
- package/dist/{ErrorBoundary-D-EKz8oE.js → ErrorBoundary-CR-ZQN_c.js} +3 -3
- package/dist/any-language-editor-CpTnK43-.js +76 -0
- package/dist/{apl-DbeWBitN.js → apl-BYaaig9_.js} +1 -1
- package/dist/{asciiarmor-DVGcwGvr.js → asciiarmor-GKQFJXQG.js} +1 -1
- package/dist/{asn1-C7ZkyMi3.js → asn1-BsSb7HP5.js} +1 -1
- package/dist/assets/__vite-browser-external-BdKGjRZ4.js +1 -0
- package/dist/assets/{worker-C3TCEtlU.js → worker-DlIBfp9S.js} +2 -2
- package/dist/{asterisk-4f1CDJJt.js → asterisk-B3I8SNb5.js} +1 -1
- package/dist/{brainfuck-Cr9wPNgk.js → brainfuck-DXjk3bQe.js} +1 -1
- package/dist/{button-DlqUC8W-.js → button-CKBkqR9J.js} +6 -1
- package/dist/{capabilities-CGBDXz_E.js → capabilities-CMBBJTcc.js} +1 -1
- package/dist/{chat-ui-CHoI65Rg.js → chat-ui-DttQ-5Ut.js} +27 -27
- package/dist/{check-BcJDmQdF.js → check-CHig47QV.js} +1 -1
- package/dist/{clike-BqAajeY2.js → clike-E2lFbGVj.js} +1 -1
- package/dist/{clojure-Bug5Gc5H.js → clojure-Dn_K4RlK.js} +1 -1
- package/dist/{cmake-R8uEfQdt.js → cmake-DpN2Top5.js} +1 -1
- package/dist/{cobol-DCX3p7Cj.js → cobol-Chf22-GM.js} +1 -1
- package/dist/{coffeescript-CA08GUrM.js → coffeescript-BVe1OiD9.js} +1 -1
- package/dist/{common-BTbFryuV.js → common-DjEjXIEn.js} +6846 -6695
- package/dist/{commonlisp-CUlYkvkK.js → commonlisp-DxoBG7fU.js} +1 -1
- package/dist/{copy-D9h0DuU7.js → copy-CD7S58CY.js} +2 -2
- package/dist/{crystal-CHw9Y8bp.js → crystal-DCM3yc4r.js} +1 -1
- package/dist/{css-BR752P21.js → css-DkZ9mMyI.js} +1 -1
- package/dist/{cypher-CGXYVdtR.js → cypher-Drw_8U5I.js} +1 -1
- package/dist/{d-B3Jeg95D.js → d-CsVGcKMF.js} +1 -1
- package/dist/{diff-BskCEFEO.js → diff-CBikYCUF.js} +1 -1
- package/dist/{dist-wdOJ5T7-.js → dist-3_o3T78I.js} +15 -15
- package/dist/{dist-C2unEUWZ.js → dist-BEmkrGoQ.js} +1492 -1484
- package/dist/{dist-3YfamrHv.js → dist-BVRM2y1P.js} +2 -2
- package/dist/{dist-cnCt-QhO.js → dist-BbSMhhD2.js} +2 -2
- package/dist/{dist-C9fJPKPl.js → dist-BrQGcfQ9.js} +4 -4
- package/dist/{dist-Bsa-FD4p.js → dist-Byj2bV8o.js} +1 -1
- package/dist/{dist-t3GZQZfR.js → dist-BzN60Z2s.js} +1 -1
- package/dist/{dist-CDiyTpo-.js → dist-C5Bn52W4.js} +3 -3
- package/dist/{dist-C1_Y0fKn.js → dist-C7v-9nUK.js} +3 -3
- package/dist/{dist-B59W3SQC.js → dist-CGAxEiaM.js} +2 -2
- package/dist/{dist-wGdFe2i2.js → dist-CO5R6VMi.js} +2 -2
- package/dist/{dist-CkF6zgs_.js → dist-CRjAdnqF.js} +14 -12
- package/dist/{dist-BDP-ZzBX.js → dist-D4Z_qdP4.js} +1 -1
- package/dist/{dist-CdoyP1Fz.js → dist-DEeLqRlU.js} +1 -1
- package/dist/{dist-TouP85Vh.js → dist-DJFiGP2k.js} +2 -2
- package/dist/{dist-Ceegh7bg.js → dist-DVFbIwc5.js} +1 -1
- package/dist/{dist-xIlsWj6K.js → dist-DcgzXCfy.js} +2 -2
- package/dist/{dist-BywyHJ0k.js → dist-Re9sOPOx.js} +2 -2
- package/dist/{dist-CN2pQuxD.js → dist-VdvbxG72.js} +1 -1
- package/dist/{dist-Bwzl7sp6.js → dist-_XvgytiS.js} +1 -1
- package/dist/{dist-BdxSRiPP.js → dist-dAqZAPcF.js} +3 -3
- package/dist/{dist-Cri9-7UA.js → dist-hXd65f0_.js} +1 -1
- package/dist/{dist-BmR-cjzI.js → dist-jWUab2d1.js} +1 -1
- package/dist/{dist-CeTE0w_x.js → dist-qhLI-SHd.js} +2 -2
- package/dist/{dockerfile-HPpWCSsC.js → dockerfile-DJnSntVB.js} +2 -2
- package/dist/{dropdown-menu-Baf29jmS.js → dropdown-menu-DhCfcscX.js} +726 -716
- package/dist/{dtd-9Bm4j20r.js → dtd-BHa4v0Bn.js} +1 -1
- package/dist/{dylan-BOpu3dto.js → dylan-BypL2Zz8.js} +1 -1
- package/dist/{ebnf-BogGWV2V.js → ebnf-5guncNu-.js} +1 -1
- package/dist/{ecl-DAcPDOW1.js → ecl-iRcVIKYZ.js} +1 -1
- package/dist/{eiffel-C4NgXX-Y.js → eiffel-BEqF9aU4.js} +1 -1
- package/dist/{elm-BiY4zCKH.js → elm-DYcfNE9c.js} +1 -1
- package/dist/{erlang-Dg5zi-Qk.js → erlang-BtAuIoF0.js} +1 -1
- package/dist/{error-banner-xVkWHg51.js → error-banner-WDhUzJyg.js} +203 -203
- package/dist/{esm-ElfO9dV2.js → esm-CR1nhb1c.js} +108 -107
- package/dist/{esm-DkklGms7.js → esm-CesmlDrs.js} +5 -5
- package/dist/{extends-KH0CV__g.js → extends-BPB6_lTK.js} +8 -7
- package/dist/{factor-B0-OaK4k.js → factor-3nzOwLuN.js} +2 -2
- package/dist/{fcl-DwSn1rXM.js → fcl-C90TGnJJ.js} +1 -1
- package/dist/{formats-nPPeLOk2.js → formats-CJMVUfb3.js} +3 -3
- package/dist/{forth-BGTlwczu.js → forth-DEaRrLUi.js} +1 -1
- package/dist/{fortran-UUzzVROb.js → fortran-Bv6JRUjY.js} +1 -1
- package/dist/{gas-CjkVDeev.js → gas-JNerWj3-.js} +1 -1
- package/dist/{gherkin-CF2G_sqt.js → gherkin-CSrl-H70.js} +1 -1
- package/dist/{glide-data-editor-n5E9BAD8.js → glide-data-editor-sPZ8fUFn.js} +8 -8
- package/dist/{glide-utils-C0dRuWI_.js → glide-utils-NShAPPtn.js} +3 -3
- package/dist/{groovy-YcvlOKLA.js → groovy-X7euO_vE.js} +1 -1
- package/dist/{haskell-BdvVmmhX.js → haskell-C48Z70Az.js} +1 -1
- package/dist/{haxe-Dkk4Avys.js → haxe-CAUWMmwR.js} +1 -1
- package/dist/{html-to-image-B09MiZT1.js → html-to-image-BTYnN4ev.js} +3782 -3784
- package/dist/{http-Cncc-AcB.js → http-BrSBnhDH.js} +1 -1
- package/dist/{idl-D5eSUN-2.js → idl-BXuPleZv.js} +1 -1
- package/dist/{javascript-DV7jbCN7.js → javascript-B4EPWJf_.js} +1 -1
- package/dist/{julia-DRMVPyrg.js → julia-ke9Kh8b7.js} +1 -1
- package/dist/{label-CEgg1Ymb.js → label-lwzzBHUW.js} +2 -2
- package/dist/{livescript-3tVlEl0n.js → livescript-Ce4uqGAC.js} +1 -1
- package/dist/{loader-D8jS1unC.js → loader-VZ__bv4g.js} +1 -1
- package/dist/{lua-DvuDcwhK.js → lua-D6fti_Jk.js} +2 -2
- package/dist/main.js +6189 -6189
- package/dist/{mathematica-DeUYrmDQ.js → mathematica-DcEpZ3Vj.js} +1 -1
- package/dist/{mbox-CP8ncY6Y.js → mbox-DFBbOu0X.js} +1 -1
- package/dist/{mermaid-CKjZUiG7.js → mermaid-BsHdQeQf.js} +4 -4
- package/dist/{mirc-D0BFuM5A.js → mirc-CqeibO3N.js} +1 -1
- package/dist/{mllike-EW0YU24D.js → mllike-D54QZYTP.js} +1 -1
- package/dist/{modelica-0c53v3vH.js → modelica-DuML2-8V.js} +1 -1
- package/dist/{mscgen-DXtnmkk0.js → mscgen-CJmKwp3b.js} +1 -1
- package/dist/{mumps-DuZvAoq5.js → mumps-DaVgFtkd.js} +1 -1
- package/dist/{nginx-BgxmKoMB.js → nginx-BXN1rqI0.js} +1 -1
- package/dist/{nsis-CXKR4weY.js → nsis-CMfRqf0V.js} +2 -2
- package/dist/{ntriples-BvwIFlGB.js → ntriples-BiOGlMDR.js} +1 -1
- package/dist/{octave-Ddh8-k4Y.js → octave-CgVnzxKk.js} +1 -1
- package/dist/{oz-DASBLPdZ.js → oz-B2mky97X.js} +1 -1
- package/dist/{pascal-DKEHBGVg.js → pascal-BoZhBf6s.js} +1 -1
- package/dist/{perl-CG83_G1y.js → perl-DjzMqXtt.js} +1 -1
- package/dist/{pig-C1IvQ7dn.js → pig-B2mB-01d.js} +1 -1
- package/dist/{powershell-Mh2j_Y9A.js → powershell-D0zT88Aj.js} +1 -1
- package/dist/{process-output-kUlWbyzk.js → process-output-CsALk6tp.js} +3 -3
- package/dist/{properties-Cr3dDyK_.js → properties-3_5qCgOj.js} +1 -1
- package/dist/{protobuf-5RkBxiY2.js → protobuf-Dgoxfi1H.js} +1 -1
- package/dist/{pug-CZBnH0wJ.js → pug-CNRdd8oG.js} +2 -2
- package/dist/{puppet-CjiD4zLe.js → puppet-DzILxZfz.js} +1 -1
- package/dist/{python-n5psJoQh.js → python-AfVdMn_l.js} +1 -1
- package/dist/{q-tF-lfOc1.js → q-C6p-CGWh.js} +1 -1
- package/dist/{r-E-Ox73Cl.js → r-CzKF1D2X.js} +1 -1
- package/dist/{reveal-component-AkbqvWB3.js → reveal-component-g415wUxR.js} +446 -446
- package/dist/{rpm-6OeX6y2d.js → rpm-Bx7FkjTO.js} +1 -1
- package/dist/{ruby-BfKhtJ9W.js → ruby-BMzgq2bf.js} +1 -1
- package/dist/{sas-BXINOUe8.js → sas-ClGVnK3F.js} +1 -1
- package/dist/{schemas-JTyiKlcH.js → schemas-DzK6U94N.js} +1380 -1364
- package/dist/{scheme-Bl28UhhC.js → scheme-C0MXqXep.js} +1 -1
- package/dist/{select-DQ9jU_B_.js → select-3qHpFKF9.js} +295 -295
- package/dist/{shell-C6dbyRNm.js → shell-CiQZv6oG.js} +1 -1
- package/dist/{sieve-CtzpqaVa.js → sieve-BiIMePvV.js} +1 -1
- package/dist/{simple-mode-Fa0cHplh.js → simple-mode-8ETW2RS6.js} +1 -1
- package/dist/{smalltalk-SWUbrj2a.js → smalltalk-9-llftyG.js} +1 -1
- package/dist/{solr-DrqND0L5.js → solr-CxCKEuwq.js} +1 -1
- package/dist/{sparql-DNeyanaw.js → sparql-BRmy7pzx.js} +1 -1
- package/dist/{spec-DNZWpXiu.js → spec-CutWdqo3.js} +4 -4
- package/dist/{spreadsheet-DUXiDdBd.js → spreadsheet-UCNUIGsn.js} +1 -1
- package/dist/{sql-BKgWZE5S.js → sql-D0hSGZ-H.js} +1 -1
- package/dist/{stex-DylRJo9v.js → stex-UeT_Aofp.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{stylus-dWe8kzGp.js → stylus-Fi4waA2H.js} +1 -1
- package/dist/{swift-BmWs7LJc.js → swift-NqPyaBye.js} +1 -1
- package/dist/{swiper-component-deYugN58.js → swiper-component-C90YjhaV.js} +2 -2
- package/dist/{tcl-DxdPnAuD.js → tcl-B4f0xfmM.js} +1 -1
- package/dist/{textile-CJnP1piA.js → textile-CnNbnPTe.js} +1 -1
- package/dist/{tiddlywiki-DwhP379Y.js → tiddlywiki-CSGSOg38.js} +1 -1
- package/dist/{tiki-1YDPYy3B.js → tiki-9F02WBA6.js} +1 -1
- package/dist/{toDate-DfFzRDkN.js → toDate-D-Rx3ux5.js} +3 -3
- package/dist/{toml-Cm-dCBP-.js → toml-AesZ6RBt.js} +1 -1
- package/dist/{tooltip-7p_32zdw.js → tooltip-Dt77sBeT.js} +88 -88
- package/dist/{troff-DNWcQdLA.js → troff-DlfvveK1.js} +1 -1
- package/dist/{ttcn-CaUsDYVT.js → ttcn--YVSkGs_.js} +1 -1
- package/dist/{ttcn-cfg-BqNhpRrY.js → ttcn-cfg-Bb1Knl_J.js} +1 -1
- package/dist/{turtle-CK42qVcQ.js → turtle-DC24v1bz.js} +1 -1
- package/dist/{useAsyncData-Cyh2jLTR.js → useAsyncData-CH6-CgJF.js} +1 -1
- package/dist/{useDateFormatter-CcY1uXEk.js → useDateFormatter-Cp9Jdxls.js} +2 -2
- package/dist/{useDeepCompareMemoize-BqcHK9ZZ.js → useDeepCompareMemoize-JC87C_jO.js} +1 -1
- package/dist/{useIframeCapabilities-BmYPLMe1.js → useIframeCapabilities-De3C-9b4.js} +1 -1
- package/dist/{useLifecycle-foJH5Q8T.js → useLifecycle-B4RGlyf0.js} +10 -10
- package/dist/{useTheme-C2ZreN00.js → useTheme-CVJ0UOf2.js} +3 -2
- package/dist/{vb-DUEXFGmn.js → vb-Dpc8vhvF.js} +1 -1
- package/dist/{vbscript-O6Mq-1Bt.js → vbscript-B-Y1XnZe.js} +1 -1
- package/dist/{vega-component-LgU-A6O9.js → vega-component-D-IXRnlx.js} +9 -9
- package/dist/{velocity-DTlmtsPi.js → velocity-DHMu9kc-.js} +1 -1
- package/dist/{verilog-prDoxOJS.js → verilog-DhiEaoUl.js} +1 -1
- package/dist/{vhdl-BAJ9qF1C.js → vhdl-D4X23YKO.js} +1 -1
- package/dist/{webidl-ybLbdZxR.js → webidl-SyzNxWpJ.js} +1 -1
- package/dist/{xquery-81N7rqzd.js → xquery-BC2R4Hk6.js} +1 -1
- package/dist/{yacas-BwVftjEP.js → yacas-DLNXPMmH.js} +1 -1
- package/dist/{z80-CmT0MNUO.js → z80-CDXWHOO6.js} +1 -1
- package/package.json +26 -26
- package/src/components/ai/ai-provider-icon.tsx +2 -2
- package/src/components/ai/ai-utils.ts +1 -1
- package/src/components/app-config/ai-config.tsx +33 -37
- package/src/components/app-config/user-config-form.tsx +1 -1
- package/src/components/data-table/__tests__/column-explorer.test.tsx +64 -4
- package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +137 -4
- package/src/components/data-table/__tests__/url-detector.test.tsx +1 -1
- package/src/components/data-table/__tests__/useColumnVisibility.test.ts +153 -1
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +54 -25
- package/src/components/data-table/column-visibility-dropdown.tsx +62 -14
- package/src/components/data-table/date-popover.tsx +2 -1
- package/src/components/data-table/hooks/use-column-visibility.ts +76 -0
- package/src/components/data-table/renderers.tsx +4 -8
- package/src/components/data-table/show-only-column-button.tsx +58 -0
- package/src/components/dependency-graph/__tests__/elements.test.ts +151 -0
- package/src/components/dependency-graph/custom-edge.tsx +68 -0
- package/src/components/dependency-graph/custom-node.tsx +54 -26
- package/src/components/dependency-graph/dependency-graph-tree.tsx +110 -21
- package/src/components/dependency-graph/elements.ts +225 -31
- package/src/components/dependency-graph/panels.tsx +23 -2
- package/src/components/dependency-graph/utils/__tests__/layout.test.ts +78 -0
- package/src/components/dependency-graph/utils/layout.ts +108 -18
- package/src/components/editor/Output.tsx +40 -0
- package/src/components/editor/__tests__/Output.test.tsx +85 -2
- package/src/components/editor/connections/secret-combobox.tsx +3 -1
- package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +832 -0
- package/src/components/editor/file-tree/__tests__/file-viewer.test.tsx +27 -0
- package/src/components/editor/file-tree/__tests__/requesting-tree.test.ts +130 -0
- package/src/components/editor/file-tree/file-browser-row.tsx +82 -0
- package/src/components/editor/file-tree/file-explorer.tsx +377 -159
- package/src/components/editor/file-tree/file-operations.tsx +1 -1
- package/src/components/editor/file-tree/file-search-results.tsx +142 -0
- package/src/components/editor/file-tree/file-tree-row.tsx +40 -0
- package/src/components/editor/file-tree/file-viewer.tsx +2 -1
- package/src/components/editor/file-tree/renderers.tsx +4 -2
- package/src/components/editor/file-tree/requesting-tree.tsx +162 -32
- package/src/components/editor/file-tree/use-file-search.ts +142 -0
- package/src/components/editor/file-tree/use-hover-expand.ts +34 -0
- package/src/components/editor/navigation/__tests__/navigation.test.ts +30 -0
- package/src/components/editor/navigation/navigation.ts +20 -0
- package/src/components/forms/form.tsx +6 -4
- package/src/components/home/components.tsx +1 -0
- package/src/components/static-html/share-modal.tsx +3 -2
- package/src/components/ui/__tests__/badge.test.ts +63 -0
- package/src/components/ui/__tests__/button.test.ts +19 -0
- package/src/components/ui/__tests__/fullscreen.test.tsx +88 -0
- package/src/components/ui/__tests__/menu-items.test.ts +31 -0
- package/src/components/ui/badge.tsx +9 -7
- package/src/components/ui/button.tsx +1 -0
- package/src/components/ui/combobox.tsx +1 -1
- package/src/components/ui/date-input.tsx +1 -1
- package/src/components/ui/dialog.tsx +3 -1
- package/src/components/ui/fullscreen.tsx +43 -1
- package/src/components/ui/input.tsx +5 -1
- package/src/components/ui/links.tsx +2 -1
- package/src/components/ui/menu-items.tsx +9 -9
- package/src/components/ui/native-select.tsx +2 -2
- package/src/components/ui/navigation.tsx +1 -1
- package/src/components/ui/range-slider.tsx +5 -3
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/sheet.tsx +1 -1
- package/src/components/ui/toast.tsx +8 -5
- package/src/components/ui/toaster.tsx +2 -2
- package/src/core/ai/ids/__tests__/ids.test.ts +0 -8
- package/src/core/ai/ids/ids.ts +1 -1
- package/src/core/cells/__tests__/add-missing-import.test.ts +20 -0
- package/src/core/codemirror/language/__tests__/utils.test.ts +1 -1
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/hotkeys/hotkeys.ts +5 -0
- package/src/core/network/__tests__/requests-toasting.test.tsx +14 -0
- package/src/core/network/requests-toasting.tsx +1 -1
- package/src/css/globals.css +28 -0
- package/src/hooks/useEventListener.ts +1 -1
- package/src/plugins/core/RenderHTML.tsx +6 -4
- package/src/plugins/impl/MatrixPlugin.tsx +1 -1
- package/src/plugins/impl/code/any-language-editor.tsx +7 -4
- package/src/plugins/impl/data-frames/__tests__/schema.test.ts +34 -1
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +25 -25
- package/src/plugins/impl/data-frames/schema.ts +5 -11
- package/src/plugins/impl/panel/__tests__/utils.test.ts +4 -4
- package/src/plugins/impl/vega/__tests__/vega.test.ts +1 -1
- package/src/stories/cell.stories.tsx +15 -11
- package/src/utils/__tests__/events.test.ts +1 -1
- package/dist/any-language-editor-D751ztAP.js +0 -76
- package/dist/assets/__vite-browser-external-Cf4O9gnt.js +0 -1
|
@@ -64,6 +64,33 @@ describe("FileViewer bounded previews", () => {
|
|
|
64
64
|
store.set(requestClientAtom, null);
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
it("uses fetched metadata to offer opening a notebook from a search result", async () => {
|
|
68
|
+
const notebook = {
|
|
69
|
+
...file,
|
|
70
|
+
id: "/workspace/app.py",
|
|
71
|
+
path: "/workspace/app.py",
|
|
72
|
+
name: "app.py",
|
|
73
|
+
};
|
|
74
|
+
const onOpenNotebook = vi.fn();
|
|
75
|
+
const client = MockRequestClient.create({
|
|
76
|
+
sendFileDetails: vi.fn().mockResolvedValue({
|
|
77
|
+
file: { ...notebook, isMarimoFile: true },
|
|
78
|
+
contents: "import marimo",
|
|
79
|
+
mimeType: "text/plain",
|
|
80
|
+
isBase64: false,
|
|
81
|
+
isTooLarge: false,
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
store.set(requestClientAtom, client);
|
|
85
|
+
render(<FileViewer file={notebook} onOpenNotebook={onOpenNotebook} />, {
|
|
86
|
+
wrapper,
|
|
87
|
+
});
|
|
88
|
+
fireEvent.click(
|
|
89
|
+
await screen.findByRole("button", { name: "Open notebook" }),
|
|
90
|
+
);
|
|
91
|
+
expect(onOpenNotebook).toHaveBeenCalledOnce();
|
|
92
|
+
});
|
|
93
|
+
|
|
67
94
|
it("requests a bounded preview and shows oversized metadata", async () => {
|
|
68
95
|
const client = renderViewer({
|
|
69
96
|
file,
|
|
@@ -307,6 +307,109 @@ describe("RequestingTree", () => {
|
|
|
307
307
|
expect(sendListFiles).toHaveBeenCalledWith({ path: "/external" });
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
+
test("caches empty directories and shares concurrent expansion requests", async () => {
|
|
311
|
+
let finish!: (value: { files: never[] }) => void;
|
|
312
|
+
sendListFiles.mockImplementationOnce(
|
|
313
|
+
() =>
|
|
314
|
+
new Promise((resolve) => {
|
|
315
|
+
finish = resolve;
|
|
316
|
+
}),
|
|
317
|
+
);
|
|
318
|
+
const first = tree.expand(EXTERNAL_ROOT_ID);
|
|
319
|
+
const second = tree.expand(EXTERNAL_ROOT_ID);
|
|
320
|
+
expect(sendListFiles).toHaveBeenCalledOnce();
|
|
321
|
+
finish({ files: [] });
|
|
322
|
+
expect(await Promise.all([first, second])).toEqual([true, true]);
|
|
323
|
+
await tree.expand(EXTERNAL_ROOT_ID);
|
|
324
|
+
expect(sendListFiles).toHaveBeenCalledOnce();
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
test("refreshes a cached ancestor when revealing a newly created folder", async () => {
|
|
328
|
+
await tree.expand(PRIMARY_ROOT_ID);
|
|
329
|
+
const newFolder = {
|
|
330
|
+
...PRIMARY_FILES[1],
|
|
331
|
+
id: "/root/new",
|
|
332
|
+
path: "/root/new",
|
|
333
|
+
name: "new",
|
|
334
|
+
};
|
|
335
|
+
const nested = {
|
|
336
|
+
...newFolder,
|
|
337
|
+
id: "/root/new/nested",
|
|
338
|
+
path: "/root/new/nested",
|
|
339
|
+
name: "nested",
|
|
340
|
+
};
|
|
341
|
+
sendListFiles.mockImplementation(async ({ path }: { path: string }) => {
|
|
342
|
+
if (path === "/root") {
|
|
343
|
+
return { files: [...PRIMARY_FILES, newFolder] };
|
|
344
|
+
}
|
|
345
|
+
if (path === "/root/new") {
|
|
346
|
+
return { files: [nested] };
|
|
347
|
+
}
|
|
348
|
+
return { files: [] };
|
|
349
|
+
});
|
|
350
|
+
sendListFiles.mockClear();
|
|
351
|
+
expect(
|
|
352
|
+
await tree.reveal({
|
|
353
|
+
...nested,
|
|
354
|
+
id: fileTreeNodeId("/root", nested.path),
|
|
355
|
+
rootPath: "/root",
|
|
356
|
+
isRoot: false,
|
|
357
|
+
isPrimaryRoot: true,
|
|
358
|
+
}),
|
|
359
|
+
).toBe(true);
|
|
360
|
+
expect(sendListFiles.mock.calls).toEqual([
|
|
361
|
+
[{ path: "/root" }],
|
|
362
|
+
[{ path: "/root/new" }],
|
|
363
|
+
[{ path: "/root/new/nested" }],
|
|
364
|
+
]);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
test("reports a search folder that no longer exists after refreshing its parent", async () => {
|
|
368
|
+
await tree.expand(PRIMARY_ROOT_ID);
|
|
369
|
+
expect(
|
|
370
|
+
await tree.reveal({
|
|
371
|
+
...PRIMARY_FILES[1],
|
|
372
|
+
id: fileTreeNodeId("/root", "/root/missing"),
|
|
373
|
+
path: "/root/missing",
|
|
374
|
+
rootPath: "/root",
|
|
375
|
+
isRoot: false,
|
|
376
|
+
isPrimaryRoot: true,
|
|
377
|
+
}),
|
|
378
|
+
).toBe(false);
|
|
379
|
+
expect(toast).toHaveBeenCalledWith(
|
|
380
|
+
expect.objectContaining({ title: "Could not reveal folder" }),
|
|
381
|
+
);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
test("retries a failed expansion", async () => {
|
|
385
|
+
sendListFiles.mockRejectedValueOnce(new Error("Offline"));
|
|
386
|
+
expect(await tree.expand(EXTERNAL_ROOT_ID)).toBe(false);
|
|
387
|
+
expect(await tree.expand(EXTERNAL_ROOT_ID)).toBe(true);
|
|
388
|
+
expect(sendListFiles).toHaveBeenCalledTimes(2);
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
test("preserves loaded descendants when refreshing their parent", async () => {
|
|
392
|
+
await tree.expand(PRIMARY_ROOT_ID);
|
|
393
|
+
const folderId = fileTreeNodeId("/root", "/root/folder1");
|
|
394
|
+
await tree.expand(folderId);
|
|
395
|
+
await tree.refreshPath("/root" as FilePath);
|
|
396
|
+
sendListFiles.mockClear();
|
|
397
|
+
await tree.expand(folderId);
|
|
398
|
+
expect(sendListFiles).not.toHaveBeenCalled();
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
test("reloads a collapsed cached folder after refreshing", async () => {
|
|
402
|
+
await tree.expand(PRIMARY_ROOT_ID);
|
|
403
|
+
const folderId = fileTreeNodeId("/root", "/root/folder1");
|
|
404
|
+
await tree.expand(folderId);
|
|
405
|
+
await tree.refreshAll([]);
|
|
406
|
+
sendListFiles.mockClear();
|
|
407
|
+
await tree.expand(folderId);
|
|
408
|
+
expect(sendListFiles).toHaveBeenCalledExactlyOnceWith({
|
|
409
|
+
path: "/root/folder1",
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
|
|
310
413
|
test("refreshes supplied open folders in addition to configured roots", async () => {
|
|
311
414
|
await tree.expand(PRIMARY_ROOT_ID);
|
|
312
415
|
sendListFiles.mockClear();
|
|
@@ -318,6 +421,33 @@ describe("RequestingTree", () => {
|
|
|
318
421
|
expect(sendListFiles).toHaveBeenCalledWith({ path: "/root/folder1" });
|
|
319
422
|
});
|
|
320
423
|
|
|
424
|
+
test("invalidates collapsed copies independently for overlapping roots", async () => {
|
|
425
|
+
getRoots.mockResolvedValue({
|
|
426
|
+
roots: [
|
|
427
|
+
{ path: "/root", name: "workspace", isPrimary: true },
|
|
428
|
+
{ path: "/root/folder1", name: "nested root", isPrimary: false },
|
|
429
|
+
],
|
|
430
|
+
});
|
|
431
|
+
const overlapping = new RequestingTree({
|
|
432
|
+
getRoots,
|
|
433
|
+
listFiles: sendListFiles,
|
|
434
|
+
createFileOrFolder: sendCreateFileOrFolder,
|
|
435
|
+
deleteFileOrFolder: sendDeleteFileOrFolder,
|
|
436
|
+
copyFileOrFolder: sendCopyFileOrFolder,
|
|
437
|
+
renameFileOrFolder: sendRenameFileOrFolder,
|
|
438
|
+
});
|
|
439
|
+
await overlapping.initialize(onChange);
|
|
440
|
+
await overlapping.expand(PRIMARY_ROOT_ID);
|
|
441
|
+
const collapsedCopy = fileTreeNodeId("/root", "/root/folder1");
|
|
442
|
+
await overlapping.expand(collapsedCopy);
|
|
443
|
+
await overlapping.refreshAll([]);
|
|
444
|
+
sendListFiles.mockClear();
|
|
445
|
+
await overlapping.expand(collapsedCopy);
|
|
446
|
+
expect(sendListFiles).toHaveBeenCalledExactlyOnceWith({
|
|
447
|
+
path: "/root/folder1",
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
|
|
321
451
|
test("keeps existing children when a refresh fails", async () => {
|
|
322
452
|
await tree.expand(PRIMARY_ROOT_ID);
|
|
323
453
|
const beforeRefresh = onChange.mock.calls.at(-1)?.[0];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import type { RowRendererProps } from "react-arborist";
|
|
5
|
+
import { useDrop } from "react-dnd";
|
|
6
|
+
import { FileTreeRow } from "./file-tree-row";
|
|
7
|
+
import { useHoverExpand } from "./use-hover-expand";
|
|
8
|
+
import type { FileTreeNode } from "./requesting-tree";
|
|
9
|
+
|
|
10
|
+
export function FileBrowserRow(props: RowRendererProps<FileTreeNode>) {
|
|
11
|
+
return props.node.data.isDirectory ? (
|
|
12
|
+
<FolderDropRow {...props} />
|
|
13
|
+
) : (
|
|
14
|
+
<FileTreeRow {...props} />
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function FolderDropRow(props: RowRendererProps<FileTreeNode>) {
|
|
19
|
+
const { node } = props;
|
|
20
|
+
const tree = node.tree;
|
|
21
|
+
const rowRef = useRef<HTMLDivElement | null>(null);
|
|
22
|
+
const [{ isHovering }, dropRef] = useDrop(
|
|
23
|
+
() => ({
|
|
24
|
+
// Arborist's drag source uses NODE. Keep its validation and move handler,
|
|
25
|
+
// but treat the entire folder row as a destination, without reorder zones.
|
|
26
|
+
accept: "NODE",
|
|
27
|
+
canDrop: () => tree.canDrop(),
|
|
28
|
+
collect: (monitor) => ({
|
|
29
|
+
isHovering: monitor.isOver({ shallow: true }) && monitor.canDrop(),
|
|
30
|
+
}),
|
|
31
|
+
hover: () => {
|
|
32
|
+
if (
|
|
33
|
+
tree.state.dnd.parentId !== node.id ||
|
|
34
|
+
tree.state.dnd.index !== null
|
|
35
|
+
) {
|
|
36
|
+
tree.dispatch({
|
|
37
|
+
type: "DND_HOVERING",
|
|
38
|
+
parentId: node.id,
|
|
39
|
+
index: null,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (!tree.canDrop()) {
|
|
43
|
+
tree.hideCursor();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
drop: () => {
|
|
47
|
+
if (!tree.canDrop()) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
void tree.props.onMove?.({
|
|
51
|
+
dragIds: tree.state.dnd.dragIds,
|
|
52
|
+
dragNodes: tree.dragNodes,
|
|
53
|
+
parentId: node.id,
|
|
54
|
+
parentNode: node,
|
|
55
|
+
index: 0,
|
|
56
|
+
});
|
|
57
|
+
tree.open(node.id);
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
[tree, node.id],
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
useHoverExpand(node, isHovering);
|
|
64
|
+
|
|
65
|
+
// Replacing innerRef avoids attaching Arborist's positional drop target.
|
|
66
|
+
// Retain its focus behavior for keyboard navigation and rename completion.
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (node.isFocused && !node.isEditing) {
|
|
69
|
+
rowRef.current?.focus({ preventScroll: true });
|
|
70
|
+
}
|
|
71
|
+
}, [node.isFocused, node.isEditing]);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<FileTreeRow
|
|
75
|
+
{...props}
|
|
76
|
+
innerRef={(element) => {
|
|
77
|
+
rowRef.current = element;
|
|
78
|
+
dropRef(element);
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|