@kabmo-labs/kabmo 0.58.1 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +513 -495
- package/dist/client/static/js/{Body-ysmhxbvk.js → Body-jqq4654r.js} +3 -3
- package/dist/client/static/js/{CsvGrid-w90pxyn2.js → CsvGrid-avw0taqb.js} +2 -2
- package/dist/client/static/js/{DocxView-evxn6kaq.js → DocxView-d221vr6g.js} +3 -3
- package/dist/client/static/js/{DrawioView-tmdevwf4.js → DrawioView-gjsy7p01.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-bpsn2z9p.js → HtmlPreview-949393v1.js} +1 -1
- package/dist/client/static/js/ImageView-pan9pqtm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-p0qmghgt.js +2 -0
- package/dist/client/static/js/MergeDiffView-swt467g7.js +1 -0
- package/dist/client/static/js/Modal-4spmcn44.js +60 -0
- package/dist/client/static/js/{PdfView-txxn6qff.js → PdfView-dzj2s6rj.js} +1 -1
- package/dist/client/static/js/SessionsView-b6szjdg5.js +1 -0
- package/dist/client/static/js/{SheetView-52b33e6f.js → SheetView-jpc178g5.js} +11 -11
- package/dist/client/static/js/{SvgPreview-hrk4pfm1.js → SvgPreview-94fap32p.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-at77sybc.js → abnfDiagram-O67JEVCF-a6eyfzrj.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-raw33jgg.js → architectureDiagram-NJMV4G6O-pgmyfncy.js} +3 -3
- package/dist/client/static/js/{astro-qha7sceh.js → astro-ryr2ajmg.js} +1 -1
- package/dist/client/static/js/bash-zknkkwkw.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-b6e90fbk.js → blockDiagram-BEXU5L5S-rf51jyb2.js} +4 -4
- package/dist/client/static/js/c-0w02jkxb.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-msg9y1c6.js → c4Diagram-YGBWAQC7-0faj48jp.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-jmrd1h8r.js → classDiagram-v2-NBCMYWYE-bvzsws8x.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-na65ebq3.js → cose-bilkent-JH36ORCC-j1amnd3m.js} +1 -1
- package/dist/client/static/js/cpp-p5b4vean.js +1 -0
- package/dist/client/static/js/css-9jzbvdyz.js +1 -0
- package/dist/client/static/js/css-sn00sq6v.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-9xkkw71m.js → cynefinDiagram-VND7K2PF-f73w6zzz.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-p59f19tv.js → dagre-6A5THRUB-a5vgvjsg.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-2e2rcvn7.js → diagram-22UHCM2B-6y9efamp.js} +9 -9
- package/dist/client/static/js/{diagram-3UASUU5V-r9ds8vgr.js → diagram-3UASUU5V-2mycy7xm.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-jgwxv7v8.js → diagram-ATOU4E4O-10zgjb66.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-20m35eqq.js → diagram-CDSNMT55-bewa52yf.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-vt3kxt2m.js → diagram-MLGK6HIB-mh3b7gd3.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-c47rgxf1.js → diagram-MPIPVDR6-gvdrbdm5.js} +2 -2
- package/dist/client/static/js/{dockerfile-gtcyey0q.js → dockerfile-6bn19kg0.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-aszw3xy3.js → ebnfDiagram-ZINNZB2B-2prre93c.js} +1 -1
- package/dist/client/static/js/{elixir-w92v180e.js → elixir-fyxw6d70.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-gbvr3gry.js → elk-276RUBZZ-9t6t9kc6.js} +2 -2
- package/dist/client/static/js/{erDiagram-OPXOYQCR-1hqca8qe.js → erDiagram-OPXOYQCR-etcggr5n.js} +6 -6
- package/dist/client/static/js/{erlang-v7344938.js → erlang-97ayje6m.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7c2ncsw7.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-07v22te5.js → ganttDiagram-FUAMR5RP-cdc4mwhs.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-y068jtz9.js → gitGraphDiagram-X574FWY7-55d0fa7x.js} +8 -8
- package/dist/client/static/js/graphql-xzykn0ba.js +1 -0
- package/dist/client/static/js/html-2zc3shky.js +1 -0
- package/dist/client/static/js/{index-r8d4bk86.js → index-10vzyga1.js} +2 -2
- package/dist/client/static/js/{index-8d8ce00v.js → index-27gwghmp.js} +2 -2
- package/dist/client/static/js/{index-zhgh7a31.js → index-2f6afhze.js} +2 -2
- package/dist/client/static/js/{index-nptbz7sv.js → index-3akjcs82.js} +1 -1
- package/dist/client/static/js/{index-fhtnvqgf.js → index-3j2he86h.js} +2 -2
- package/dist/client/static/js/index-461ga40v.js +2 -0
- package/dist/client/static/js/{index-9qf2h9jb.js → index-51rbgeh9.js} +12 -12
- package/dist/client/static/js/{index-s4dpkds5.js → index-537m8a3x.js} +2 -2
- package/dist/client/static/js/{index-tdg7hz80.js → index-58z2hatp.js} +2 -2
- package/dist/client/static/js/{index-4tbdws4r.js → index-5e4e18tg.js} +2 -2
- package/dist/client/static/js/{index-gqrt766t.js → index-60cxxnpk.js} +61 -61
- package/dist/client/static/js/{index-th61y26d.js → index-69mnn71v.js} +2 -2
- package/dist/client/static/js/{index-e0kahttb.js → index-6bsez5n6.js} +1 -1
- package/dist/client/static/js/{index-gaa39w5q.js → index-8tzt0dek.js} +2 -2
- package/dist/client/static/js/{index-zs7kw0be.js → index-8z9aqgf3.js} +4 -4
- package/dist/client/static/js/{index-ewryzs4g.js → index-92h38pwg.js} +2 -2
- package/dist/client/static/js/{index-f61c25vn.js → index-9rvjegmy.js} +3 -3
- package/dist/client/static/js/{index-80kx6dm6.js → index-a3bpmw2r.js} +2 -2
- package/dist/client/static/js/{index-xmg1x6zv.js → index-a5ecn5yx.js} +5 -5
- package/dist/client/static/js/{index-azz46nwc.js → index-ax8gaayq.js} +2 -2
- package/dist/client/static/js/{index-wn28m9h7.js → index-c253x7vt.js} +8 -8
- package/dist/client/static/js/{index-y0f3wbc3.js → index-d9sfavx1.js} +2 -2
- package/dist/client/static/js/{index-5hvt233n.js → index-db6s66jr.js} +2 -2
- package/dist/client/static/js/index-eggbcdwx.js +481 -0
- package/dist/client/static/js/{index-e4nge3f4.js → index-f13ern5e.js} +1 -1
- package/dist/client/static/js/index-f6t91mpp.js +2 -0
- package/dist/client/static/js/{index-wxqcnsrq.js → index-fr91ghwb.js} +2 -2
- package/dist/client/static/js/{index-tq3t3qm4.js → index-fsa18ns9.js} +2 -2
- package/dist/client/static/js/{index-fv7nybnf.js → index-fyt8m8ah.js} +2 -2
- package/dist/client/static/js/{index-007sewcn.js → index-gcad7b6g.js} +2 -2
- package/dist/client/static/js/{index-rxt8sf9a.js → index-h1xbx74w.js} +2 -2
- package/dist/client/static/js/{index-medk4f18.js → index-j1ksa4x2.js} +2 -2
- package/dist/client/static/js/{index-sxag9ptg.js → index-jct0jryd.js} +2 -2
- package/dist/client/static/js/{index-qefssj0m.js → index-jpvng27a.js} +1 -1
- package/dist/client/static/js/{index-vw8b29ek.js → index-me0b6wkw.js} +1 -1
- package/dist/client/static/js/{index-6x0kn8pb.js → index-mhrkjbjq.js} +2 -2
- package/dist/client/static/js/{index-fe92hqmb.js → index-mngpcca7.js} +4 -4
- package/dist/client/static/js/index-mttx9327.css +1 -0
- package/dist/client/static/js/{index-5xxbbzqa.js → index-mx5y9vt9.js} +7 -7
- package/dist/client/static/js/{index-3ymw778n.js → index-ndqtff48.js} +2 -2
- package/dist/client/static/js/{index-cmjyet7w.js → index-nf4hq5tg.js} +27 -27
- package/dist/client/static/js/{index-cpp43af3.js → index-njhrm5qa.js} +9 -9
- package/dist/client/static/js/index-nnwcbp2d.js +2 -0
- package/dist/client/static/js/{index-3p732mvs.js → index-np2rfq06.js} +2 -2
- package/dist/client/static/js/{index-2s17netq.js → index-nwbr15b3.js} +2 -2
- package/dist/client/static/js/{index-an7fq7f6.js → index-pa70qj4p.js} +1 -1
- package/dist/client/static/js/index-pe5f2gmn.js +1 -0
- package/dist/client/static/js/{index-1e0rt7c6.js → index-pgy7ree5.js} +5 -5
- package/dist/client/static/js/index-pzwf6hwe.js +4 -0
- package/dist/client/static/js/{index-7sq6cjt1.js → index-q3k8r0ms.js} +11 -11
- package/dist/client/static/js/{index-j830qk07.js → index-rw84kefb.js} +2 -2
- package/dist/client/static/js/{index-94d416ee.js → index-s9ts6qbj.js} +2 -2
- package/dist/client/static/js/{index-vny4ymjf.js → index-sg65xdey.js} +1 -1
- package/dist/client/static/js/{index-hb7a7m9m.js → index-skvfxcd8.js} +1 -1
- package/dist/client/static/js/{index-1e710snk.js → index-sx2yz2wx.js} +1 -1
- package/dist/client/static/js/{index-kzzvrqnv.js → index-trq7bdvk.js} +2 -2
- package/dist/client/static/js/{index-v8xhgfeq.js → index-vs2y8gxr.js} +2 -2
- package/dist/client/static/js/index-wwyjzhgs.js +2 -0
- package/dist/client/static/js/{index-374xq5a4.js → index-xe447cw3.js} +1 -1
- package/dist/client/static/js/index-y09de44h.js +2 -0
- package/dist/client/static/js/{index-jxsha63v.js → index-y4cx8cqf.js} +2 -2
- package/dist/client/static/js/{index-c9aqx3ht.js → index-yg38s8t3.js} +1 -1
- package/dist/client/static/js/{index-dxq1tbwm.js → index-yh7gngsh.js} +2 -2
- package/dist/client/static/js/{index-3m1dksmy.js → index-yrwm437g.js} +2 -2
- package/dist/client/static/js/{index-7ynf3s2w.js → index-z82nd2bd.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-1x83h4k4.js → infoDiagram-VRGFBTTK-9xph6cr5.js} +2 -2
- package/dist/client/static/js/ini-62r3vxaf.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-et6z3c28.js → ishikawaDiagram-OU5B5YK6-3gshs3v8.js} +2 -2
- package/dist/client/static/js/java-kacycary.js +1 -0
- package/dist/client/static/js/javascript-zc1qnyyp.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-sw669e7a.js → journeyDiagram-ZHPQQLJL-fa8x56mf.js} +2 -2
- package/dist/client/static/js/json-yrwpn6bd.js +1 -0
- package/dist/client/static/js/jsx-b40ag8q1.js +1 -0
- package/dist/client/static/js/{julia-z14p8jsx.js → julia-agc5kfvg.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-aqxg95kx.js → kanban-definition-PNTS6WVX-fybp2hh4.js} +6 -6
- package/dist/client/static/js/lua-bk961f37.js +1 -0
- package/dist/client/static/js/markdown-b7rgzgd6.js +1 -0
- package/dist/client/static/js/mermaid.core-jjh5ggp0.js +12 -0
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-530anpc4.js → mindmap-definition-NLK3R4M7-gtfbg619.js} +4 -4
- package/dist/client/static/js/one-dark-pro-vht9rv39.js +1 -0
- package/dist/client/static/js/one-light-arxc5whh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-5zar6hvy.js → pegDiagram-GJSIUBJH-1a51sbqv.js} +1 -1
- package/dist/client/static/js/{perl-1na2x6yd.js → perl-v5vbtzgf.js} +1 -1
- package/dist/client/static/js/{php-x75tt7w3.js → php-83qwy98t.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-3bx8syvw.js → pieDiagram-5QR66LMP-zd9svyyn.js} +3 -3
- package/dist/client/static/js/properties-k8gbzggp.js +1 -0
- package/dist/client/static/js/python-343tspad.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-yaarpr2e.js → quadrantDiagram-O4NWA36T-5gtw2m6s.js} +2 -2
- package/dist/client/static/js/r-ycdwmv8g.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-ag41q4nt.js → railroadDiagram-XR7U4H2S-3ccwpfzz.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g8sr48h4.js → requirementDiagram-PLB6GJNP-sasndrrp.js} +3 -3
- package/dist/client/static/js/{ruby-3h22qahv.js → ruby-994n5j6e.js} +1 -1
- package/dist/client/static/js/{rust-r27demr5.js → rust-n9z2c9m3.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-t1wbd1hh.js → sankeyDiagram-IPEJSGJF-2ahb4sda.js} +3 -3
- package/dist/client/static/js/{sass-8bq5r2tz.js → sass-p6g7qdv2.js} +1 -1
- package/dist/client/static/js/{scss-c04ezwnn.js → scss-4j4t3r6y.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-407mjqty.js → sequenceDiagram-PO4LG4MO-bfj90kz1.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-w38zb9ky.js → sizeCapture-INFHLROL-5tygxmtc.js} +1 -1
- package/dist/client/static/js/sql-kwpd5w07.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-4cvgymkc.js → stateDiagram-v2-GCMORJYK-533xw76e.js} +3 -3
- package/dist/client/static/js/{svelte-egg3x4tw.js → svelte-bek3h1sz.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-w7ts2rzw.js → swimlanes-2SLR337P-gd3d04pk.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xxmvdyg4.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-nq46nzy9.js → timeline-definition-EJHVYXUP-fvqvgqvg.js} +3 -3
- package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +1 -0
- package/dist/client/static/js/tsx-gjxfjnbk.js +1 -0
- package/dist/client/static/js/typescript-4dchbnya.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-q144snzb.js → usecaseDiagram-POWQR4AR-tm1f0m4x.js} +15 -15
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-2wemak2p.js → vennDiagram-UO4OBE2U-2vdvv1hd.js} +4 -4
- package/dist/client/static/js/{vue-d7p4wv35.js → vue-y44m889c.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-bb2qvvgr.js → wardleyDiagram-VNRHLVJA-7avcjznx.js} +4 -4
- package/dist/client/static/js/xml-xs6qz3ya.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9dr05fdq.js → xychartDiagram-PMCCYNJV-g39y526n.js} +4 -4
- package/dist/client/static/js/yaml-174nk5bn.js +1 -0
- package/package.json +7 -7
- package/src/client/borders.css +15 -3
- package/src/client/components/common/ComposerTextarea.test.tsx +13 -1
- package/src/client/components/common/ComposerTextarea.tsx +8 -2
- package/src/client/components/common/MarkdownRenderer.tsx +11 -2
- package/src/client/components/common/harness-glyph/harness-glyph.test.ts +0 -4
- package/src/client/components/common/harness-glyph/index.tsx +4 -5
- package/src/client/components/common/markdown-inline-file.test.tsx +90 -15
- package/src/client/components/common/session-actions-menu/index.test.tsx +45 -0
- package/src/client/components/common/session-actions-menu/index.tsx +6 -1
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +4 -1
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +28 -35
- package/src/client/components/layout/desktop-layout/index.tsx +5 -3
- package/src/client/components/layout/desktop-layout/resizer/index.tsx +13 -3
- package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +41 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +21 -1
- package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +1 -0
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -2
- package/src/client/components/layout/session-sidebar/ClassicView.tsx +2 -0
- package/src/client/components/layout/session-sidebar/SessionList.tsx +4 -0
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +22 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +45 -28
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +9 -3
- package/src/client/components/layout/session-sidebar/modern/index.tsx +2 -0
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +27 -11
- package/src/client/components/layout/session-sidebar/search-results.test.tsx +29 -16
- package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +1 -0
- package/src/client/components/layout/session-sidebar/variant-props.ts +2 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +9 -0
- package/src/client/components/mobile/SessionSidebar.tsx +4 -0
- package/src/client/components/mobile/left-drawer-nav.test.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +4 -0
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +3 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +85 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +30 -14
- package/src/client/components/mobile/mobile-session-sidebar/List.tsx +4 -0
- package/src/client/components/settings/apply-side-effects.test.ts +31 -0
- package/src/client/components/settings/apply-side-effects.ts +7 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +3 -2
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.test.tsx +95 -0
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +35 -0
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.gutter.test.ts +26 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +6 -3
- package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +17 -0
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +9 -3
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +39 -2
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +19 -4
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +28 -21
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.wait.test.tsx +48 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +44 -21
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +24 -0
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +44 -18
- package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +35 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +33 -12
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +24 -0
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +14 -3
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +24 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +78 -135
- package/src/client/components/workspace/chat-timeline/chat-input/VoiceButton.tsx +58 -0
- package/src/client/components/workspace/chat-timeline/chat-input/action-base.ts +42 -0
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.test.ts +108 -0
- package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.tsx +122 -0
- package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +78 -20
- package/src/client/components/workspace/chat-timeline/chat-input/styles/index.tsx +11 -5
- package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +19 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.test.tsx +125 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +84 -27
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +18 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +14 -5
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +31 -10
- package/src/client/components/workspace/model-dropdown/Header.tsx +13 -5
- package/src/client/components/workspace/model-dropdown/Panel.tsx +18 -0
- package/src/client/components/workspace/model-dropdown/ThinkingLevels.tsx +51 -0
- package/src/client/components/workspace/model-dropdown/Trigger.tsx +99 -0
- package/src/client/components/workspace/model-dropdown/bands.ts +51 -0
- package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +21 -5
- package/src/client/components/workspace/model-dropdown/index.tsx +20 -47
- package/src/client/components/workspace/model-dropdown/thinking-levels.test.tsx +108 -0
- package/src/client/components/workspace/model-dropdown/trigger.test.ts +54 -8
- package/src/client/hooks/chat/composer/attachments.test.ts +12 -0
- package/src/client/hooks/chat/composer/attachments.ts +16 -4
- package/src/client/hooks/chat/composer/pipeline.test.ts +14 -0
- package/src/client/hooks/chat/composer/pipeline.ts +15 -6
- package/src/client/hooks/chat/omp/session-list.activity.test.ts +20 -0
- package/src/client/hooks/chat/omp/session-merges.ts +18 -6
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -0
- package/src/client/hooks/chat/timeline/scope.test.ts +17 -0
- package/src/client/hooks/chat/timeline/scope.ts +6 -1
- package/src/client/hooks/chat/timeline/send-refusal.test.ts +19 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +17 -0
- package/src/client/hooks/chat/timeline/send.ts +17 -0
- package/src/client/hooks/editor/quick-open.ts +41 -0
- package/src/client/hooks/ui/border-style.test.ts +13 -0
- package/src/client/hooks/ui/markdown-render.ts +11 -6
- package/src/client/hooks/ui/open-inline-file.test.ts +16 -0
- package/src/client/hooks/ui/open-inline-file.ts +4 -2
- package/src/client/hooks/ui/show-more.ts +11 -1
- package/src/client/hooks/ui/ui-feedback.test.ts +11 -0
- package/src/client/hooks/ui/verified-inline-files.test.tsx +143 -0
- package/src/client/hooks/ui/verified-inline-files.ts +165 -0
- package/src/client/hooks/workspace/mobile-workspace-panels.test.tsx +116 -0
- package/src/client/hooks/workspace/mobile-workspace-panels.ts +73 -0
- package/src/client/hooks/workspace/panel-resize.test.ts +127 -0
- package/src/client/hooks/workspace/panel-resize.ts +81 -0
- package/src/client/hooks/workspace/session-list-limit.test.ts +80 -0
- package/src/client/hooks/workspace/session-list-limit.ts +69 -0
- package/src/client/hooks/workspace/session-pin.ts +58 -0
- package/src/client/hooks/workspace/workspace-panels-mode.test.tsx +87 -0
- package/src/client/hooks/workspace/workspace-panels-mode.ts +76 -0
- package/src/client/lib/router/branch-params.test.ts +17 -1
- package/src/client/lib/router/branch-params.ts +18 -0
- package/src/client/lib/ui/pressed.ts +15 -0
- package/src/client/tailwind.css +30 -10
- package/src/server/lib/connect/cloudflared.lifecycle.test.ts +25 -9
- package/src/server/lib/db/schema.test.ts +1 -1
- package/src/server/lib/db/schema.ts +17 -0
- package/src/server/lib/harness/activity.server.test.ts +81 -0
- package/src/server/lib/harness/activity.server.ts +55 -0
- package/src/server/lib/harness/spawn.server.ts +9 -0
- package/src/server/lib/omp/session/delete.server.ts +4 -2
- package/src/server/lib/omp/session/sidebar-activity.server.test.ts +24 -2
- package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +14 -0
- package/src/server/lib/sessions/last-opened.server.test.ts +17 -0
- package/src/server/lib/sessions/last-opened.server.ts +18 -1
- package/src/server/routes/sessions/index.ts +3 -2
- package/src/server/routes/sessions/routes.test.ts +29 -46
- package/src/server/routes/sessions/session.ts +40 -62
- package/src/server/routes/sessions/state.test.ts +89 -0
- package/src/server/routes/sessions/state.ts +86 -0
- package/src/shared/lib/chat/attachment-budget.test.ts +74 -0
- package/src/shared/lib/chat/attachment-budget.ts +111 -0
- package/src/shared/lib/chat/attachments.test.ts +0 -17
- package/src/shared/lib/chat/attachments.ts +0 -53
- package/src/shared/lib/chat/timeline/block-chrome.test.ts +35 -0
- package/src/shared/lib/chat/timeline/block-chrome.ts +21 -0
- package/src/shared/lib/markdown/degenerate-emphasis.test.ts +64 -0
- package/src/shared/lib/markdown/degenerate-emphasis.ts +90 -0
- package/src/shared/lib/markdown/inline-file.test.ts +79 -22
- package/src/shared/lib/markdown/inline-file.ts +57 -25
- package/src/shared/lib/markdown/marked.ts +5 -1
- package/src/shared/lib/settings/defaults.ts +2 -0
- package/src/shared/lib/theme/border-style.ts +1 -1
- package/src/shared/lib/workspace/active-project.test.ts +17 -1
- package/src/shared/lib/workspace/active-project.ts +9 -0
- package/src/shared/lib/workspace/project-settings-delete.test.ts +97 -0
- package/src/shared/lib/workspace/project-settings.test.ts +2 -34
- package/src/shared/lib/workspace/project-settings.ts +6 -0
- package/src/shared/lib/workspace/session-list-limit.test.ts +31 -0
- package/src/shared/lib/workspace/session-list-limit.ts +32 -0
- package/src/shared/lib/workspace/sidebar-sort.test.ts +21 -0
- package/src/shared/lib/workspace/workspace-panel-widths.ts +1 -1
- package/src/shared/lib/workspace/workspace-session.test.ts +34 -0
- package/src/shared/lib/workspace/workspace-session.ts +40 -0
- package/src/shared/types/settings/state.ts +10 -0
- package/dist/client/static/js/ImageView-ssazqckj.js +0 -1
- package/dist/client/static/js/LayoutWrapper-qwpfq4dq.js +0 -2
- package/dist/client/static/js/MergeDiffView-en6aazw8.js +0 -1
- package/dist/client/static/js/Modal-zjnhj9nb.js +0 -60
- package/dist/client/static/js/SessionsView-eryjtmb2.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +0 -1
- package/dist/client/static/js/bash-n5d0esqg.js +0 -1
- package/dist/client/static/js/c-pk766wx0.js +0 -1
- package/dist/client/static/js/cpp-3pt91jvm.js +0 -1
- package/dist/client/static/js/css-q2k6afe3.js +0 -1
- package/dist/client/static/js/css-sp1cgdbr.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +0 -1
- package/dist/client/static/js/graphql-qx4tt6ze.js +0 -1
- package/dist/client/static/js/html-5e0g8664.js +0 -1
- package/dist/client/static/js/index-4ddgpqm0.css +0 -1
- package/dist/client/static/js/index-5g2j626a.js +0 -1
- package/dist/client/static/js/index-cc7qbfvn.js +0 -477
- package/dist/client/static/js/index-f27wvdky.js +0 -4
- package/dist/client/static/js/index-m5n0zsft.js +0 -2
- package/dist/client/static/js/index-rqt8mem9.js +0 -2
- package/dist/client/static/js/index-s9k82stc.js +0 -2
- package/dist/client/static/js/index-skwem10a.js +0 -2
- package/dist/client/static/js/index-tv9rn2nd.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +0 -1
- package/dist/client/static/js/ini-bdk46a3d.js +0 -1
- package/dist/client/static/js/java-3g3925cf.js +0 -1
- package/dist/client/static/js/javascript-av46zx4c.js +0 -1
- package/dist/client/static/js/json-hdyzmffz.js +0 -1
- package/dist/client/static/js/jsx-y8r9mrdq.js +0 -1
- package/dist/client/static/js/lua-wf5k6p3r.js +0 -1
- package/dist/client/static/js/markdown-9bf16dx7.js +0 -1
- package/dist/client/static/js/mermaid.core-6cgqsgcf.js +0 -12
- package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +0 -1
- package/dist/client/static/js/one-light-2n5y8592.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +0 -1
- package/dist/client/static/js/properties-xk4dn00p.js +0 -1
- package/dist/client/static/js/python-7sgz05n4.js +0 -1
- package/dist/client/static/js/r-w4qxm0pv.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +0 -1
- package/dist/client/static/js/sql-sd00wgem.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-v82nym6b.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +0 -1
- package/dist/client/static/js/tsx-h5yzg80q.js +0 -1
- package/dist/client/static/js/typescript-qy1sbhea.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +0 -1
- package/dist/client/static/js/xml-mrk4xakv.js +0 -1
- package/dist/client/static/js/yaml-xaza6dra.js +0 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +0 -110
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +0 -86
|
@@ -29,12 +29,18 @@ import { rewriteWikiReferences } from '@/shared/lib/wiki/document-urls';
|
|
|
29
29
|
import { expandGollumLinks } from '@/shared/lib/wiki/pages';
|
|
30
30
|
import { MATH_PENDING_CLASS, preloadKatex } from '@/shared/lib/markdown/katex';
|
|
31
31
|
import { sanitizeHtml } from '@/shared/lib/markdown/sanitize';
|
|
32
|
-
import {
|
|
32
|
+
import { inlineFileCandidates, type InlineFileReference as MarkdownFileReference } from '@/shared/lib/markdown/inline-file';
|
|
33
33
|
import { localizeFileImageSources, markLocalImageSources } from '@/shared/lib/chat/timeline/local-image';
|
|
34
34
|
|
|
35
35
|
export interface RenderedMarkdown {
|
|
36
36
|
html: string;
|
|
37
37
|
blocks: MdBlock[];
|
|
38
|
+
/**
|
|
39
|
+
* The inline file references the HTML names, for the caller to verify
|
|
40
|
+
* against the workspace before marking any of them clickable. Document and
|
|
41
|
+
* wiki renders resolve their own references and leave this empty.
|
|
42
|
+
*/
|
|
43
|
+
references: MarkdownFileReference[];
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
/** Everything the render depends on, as PRIMITIVES. A new object per render is
|
|
@@ -73,7 +79,7 @@ export function useRenderedMarkdown(options: MarkdownRenderOptions): RenderedMar
|
|
|
73
79
|
} = options;
|
|
74
80
|
|
|
75
81
|
return useMemo(() => {
|
|
76
|
-
if (!content) return { html: '', blocks: [] as MdBlock[] };
|
|
82
|
+
if (!content) return { html: '', blocks: [] as MdBlock[], references: [] as MarkdownFileReference[] };
|
|
77
83
|
// Gollum's `[[Page]]` is invisible to a markdown parser, so it is expanded
|
|
78
84
|
// before parsing rather than patched afterwards.
|
|
79
85
|
const source = wikiPath ? expandGollumLinks(content) : content;
|
|
@@ -97,13 +103,12 @@ export function useRenderedMarkdown(options: MarkdownRenderOptions): RenderedMar
|
|
|
97
103
|
// Agent output is the one place an inline `` `path` `` is a file the reader
|
|
98
104
|
// can open. A document preview and a wiki page resolve their OWN references
|
|
99
105
|
// through the scope above, so marking them here would be a second rule for
|
|
100
|
-
// the same job. The
|
|
101
|
-
// need a DOMPurify allow-list entry (same contract as local images).
|
|
106
|
+
// the same job. The caller marks only the ones the workspace confirms.
|
|
102
107
|
const agentOutput = !isDocument && !isWiki;
|
|
103
|
-
const withFiles = agentOutput ? markInlineFilePaths(sanitized) : sanitized;
|
|
104
108
|
return {
|
|
105
|
-
html: chat ? markLocalImageSources(
|
|
109
|
+
html: chat ? markLocalImageSources(sanitized) : sanitized,
|
|
106
110
|
blocks: mapped?.blocks ?? [],
|
|
111
|
+
references: agentOutput ? inlineFileCandidates(sanitized) : [],
|
|
107
112
|
};
|
|
108
113
|
// Primitive deps: the caller may build `scope`/`wikiScope` inline, and a
|
|
109
114
|
// new object identity would re-parse the whole document every render.
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
16
16
|
import { Window } from 'happy-dom';
|
|
17
17
|
import { closePalette, paletteState } from '@/client/lib/commands/overlays';
|
|
18
|
+
import { forgetQuickOpenIndex, loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
|
|
18
19
|
import { setPluginContext } from '@/client/lib/plugins/context';
|
|
19
20
|
import { getLineReveal, setLineReveal } from '@/client/lib/line-reveal';
|
|
20
21
|
import {
|
|
@@ -62,6 +63,7 @@ afterEach(() => {
|
|
|
62
63
|
closePalette();
|
|
63
64
|
setLineReveal(null);
|
|
64
65
|
setPluginContext(null, null);
|
|
66
|
+
forgetQuickOpenIndex();
|
|
65
67
|
files = [];
|
|
66
68
|
fetchCalls = [];
|
|
67
69
|
opened = [];
|
|
@@ -90,6 +92,20 @@ describe('openInlineFileReference', () => {
|
|
|
90
92
|
expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
|
|
91
93
|
});
|
|
92
94
|
|
|
95
|
+
test('a click reuses the index the chip verification already fetched', async () => {
|
|
96
|
+
setPluginContext(null, ROOT);
|
|
97
|
+
files = [{ path: 'src/client/App.tsx' }, { path: 'src/server/read.ts' }];
|
|
98
|
+
// The verification pass for the chip, before any click.
|
|
99
|
+
await loadQuickOpenIndex(ROOT);
|
|
100
|
+
fetchCalls = [];
|
|
101
|
+
|
|
102
|
+
await openInlineFileReference({ path: 'App.tsx', line: 3 });
|
|
103
|
+
|
|
104
|
+
expect(fetchCalls).toEqual([]);
|
|
105
|
+
expect(getLineReveal()).toEqual({ path: 'src/client/App.tsx', line: 3 });
|
|
106
|
+
expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
|
|
107
|
+
});
|
|
108
|
+
|
|
93
109
|
test('a bare filename with several matches opens the picker on the name', async () => {
|
|
94
110
|
setPluginContext(null, ROOT);
|
|
95
111
|
files = [{ path: 'src/a/index.ts' }, { path: 'src/b/index.ts' }];
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* jump that was already served).
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import {
|
|
24
|
+
import { loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
|
|
25
25
|
import { openFileInEditor } from '@/client/hooks/ui/open-file';
|
|
26
26
|
import { openPalette } from '@/client/lib/commands/overlays';
|
|
27
27
|
import { setLineReveal } from '@/client/lib/line-reveal';
|
|
@@ -45,7 +45,9 @@ export async function openInlineFileReference(reference: InlineFileTarget): Prom
|
|
|
45
45
|
const root = pluginContext().workspacePath ?? undefined;
|
|
46
46
|
|
|
47
47
|
if (root && !reference.path.includes('/')) {
|
|
48
|
-
|
|
48
|
+
// The same loader the chip verification used, so a click does not repeat
|
|
49
|
+
// the walk the chip already paid for.
|
|
50
|
+
const entries = await loadQuickOpenIndex(root);
|
|
49
51
|
const target = chooseFileTarget(reference, entries);
|
|
50
52
|
if (target.kind === 'pick') {
|
|
51
53
|
openPalette('files', { query: target.query });
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* keep going AND to start over.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { useCallback, useState } from 'preact/hooks';
|
|
20
|
+
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
|
21
21
|
|
|
22
22
|
export interface ShowMore {
|
|
23
23
|
visibleCount: number;
|
|
@@ -29,6 +29,16 @@ export interface ShowMore {
|
|
|
29
29
|
|
|
30
30
|
export function useShowMore(initial = 5, step = 7): ShowMore {
|
|
31
31
|
const [visibleCount, setVisibleCount] = useState(initial);
|
|
32
|
+
const previousInitial = useRef(initial);
|
|
33
|
+
// A page size that comes from a setting can change while the list is mounted
|
|
34
|
+
// (Settings is drawn over the open sidebar). Reset to the new window rather
|
|
35
|
+
// than keep a count the user never chose — but not on mount, where the state
|
|
36
|
+
// already starts at `initial` and a late effect would overwrite a click.
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (previousInitial.current === initial) return;
|
|
39
|
+
previousInitial.current = initial;
|
|
40
|
+
setVisibleCount(initial);
|
|
41
|
+
}, [initial]);
|
|
32
42
|
const showMore = useCallback(() => setVisibleCount((c) => c + step), [step]);
|
|
33
43
|
const showLess = useCallback(() => setVisibleCount(initial), [initial]);
|
|
34
44
|
return { visibleCount, showMore, showLess, canShowLess: visibleCount > initial };
|
|
@@ -180,6 +180,17 @@ describe('useShowMore', () => {
|
|
|
180
180
|
expect(seen.current!.visibleCount).toBe(13);
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
+
test('a new initial resets the window, so a saved page size applies immediately', () => {
|
|
184
|
+
const seen: { current: ShowMore | null } = { current: null };
|
|
185
|
+
mount(h(ShowMoreProbe, { initial: 5, seen }));
|
|
186
|
+
act(() => seen.current!.showMore());
|
|
187
|
+
expect(seen.current!.visibleCount).toBe(12);
|
|
188
|
+
|
|
189
|
+
mount(h(ShowMoreProbe, { initial: 10, seen }));
|
|
190
|
+
expect(seen.current!.visibleCount).toBe(10);
|
|
191
|
+
expect(seen.current!.canShowLess).toBe(false);
|
|
192
|
+
});
|
|
193
|
+
|
|
183
194
|
test('canShowLess is false until the window grows, and showLess collapses to the initial size', () => {
|
|
184
195
|
const seen: { current: ShowMore | null } = { current: null };
|
|
185
196
|
mount(h(ShowMoreProbe, { seen }));
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which references the timeline is allowed to make clickable.
|
|
8
|
+
*
|
|
9
|
+
* The integration suite (`markdown-inline-file.test.tsx`) pins the chip; this
|
|
10
|
+
* pins the answers the hook gives the marker — a directory path is stat'ed, a
|
|
11
|
+
* bare name goes through the index, and an unanswerable probe (refusal, no
|
|
12
|
+
* workspace) verifies NOTHING, because a clickable chip that opens a missing
|
|
13
|
+
* file is the bug.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import { render } from 'preact';
|
|
19
|
+
import { act } from 'preact/test-utils';
|
|
20
|
+
import { forgetQuickOpenIndex } from '@/client/hooks/editor/quick-open';
|
|
21
|
+
import {
|
|
22
|
+
forgetInlineFileVerdicts,
|
|
23
|
+
probeInlineFileExists,
|
|
24
|
+
useVerifiedInlineFiles,
|
|
25
|
+
} from '@/client/hooks/ui/verified-inline-files';
|
|
26
|
+
import { setPluginContext } from '@/client/lib/plugins/context';
|
|
27
|
+
import type { InlineFileReference } from '@/shared/lib/markdown/inline-file';
|
|
28
|
+
|
|
29
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement'] as const;
|
|
30
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
31
|
+
const nativeFetch = globalThis.fetch;
|
|
32
|
+
|
|
33
|
+
let container: HTMLElement;
|
|
34
|
+
let requests: string[] = [];
|
|
35
|
+
let existing = new Set<string>();
|
|
36
|
+
let listed: string[] = [];
|
|
37
|
+
let failFetch = false;
|
|
38
|
+
|
|
39
|
+
function jsonResponse(body: unknown, status = 200): Response {
|
|
40
|
+
return { ok: status >= 200 && status < 300, status, json: async () => body } as unknown as Response;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function Harness({ references }: { references: readonly InlineFileReference[] }) {
|
|
44
|
+
const verified = useVerifiedInlineFiles(references);
|
|
45
|
+
return <span id="verified">{[...verified].sort().join(',')}</span>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function settle(): Promise<void> {
|
|
49
|
+
await act(async () => {
|
|
50
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
51
|
+
setTimeout(resolve, 0);
|
|
52
|
+
await promise;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function mount(references: InlineFileReference[], root: string | null): Promise<string> {
|
|
57
|
+
container = document.createElement('div');
|
|
58
|
+
document.body.appendChild(container);
|
|
59
|
+
setPluginContext(null, root);
|
|
60
|
+
act(() => render(<Harness references={references} />, container));
|
|
61
|
+
await settle();
|
|
62
|
+
return container.querySelector('#verified')?.textContent ?? '';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
beforeAll(() => {
|
|
66
|
+
const win = new Window({ url: 'http://localhost' });
|
|
67
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
68
|
+
for (const key of DOM_GLOBALS) {
|
|
69
|
+
nativeGlobals[key] = target[key];
|
|
70
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
71
|
+
}
|
|
72
|
+
globalThis.fetch = (async (input: string | URL | Request) => {
|
|
73
|
+
const url = new URL(String(input), 'http://localhost');
|
|
74
|
+
requests.push(`${url.pathname}?${url.searchParams.toString()}`);
|
|
75
|
+
if (failFetch) throw new Error('offline');
|
|
76
|
+
if (url.pathname === '/api/fs/exists') {
|
|
77
|
+
return jsonResponse({ exists: existing.has(url.searchParams.get('path') ?? ''), mtimeMs: null });
|
|
78
|
+
}
|
|
79
|
+
if (url.pathname === '/api/fs/list') {
|
|
80
|
+
return jsonResponse({ files: listed.map((path) => ({ path })), truncated: false });
|
|
81
|
+
}
|
|
82
|
+
return jsonResponse({}, 404);
|
|
83
|
+
}) as unknown as typeof globalThis.fetch;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
afterAll(() => {
|
|
87
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
88
|
+
for (const key of DOM_GLOBALS) {
|
|
89
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
90
|
+
else target[key] = nativeGlobals[key];
|
|
91
|
+
}
|
|
92
|
+
globalThis.fetch = nativeFetch;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
afterEach(() => {
|
|
96
|
+
render(null, container);
|
|
97
|
+
container.remove();
|
|
98
|
+
setPluginContext(null, null);
|
|
99
|
+
forgetQuickOpenIndex();
|
|
100
|
+
forgetInlineFileVerdicts();
|
|
101
|
+
requests = [];
|
|
102
|
+
existing = new Set();
|
|
103
|
+
listed = [];
|
|
104
|
+
failFetch = false;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
describe('useVerifiedInlineFiles', () => {
|
|
108
|
+
test('a directory path is verified by the exists route, a bare name by the index', async () => {
|
|
109
|
+
existing = new Set(['src/a.ts']);
|
|
110
|
+
listed = ['src/client/App.tsx'];
|
|
111
|
+
const text = await mount([{ path: 'src/a.ts' }, { path: 'App.tsx' }], '/repo');
|
|
112
|
+
expect(text).toBe('App.tsx,src/a.ts');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('a path the workspace does not have is not verified', async () => {
|
|
116
|
+
existing = new Set(['src/a.ts']);
|
|
117
|
+
expect(await mount([{ path: 'src/gone.ts' }], '/repo')).toBe('');
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('the same path is asked about once', async () => {
|
|
121
|
+
existing = new Set(['src/a.ts']);
|
|
122
|
+
await mount([{ path: 'src/a.ts' }, { path: 'src/a.ts', line: 9 }], '/repo');
|
|
123
|
+
expect(requests.filter((url) => url.startsWith('/api/fs/exists'))).toHaveLength(1);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test('a settled verdict is reused instead of stat-ing again', async () => {
|
|
127
|
+
existing = new Set(['src/a.ts']);
|
|
128
|
+
expect(await probeInlineFileExists('/repo', 'src/a.ts')).toBe(true);
|
|
129
|
+
expect(await probeInlineFileExists('/repo', 'src/a.ts')).toBe(true);
|
|
130
|
+
expect(requests.filter((url) => url.startsWith('/api/fs/exists'))).toHaveLength(1);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('a failed probe verifies nothing', async () => {
|
|
134
|
+
failFetch = true;
|
|
135
|
+
expect(await mount([{ path: 'src/a.ts' }, { path: 'App.tsx' }], '/repo')).toBe('');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('without a workspace nothing is asked and nothing is verified', async () => {
|
|
139
|
+
existing = new Set(['src/a.ts']);
|
|
140
|
+
expect(await mount([{ path: 'src/a.ts' }], null)).toBe('');
|
|
141
|
+
expect(requests).toEqual([]);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which inline file references a chat message wrote actually name a file.
|
|
8
|
+
*
|
|
9
|
+
* The detector (`inline-file.ts`) accepts anything that LOOKS like a path, and
|
|
10
|
+
* the agent does not always write one that resolves: a partial name, a path
|
|
11
|
+
* from another checkout, a file it never created. Marking all of them made the
|
|
12
|
+
* chip a promise the click could not keep — the tab opened empty and the editor
|
|
13
|
+
* said the file was missing.
|
|
14
|
+
*
|
|
15
|
+
* So the marker is gated on this hook. A reference WITH a directory is a
|
|
16
|
+
* workspace-relative location, which `/api/fs/exists` stats exactly. A BARE
|
|
17
|
+
* name has no location, so it is resolved through the quick-open index the
|
|
18
|
+
* click itself uses (`chooseFileTarget`): an exact entry, or a basename match,
|
|
19
|
+
* is a file that can be opened; nothing is not.
|
|
20
|
+
*
|
|
21
|
+
* Only a POSITIVE answer marks a chip. A failed probe, an absent workspace and
|
|
22
|
+
* an unreadable index all leave it plain text — an inert chip is honest, a
|
|
23
|
+
* clickable one that opens a missing tab is the bug this exists to prevent.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
27
|
+
import { loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
|
|
28
|
+
import { pluginContext } from '@/client/lib/plugins/context';
|
|
29
|
+
import { chooseFileTarget } from '@/shared/lib/fs/open-reference';
|
|
30
|
+
import type { InlineFileReference } from '@/shared/lib/markdown/inline-file';
|
|
31
|
+
|
|
32
|
+
/** Probes for the same scope and path share one request. */
|
|
33
|
+
const inFlightProbes = new Map<string, Promise<boolean>>();
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A settled verdict is reused for this long, so ten messages that mention the
|
|
37
|
+
* same file cost one `stat`, not ten. Short on purpose: a file created after a
|
|
38
|
+
* stale "missing" must become clickable soon.
|
|
39
|
+
*/
|
|
40
|
+
const VERDICT_REUSE_MS = 5_000;
|
|
41
|
+
|
|
42
|
+
interface CachedVerdict {
|
|
43
|
+
settledAt: number;
|
|
44
|
+
exists: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const verdictCache = new Map<string, CachedVerdict>();
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Whether `path` names a file under `root`.
|
|
51
|
+
*
|
|
52
|
+
* The route is the same one `useMissingFiles` asks, so "a chip is clickable"
|
|
53
|
+
* and "a tab is not missing" cannot disagree about what exists. A refusal is
|
|
54
|
+
* NOT an answer: only an explicit `exists: true` verifies.
|
|
55
|
+
*/
|
|
56
|
+
export function probeInlineFileExists(root: string, path: string): Promise<boolean> {
|
|
57
|
+
const key = `${root}\u0000${path}`;
|
|
58
|
+
const cached = verdictCache.get(key);
|
|
59
|
+
if (cached && Date.now() - cached.settledAt < VERDICT_REUSE_MS) {
|
|
60
|
+
return Promise.resolve(cached.exists);
|
|
61
|
+
}
|
|
62
|
+
const pending = inFlightProbes.get(key);
|
|
63
|
+
if (pending) return pending;
|
|
64
|
+
const params = new URLSearchParams({ path, root });
|
|
65
|
+
const probe = (async () => {
|
|
66
|
+
try {
|
|
67
|
+
const res = await fetch(`/api/fs/exists?${params.toString()}`);
|
|
68
|
+
const data = (await res.json().catch(() => null)) as { exists?: unknown } | null;
|
|
69
|
+
return res.ok && data?.exists === true;
|
|
70
|
+
} catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
})().then((exists) => {
|
|
74
|
+
verdictCache.set(key, { settledAt: Date.now(), exists });
|
|
75
|
+
return exists;
|
|
76
|
+
}).finally(() => inFlightProbes.delete(key));
|
|
77
|
+
inFlightProbes.set(key, probe);
|
|
78
|
+
return probe;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Drop the shared verdicts. Tests that change a scope's files call this. */
|
|
82
|
+
export function forgetInlineFileVerdicts(): void {
|
|
83
|
+
verdictCache.clear();
|
|
84
|
+
inFlightProbes.clear();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface Verdicts {
|
|
88
|
+
/** The workspace the verdicts belong to; a different root starts over. */
|
|
89
|
+
root: string | null;
|
|
90
|
+
byPath: Map<string, boolean>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The reference paths that exist, for the current message and workspace.
|
|
95
|
+
*
|
|
96
|
+
* Verdicts live in a ref so a streaming re-render does not re-ask about spans
|
|
97
|
+
* that are already settled; `revision` is the only thing that repaints. A path
|
|
98
|
+
* that appears later (the agent finished writing the sentence) is probed once.
|
|
99
|
+
*/
|
|
100
|
+
export function useVerifiedInlineFiles(references: readonly InlineFileReference[]): ReadonlySet<string> {
|
|
101
|
+
const root = pluginContext().workspacePath;
|
|
102
|
+
const verdicts = useRef<Verdicts>({ root, byPath: new Map() });
|
|
103
|
+
const inFlight = useRef(new Set<string>());
|
|
104
|
+
const alive = useRef(true);
|
|
105
|
+
const [revision, setRevision] = useState(0);
|
|
106
|
+
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
alive.current = true;
|
|
109
|
+
return () => {
|
|
110
|
+
alive.current = false;
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
|
|
114
|
+
const paths = useMemo(() => {
|
|
115
|
+
const unique = new Set<string>();
|
|
116
|
+
for (const reference of references) unique.add(reference.path);
|
|
117
|
+
return [...unique];
|
|
118
|
+
}, [references]);
|
|
119
|
+
// A string dep keeps the effect stable while the parse produces a new array
|
|
120
|
+
// with the same content (every streaming tick does).
|
|
121
|
+
const pathKey = paths.join('\n');
|
|
122
|
+
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (verdicts.current.root !== root) {
|
|
125
|
+
verdicts.current = { root, byPath: new Map() };
|
|
126
|
+
inFlight.current = new Set();
|
|
127
|
+
}
|
|
128
|
+
if (!root) return;
|
|
129
|
+
const current = verdicts.current.byPath;
|
|
130
|
+
const unknown = paths.filter((path) => !current.has(path) && !inFlight.current.has(path));
|
|
131
|
+
if (unknown.length === 0) return;
|
|
132
|
+
for (const path of unknown) inFlight.current.add(path);
|
|
133
|
+
const scope = root;
|
|
134
|
+
|
|
135
|
+
void (async () => {
|
|
136
|
+
const needsIndex = unknown.some((path) => !path.includes('/'));
|
|
137
|
+
const entries = needsIndex ? await loadQuickOpenIndex(scope) : [];
|
|
138
|
+
const answers = await Promise.all(
|
|
139
|
+
unknown.map(async (path): Promise<[string, boolean]> => [
|
|
140
|
+
path,
|
|
141
|
+
path.includes('/')
|
|
142
|
+
? await probeInlineFileExists(scope, path)
|
|
143
|
+
: chooseFileTarget({ path }, entries).kind !== 'literal',
|
|
144
|
+
]),
|
|
145
|
+
);
|
|
146
|
+
// The component may have unmounted, or the workspace switched, while the
|
|
147
|
+
// requests were in flight; a verdict for the wrong scope is not stored.
|
|
148
|
+
if (verdicts.current.root !== scope) return;
|
|
149
|
+
for (const [path, exists] of answers) {
|
|
150
|
+
inFlight.current.delete(path);
|
|
151
|
+
verdicts.current.byPath.set(path, exists);
|
|
152
|
+
}
|
|
153
|
+
if (alive.current) setRevision((value) => value + 1);
|
|
154
|
+
})();
|
|
155
|
+
}, [pathKey, root]);
|
|
156
|
+
|
|
157
|
+
return useMemo(() => {
|
|
158
|
+
const verified = new Set<string>();
|
|
159
|
+
if (verdicts.current.root === root) {
|
|
160
|
+
for (const [path, exists] of verdicts.current.byPath) if (exists) verified.add(path);
|
|
161
|
+
}
|
|
162
|
+
return verified;
|
|
163
|
+
// `revision` is the repaint signal for the mutable verdict map.
|
|
164
|
+
}, [revision, root, pathKey]);
|
|
165
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The phone's folder workspace entry: a press writes the folder's synthetic id
|
|
8
|
+
* and opens the panel drawer, and a settled workspace id reopens the drawer
|
|
9
|
+
* after a reload. A real session must do neither.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
13
|
+
import { Window } from 'happy-dom';
|
|
14
|
+
import { h, render } from 'preact';
|
|
15
|
+
import { act } from 'preact/test-utils';
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
useMobileWorkspacePanels,
|
|
19
|
+
type MobileWorkspacePanelsOptions,
|
|
20
|
+
} from '@/client/hooks/workspace/mobile-workspace-panels';
|
|
21
|
+
import type { MobileDrawerReveals } from '@/client/components/mobile/mobile-drawer-reveals';
|
|
22
|
+
import { resetSessionStateStore } from '@/shared/lib/workspace/session-state/store';
|
|
23
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
24
|
+
|
|
25
|
+
let container: HTMLElement | undefined;
|
|
26
|
+
let open: ((folderId: number) => void) | null = null;
|
|
27
|
+
|
|
28
|
+
function drawers(count: { opened: number }): MobileDrawerReveals {
|
|
29
|
+
return {
|
|
30
|
+
right: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
openSessionDrawer: () => {},
|
|
33
|
+
openRightDrawer: () => { count.opened += 1; },
|
|
34
|
+
openNamedPanel: () => {},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function Probe(props: MobileWorkspacePanelsOptions) {
|
|
39
|
+
open = useMobileWorkspacePanels(props);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function mount(options: MobileWorkspacePanelsOptions) {
|
|
44
|
+
container = document.body.appendChild(document.createElement('div'));
|
|
45
|
+
await act(async () => { render(h(Probe, options), container as HTMLElement); });
|
|
46
|
+
await act(async () => {});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
beforeAll(() => {
|
|
50
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
beforeEach(() => {
|
|
54
|
+
resetSessionStateStore();
|
|
55
|
+
open = null;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
afterAll(() => {
|
|
59
|
+
restoreDomGlobals();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
afterEach(() => {
|
|
63
|
+
if (container) render(null, container);
|
|
64
|
+
container?.remove();
|
|
65
|
+
container = undefined;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe('useMobileWorkspacePanels', () => {
|
|
69
|
+
test('a press writes the workspace id and opens the panel drawer', async () => {
|
|
70
|
+
const count = { opened: 0 };
|
|
71
|
+
let screen = 'main';
|
|
72
|
+
let search = '';
|
|
73
|
+
await mount({
|
|
74
|
+
stateSessionId: 'real-1',
|
|
75
|
+
drawers: drawers(count),
|
|
76
|
+
setSearchParams: (next) => {
|
|
77
|
+
const value = typeof next === 'function' ? next(new URLSearchParams()) : next;
|
|
78
|
+
search = String(value);
|
|
79
|
+
},
|
|
80
|
+
setCurrentScreen: (next) => { screen = next; },
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
await act(async () => { open?.(7); });
|
|
84
|
+
|
|
85
|
+
expect(search).toContain('sessionId=workspace-7');
|
|
86
|
+
expect(search).toContain('folderId=7');
|
|
87
|
+
expect(screen).toBe('right');
|
|
88
|
+
expect(count.opened).toBe(0);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('a repeat press on an already-settled workspace reveals the drawer', async () => {
|
|
92
|
+
const count = { opened: 0 };
|
|
93
|
+
await mount({
|
|
94
|
+
stateSessionId: 'workspace-7',
|
|
95
|
+
drawers: drawers(count),
|
|
96
|
+
setSearchParams: () => {},
|
|
97
|
+
setCurrentScreen: () => {},
|
|
98
|
+
});
|
|
99
|
+
// The mount effect is the reload/cold-restore path.
|
|
100
|
+
expect(count.opened).toBe(1);
|
|
101
|
+
|
|
102
|
+
await act(async () => { open?.(7); });
|
|
103
|
+
expect(count.opened).toBe(2);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test('a real session opens nothing on mount', async () => {
|
|
107
|
+
const count = { opened: 0 };
|
|
108
|
+
await mount({
|
|
109
|
+
stateSessionId: 'real-1',
|
|
110
|
+
drawers: drawers(count),
|
|
111
|
+
setSearchParams: () => {},
|
|
112
|
+
setCurrentScreen: () => {},
|
|
113
|
+
});
|
|
114
|
+
expect(count.opened).toBe(0);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The phone's folder-workspace button: write the folder's synthetic session id
|
|
8
|
+
* and bring its panel drawer forward.
|
|
9
|
+
*
|
|
10
|
+
* The drawer is a SCREEN, so the URL write alone is not enough. Two paths open
|
|
11
|
+
* it: the button press (which may be a repeat on the current folder) and a
|
|
12
|
+
* settled session id after a reload or a cold restore. Both seed Files when the
|
|
13
|
+
* folder has never picked a drawer view, because under `tabs` navigation the
|
|
14
|
+
* fallback alone lands on the catalog.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useEffect, useRef } from 'preact/hooks';
|
|
18
|
+
import type { SetSearchParams } from '@/client/lib/router/search-params';
|
|
19
|
+
import { workspaceSessionParams } from '@/client/lib/router/branch-params';
|
|
20
|
+
import type { MobileDrawerReveals, MobileScreen } from '@/client/components/mobile/mobile-drawer-reveals';
|
|
21
|
+
import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
|
|
22
|
+
import { DEFAULT_RIGHT_PANEL_TYPE } from '@/shared/lib/workspace/right-panels';
|
|
23
|
+
import {
|
|
24
|
+
isWorkspaceSessionId,
|
|
25
|
+
workspaceSessionId,
|
|
26
|
+
} from '@/shared/lib/workspace/workspace-session';
|
|
27
|
+
|
|
28
|
+
export interface MobileWorkspacePanelsOptions {
|
|
29
|
+
/** The settled session id from `SessionStateProvider`. */
|
|
30
|
+
stateSessionId: string;
|
|
31
|
+
drawers: MobileDrawerReveals;
|
|
32
|
+
setSearchParams: SetSearchParams;
|
|
33
|
+
setCurrentScreen: (screen: MobileScreen) => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function useMobileWorkspacePanels({
|
|
37
|
+
stateSessionId,
|
|
38
|
+
drawers,
|
|
39
|
+
setSearchParams,
|
|
40
|
+
setCurrentScreen,
|
|
41
|
+
}: MobileWorkspacePanelsOptions): (folderId: number) => void {
|
|
42
|
+
const handleOpenWorkspacePanels = useCallback(
|
|
43
|
+
(folderId: number) => {
|
|
44
|
+
const workspaceId = workspaceSessionId(folderId);
|
|
45
|
+
if (getSessionValue(workspaceId, 'layout.mobileRightPanel') === undefined) {
|
|
46
|
+
setSessionKey(workspaceId, 'layout.mobileRightPanel', DEFAULT_RIGHT_PANEL_TYPE);
|
|
47
|
+
}
|
|
48
|
+
setSearchParams(prev => workspaceSessionParams(prev, folderId), { replace: true });
|
|
49
|
+
if (stateSessionId === workspaceId) drawers.openRightDrawer();
|
|
50
|
+
else setCurrentScreen('right');
|
|
51
|
+
},
|
|
52
|
+
[stateSessionId, drawers, setSearchParams, setCurrentScreen],
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// A workspace session opens on its panels, from a reload or a cold restore:
|
|
56
|
+
// in `tabs` mode the drawer otherwise lands on its catalog. Keyed by the
|
|
57
|
+
// SETTLED session id, not the just-written URL param.
|
|
58
|
+
const revealedRef = useRef<string | null>(null);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (!isWorkspaceSessionId(stateSessionId)) {
|
|
61
|
+
revealedRef.current = null;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (revealedRef.current === stateSessionId) return;
|
|
65
|
+
revealedRef.current = stateSessionId;
|
|
66
|
+
if (getSessionValue(stateSessionId, 'layout.mobileRightPanel') === undefined) {
|
|
67
|
+
setSessionKey(stateSessionId, 'layout.mobileRightPanel', DEFAULT_RIGHT_PANEL_TYPE);
|
|
68
|
+
}
|
|
69
|
+
drawers.openRightDrawer();
|
|
70
|
+
}, [stateSessionId, drawers]);
|
|
71
|
+
|
|
72
|
+
return handleOpenWorkspacePanels;
|
|
73
|
+
}
|