@kabmo-labs/kabmo 0.58.1 → 0.59.1
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-5yedtmnk.js} +3 -3
- package/dist/client/static/js/{CsvGrid-w90pxyn2.js → CsvGrid-39m8pp1c.js} +2 -2
- package/dist/client/static/js/{DocxView-evxn6kaq.js → DocxView-vd99cv12.js} +3 -3
- package/dist/client/static/js/{DrawioView-tmdevwf4.js → DrawioView-6nq4412n.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-bpsn2z9p.js → HtmlPreview-cs51gszy.js} +1 -1
- package/dist/client/static/js/ImageView-nc2n0w6s.js +1 -0
- package/dist/client/static/js/LayoutWrapper-j7786frq.js +2 -0
- package/dist/client/static/js/MergeDiffView-0rn5zsy5.js +1 -0
- package/dist/client/static/js/Modal-7ag7a9qq.js +60 -0
- package/dist/client/static/js/{PdfView-txxn6qff.js → PdfView-0zab721q.js} +1 -1
- package/dist/client/static/js/SessionsView-t9rhx472.js +1 -0
- package/dist/client/static/js/{SheetView-52b33e6f.js → SheetView-2wdn5hkd.js} +11 -11
- package/dist/client/static/js/{SvgPreview-hrk4pfm1.js → SvgPreview-fmrfxd7z.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-at77sybc.js → abnfDiagram-O67JEVCF-41scfh9v.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-fp6etjvt.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-pespk9mt.js} +4 -4
- package/dist/client/static/js/c-0w02jkxb.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-msg9y1c6.js → c4Diagram-YGBWAQC7-rt4z91dx.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-jmrd1h8r.js → classDiagram-v2-NBCMYWYE-6bzaq8sd.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-na65ebq3.js → cose-bilkent-JH36ORCC-z3fhgcba.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-8endeh4p.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-p59f19tv.js → dagre-6A5THRUB-2a2f32dv.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-2e2rcvn7.js → diagram-22UHCM2B-wgbyr6b7.js} +9 -9
- package/dist/client/static/js/{diagram-3UASUU5V-r9ds8vgr.js → diagram-3UASUU5V-5122b41x.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-jgwxv7v8.js → diagram-ATOU4E4O-1gt9fr7e.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-20m35eqq.js → diagram-CDSNMT55-v6hs59jb.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-vt3kxt2m.js → diagram-MLGK6HIB-yey2m5nm.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-c47rgxf1.js → diagram-MPIPVDR6-hg4f3q4d.js} +2 -2
- package/dist/client/static/js/{dockerfile-gtcyey0q.js → dockerfile-56tfnp5r.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-aszw3xy3.js → ebnfDiagram-ZINNZB2B-2mhc9aar.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-wedtvz9y.js} +2 -2
- package/dist/client/static/js/{erDiagram-OPXOYQCR-1hqca8qe.js → erDiagram-OPXOYQCR-1kysnby9.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-vd4z6bvy.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-07v22te5.js → ganttDiagram-FUAMR5RP-j4g65rpm.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-vcwmj4b3.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-1mkn5fbf.js +481 -0
- package/dist/client/static/js/{index-medk4f18.js → index-2h7xh93h.js} +2 -2
- package/dist/client/static/js/{index-fhtnvqgf.js → index-3j2he86h.js} +2 -2
- package/dist/client/static/js/{index-zhgh7a31.js → index-3kedv94b.js} +2 -2
- package/dist/client/static/js/{index-374xq5a4.js → index-42k78whj.js} +1 -1
- package/dist/client/static/js/{index-c9aqx3ht.js → index-42q5gg7t.js} +1 -1
- 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-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-th61y26d.js → index-69mnn71v.js} +2 -2
- package/dist/client/static/js/index-6vbra7p9.js +1 -0
- package/dist/client/static/js/{index-007sewcn.js → index-7enfdvh0.js} +2 -2
- package/dist/client/static/js/{index-gaa39w5q.js → index-8tzt0dek.js} +2 -2
- package/dist/client/static/js/{index-ewryzs4g.js → index-92h38pwg.js} +2 -2
- package/dist/client/static/js/{index-vw8b29ek.js → index-9mgpbwfr.js} +1 -1
- package/dist/client/static/js/{index-80kx6dm6.js → index-a3bpmw2r.js} +2 -2
- package/dist/client/static/js/{index-fv7nybnf.js → index-a70sk36c.js} +2 -2
- package/dist/client/static/js/index-c5401dqs.js +4 -0
- package/dist/client/static/js/{index-xmg1x6zv.js → index-csxnqgzw.js} +5 -5
- package/dist/client/static/js/{index-qefssj0m.js → index-d201jvs9.js} +1 -1
- 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-dbsy29gn.js +2 -0
- package/dist/client/static/js/{index-j830qk07.js → index-dw9epydj.js} +2 -2
- package/dist/client/static/js/{index-s4dpkds5.js → index-e39m185a.js} +2 -2
- package/dist/client/static/js/{index-dxq1tbwm.js → index-fg0ne74z.js} +2 -2
- package/dist/client/static/js/{index-hb7a7m9m.js → index-fnaq8baz.js} +1 -1
- package/dist/client/static/js/{index-tq3t3qm4.js → index-fsa18ns9.js} +2 -2
- package/dist/client/static/js/{index-wxqcnsrq.js → index-fvphmwkf.js} +2 -2
- package/dist/client/static/js/{index-94d416ee.js → index-gajpd90b.js} +2 -2
- package/dist/client/static/js/{index-rxt8sf9a.js → index-h1xbx74w.js} +2 -2
- package/dist/client/static/js/{index-1e0rt7c6.js → index-hgzf4ask.js} +5 -5
- package/dist/client/static/js/{index-wn28m9h7.js → index-hrez92pw.js} +8 -8
- package/dist/client/static/js/{index-zs7kw0be.js → index-jaf968hx.js} +4 -4
- package/dist/client/static/js/{index-sxag9ptg.js → index-jct0jryd.js} +2 -2
- package/dist/client/static/js/{index-5xxbbzqa.js → index-kt77dwsg.js} +7 -7
- package/dist/client/static/js/{index-8d8ce00v.js → index-m62sf9wn.js} +2 -2
- package/dist/client/static/js/{index-6x0kn8pb.js → index-mhrkjbjq.js} +2 -2
- package/dist/client/static/js/index-mttx9327.css +1 -0
- package/dist/client/static/js/{index-1e710snk.js → index-n7bmqeqz.js} +1 -1
- 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-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-nptbz7sv.js → index-pn0ja904.js} +1 -1
- package/dist/client/static/js/{index-azz46nwc.js → index-pr8wsq24.js} +2 -2
- package/dist/client/static/js/{index-7sq6cjt1.js → index-q3k8r0ms.js} +11 -11
- package/dist/client/static/js/{index-an7fq7f6.js → index-qc3de995.js} +1 -1
- package/dist/client/static/js/{index-f61c25vn.js → index-r42f3r1p.js} +3 -3
- package/dist/client/static/js/{index-e4nge3f4.js → index-s7p2wdr1.js} +1 -1
- package/dist/client/static/js/{index-vny4ymjf.js → index-sg65xdey.js} +1 -1
- package/dist/client/static/js/index-skp6991n.js +2 -0
- package/dist/client/static/js/index-spnrx2c0.js +2 -0
- package/dist/client/static/js/{index-fe92hqmb.js → index-sqyvj03y.js} +4 -4
- package/dist/client/static/js/{index-cpp43af3.js → index-tz5ewsza.js} +9 -9
- package/dist/client/static/js/{index-v8xhgfeq.js → index-vs2y8gxr.js} +2 -2
- package/dist/client/static/js/{index-e0kahttb.js → index-vs3g6njv.js} +1 -1
- package/dist/client/static/js/index-wkxsypj1.js +2 -0
- package/dist/client/static/js/{index-gqrt766t.js → index-xqz7bqcn.js} +61 -61
- package/dist/client/static/js/{index-jxsha63v.js → index-y4cx8cqf.js} +2 -2
- package/dist/client/static/js/{index-kzzvrqnv.js → index-y5pkqrga.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-7craq9x2.js} +2 -2
- package/dist/client/static/js/ini-62r3vxaf.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-et6z3c28.js → ishikawaDiagram-OU5B5YK6-ncjty2re.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-yx222bzt.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-a2f84qmn.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-9vfwthw3.js +12 -0
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-530anpc4.js → mindmap-definition-NLK3R4M7-fsxysg6f.js} +4 -4
- package/dist/client/static/js/one-dark-pro-7v4by00h.js +1 -0
- package/dist/client/static/js/one-light-5rfzh8p4.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-77wxmp9g.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-gvgfhez0.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-9zkbt5h8.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-w55bsyw6.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g8sr48h4.js → requirementDiagram-PLB6GJNP-828s1e5g.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-csv5f258.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-t1wbd1hh.js → sankeyDiagram-IPEJSGJF-34f3fyvg.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-nnta2hn0.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-w38zb9ky.js → sizeCapture-INFHLROL-gpcramga.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-3f2en220.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-jgqt12z9.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xx1z57df.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-nq46nzy9.js → timeline-definition-EJHVYXUP-sgchcs11.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-znkg9pkq.js} +15 -15
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-2wemak2p.js → vennDiagram-UO4OBE2U-dncg96ej.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-77xz2d49.js} +4 -4
- package/dist/client/static/js/xml-xs6qz3ya.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9dr05fdq.js → xychartDiagram-PMCCYNJV-40j1aqyf.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/common/session-row/TrailingSlot.tsx +8 -1
- package/src/client/components/common/session-row/index.tsx +4 -0
- package/src/client/components/common/session-row/session-row.test.tsx +5 -0
- 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/RevealRow.tsx +36 -5
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +45 -28
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +10 -3
- package/src/client/components/layout/session-sidebar/modern/index.tsx +2 -0
- package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +28 -1
- 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/CloseButton.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +40 -10
- package/src/client/components/workspace/model-dropdown/Header.tsx +33 -18
- package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -1
- 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 +39 -5
- package/src/client/components/workspace/model-dropdown/index.tsx +20 -47
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +34 -4
- 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
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* The chip the reader actually clicks.
|
|
8
8
|
*
|
|
9
9
|
* The detector and the opener are tested on their own; this pins the wiring
|
|
10
|
-
* between them — that the chat pipeline marks
|
|
11
|
-
*
|
|
12
|
-
* tab, and that a document preview
|
|
13
|
-
* the chat one.
|
|
10
|
+
* between them — that the chat pipeline marks a span only after the workspace
|
|
11
|
+
* confirms its file, that a click (and Enter) reaches the editor, that a
|
|
12
|
+
* finished text selection does not open a tab, and that a document preview
|
|
13
|
+
* keeps its own link rule instead of getting the chat one.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
@@ -18,6 +18,8 @@ import { Window } from 'happy-dom';
|
|
|
18
18
|
import { render } from 'preact';
|
|
19
19
|
import { act } from 'preact/test-utils';
|
|
20
20
|
import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
|
|
21
|
+
import { forgetQuickOpenIndex } from '@/client/hooks/editor/quick-open';
|
|
22
|
+
import { forgetInlineFileVerdicts } from '@/client/hooks/ui/verified-inline-files';
|
|
21
23
|
import { setPluginContext } from '@/client/lib/plugins/context';
|
|
22
24
|
|
|
23
25
|
const DOM_GLOBALS = [
|
|
@@ -25,10 +27,23 @@ const DOM_GLOBALS = [
|
|
|
25
27
|
'Event', 'CustomEvent', 'MouseEvent', 'KeyboardEvent', 'MutationObserver',
|
|
26
28
|
] as const;
|
|
27
29
|
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
30
|
+
const nativeFetch = globalThis.fetch;
|
|
28
31
|
|
|
29
32
|
let win: Window;
|
|
30
33
|
let opened: Array<{ path: string; root?: string }> = [];
|
|
31
34
|
let container: HTMLElement;
|
|
35
|
+
/** Paths the stubbed `/api/fs/exists` reports as present. */
|
|
36
|
+
let existing = new Set<string>();
|
|
37
|
+
/** Rows the stubbed `/api/fs/list` answers, for bare-name resolution. */
|
|
38
|
+
let listed: string[] = [];
|
|
39
|
+
|
|
40
|
+
function jsonResponse(body: unknown, status = 200): Response {
|
|
41
|
+
return {
|
|
42
|
+
ok: status >= 200 && status < 300,
|
|
43
|
+
status,
|
|
44
|
+
json: async () => body,
|
|
45
|
+
} as unknown as Response;
|
|
46
|
+
}
|
|
32
47
|
|
|
33
48
|
beforeAll(() => {
|
|
34
49
|
win = new Window({ url: 'http://localhost' });
|
|
@@ -37,6 +52,17 @@ beforeAll(() => {
|
|
|
37
52
|
nativeGlobals[key] = target[key];
|
|
38
53
|
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
39
54
|
}
|
|
55
|
+
globalThis.fetch = (async (input: string | URL | Request) => {
|
|
56
|
+
const url = new URL(String(input), 'http://localhost');
|
|
57
|
+
if (url.pathname === '/api/fs/exists') {
|
|
58
|
+
const path = url.searchParams.get('path') ?? '';
|
|
59
|
+
return jsonResponse({ exists: existing.has(path), mtimeMs: null });
|
|
60
|
+
}
|
|
61
|
+
if (url.pathname === '/api/fs/list') {
|
|
62
|
+
return jsonResponse({ files: listed.map((path) => ({ path })), truncated: false });
|
|
63
|
+
}
|
|
64
|
+
return jsonResponse({ error: 'not found' }, 404);
|
|
65
|
+
}) as unknown as typeof globalThis.fetch;
|
|
40
66
|
win.addEventListener('omp:open-file', (event) => {
|
|
41
67
|
opened.push((event as unknown as CustomEvent<{ path: string; root?: string }>).detail);
|
|
42
68
|
});
|
|
@@ -48,16 +74,33 @@ afterAll(() => {
|
|
|
48
74
|
if (nativeGlobals[key] === undefined) delete target[key];
|
|
49
75
|
else target[key] = nativeGlobals[key];
|
|
50
76
|
}
|
|
77
|
+
globalThis.fetch = nativeFetch;
|
|
51
78
|
});
|
|
52
79
|
|
|
53
80
|
afterEach(() => {
|
|
54
81
|
render(null, container);
|
|
55
82
|
container.remove();
|
|
56
83
|
opened = [];
|
|
84
|
+
existing = new Set();
|
|
85
|
+
listed = [];
|
|
86
|
+
forgetQuickOpenIndex();
|
|
87
|
+
forgetInlineFileVerdicts();
|
|
57
88
|
setPluginContext(null, null);
|
|
58
89
|
});
|
|
59
90
|
|
|
60
|
-
|
|
91
|
+
/** Let the renderer's verification requests settle, then repaint. */
|
|
92
|
+
async function settle(): Promise<void> {
|
|
93
|
+
await act(async () => {
|
|
94
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
95
|
+
setTimeout(resolve, 0);
|
|
96
|
+
await promise;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function mount(
|
|
101
|
+
content: string,
|
|
102
|
+
options: { document?: boolean; sessionId?: string } = {},
|
|
103
|
+
): Promise<HTMLElement> {
|
|
61
104
|
container = document.createElement('div');
|
|
62
105
|
document.body.appendChild(container);
|
|
63
106
|
setPluginContext(options.sessionId ?? null, '/repo');
|
|
@@ -72,12 +115,14 @@ function mount(content: string, options: { document?: boolean; sessionId?: strin
|
|
|
72
115
|
container,
|
|
73
116
|
);
|
|
74
117
|
});
|
|
118
|
+
await settle();
|
|
75
119
|
return container;
|
|
76
120
|
}
|
|
77
121
|
|
|
78
122
|
describe('inline file chips in the chat timeline', () => {
|
|
79
|
-
test('a path span is marked, and a click opens the file', () => {
|
|
80
|
-
|
|
123
|
+
test('a verified path span is marked, and a click opens the file', async () => {
|
|
124
|
+
existing = new Set(['src/client/App.tsx']);
|
|
125
|
+
const host = await mount('see `src/client/App.tsx:7` for the shell', { sessionId: 's1' });
|
|
81
126
|
const chip = host.querySelector<HTMLElement>('code[data-file-path]');
|
|
82
127
|
expect(chip?.textContent).toBe('src/client/App.tsx:7');
|
|
83
128
|
expect(chip?.getAttribute('data-file-path')).toBe('src/client/App.tsx');
|
|
@@ -92,8 +137,36 @@ describe('inline file chips in the chat timeline', () => {
|
|
|
92
137
|
expect(opened[0].root).toBe('/repo');
|
|
93
138
|
});
|
|
94
139
|
|
|
95
|
-
test('
|
|
96
|
-
|
|
140
|
+
test('a path whose file does not exist stays plain text', async () => {
|
|
141
|
+
existing = new Set(['src/client/App.tsx']);
|
|
142
|
+
const host = await mount('see `src/client/Gone.tsx` and `src/client/App.tsx`', { sessionId: 's1' });
|
|
143
|
+
const chips = host.querySelectorAll<HTMLElement>('code[data-file-path]');
|
|
144
|
+
expect([...chips].map((chip) => chip.getAttribute('data-file-path'))).toEqual(['src/client/App.tsx']);
|
|
145
|
+
expect(host.textContent).toContain('src/client/Gone.tsx');
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('a bare filename resolves through the workspace index', async () => {
|
|
149
|
+
listed = ['src/client/App.tsx'];
|
|
150
|
+
const host = await mount('`App.tsx` is the shell', { sessionId: 's1' });
|
|
151
|
+
const chip = host.querySelector<HTMLElement>('code[data-file-path]');
|
|
152
|
+
expect(chip?.getAttribute('data-file-path')).toBe('App.tsx');
|
|
153
|
+
|
|
154
|
+
act(() => {
|
|
155
|
+
chip!.dispatchEvent(new win.MouseEvent('click', { bubbles: true }) as unknown as Event);
|
|
156
|
+
});
|
|
157
|
+
await settle();
|
|
158
|
+
|
|
159
|
+
expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test('a bare filename with no index match stays plain text', async () => {
|
|
163
|
+
const host = await mount('`Missing.tsx` never existed', { sessionId: 's1' });
|
|
164
|
+
expect(host.querySelectorAll('code[data-file-path]')).toHaveLength(0);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
test('Enter on a focused chip opens it', async () => {
|
|
168
|
+
existing = new Set(['src/client/App.tsx']);
|
|
169
|
+
const host = await mount('`src/client/App.tsx`', { sessionId: 's1' });
|
|
97
170
|
const chip = host.querySelector<HTMLElement>('code[data-file-path]')!;
|
|
98
171
|
|
|
99
172
|
act(() => {
|
|
@@ -103,8 +176,9 @@ describe('inline file chips in the chat timeline', () => {
|
|
|
103
176
|
expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
|
|
104
177
|
});
|
|
105
178
|
|
|
106
|
-
test('a click that finishes a text selection does not open a tab', () => {
|
|
107
|
-
|
|
179
|
+
test('a click that finishes a text selection does not open a tab', async () => {
|
|
180
|
+
existing = new Set(['src/client/App.tsx']);
|
|
181
|
+
const host = await mount('`src/client/App.tsx`', { sessionId: 's1' });
|
|
108
182
|
const chip = host.querySelector<HTMLElement>('code[data-file-path]')!;
|
|
109
183
|
const range = document.createRange();
|
|
110
184
|
range.selectNodeContents(chip);
|
|
@@ -119,13 +193,14 @@ describe('inline file chips in the chat timeline', () => {
|
|
|
119
193
|
expect(opened).toEqual([]);
|
|
120
194
|
});
|
|
121
195
|
|
|
122
|
-
test('ordinary inline code stays plain text', () => {
|
|
123
|
-
const host = mount('`bun test` and `state.user.id`', { sessionId: 's1' });
|
|
196
|
+
test('ordinary inline code stays plain text', async () => {
|
|
197
|
+
const host = await mount('`bun test` and `state.user.id`', { sessionId: 's1' });
|
|
124
198
|
expect(host.querySelectorAll('code[data-file-path]')).toHaveLength(0);
|
|
125
199
|
});
|
|
126
200
|
|
|
127
|
-
test('a document preview is not the chat: its inline code is not marked', () => {
|
|
128
|
-
|
|
201
|
+
test('a document preview is not the chat: its inline code is not marked', async () => {
|
|
202
|
+
existing = new Set(['src/client/App.tsx']);
|
|
203
|
+
const host = await mount('`src/client/App.tsx`', { sessionId: 's1', document: true });
|
|
129
204
|
expect(host.querySelectorAll('code[data-file-path]')).toHaveLength(0);
|
|
130
205
|
});
|
|
131
206
|
});
|
|
@@ -184,6 +184,51 @@ describe('session menu export markdown', () => {
|
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
+
describe('session menu pin', () => {
|
|
188
|
+
test('a real session offers Pin this session and posts the toggle', async () => {
|
|
189
|
+
stubHarnesses([]);
|
|
190
|
+
const el = await mount('claude');
|
|
191
|
+
const item = [...el.querySelectorAll('[role="menuitem"]')]
|
|
192
|
+
.find((node) => node.textContent?.trim() === 'Pin this session') as HTMLElement | undefined;
|
|
193
|
+
expect(item).toBeDefined();
|
|
194
|
+
|
|
195
|
+
const calls: { url: string; body: unknown }[] = [];
|
|
196
|
+
globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
197
|
+
calls.push({ url: String(input), body: init?.body });
|
|
198
|
+
return new Response(JSON.stringify({ success: true }), { status: 200 });
|
|
199
|
+
}) as typeof fetch;
|
|
200
|
+
|
|
201
|
+
await act(async () => {
|
|
202
|
+
item!.click();
|
|
203
|
+
for (let i = 0; i < 5; i += 1) await Promise.resolve();
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
expect(calls[0]?.url).toBe('/api/sessions/s1/pin');
|
|
207
|
+
expect(calls[0]?.body).toBeInstanceOf(FormData);
|
|
208
|
+
expect((calls[0]?.body as FormData).get('pinned')).toBe('true');
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
test('a pending chat offers no pin', async () => {
|
|
212
|
+
stubHarnesses([]);
|
|
213
|
+
render(null, container);
|
|
214
|
+
await act(async () => {
|
|
215
|
+
render(
|
|
216
|
+
h(SessionActionsMenu, {
|
|
217
|
+
anchor,
|
|
218
|
+
sessionId: 'new-123',
|
|
219
|
+
harness: 'claude',
|
|
220
|
+
folderId: 1,
|
|
221
|
+
onClose: () => {},
|
|
222
|
+
}),
|
|
223
|
+
container,
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
const labels = [...document.body.querySelectorAll('[role="menuitem"]')]
|
|
227
|
+
.map((node) => node.textContent?.trim());
|
|
228
|
+
expect(labels).not.toContain('Pin this session');
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
187
232
|
describe('session menu placement', () => {
|
|
188
233
|
test('the panel hangs below the trigger it was opened from', async () => {
|
|
189
234
|
// A trailing `⋯` in the middle of a phone drawer: below it is where the
|
|
@@ -29,10 +29,11 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'preac
|
|
|
29
29
|
import type { TargetedMouseEvent } from 'preact';
|
|
30
30
|
import { createPortal } from 'preact/compat';
|
|
31
31
|
import { placeMenu, type MenuPlacement } from '@/shared/lib/ui/menu-anchor';
|
|
32
|
-
import { Archive, ArchiveRestore, Copy, Download, GitBranch, GitFork, Hourglass, Pencil, Trash2, WandSparkles } from 'lucide-preact';
|
|
32
|
+
import { Archive, ArchiveRestore, Copy, Download, GitBranch, GitFork, Hourglass, Pencil, Pin, PinOff, Trash2, WandSparkles } from 'lucide-preact';
|
|
33
33
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
34
34
|
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
35
35
|
import { startPendingSession } from '@/client/hooks/chat/omp/pending-sessions';
|
|
36
|
+
import { useSessionPin } from '@/client/hooks/workspace/session-pin';
|
|
36
37
|
import { expandSessionBranch } from '@/client/hooks/workspace/expanded-sessions';
|
|
37
38
|
import { setHarnessPick } from '@/client/hooks/chat/timeline/session-harness';
|
|
38
39
|
import { formatNewSessionTitle } from '@kabmo-labs/kabmo-omp/session-core/default-title';
|
|
@@ -138,6 +139,7 @@ export function SessionActionsMenu({
|
|
|
138
139
|
const [, setSearchParams] = useSearchParams();
|
|
139
140
|
const { harnesses } = useHarnesses();
|
|
140
141
|
const { pushToast } = useToasts();
|
|
142
|
+
const pin = useSessionPin(sessionId);
|
|
141
143
|
const canSpawnChild =
|
|
142
144
|
sessionId !== undefined &&
|
|
143
145
|
!String(sessionId).startsWith('new-') &&
|
|
@@ -320,6 +322,9 @@ export function SessionActionsMenu({
|
|
|
320
322
|
{canExport && (
|
|
321
323
|
<MenuItem icon={Download} label="Export markdown" onClick={run(exportMarkdown)} />
|
|
322
324
|
)}
|
|
325
|
+
{pin.canPin && (
|
|
326
|
+
<MenuItem icon={pin.isPinned ? PinOff : Pin} label={pin.isPinned ? 'Unpin this session' : 'Pin this session'} onClick={run(pin.toggle)} />
|
|
327
|
+
)}
|
|
323
328
|
{/* A held prompt is the row's whole content, so dropping it belongs in
|
|
324
329
|
the same menu as the row's other verbs rather than on the row face. */}
|
|
325
330
|
{onCancelWait && (
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
* same x as the sort icon's right edge, and on hover the dots take its place on
|
|
29
29
|
* that line. The list's content edge is the action row's (`.session-list-gutter`
|
|
30
30
|
* in `tailwind.css`), so no scrollbar-width correction belongs here.
|
|
31
|
+
*
|
|
32
|
+
* Touch is the exception: with no hover to swap the two, the age takes the
|
|
33
|
+
* workspace header's `+` column and the trigger keeps its `⋯` column, so the
|
|
34
|
+
* age's right edge lands on the plus button's right edge. Desktop keeps the
|
|
35
|
+
* shared box above, where the age and the dots occupy the SAME column.
|
|
31
36
|
*/
|
|
32
37
|
|
|
33
38
|
import type { TargetedMouseEvent } from 'preact';
|
|
@@ -104,7 +109,9 @@ export function TrailingSlot({
|
|
|
104
109
|
// The box is as wide as the age, never a fixed 32px: `12 Sep` is 36px at
|
|
105
110
|
// 10px mono, and a fixed box wrapped it into two lines (`12` / `Sep`).
|
|
106
111
|
// `min-w-8` keeps the 22px trigger's box inside the column, and the age
|
|
107
|
-
// stays in flow so the title truncates before it instead of under it.
|
|
112
|
+
// stays in flow so the title truncates before it instead of under it. The
|
|
113
|
+
// trigger is overlaid on the SAME column: on hover the age fades and the
|
|
114
|
+
// dots take its place without moving the column.
|
|
108
115
|
<span className="relative ml-2 flex h-4 min-w-8 shrink-0 items-center justify-end pr-1">
|
|
109
116
|
{timeNode(
|
|
110
117
|
'whitespace-nowrap font-mono text-[10px] leading-none transition-opacity group-hover/item:opacity-0 group-focus-within/item:opacity-0',
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
* on that line. `WorkspaceHeader` states the same inset; the row and the header
|
|
41
41
|
* move together.
|
|
42
42
|
*
|
|
43
|
+
* Touch has no hover to swap the two, so there the age gets the header's `+`
|
|
44
|
+
* column and the trigger keeps `⋯`: its right edge lands on the plus button's
|
|
45
|
+
* right edge instead (see `TrailingSlot`). Desktop keeps the shared box above.
|
|
46
|
+
*
|
|
43
47
|
* ## The touch row is exactly as tall as the folder header
|
|
44
48
|
*
|
|
45
49
|
* `h-8` — 32px — is the workspace header's height on touch (`WorkspaceHeader`),
|
|
@@ -173,6 +173,11 @@ describe('modern session row', () => {
|
|
|
173
173
|
const age = trailing.querySelector('span.font-mono') as HTMLElement;
|
|
174
174
|
expect(age.className).toContain('min-w-7');
|
|
175
175
|
expect(age.className).toContain('text-right');
|
|
176
|
+
// The age is immediately BEFORE the trigger, 2px apart: its right edge is
|
|
177
|
+
// the trigger's left edge minus the header's cluster gap, i.e. the plus
|
|
178
|
+
// button's right edge. That alignment is touch-only; desktop overlays the
|
|
179
|
+
// age and trigger in one column.
|
|
180
|
+
expect(age.nextElementSibling).toBe(trailing.querySelector('[aria-label="Session actions"]'));
|
|
176
181
|
});
|
|
177
182
|
|
|
178
183
|
test('a leaf touch row reserves the chevron column for its age and actions', async () => {
|
|
@@ -84,6 +84,8 @@ export interface RightColumnProps {
|
|
|
84
84
|
openRequest?: { panelKey: string; nonce: number } | null;
|
|
85
85
|
/** The strip's trailing actions (refresh, collapse). */
|
|
86
86
|
actions?: ReactNode;
|
|
87
|
+
/** Width transition duration; 0 while the group itself is resizing. */
|
|
88
|
+
transitionMs?: number;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
export function RightColumn({
|
|
@@ -106,6 +108,7 @@ export function RightColumn({
|
|
|
106
108
|
onSelectPanel,
|
|
107
109
|
openRequest,
|
|
108
110
|
actions,
|
|
111
|
+
transitionMs,
|
|
109
112
|
}: RightColumnProps) {
|
|
110
113
|
// The right column is a destination too: a panel dragged from the left rail
|
|
111
114
|
// must land where it was dropped, not bounce back because only the 44px rail
|
|
@@ -265,7 +268,7 @@ export function RightColumn({
|
|
|
265
268
|
);
|
|
266
269
|
|
|
267
270
|
return (
|
|
268
|
-
<Panel panelRef={panelRef} id="right-panel" defaultSize={width} minSize={minWidth} maxSize={maxWidth} collapsed={!open}>
|
|
271
|
+
<Panel panelRef={panelRef} id="right-panel" defaultSize={width} minSize={minWidth} maxSize={maxWidth} collapsed={!open} transitionMs={transitionMs}>
|
|
269
272
|
<div
|
|
270
273
|
className={`w-full h-full ${rightDrop.active ? 'ring-1 ring-inset ring-ink/30' : ''}`}
|
|
271
274
|
{...rightDrop.dropProps}
|
|
@@ -13,6 +13,7 @@ import { ResizeHandle } from '@/client/components/layout/desktop-layout/ResizeHa
|
|
|
13
13
|
import { RightColumn } from '@/client/components/layout/desktop-layout/RightColumn';
|
|
14
14
|
import type { PanelNavStyle } from '@/shared/lib/workspace/panel-nav';
|
|
15
15
|
import { useAvailableWidth } from '@/client/hooks/workspace/available-width';
|
|
16
|
+
import { readPanelWidths, useSnapResize } from '@/client/hooks/workspace/panel-resize';
|
|
16
17
|
import {
|
|
17
18
|
HANDLE_WIDTH,
|
|
18
19
|
MIN_EDITOR_PANEL_WIDTH,
|
|
@@ -155,6 +156,9 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
155
156
|
// not area any panel may take.
|
|
156
157
|
const groupRef = useRef<HTMLDivElement>(null);
|
|
157
158
|
const available = useAvailableWidth(groupRef);
|
|
159
|
+
// A panel follows the group instantly while the area or the width mode is
|
|
160
|
+
// moving, instead of re-targeting its 200ms transition on every tick.
|
|
161
|
+
const snapResize = useSnapResize(available, chatHidden);
|
|
158
162
|
|
|
159
163
|
// ONE catalog for both kinds of panel. The list is memoised per render pass
|
|
160
164
|
// and the components inside it are `lazy()` at module scope, so switching the
|
|
@@ -210,35 +214,6 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
210
214
|
onRightPanelSuppressed?.(available == null || available <= 0 ? null : rightSuppressed);
|
|
211
215
|
}, [available, rightSuppressed, onRightPanelSuppressed]);
|
|
212
216
|
|
|
213
|
-
/**
|
|
214
|
-
* Widths of the fixed panels as they are right now, keyed by slot: the
|
|
215
|
-
* editor (source or diff, whichever is showing) and the right panel under
|
|
216
|
-
* the view it currently holds. The chat column is the group's filler, so it
|
|
217
|
-
* has no width of its own to report.
|
|
218
|
-
*
|
|
219
|
-
* Each is stored as a share of the area it was measured in, so the layout
|
|
220
|
-
* follows a window resize instead of holding a pixel value that was only
|
|
221
|
-
* right on the display it was dragged on.
|
|
222
|
-
*/
|
|
223
|
-
const readPanelWidths = (): PanelWidths => {
|
|
224
|
-
const patch: PanelWidths = {};
|
|
225
|
-
const editor = editorPanelRef.current?.getSize()?.inPixels;
|
|
226
|
-
const right = rightPanelRef.current?.getSize()?.inPixels;
|
|
227
|
-
// With the chat hidden the editor's width is whatever is left over, not a
|
|
228
|
-
// choice — persisting it would overwrite the width the user set for the
|
|
229
|
-
// ordinary layout with the one this mode produced. A drag made here still
|
|
230
|
-
// moves the RIGHT panel, which is the width that was actually chosen.
|
|
231
|
-
if (!chatHidden && editor != null && editor > 0) {
|
|
232
|
-
patch[editorWidthMode] = { px: Math.round(editor), ...(available ? { fraction: editor / available } : {}) };
|
|
233
|
-
}
|
|
234
|
-
if (right != null && right > 0) {
|
|
235
|
-
patch.right = {
|
|
236
|
-
[shownRightPanel]: { px: Math.round(right), ...(available ? { fraction: right / available } : {}) },
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
return patch;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
217
|
return (
|
|
243
218
|
<div className="flex flex-1 overflow-hidden">
|
|
244
219
|
<Group
|
|
@@ -250,15 +225,16 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
250
225
|
// Persist only real drags: imperative restores and constraint
|
|
251
226
|
// recomputes would otherwise rewrite the saved widths with the
|
|
252
227
|
// clamped sizes they just derived from them.
|
|
253
|
-
onPanelWidths(
|
|
228
|
+
onPanelWidths(
|
|
229
|
+
readPanelWidths({ editorPanelRef, rightPanelRef, available, chatHidden, editorWidthMode, shownRightPanel }),
|
|
230
|
+
);
|
|
254
231
|
}}
|
|
255
232
|
>
|
|
256
233
|
<Panel
|
|
257
234
|
id="center-panel"
|
|
258
235
|
filler
|
|
259
|
-
// Collapsed — not unmounted — in compact/full view: the chat holds the
|
|
260
|
-
//
|
|
261
|
-
// document must not discard any of them.
|
|
236
|
+
// Collapsed — not unmounted — in compact/full view: the chat holds the live
|
|
237
|
+
// run, the composer draft and the scroll position across a widening.
|
|
262
238
|
collapsed={chatHidden}
|
|
263
239
|
minSize={fillerMinWidth({
|
|
264
240
|
available,
|
|
@@ -273,9 +249,25 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
273
249
|
<ChatTimeline className="w-full h-full" appSettings={appSettings} onSessionTitle={onSessionTitle} />
|
|
274
250
|
</div>
|
|
275
251
|
</Panel>
|
|
276
|
-
|
|
277
252
|
{showEditor && !chatHidden && <ResizeHandle />}
|
|
278
|
-
<Panel
|
|
253
|
+
<Panel
|
|
254
|
+
panelRef={editorPanelRef}
|
|
255
|
+
id="editor-panel"
|
|
256
|
+
defaultSize={editorWidth}
|
|
257
|
+
minSize={MIN_EDITOR_PANEL_WIDTH}
|
|
258
|
+
maxSize={editorMaxSize}
|
|
259
|
+
collapsed={!showEditor}
|
|
260
|
+
// With the chat collapsed the editor is the surface that takes the
|
|
261
|
+
// freed width, so it becomes the group's filler instead of chasing
|
|
262
|
+
// the leftover through a px width. A px width here animated from the
|
|
263
|
+
// old value to the new one while the chat was already 0, which left
|
|
264
|
+
// the right panel parked mid-row and slid it back as the editor
|
|
265
|
+
// caught up — the jump this replaces. As a filler it STRETCHES in the
|
|
266
|
+
// same layout pass: no intermediate gap, no re-applied width, and the
|
|
267
|
+
// right panel never leaves the right edge.
|
|
268
|
+
filler={chatHidden}
|
|
269
|
+
transitionMs={snapResize ? 0 : undefined}
|
|
270
|
+
>
|
|
279
271
|
<div className="flex w-full h-full" {...drop.dropProps} {...drop.captureDropProps}>
|
|
280
272
|
<EditorDropOverlay visible={drop.isDragging} />
|
|
281
273
|
<EditorPluginRail
|
|
@@ -313,6 +305,7 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
313
305
|
{rightPanelShown && <ResizeHandle />}
|
|
314
306
|
<RightColumn
|
|
315
307
|
panelRef={rightPanelRef}
|
|
308
|
+
transitionMs={snapResize ? 0 : undefined}
|
|
316
309
|
open={rightPanelShown}
|
|
317
310
|
width={rightWidth}
|
|
318
311
|
minWidth={rightPanelMin}
|
|
@@ -31,6 +31,7 @@ import { useCopyTabPath } from '@/client/hooks/workspace/copy-tab-path';
|
|
|
31
31
|
import { useRightSideLayout, type RightSideLayout } from '@/client/hooks/workspace/right-side';
|
|
32
32
|
import { useActiveWorkspaceProject } from '@/client/hooks/workspace/active-project';
|
|
33
33
|
import { useRightPanelPresence } from '@/client/hooks/workspace/right-panel-presence';
|
|
34
|
+
import { useWorkspacePanelsMode } from '@/client/hooks/workspace/workspace-panels-mode';
|
|
34
35
|
|
|
35
36
|
interface DesktopLayoutProps {
|
|
36
37
|
sessionId: string | null;
|
|
@@ -76,7 +77,7 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
|
|
|
76
77
|
// The workspace the session belongs to, its root, and whether one exists —
|
|
77
78
|
// one hook, because a worktree session reading its folder's path is how the
|
|
78
79
|
// panels ended up on the wrong checkout.
|
|
79
|
-
const { path: activeProjectPath, hasActiveContext } = useActiveWorkspaceProject(folders, sessionId);
|
|
80
|
+
const { folder: activeProjectFolder, path: activeProjectPath, hasActiveContext } = useActiveWorkspaceProject(folders, sessionId);
|
|
80
81
|
|
|
81
82
|
// Opening a file must show the column (and the side it lives on). The hook
|
|
82
83
|
// that owns that flag is built below, after the tab list exists — a tab is
|
|
@@ -126,6 +127,7 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
|
|
|
126
127
|
});
|
|
127
128
|
rightSideRef.current = rightSide;
|
|
128
129
|
const { showRightPanel, showEditor } = rightSide;
|
|
130
|
+
const workspace = useWorkspacePanelsMode({ sessionId, revealPanel: rightSide.revealRightPanel, requestPanel: requestRightPanel });
|
|
129
131
|
// ONE flag for the whole side, read by the navbar's control AND by the rail:
|
|
130
132
|
// a second "is anything visible" spelling would let the button read one state
|
|
131
133
|
// while the rail draws another.
|
|
@@ -283,14 +285,14 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
|
|
|
283
285
|
<main className="flex flex-col h-full">
|
|
284
286
|
<PluginBootstrap workspacePath={activeProjectPath} />
|
|
285
287
|
<TopNavbar
|
|
286
|
-
sessionTitle={sessionTitle}
|
|
288
|
+
sessionTitle={workspace.active ? activeProjectFolder?.name ?? null : sessionTitle}
|
|
287
289
|
sessionId={sessionId}
|
|
288
290
|
showLeftPanel={sidebarOpen}
|
|
289
291
|
showRightSide={rightSideShown && rightPanel.sideVisible}
|
|
290
292
|
streamStatus={streamStatus}
|
|
291
293
|
onToggleRightSide={rightPanel.toggle}
|
|
292
294
|
onToggleLeftPanel={() => handleToggleLeftPanel(!sidebarOpen)}
|
|
293
|
-
sessionActions={sessionActions}
|
|
295
|
+
sessionActions={workspace.active ? undefined : sessionActions}
|
|
294
296
|
/>
|
|
295
297
|
|
|
296
298
|
<WorkspacePanels
|
|
@@ -115,13 +115,20 @@ export function Panel(props: {
|
|
|
115
115
|
* the movement instead of the content popping in.
|
|
116
116
|
*/
|
|
117
117
|
collapsed?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Width transition duration in ms. 0 makes the panel follow a live container
|
|
120
|
+
* resize instantly instead of re-targeting the same 200ms animation on every
|
|
121
|
+
* observer tick (which lags the container and then overshoots as the other
|
|
122
|
+
* flexible panel gives the difference back).
|
|
123
|
+
*/
|
|
124
|
+
transitionMs?: number;
|
|
118
125
|
/** This panel absorbs the remaining space instead of holding its own px. */
|
|
119
126
|
filler?: boolean;
|
|
120
127
|
className?: string;
|
|
121
128
|
style?: CSSProperties;
|
|
122
129
|
children: ComponentChildren;
|
|
123
130
|
}) {
|
|
124
|
-
const { id, panelRef, defaultSize, minSize = 0, maxSize, collapsed = false, filler = false, className, style, children } = props;
|
|
131
|
+
const { id, panelRef, defaultSize, minSize = 0, maxSize, collapsed = false, transitionMs = 200, filler = false, className, style, children } = props;
|
|
125
132
|
const group = useContext(GroupContext);
|
|
126
133
|
if (!group) {
|
|
127
134
|
throw new Error(`<Panel id="${id}"> must be rendered inside a <Group>`);
|
|
@@ -181,12 +188,15 @@ export function Panel(props: {
|
|
|
181
188
|
}, [id]);
|
|
182
189
|
|
|
183
190
|
// Constraints can change between renders (e.g. the right panel's min per
|
|
184
|
-
// view); refresh the registry entry every render.
|
|
191
|
+
// view); refresh the registry entry every render. `isFiller` belongs here
|
|
192
|
+
// too: the editor column becomes the group's filler in compact/full view, and
|
|
193
|
+
// a stale flag would let a drag write a px size to a panel flexbox is sizing.
|
|
185
194
|
useEffect(() => {
|
|
186
195
|
const state = panels.current.get(id);
|
|
187
196
|
if (state) {
|
|
188
197
|
state.minSize = minPx;
|
|
189
198
|
state.maxSize = maxPx;
|
|
199
|
+
state.isFiller = filler;
|
|
190
200
|
}
|
|
191
201
|
});
|
|
192
202
|
|
|
@@ -246,7 +256,7 @@ export function Panel(props: {
|
|
|
246
256
|
// read as one movement. It also carries a panel to its remembered width
|
|
247
257
|
// on a view switch, and to zero on collapse, instead of snapping.
|
|
248
258
|
transition: transitionReady
|
|
249
|
-
? `${orientation === 'horizontal' ? 'width' : 'height'}
|
|
259
|
+
? `${orientation === 'horizontal' ? 'width' : 'height'} ${transitionMs}ms cubic-bezier(0.22, 1, 0.36, 1)`
|
|
250
260
|
: 'none',
|
|
251
261
|
overflow: 'hidden',
|
|
252
262
|
position: 'relative',
|
|
@@ -110,6 +110,47 @@ async function mount() {
|
|
|
110
110
|
stubLayout();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
describe('panel sizing', () => {
|
|
114
|
+
test('a panel switched to the filler stretches in place, and keeps its node and width on return', async () => {
|
|
115
|
+
// The editor column takes the freed chat width by BECOMING the group's
|
|
116
|
+
// filler (compact/full view). A filler is sized by flexbox, so its own px
|
|
117
|
+
// width must be dropped; switching back must restore the remembered width.
|
|
118
|
+
// Both happen on the mounted panel: the style switch must not lose the node
|
|
119
|
+
// or the remembered width (a remount here would be a visible rebuild).
|
|
120
|
+
const Layout = ({ filler }: { filler: boolean }) =>
|
|
121
|
+
h(Group, {
|
|
122
|
+
orientation: 'horizontal',
|
|
123
|
+
children: [
|
|
124
|
+
h(Panel, { key: 'chat', id: 'chat', filler: true, collapsed: true, children: h('div', null, 'chat') }),
|
|
125
|
+
h(Panel, { key: 'editor', id: 'editor', defaultSize: 200, filler, children: h('div', null, 'editor') }),
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
130
|
+
container = document.createElement('div');
|
|
131
|
+
document.body.appendChild(container);
|
|
132
|
+
await act(async () => {
|
|
133
|
+
render(h(Layout, { filler: false }), container);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const editor = container.querySelector<HTMLElement>('[data-panel-id="editor"]');
|
|
137
|
+
expect(editor).not.toBeNull();
|
|
138
|
+
expect(widthOf('editor')).toBe(200);
|
|
139
|
+
|
|
140
|
+
await act(async () => {
|
|
141
|
+
render(h(Layout, { filler: true }), container);
|
|
142
|
+
});
|
|
143
|
+
expect(container.querySelector('[data-panel-id="editor"]')).toBe(editor);
|
|
144
|
+
expect(editor!.style.width).toBe('');
|
|
145
|
+
|
|
146
|
+
await act(async () => {
|
|
147
|
+
render(h(Layout, { filler: false }), container);
|
|
148
|
+
});
|
|
149
|
+
expect(container.querySelector('[data-panel-id="editor"]')).toBe(editor);
|
|
150
|
+
expect(widthOf('editor')).toBe(200);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
113
154
|
describe('separator drag commit', () => {
|
|
114
155
|
test('the reported layout is the width the panel rendered, not the pre-drag one', async () => {
|
|
115
156
|
await mount();
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { useRef, useState } from 'preact/hooks';
|
|
18
|
-
import { ChevronDown, ChevronRight, MoreHorizontal, Pin, Plus } from 'lucide-preact';
|
|
18
|
+
import { ChevronDown, ChevronRight, FolderOpen, MoreHorizontal, Pin, Plus } from 'lucide-preact';
|
|
19
19
|
import { AnchoredMenu } from '@/client/components/common/anchored-menu';
|
|
20
20
|
import { anchorRectOf, type AnchorRect } from '@/shared/lib/ui/menu-anchor';
|
|
21
21
|
import { NewWorktreeModal } from '@/client/components/workspace/worktree-modal/index';
|
|
@@ -23,6 +23,7 @@ import { SelectionCheckbox } from '@/client/components/common/batch-selection/Se
|
|
|
23
23
|
import { WorkspaceOptionsMenu } from '@/client/components/common/workspace-options-menu';
|
|
24
24
|
import { getProjectIcon } from '@/shared/lib/workspace/project-icon';
|
|
25
25
|
import { projectAccentStyle } from '@/shared/lib/workspace/project-accent';
|
|
26
|
+
import { PRESSED_TOGGLE_CLASS } from '@/client/lib/ui/pressed';
|
|
26
27
|
import type { WorkspaceFolderData } from '@/shared/types';
|
|
27
28
|
|
|
28
29
|
export interface CategoryHeaderCheckbox {
|
|
@@ -45,6 +46,10 @@ export interface CategoryHeaderProps {
|
|
|
45
46
|
/** Close the `⋯` menu (backdrop, Escape, or a parent that moved on). */
|
|
46
47
|
onCloseMenu: () => void;
|
|
47
48
|
onNewSession: () => void;
|
|
49
|
+
/** Open this folder's workspace: its panels, grouped under a per-folder id. */
|
|
50
|
+
onOpenWorkspacePanels: () => void;
|
|
51
|
+
/** The URL is already on this folder's workspace session. */
|
|
52
|
+
workspaceActive?: boolean;
|
|
48
53
|
/** Start a chat in a worktree made from this folder. */
|
|
49
54
|
onNewWorktreeSession?: (folderId: number, worktreePath: string) => void;
|
|
50
55
|
onOpenFolder?: () => void;
|
|
@@ -66,6 +71,8 @@ export function CategoryHeader({
|
|
|
66
71
|
onToggleMenu,
|
|
67
72
|
onCloseMenu,
|
|
68
73
|
onNewSession,
|
|
74
|
+
onOpenWorkspacePanels,
|
|
75
|
+
workspaceActive = false,
|
|
69
76
|
onNewWorktreeSession,
|
|
70
77
|
onOpenFolder,
|
|
71
78
|
onSelectSessions,
|
|
@@ -146,6 +153,19 @@ export function CategoryHeader({
|
|
|
146
153
|
a checkbox is a second thing the click could mean. */}
|
|
147
154
|
{!batchActive && (
|
|
148
155
|
<div className="flex items-center space-x-0.5 pl-1">
|
|
156
|
+
<button
|
|
157
|
+
type="button"
|
|
158
|
+
title={`Workspace panels for ${folder.name}`}
|
|
159
|
+
aria-label={`Open workspace panels for ${folder.name}`}
|
|
160
|
+
aria-pressed={workspaceActive}
|
|
161
|
+
className={`w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-colors ${
|
|
162
|
+
workspaceActive ? PRESSED_TOGGLE_CLASS : 'text-ink/40 hover:text-ink hover:bg-ink/10'
|
|
163
|
+
}`}
|
|
164
|
+
onClick={(e) => { e.stopPropagation(); onOpenWorkspacePanels(); }}
|
|
165
|
+
>
|
|
166
|
+
<FolderOpen size={12} />
|
|
167
|
+
</button>
|
|
168
|
+
|
|
149
169
|
{/* `aria-label` as well as `title`, like the phone's row: the button
|
|
150
170
|
is icon-only, so `title` alone leaves it unnamed to assistive tech
|
|
151
171
|
and to `getByRole` — and naming the FOLDER is what tells this
|