@kabmo-labs/kabmo 0.58.0 → 0.58.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 +457 -444
- package/dist/client/static/js/{Body-karkrzkc.js → Body-ysmhxbvk.js} +3 -3
- package/dist/client/static/js/{CsvGrid-j03knmbe.js → CsvGrid-w90pxyn2.js} +1 -1
- package/dist/client/static/js/{DocxView-e8408vzs.js → DocxView-evxn6kaq.js} +1 -1
- package/dist/client/static/js/{DrawioView-fj4mfzch.js → DrawioView-tmdevwf4.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-9g8xwzgw.js → HtmlPreview-bpsn2z9p.js} +1 -1
- package/dist/client/static/js/{ImageView-sz4fzz9k.js → ImageView-ssazqckj.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-q6q4h04a.js → LayoutWrapper-qwpfq4dq.js} +2 -2
- package/dist/client/static/js/MergeDiffView-en6aazw8.js +1 -0
- package/dist/client/static/js/{Modal-ahecatp5.js → Modal-zjnhj9nb.js} +19 -19
- package/dist/client/static/js/{PdfView-8jtdx5hd.js → PdfView-txxn6qff.js} +1 -1
- package/dist/client/static/js/{SessionsView-jwp8xvw5.js → SessionsView-eryjtmb2.js} +1 -1
- package/dist/client/static/js/{SheetView-hwx8s864.js → SheetView-52b33e6f.js} +1 -1
- package/dist/client/static/js/{SvgPreview-ete36nzv.js → SvgPreview-hrk4pfm1.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-7nsqzz6z.js → abnfDiagram-O67JEVCF-at77sybc.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xvpkfq2f.js → architectureDiagram-NJMV4G6O-raw33jgg.js} +3 -3
- package/dist/client/static/js/{astro-rsrqgjjx.js → astro-qha7sceh.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-0saahcs6.js → blockDiagram-BEXU5L5S-b6e90fbk.js} +6 -6
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-ktpqnb4a.js → c4Diagram-YGBWAQC7-msg9y1c6.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-x67cz3ms.js → classDiagram-v2-NBCMYWYE-jmrd1h8r.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-9wzmhkz8.js → cose-bilkent-JH36ORCC-na65ebq3.js} +1 -1
- package/dist/client/static/js/css-q2k6afe3.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dmmgmv99.js → cynefinDiagram-VND7K2PF-9xkkw71m.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-ygkkms1t.js → dagre-6A5THRUB-p59f19tv.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-qxj0pqb4.js → diagram-22UHCM2B-2e2rcvn7.js} +8 -8
- package/dist/client/static/js/{diagram-3UASUU5V-77k8w5dt.js → diagram-3UASUU5V-r9ds8vgr.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-m0h86vf4.js → diagram-ATOU4E4O-jgwxv7v8.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-5v28kaeg.js → diagram-CDSNMT55-20m35eqq.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-zgcg9gaz.js → diagram-MLGK6HIB-vt3kxt2m.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-10c9s6e6.js → diagram-MPIPVDR6-c47rgxf1.js} +1 -1
- package/dist/client/static/js/{dockerfile-dr9sdsqp.js → dockerfile-gtcyey0q.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mz4022dz.js → ebnfDiagram-ZINNZB2B-aszw3xy3.js} +1 -1
- package/dist/client/static/js/{elixir-3dy25ex8.js → elixir-w92v180e.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-ccerbsag.js → elk-276RUBZZ-gbvr3gry.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-a8vjyrrw.js → erDiagram-OPXOYQCR-1hqca8qe.js} +2 -2
- package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-sz1g29fp.js → ganttDiagram-FUAMR5RP-07v22te5.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-efqk42q0.js → gitGraphDiagram-X574FWY7-y068jtz9.js} +8 -8
- package/dist/client/static/js/graphql-qx4tt6ze.js +1 -0
- package/dist/client/static/js/html-5e0g8664.js +1 -0
- package/dist/client/static/js/{index-gw4c5n3a.js → index-007sewcn.js} +1 -1
- package/dist/client/static/js/{index-qbqm3c91.js → index-1e0rt7c6.js} +2 -2
- package/dist/client/static/js/{index-6qqsy78z.js → index-1e710snk.js} +1 -1
- package/dist/client/static/js/{index-kc5yt2cd.js → index-2s17netq.js} +2 -2
- package/dist/client/static/js/{index-7s4dge1z.js → index-374xq5a4.js} +1 -1
- package/dist/client/static/js/index-4ddgpqm0.css +1 -0
- package/dist/client/static/js/{index-6h46r2de.js → index-5g2j626a.js} +1 -1
- package/dist/client/static/js/{index-5tp3emtg.js → index-5hvt233n.js} +1 -1
- package/dist/client/static/js/{index-ssepzdaz.js → index-5xxbbzqa.js} +5 -5
- package/dist/client/static/js/{index-jnxmvxb8.js → index-7sq6cjt1.js} +11 -11
- package/dist/client/static/js/{index-q0k1am0g.js → index-80kx6dm6.js} +2 -2
- package/dist/client/static/js/{index-2f6psebk.js → index-8d8ce00v.js} +1 -1
- package/dist/client/static/js/{index-gqsnyh8k.js → index-94d416ee.js} +1 -1
- package/dist/client/static/js/{index-2a0b9ya2.js → index-an7fq7f6.js} +1 -1
- package/dist/client/static/js/{index-6ey6y9em.js → index-azz46nwc.js} +2 -2
- package/dist/client/static/js/{index-bkwax812.js → index-c9aqx3ht.js} +1 -1
- package/dist/client/static/js/{index-rr79n77k.js → index-cc7qbfvn.js} +155 -148
- package/dist/client/static/js/{index-wnk9k57k.js → index-cmjyet7w.js} +50 -50
- package/dist/client/static/js/{index-f31c6jg8.js → index-cpp43af3.js} +8 -8
- package/dist/client/static/js/{index-dz18nn65.js → index-dxq1tbwm.js} +1 -1
- package/dist/client/static/js/{index-8aqjj2x2.js → index-e0kahttb.js} +1 -1
- package/dist/client/static/js/{index-ts8rhd06.js → index-e4nge3f4.js} +1 -1
- package/dist/client/static/js/{index-k4qshngy.js → index-f27wvdky.js} +3 -3
- package/dist/client/static/js/{index-7ma44af3.js → index-f61c25vn.js} +1 -1
- package/dist/client/static/js/{index-nzq51nbb.js → index-fe92hqmb.js} +5 -5
- package/dist/client/static/js/{index-k56patms.js → index-fv7nybnf.js} +2 -2
- package/dist/client/static/js/{index-xfyxmaj1.js → index-gqrt766t.js} +44 -44
- package/dist/client/static/js/{index-mkp3gwag.js → index-hb7a7m9m.js} +1 -1
- package/dist/client/static/js/{index-qkcmspxq.js → index-j830qk07.js} +1 -1
- package/dist/client/static/js/{index-6ac860yz.js → index-kzzvrqnv.js} +1 -1
- package/dist/client/static/js/{index-x7h04xzf.js → index-m5n0zsft.js} +1 -1
- package/dist/client/static/js/{index-q5q8a3qn.js → index-medk4f18.js} +1 -1
- package/dist/client/static/js/{index-tnxp90ac.js → index-nptbz7sv.js} +1 -1
- package/dist/client/static/js/{index-r1wrke3j.js → index-qefssj0m.js} +1 -1
- package/dist/client/static/js/{index-mpyd7qxj.js → index-r8d4bk86.js} +2 -2
- package/dist/client/static/js/{index-vf01q99d.js → index-rqt8mem9.js} +2 -2
- package/dist/client/static/js/{index-zh550byg.js → index-s4dpkds5.js} +1 -1
- package/dist/client/static/js/index-s9k82stc.js +2 -0
- package/dist/client/static/js/{index-xygk0v3e.js → index-skwem10a.js} +2 -2
- package/dist/client/static/js/{index-k1576e2m.js → index-tv9rn2nd.js} +1 -1
- package/dist/client/static/js/{index-dqf0srrp.js → index-vny4ymjf.js} +2 -2
- package/dist/client/static/js/{index-w5j1wgcz.js → index-vw8b29ek.js} +1 -1
- package/dist/client/static/js/{index-e42ys2q3.js → index-wn28m9h7.js} +7 -7
- package/dist/client/static/js/{index-tc07gd33.js → index-wxqcnsrq.js} +2 -2
- package/dist/client/static/js/{index-j863hg0d.js → index-xmg1x6zv.js} +6 -6
- package/dist/client/static/js/{index-t71k3b28.js → index-zhgh7a31.js} +1 -1
- package/dist/client/static/js/{index-vb5a3g01.js → index-zs7kw0be.js} +3 -3
- package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-rykcacj5.js → infoDiagram-VRGFBTTK-1x83h4k4.js} +2 -2
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rj752kd8.js → ishikawaDiagram-OU5B5YK6-et6z3c28.js} +2 -2
- package/dist/client/static/js/javascript-av46zx4c.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mtetwn6f.js → journeyDiagram-ZHPQQLJL-sw669e7a.js} +3 -3
- package/dist/client/static/js/{julia-mxe3pnz3.js → julia-z14p8jsx.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-4h5pw5mm.js → kanban-definition-PNTS6WVX-aqxg95kx.js} +7 -7
- package/dist/client/static/js/{mermaid.core-bs542jma.js → mermaid.core-6cgqsgcf.js} +3 -3
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-67s4xy7h.js → mindmap-definition-NLK3R4M7-530anpc4.js} +4 -4
- package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +1 -0
- package/dist/client/static/js/one-light-2n5y8592.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-qykb6ssk.js → pegDiagram-GJSIUBJH-5zar6hvy.js} +1 -1
- package/dist/client/static/js/{perl-a8eeaqkn.js → perl-1na2x6yd.js} +1 -1
- package/dist/client/static/js/{php-6gq92zt8.js → php-x75tt7w3.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-mymrrvck.js → pieDiagram-5QR66LMP-3bx8syvw.js} +2 -2
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-6f8ahd40.js → quadrantDiagram-O4NWA36T-yaarpr2e.js} +2 -2
- package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-c3habpvw.js → railroadDiagram-XR7U4H2S-ag41q4nt.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-nysqy6te.js → requirementDiagram-PLB6GJNP-g8sr48h4.js} +4 -4
- package/dist/client/static/js/{ruby-mc826p2e.js → ruby-3h22qahv.js} +1 -1
- package/dist/client/static/js/{rust-m4f4vpvn.js → rust-r27demr5.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s5dtfp3z.js → sankeyDiagram-IPEJSGJF-t1wbd1hh.js} +1 -1
- package/dist/client/static/js/{scss-9wz47c6t.js → scss-c04ezwnn.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bb3yp049.js → sequenceDiagram-PO4LG4MO-407mjqty.js} +5 -5
- package/dist/client/static/js/{sizeCapture-INFHLROL-0m2msee7.js → sizeCapture-INFHLROL-w38zb9ky.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-cd0qgj6t.js → stateDiagram-v2-GCMORJYK-4cvgymkc.js} +3 -3
- package/dist/client/static/js/{svelte-5vrwkc13.js → svelte-egg3x4tw.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-rpb01f7p.js → swimlanes-2SLR337P-w7ts2rzw.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-zx36y2c8.js → swimlanesDiagram-TC7HE7FX-v82nym6b.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-tqw2e6y1.js → timeline-definition-EJHVYXUP-nq46nzy9.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-dhf4d5xg.js → usecaseDiagram-POWQR4AR-q144snzb.js} +22 -22
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-ztkk79dv.js → vennDiagram-UO4OBE2U-2wemak2p.js} +5 -5
- package/dist/client/static/js/{vue-gmjnxjm3.js → vue-d7p4wv35.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-ahre5tmv.js → wardleyDiagram-VNRHLVJA-bb2qvvgr.js} +2 -2
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-vak2c50n.js → xychartDiagram-PMCCYNJV-9dr05fdq.js} +4 -4
- package/package.json +4 -4
- package/src/client/components/common/anchored-menu/index.tsx +11 -4
- package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
- package/src/client/components/common/session-row/index.tsx +32 -16
- package/src/client/components/common/session-row/session-row.test.tsx +56 -18
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +24 -3
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +20 -0
- package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +5 -0
- package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +81 -162
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +7 -3
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +12 -4
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +24 -6
- package/src/client/components/workspace/chat-timeline/UserTurn.tsx +17 -4
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +16 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +66 -10
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +103 -41
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +54 -35
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +110 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +51 -32
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +62 -0
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +15 -3
- package/src/client/components/workspace/chat-timeline/chat-input/access-capability.test.tsx +151 -0
- package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
- package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +21 -5
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +100 -71
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +83 -66
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.test.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +36 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +10 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +11 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +5 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +19 -12
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +50 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/props.ts +2 -0
- package/src/client/hooks/chat/timeline/access-ladder-wiring.test.ts +111 -0
- package/src/client/hooks/chat/timeline/access-ladder.test.ts +66 -0
- package/src/client/hooks/chat/timeline/access-ladder.ts +72 -0
- package/src/client/hooks/chat/timeline/access-mode.ts +11 -1
- package/src/client/hooks/chat/timeline/index.ts +4 -5
- package/src/client/hooks/chat/timeline/modes-contract.ts +10 -1
- package/src/client/hooks/chat/timeline/modes.ts +10 -2
- package/src/server/lib/realtime/topics/session-data.server.ts +6 -5
- package/src/server/lib/realtime/topics/session-data.test.ts +35 -0
- package/src/shared/lib/chat/orchestration/outcome-markdown.test.ts +57 -0
- package/src/shared/lib/chat/orchestration/outcome-markdown.ts +74 -0
- package/dist/client/static/js/MergeDiffView-b8f013ws.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +0 -1
- package/dist/client/static/js/css-9gak6bze.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +0 -1
- package/dist/client/static/js/graphql-2ntm7jyh.js +0 -1
- package/dist/client/static/js/html-mt2yb43b.js +0 -1
- package/dist/client/static/js/index-f44k9k8d.css +0 -1
- package/dist/client/static/js/index-ver116ed.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +0 -1
- package/dist/client/static/js/javascript-0mqgcvps.js +0 -1
- package/dist/client/static/js/one-dark-pro-541ed4b7.js +0 -1
- package/dist/client/static/js/one-light-nr79mykt.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +0 -1
- package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-vy6rp5gp.js +0 -1
|
@@ -7,6 +7,7 @@ import { ModeToggles } from '@/client/components/workspace/chat-timeline/chat-in
|
|
|
7
7
|
import { PluginComposerActions } from '@/client/components/workspace/chat-timeline/chat-input/PluginComposerSlots';
|
|
8
8
|
import type { ComposerModes } from '@/client/components/workspace/chat-timeline/chat-input/modes-props';
|
|
9
9
|
import { DEFAULT_APPROVAL_MODE, type ApprovalMode } from '@kabmo-labs/kabmo-omp/access-mode';
|
|
10
|
+
import { harnessRaisesApprovals } from '@kabmo-labs/kabmo-harness/catalog';
|
|
10
11
|
|
|
11
12
|
export interface ComposerToolbarProps {
|
|
12
13
|
isMobile: boolean;
|
|
@@ -143,6 +144,10 @@ export function ComposerToolbar({
|
|
|
143
144
|
// comment above measured.
|
|
144
145
|
const actionSize = isMobile ? 'w-8 h-8' : 'w-7 h-7';
|
|
145
146
|
const iconSize = isMobile ? 14 : 12;
|
|
147
|
+
// An agent that never sends `session/request_permission` (measured: jcode,
|
|
148
|
+
// pi-acp behind `pi`/`omo`) has nothing for the three tiers to answer, so the
|
|
149
|
+
// chip is not drawn at all — see `harnessRaisesApprovals`.
|
|
150
|
+
const accessAvailable = showAccess && harnessRaisesApprovals(harness);
|
|
146
151
|
|
|
147
152
|
return (
|
|
148
153
|
<div
|
|
@@ -181,10 +186,17 @@ export function ComposerToolbar({
|
|
|
181
186
|
/>
|
|
182
187
|
)}
|
|
183
188
|
|
|
184
|
-
{(showModel || showThinking) &&
|
|
189
|
+
{(showModel || showThinking) && accessAvailable && <div className="w-[1px] h-3 bg-ink/10" />}
|
|
185
190
|
|
|
186
|
-
{
|
|
187
|
-
<AccessDropdown
|
|
191
|
+
{accessAvailable && onSelectAccess && (
|
|
192
|
+
<AccessDropdown
|
|
193
|
+
value={accessMode}
|
|
194
|
+
onSelect={onSelectAccess}
|
|
195
|
+
harness={harness}
|
|
196
|
+
iconOnly={isMobile}
|
|
197
|
+
ladder={modes?.accessLadder ?? null}
|
|
198
|
+
{...(modes?.onSelectSessionMode ? { onSelectLadder: modes.onSelectSessionMode } : {})}
|
|
199
|
+
/>
|
|
188
200
|
)}
|
|
189
201
|
|
|
190
202
|
{/* On a narrow composer the mode toggles live in the row above (the
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The assembled composer's Access Control, per harness.
|
|
8
|
+
*
|
|
9
|
+
* `Toolbar.test.ts` pins the chip's own gate; this file pins it through
|
|
10
|
+
* `ChatInput`, which is what a chat actually renders — including the default
|
|
11
|
+
* `showAccess` and the modes slice. The rule: an agent that never sends
|
|
12
|
+
* `session/request_permission` (measured: `jcode`, and `pi-acp` behind
|
|
13
|
+
* `pi`/`omo`) gets no chip, because its three tiers would answer nothing.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import { h, render } from 'preact';
|
|
19
|
+
import { act } from 'preact/test-utils';
|
|
20
|
+
import { ChatInput } from '@/client/components/workspace/chat-timeline/chat-input';
|
|
21
|
+
import type { ComposerModes } from '@/client/components/workspace/chat-timeline/chat-input/modes-props';
|
|
22
|
+
import { restoreRealtime, silenceRealtime } from '@/test-support/silent-socket';
|
|
23
|
+
|
|
24
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'HTMLInputElement', 'HTMLTextAreaElement', 'Event', 'MouseEvent', 'KeyboardEvent', 'FocusEvent'] as const;
|
|
25
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
26
|
+
const nativeResizeObserver = (globalThis as unknown as Record<string, unknown>).ResizeObserver;
|
|
27
|
+
|
|
28
|
+
class FakeResizeObserver {
|
|
29
|
+
constructor(private readonly callback: (entries: Array<{ contentRect: { width: number } }>) => void) {
|
|
30
|
+
this.callback([{ contentRect: { width: 900 } }]);
|
|
31
|
+
}
|
|
32
|
+
observe() {}
|
|
33
|
+
unobserve() {}
|
|
34
|
+
disconnect() {}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
beforeAll(() => {
|
|
38
|
+
const win = new Window({ url: 'http://localhost' });
|
|
39
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
40
|
+
for (const key of DOM_GLOBALS) {
|
|
41
|
+
if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
|
|
42
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
43
|
+
}
|
|
44
|
+
target.ResizeObserver = FakeResizeObserver;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
afterAll(() => {
|
|
48
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
49
|
+
for (const key of DOM_GLOBALS) {
|
|
50
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
51
|
+
else target[key] = nativeGlobals[key];
|
|
52
|
+
}
|
|
53
|
+
if (nativeResizeObserver === undefined) delete target.ResizeObserver;
|
|
54
|
+
else target.ResizeObserver = nativeResizeObserver;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
let container: HTMLElement | null = null;
|
|
58
|
+
|
|
59
|
+
beforeEach(() => {
|
|
60
|
+
silenceRealtime();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
afterEach(() => {
|
|
64
|
+
if (container) {
|
|
65
|
+
render(null, container);
|
|
66
|
+
container.remove();
|
|
67
|
+
container = null;
|
|
68
|
+
}
|
|
69
|
+
restoreRealtime();
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function modes(): ComposerModes {
|
|
73
|
+
return {
|
|
74
|
+
plan: false,
|
|
75
|
+
goal: false,
|
|
76
|
+
goalOpen: false,
|
|
77
|
+
goalRecord: null,
|
|
78
|
+
goalContinuation: null,
|
|
79
|
+
goalEvaluating: false,
|
|
80
|
+
goalArm: null,
|
|
81
|
+
disarmGoal: () => {},
|
|
82
|
+
pending: false,
|
|
83
|
+
planAvailable: true,
|
|
84
|
+
goalAvailable: true,
|
|
85
|
+
error: null,
|
|
86
|
+
clearError: () => {},
|
|
87
|
+
onTogglePlan: () => {},
|
|
88
|
+
onGoalAction: async () => ({ ok: true }),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const accessChip = '[aria-label^="Access control:"]';
|
|
93
|
+
|
|
94
|
+
/** The composer for `harness`, as every chat renders it (default `showAccess`). */
|
|
95
|
+
function input(harness: string) {
|
|
96
|
+
return h(ChatInput, {
|
|
97
|
+
value: '',
|
|
98
|
+
onChange: () => {},
|
|
99
|
+
onSend: () => {},
|
|
100
|
+
isGenerating: false,
|
|
101
|
+
composerModelRef: { current: null },
|
|
102
|
+
variant: 'desktop',
|
|
103
|
+
sessionId: 'access-capability-test',
|
|
104
|
+
accessMode: 'always-ask',
|
|
105
|
+
onAccessModeChange: () => {},
|
|
106
|
+
modes: modes(),
|
|
107
|
+
harness,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function mount(harness: string): Promise<HTMLElement> {
|
|
112
|
+
const host = document.createElement('div');
|
|
113
|
+
document.body.appendChild(host);
|
|
114
|
+
await act(async () => { render(input(harness), host); });
|
|
115
|
+
container = host;
|
|
116
|
+
return host;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
describe('composer Access Control capability', () => {
|
|
120
|
+
test('switching the harness removes or restores the chip in place', async () => {
|
|
121
|
+
// The tab strip writes the pick, and the composer re-renders with the new
|
|
122
|
+
// `harness`. The chip has to follow that render: a gate read once at mount
|
|
123
|
+
// would leave a dead control over an agent that never asks.
|
|
124
|
+
const host = document.createElement('div');
|
|
125
|
+
document.body.appendChild(host);
|
|
126
|
+
container = host;
|
|
127
|
+
await act(async () => { render(input('omp-rpc'), host); });
|
|
128
|
+
expect(host.querySelectorAll(accessChip).length).toBe(1);
|
|
129
|
+
|
|
130
|
+
await act(async () => { render(input('jcode'), host); });
|
|
131
|
+
expect(host.querySelectorAll(accessChip).length).toBe(0);
|
|
132
|
+
|
|
133
|
+
await act(async () => { render(input('claude'), host); });
|
|
134
|
+
expect(host.querySelectorAll(accessChip).length).toBe(1);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('a harness that raises approvals keeps the chip', async () => {
|
|
138
|
+
const el = await mount('claude');
|
|
139
|
+
expect(el.querySelectorAll(accessChip).length).toBe(1);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test('a harness that never asks has no chip at all', async () => {
|
|
143
|
+
for (const harness of ['jcode', 'pi', 'omo']) {
|
|
144
|
+
const el = await mount(harness);
|
|
145
|
+
expect(el.querySelectorAll(accessChip).length, harness).toBe(0);
|
|
146
|
+
render(null, el);
|
|
147
|
+
el.remove();
|
|
148
|
+
container = null;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -51,6 +51,11 @@ export interface ComposerModes {
|
|
|
51
51
|
goalAvailable: boolean;
|
|
52
52
|
/** The agent's own mode selector (ACP), or null when it publishes none. */
|
|
53
53
|
sessionMode?: SessionModeState | null;
|
|
54
|
+
/**
|
|
55
|
+
* The same selector when its values ARE access policies: the toolbar draws
|
|
56
|
+
* it inside Access Control and gives up the separate Session Mode chip.
|
|
57
|
+
*/
|
|
58
|
+
accessLadder?: SessionModeState | null;
|
|
54
59
|
/** Move the agent's mode selector. */
|
|
55
60
|
onSelectSessionMode?: (value: string) => void;
|
|
56
61
|
/**
|
|
@@ -142,7 +142,7 @@ describe('fork preview in the pending composer', () => {
|
|
|
142
142
|
});
|
|
143
143
|
await settle();
|
|
144
144
|
|
|
145
|
-
const other =
|
|
145
|
+
const other = document.body.querySelector('[data-testid="parent-candidate"][data-session-id="sess-b"]');
|
|
146
146
|
expect(other, 'the other source is not offered').not.toBeNull();
|
|
147
147
|
act(() => {
|
|
148
148
|
(other as HTMLElement).dispatchEvent(new window.MouseEvent('click', { bubbles: true }));
|
package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx
CHANGED
|
@@ -74,6 +74,22 @@ describe('ParentSessionPicker', () => {
|
|
|
74
74
|
expect(trigger?.querySelector('.lucide-git-branch')).toBeNull();
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
+
test('the panel is portalled out of the trigger row', async () => {
|
|
78
|
+
const host = await mount(
|
|
79
|
+
h(ParentSessionPicker, { folders, sessionId: null, value: null, onChange: () => {} }),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
await act(async () => {
|
|
83
|
+
(host.querySelector('[data-testid="parent-session-picker"]') as HTMLButtonElement).click();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// A panel rendered inside the row would widen the row's scrollWidth on a
|
|
87
|
+
// phone and drag the layout sideways when it opened. `AnchoredMenu` paints
|
|
88
|
+
// it in `document.body` instead.
|
|
89
|
+
expect(host.querySelector('[data-testid="parent-candidate"]')).toBeNull();
|
|
90
|
+
expect(document.body.querySelectorAll('[data-testid="parent-candidate"]').length).toBeGreaterThan(0);
|
|
91
|
+
});
|
|
92
|
+
|
|
77
93
|
test('the search row narrows the sessions on title and folder name', async () => {
|
|
78
94
|
const host = await mount(
|
|
79
95
|
h(ParentSessionPicker, { folders, sessionId: null, value: null, onChange: () => {} }),
|
|
@@ -82,19 +98,19 @@ describe('ParentSessionPicker', () => {
|
|
|
82
98
|
await act(async () => {
|
|
83
99
|
(host.querySelector('[data-testid="parent-session-picker"]') as HTMLButtonElement).click();
|
|
84
100
|
});
|
|
85
|
-
const input =
|
|
101
|
+
const input = document.body.querySelector('input[aria-label="Search parent session"]') as HTMLInputElement;
|
|
86
102
|
expect(input).not.toBeNull();
|
|
87
103
|
await act(async () => {
|
|
88
104
|
input.value = 'pipeline';
|
|
89
105
|
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
90
106
|
});
|
|
91
107
|
|
|
92
|
-
const ids = [...
|
|
108
|
+
const ids = [...document.body.querySelectorAll('[data-testid="parent-candidate"]')].map((row) =>
|
|
93
109
|
row.getAttribute('data-session-id'),
|
|
94
110
|
);
|
|
95
111
|
expect(ids).toEqual(['b']);
|
|
96
112
|
// "No parent" is an action, not a search result: it survives the filter.
|
|
97
|
-
expect(
|
|
113
|
+
expect(document.body.querySelector('[data-testid="parent-candidate-none"]')).not.toBeNull();
|
|
98
114
|
});
|
|
99
115
|
|
|
100
116
|
test('choosing a session reports it, and "No parent" clears the pick', async () => {
|
|
@@ -114,7 +130,7 @@ describe('ParentSessionPicker', () => {
|
|
|
114
130
|
(host.querySelector('[data-testid="parent-session-picker"]') as HTMLButtonElement).click();
|
|
115
131
|
});
|
|
116
132
|
await act(async () => {
|
|
117
|
-
(
|
|
133
|
+
(document.body.querySelector('[data-testid="parent-candidate"]') as HTMLButtonElement).click();
|
|
118
134
|
});
|
|
119
135
|
expect(seen).toEqual(['a']);
|
|
120
136
|
|
|
@@ -122,7 +138,7 @@ describe('ParentSessionPicker', () => {
|
|
|
122
138
|
(host.querySelector('[data-testid="parent-session-picker"]') as HTMLButtonElement).click();
|
|
123
139
|
});
|
|
124
140
|
await act(async () => {
|
|
125
|
-
(
|
|
141
|
+
(document.body.querySelector('[data-testid="parent-candidate-none"]') as HTMLButtonElement).click();
|
|
126
142
|
});
|
|
127
143
|
expect(seen).toEqual(['a', null]);
|
|
128
144
|
});
|
|
@@ -13,12 +13,22 @@
|
|
|
13
13
|
*
|
|
14
14
|
* A pending chat is never offered (it has no id to parent), and neither is an
|
|
15
15
|
* archived one (the server refuses to spawn under it).
|
|
16
|
+
*
|
|
17
|
+
* The panel is PORTALLED and `fixed` (`AnchoredMenu`). In the phone layout the
|
|
18
|
+
* trigger sits in a wrapped chip row above the composer, so an `absolute
|
|
19
|
+
* bottom-full left-0` panel wider than its trigger ran past the right edge and,
|
|
20
|
+
* because that row is the scroller, stretched its `scrollWidth`: opening the
|
|
21
|
+
* menu shifted the whole new-session screen sideways. A `fixed` panel placed by
|
|
22
|
+
* `placeMenu` is clamped to the window and contributes nothing to the row's
|
|
23
|
+
* layout. `WaitingDependencyPicker`, which shares the row, already works this
|
|
24
|
+
* way.
|
|
16
25
|
*/
|
|
17
26
|
|
|
18
27
|
import { useCallback, useMemo, useRef, useState } from 'preact/hooks';
|
|
19
28
|
import { Check, ChevronDown, GitFork, X } from 'lucide-preact';
|
|
20
|
-
import {
|
|
29
|
+
import { AnchoredMenu } from '@/client/components/common/anchored-menu';
|
|
21
30
|
import { PickerSearch } from '@/client/components/common/picker-search';
|
|
31
|
+
import { anchorRectOf, type AnchorRect } from '@/shared/lib/ui/menu-anchor';
|
|
22
32
|
import { matchesPickerQuery } from '@/shared/lib/ui/picker-filter';
|
|
23
33
|
import type { WorkspaceFolderData } from '@/shared/types';
|
|
24
34
|
|
|
@@ -75,12 +85,23 @@ export function ParentSessionPicker({
|
|
|
75
85
|
}: ParentSessionPickerProps) {
|
|
76
86
|
const [open, setOpen] = useState(false);
|
|
77
87
|
const [query, setQuery] = useState('');
|
|
78
|
-
const
|
|
88
|
+
const [anchor, setAnchor] = useState<AnchorRect | null>(null);
|
|
89
|
+
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
79
90
|
const close = useCallback(() => {
|
|
80
91
|
setOpen(false);
|
|
81
92
|
setQuery('');
|
|
93
|
+
setAnchor(null);
|
|
82
94
|
}, []);
|
|
83
|
-
|
|
95
|
+
const toggle = () => {
|
|
96
|
+
if (open) {
|
|
97
|
+
close();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const trigger = triggerRef.current;
|
|
101
|
+
if (!trigger) return;
|
|
102
|
+
setAnchor(anchorRectOf(trigger));
|
|
103
|
+
setOpen(true);
|
|
104
|
+
};
|
|
84
105
|
const options = useMemo(() => parentSessionOptions(folders, sessionId), [folders, sessionId]);
|
|
85
106
|
const visible = useMemo(
|
|
86
107
|
() => options.filter((option) => matchesPickerQuery(`${option.title} ${option.folderName}`, query)),
|
|
@@ -90,11 +111,12 @@ export function ParentSessionPicker({
|
|
|
90
111
|
const triggerLabel = selected ? selected.title : value ? value : `${label}: none`;
|
|
91
112
|
|
|
92
113
|
return (
|
|
93
|
-
<div className="
|
|
114
|
+
<div className="shrink-0">
|
|
94
115
|
<button
|
|
116
|
+
ref={triggerRef}
|
|
95
117
|
type="button"
|
|
96
118
|
data-testid="parent-session-picker"
|
|
97
|
-
onClick={
|
|
119
|
+
onClick={toggle}
|
|
98
120
|
title={selected ? `${label}: ${selected.title}` : `Choose a session for ${label.toLowerCase()}`}
|
|
99
121
|
aria-label={selected ? `${label}: ${selected.title}` : label}
|
|
100
122
|
aria-expanded={open}
|
|
@@ -110,82 +132,89 @@ export function ParentSessionPicker({
|
|
|
110
132
|
/>
|
|
111
133
|
</button>
|
|
112
134
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
<AnchoredMenu
|
|
136
|
+
anchor={open ? anchor : null}
|
|
137
|
+
ariaLabel={label}
|
|
138
|
+
// `max-w` is the horizontal half of the viewport clamp: `placeMenu`
|
|
139
|
+
// pins the panel's left edge inside the window, but a panel wider than
|
|
140
|
+
// the window would still run past the right one. 1rem is the two 8px
|
|
141
|
+
// margins it keeps.
|
|
142
|
+
className="w-max min-w-[16rem] max-w-[calc(100vw-1rem)] bg-paper border border-ink/10 rounded-lg shadow-lg flex flex-col text-xs py-1"
|
|
143
|
+
onClose={close}
|
|
144
|
+
>
|
|
145
|
+
<div className="flex items-center justify-between px-3 py-1.5 border-b border-ink/5">
|
|
146
|
+
<span className="text-[10px] uppercase tracking-wider text-ink/40 font-semibold">
|
|
147
|
+
{label}
|
|
148
|
+
</span>
|
|
149
|
+
{value && allowNone && (
|
|
150
|
+
<button
|
|
151
|
+
type="button"
|
|
152
|
+
onClick={() => {
|
|
153
|
+
onChange(null);
|
|
154
|
+
close();
|
|
155
|
+
}}
|
|
156
|
+
title="Start a top-level chat"
|
|
157
|
+
aria-label="Clear parent session"
|
|
158
|
+
className="flex items-center gap-1 text-[10px] text-ink/50 hover:text-ink cursor-pointer"
|
|
159
|
+
>
|
|
160
|
+
<X size={10} /> clear
|
|
161
|
+
</button>
|
|
162
|
+
)}
|
|
163
|
+
</div>
|
|
164
|
+
<PickerSearch value={query} onChange={setQuery} ariaLabel={`Search ${label.toLowerCase()}`} placeholder="Search sessions…" />
|
|
165
|
+
<div className="max-h-64 scrollbar-overlay-container py-1">
|
|
166
|
+
{allowNone && (
|
|
167
|
+
<button
|
|
168
|
+
type="button"
|
|
169
|
+
data-testid="parent-candidate-none"
|
|
170
|
+
onClick={() => {
|
|
171
|
+
onChange(null);
|
|
172
|
+
close();
|
|
173
|
+
}}
|
|
174
|
+
className={`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors cursor-pointer hover:bg-ink/5 ${
|
|
175
|
+
value ? 'text-ink/70' : 'text-ink font-medium'
|
|
176
|
+
}`}
|
|
177
|
+
>
|
|
178
|
+
<span className="w-3 shrink-0">{!value && <Check size={11} />}</span>
|
|
179
|
+
<span className="min-w-0 flex-1 truncate">No parent (top-level chat)</span>
|
|
180
|
+
</button>
|
|
181
|
+
)}
|
|
182
|
+
{visible.map((option) => {
|
|
183
|
+
const active = option.id === value;
|
|
184
|
+
return (
|
|
137
185
|
<button
|
|
186
|
+
key={option.id}
|
|
138
187
|
type="button"
|
|
139
|
-
data-testid="parent-candidate
|
|
188
|
+
data-testid="parent-candidate"
|
|
189
|
+
data-session-id={option.id}
|
|
140
190
|
onClick={() => {
|
|
141
|
-
onChange(
|
|
191
|
+
onChange(option.id);
|
|
142
192
|
close();
|
|
143
193
|
}}
|
|
144
194
|
className={`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors cursor-pointer hover:bg-ink/5 ${
|
|
145
|
-
|
|
195
|
+
active ? 'text-ink font-medium' : 'text-ink/70'
|
|
146
196
|
}`}
|
|
147
197
|
>
|
|
148
|
-
<span className="w-3 shrink-0">{
|
|
149
|
-
<span className="min-w-0 flex-1 truncate">
|
|
198
|
+
<span className="w-3 shrink-0">{active && <Check size={11} />}</span>
|
|
199
|
+
<span className="max-w-[18rem] min-w-0 flex-1 truncate">{option.title}</span>
|
|
200
|
+
{/* Same rule as the wait picker: the folder is the
|
|
201
|
+
disambiguator between two sessions called "Fix build", so
|
|
202
|
+
it is pinned to the row's RIGHT edge and the panel is
|
|
203
|
+
sized to it. Truncation is the fallback at the viewport
|
|
204
|
+
cap, where the title has already yielded. */}
|
|
205
|
+
<span title={option.folderName} className="ml-auto min-w-0 truncate text-[10px] text-ink/40">
|
|
206
|
+
{option.folderName}
|
|
207
|
+
</span>
|
|
150
208
|
</button>
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
data-testid="parent-candidate"
|
|
159
|
-
data-session-id={option.id}
|
|
160
|
-
onClick={() => {
|
|
161
|
-
onChange(option.id);
|
|
162
|
-
close();
|
|
163
|
-
}}
|
|
164
|
-
className={`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors cursor-pointer hover:bg-ink/5 ${
|
|
165
|
-
active ? 'text-ink font-medium' : 'text-ink/70'
|
|
166
|
-
}`}
|
|
167
|
-
>
|
|
168
|
-
<span className="w-3 shrink-0">{active && <Check size={11} />}</span>
|
|
169
|
-
<span className="max-w-[18rem] min-w-0 flex-1 truncate">{option.title}</span>
|
|
170
|
-
{/* Same rule as the wait picker: the folder is the
|
|
171
|
-
disambiguator between two sessions called "Fix build", so
|
|
172
|
-
it is pinned to the row's RIGHT edge and the panel is
|
|
173
|
-
sized to it. Truncation is the fallback at the viewport
|
|
174
|
-
cap, where the title has already yielded. */}
|
|
175
|
-
<span title={option.folderName} className="ml-auto min-w-0 truncate text-[10px] text-ink/40">
|
|
176
|
-
{option.folderName}
|
|
177
|
-
</span>
|
|
178
|
-
</button>
|
|
179
|
-
);
|
|
180
|
-
})}
|
|
181
|
-
{options.length === 0 ? (
|
|
182
|
-
<div className="px-3 py-2 text-ink/40 italic">No sessions to parent under yet</div>
|
|
183
|
-
) : visible.length === 0 ? (
|
|
184
|
-
<div className="px-3 py-2 text-ink/40 italic">No match for “{query.trim()}”</div>
|
|
185
|
-
) : null}
|
|
186
|
-
</div>
|
|
209
|
+
);
|
|
210
|
+
})}
|
|
211
|
+
{options.length === 0 ? (
|
|
212
|
+
<div className="px-3 py-2 text-ink/40 italic">No sessions to parent under yet</div>
|
|
213
|
+
) : visible.length === 0 ? (
|
|
214
|
+
<div className="px-3 py-2 text-ink/40 italic">No match for “{query.trim()}”</div>
|
|
215
|
+
) : null}
|
|
187
216
|
</div>
|
|
188
|
-
|
|
217
|
+
</AnchoredMenu>
|
|
189
218
|
</div>
|
|
190
219
|
);
|
|
191
220
|
}
|
package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx
CHANGED
|
@@ -91,7 +91,7 @@ describe('WorkspacePicker', () => {
|
|
|
91
91
|
(host.querySelector('button') as HTMLButtonElement).click();
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
const text = textOf(
|
|
94
|
+
const text = textOf(document.body);
|
|
95
95
|
expect(text).toContain('Target Workspace');
|
|
96
96
|
expect(text).toContain('kabmo');
|
|
97
97
|
expect(text).toContain('notes');
|
|
@@ -113,14 +113,14 @@ describe('WorkspacePicker', () => {
|
|
|
113
113
|
await act(async () => {
|
|
114
114
|
(host.querySelector('button') as HTMLButtonElement).click();
|
|
115
115
|
});
|
|
116
|
-
const input =
|
|
116
|
+
const input = document.body.querySelector('input[aria-label="Search workspaces"]') as HTMLInputElement;
|
|
117
117
|
expect(input).not.toBeNull();
|
|
118
118
|
await act(async () => {
|
|
119
119
|
input.value = 'note';
|
|
120
120
|
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
const rows = [...
|
|
123
|
+
const rows = [...document.body.querySelectorAll('[role="menuitemradio"]')] as HTMLButtonElement[];
|
|
124
124
|
expect(rows.map((row) => row.textContent?.trim())).toEqual(['notes']);
|
|
125
125
|
});
|
|
126
126
|
|
|
@@ -140,7 +140,7 @@ describe('WorkspacePicker', () => {
|
|
|
140
140
|
await act(async () => {
|
|
141
141
|
trigger.click();
|
|
142
142
|
});
|
|
143
|
-
const rows = [...
|
|
143
|
+
const rows = [...document.body.querySelectorAll('[role="menuitemradio"]')] as HTMLButtonElement[];
|
|
144
144
|
expect(rows[0]?.querySelector('.lucide-code-2')).not.toBeNull();
|
|
145
145
|
// A workspace with no icon keeps the default folder mark.
|
|
146
146
|
expect(rows[1]?.querySelector('.lucide-folder')).not.toBeNull();
|
|
@@ -164,7 +164,7 @@ describe('WorkspacePicker', () => {
|
|
|
164
164
|
await act(async () => {
|
|
165
165
|
(host.querySelector('button') as HTMLButtonElement).click();
|
|
166
166
|
});
|
|
167
|
-
const add = [...
|
|
167
|
+
const add = [...document.body.querySelectorAll('[role="menuitem"]')]
|
|
168
168
|
.find((row) => row.textContent?.includes('Add new workspace')) as HTMLButtonElement | undefined;
|
|
169
169
|
expect(add).toBeDefined();
|
|
170
170
|
|
|
@@ -173,7 +173,7 @@ describe('WorkspacePicker', () => {
|
|
|
173
173
|
});
|
|
174
174
|
expect(asked).toBe(1);
|
|
175
175
|
// The menu closes: the dialog is the next thing the user sees.
|
|
176
|
-
expect(
|
|
176
|
+
expect(document.body.querySelector('[role="menu"]')).toBeNull();
|
|
177
177
|
} finally {
|
|
178
178
|
window.removeEventListener(NEW_WORKSPACE_EVENT, onAsk);
|
|
179
179
|
}
|
|
@@ -191,8 +191,8 @@ describe('WorkspacePicker', () => {
|
|
|
191
191
|
await act(async () => {
|
|
192
192
|
(host.querySelector('button') as HTMLButtonElement).click();
|
|
193
193
|
});
|
|
194
|
-
expect(textOf(
|
|
195
|
-
expect(textOf(
|
|
194
|
+
expect(textOf(document.body)).toContain('No workspaces available');
|
|
195
|
+
expect(textOf(document.body)).toContain('Add new workspace');
|
|
196
196
|
});
|
|
197
197
|
|
|
198
198
|
test('choosing a folder clears the worktree pick', async () => {
|
|
@@ -216,7 +216,7 @@ describe('WorkspacePicker', () => {
|
|
|
216
216
|
await act(async () => {
|
|
217
217
|
(host.querySelector('button') as HTMLButtonElement).click();
|
|
218
218
|
});
|
|
219
|
-
const rows = [...
|
|
219
|
+
const rows = [...document.body.querySelectorAll('[role="menuitemradio"]')] as HTMLButtonElement[];
|
|
220
220
|
expect(rows.length).toBe(2);
|
|
221
221
|
await act(async () => {
|
|
222
222
|
rows[1]?.click();
|