@kabmo-labs/kabmo 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +412 -412
- package/dist/client/static/js/{CsvGrid-z74weshk.js → CsvGrid-br4j001k.js} +2 -2
- package/dist/client/static/js/{DocxView-dpe5x9ab.js → DocxView-kmtkbmmw.js} +3 -3
- package/dist/client/static/js/{DrawioView-ftzwjf8v.js → DrawioView-3df0g3jr.js} +2 -2
- package/dist/client/static/js/ImageView-2r8p5z3y.js +1 -0
- package/dist/client/static/js/LayoutWrapper-rq3d2a4e.js +2 -0
- package/dist/client/static/js/Modal-tmxhxd6q.js +59 -0
- package/dist/client/static/js/{PdfView-vjec8z3z.js → PdfView-p5z7c7eg.js} +1 -1
- package/dist/client/static/js/{SessionsView-g7z3fxbp.js → SessionsView-t06h6zfx.js} +1 -1
- package/dist/client/static/js/{SheetView-hhtfkdhe.js → SheetView-agw459v2.js} +19 -19
- package/dist/client/static/js/{SvgPreview-48n3ex6p.js → SvgPreview-b9rfy1h6.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-bpvzdara.js → abnfDiagram-O67JEVCF-wbnhzcnj.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xw62cr7j.js → architectureDiagram-NJMV4G6O-t2sgevea.js} +3 -3
- package/dist/client/static/js/{astro-56b0as3q.js → astro-hyj5wege.js} +1 -1
- package/dist/client/static/js/bash-8d8z8zrg.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-x3a6cgar.js → blockDiagram-BEXU5L5S-v2nzp54a.js} +5 -5
- package/dist/client/static/js/c-acmn1zc9.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-katvaxbj.js → c4Diagram-YGBWAQC7-7h03146b.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-bjz4mqqh.js → classDiagram-v2-NBCMYWYE-m57e9kp1.js} +7 -7
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-fsn80psf.js → cose-bilkent-JH36ORCC-c4tnh4mg.js} +1 -1
- package/dist/client/static/js/cpp-620mvjkk.js +1 -0
- package/dist/client/static/js/css-bt76kxbq.js +1 -0
- package/dist/client/static/js/css-drfs4n12.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-cfhbsnkm.js → cynefinDiagram-VND7K2PF-mjf6njey.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-j2wt7ns6.js → dagre-6A5THRUB-6yma9ch3.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-abrdj714.js → diagram-22UHCM2B-1q4ce2gb.js} +18 -18
- package/dist/client/static/js/{diagram-3UASUU5V-dbn15bxn.js → diagram-3UASUU5V-0ttps29p.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-y79pwf7w.js → diagram-ATOU4E4O-1mzexgv1.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-f8ryt86n.js → diagram-CDSNMT55-4ae89t23.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-ws7wn3q9.js → diagram-MLGK6HIB-057jaqvh.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-zmznrg13.js → diagram-MPIPVDR6-p6yyq5sx.js} +2 -2
- package/dist/client/static/js/{dockerfile-qgc921kw.js → dockerfile-00hqsk9c.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-y5q7hy1v.js → ebnfDiagram-ZINNZB2B-bsk7dvm4.js} +1 -1
- package/dist/client/static/js/{elixir-12pgbgtq.js → elixir-80wq7gak.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-vddwbn6q.js → elk-276RUBZZ-dsq91er5.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-qdqcx4g4.js → erDiagram-OPXOYQCR-p7p13mbh.js} +9 -9
- package/dist/client/static/js/{erlang-811btv6p.js → erlang-814e8qy5.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7b4w6phx.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-763hk9rm.js → ganttDiagram-FUAMR5RP-bwgnttyk.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-bgx1q5nw.js → gitGraphDiagram-X574FWY7-ca0gj5am.js} +13 -13
- package/dist/client/static/js/graphql-j1a6zp7m.js +1 -0
- package/dist/client/static/js/html-m0megrvb.js +1 -0
- package/dist/client/static/js/index-064vdkrs.js +2 -0
- package/dist/client/static/js/{index-w57zbym7.js → index-16sd19f0.js} +2 -2
- package/dist/client/static/js/{index-qt9jc4ck.js → index-19x11s5w.js} +2 -2
- package/dist/client/static/js/{index-2b1wnvez.js → index-1c2jvnyh.js} +2 -2
- package/dist/client/static/js/{index-jpp0zm7t.js → index-29npynva.js} +19 -19
- package/dist/client/static/js/{index-gcwmpfr4.js → index-2ks0m8ss.js} +2 -2
- package/dist/client/static/js/{index-pfj3sd1n.js → index-33qxg79j.js} +7 -7
- package/dist/client/static/js/index-3bf7r7z4.js +12 -0
- package/dist/client/static/js/index-3qnjdjg2.js +1 -0
- package/dist/client/static/js/index-4bqssvt6.js +2 -0
- package/dist/client/static/js/{index-03j5j1j0.js → index-561gkvve.js} +2 -2
- package/dist/client/static/js/{index-szk3vk8h.js → index-5gf52a6d.js} +2 -2
- package/dist/client/static/js/{index-fqatn0vh.js → index-5h8y54t6.js} +1 -1
- package/dist/client/static/js/{index-f51jxezc.js → index-5wz0y88c.js} +2 -2
- package/dist/client/static/js/{index-x2wvq4ae.js → index-64sqfr4a.js} +2 -2
- package/dist/client/static/js/{index-mwm8aptp.js → index-7055hdx1.js} +1 -1
- package/dist/client/static/js/index-8pksqzwq.js +1 -0
- package/dist/client/static/js/index-95kese1h.js +1 -0
- package/dist/client/static/js/{index-acphtw1r.js → index-9d3n04vb.js} +2 -2
- package/dist/client/static/js/{index-cj39b26c.js → index-aagt3382.js} +1 -1
- package/dist/client/static/js/{index-gzafyqsr.js → index-abs635a1.js} +56 -56
- package/dist/client/static/js/{index-xkwybnf3.js → index-amys498v.js} +198 -198
- package/dist/client/static/js/{index-vkerrwpa.js → index-bafe7hmd.js} +2 -2
- package/dist/client/static/js/{index-34ff2vq6.js → index-bjv5ga2e.js} +2 -2
- package/dist/client/static/js/{index-fbct0jcf.js → index-d23eacf2.js} +2 -2
- package/dist/client/static/js/{index-wqrdgt1g.js → index-dn7hg4em.js} +2 -2
- package/dist/client/static/js/index-dpy3ewrn.css +1 -0
- package/dist/client/static/js/{index-61j9qkck.js → index-dr5hca5b.js} +3 -3
- package/dist/client/static/js/{index-3h2mr90j.js → index-dxvtjn6a.js} +2 -2
- package/dist/client/static/js/index-eqhjs1yv.js +4 -0
- package/dist/client/static/js/{index-x7rfmwg8.js → index-ex5dtdx2.js} +6 -6
- package/dist/client/static/js/{index-228yzebd.js → index-f7te27n5.js} +5 -5
- package/dist/client/static/js/{index-6sqmhdyv.js → index-fj5rsp5v.js} +2 -2
- package/dist/client/static/js/{index-n1ga63de.js → index-g7s0wsag.js} +2 -2
- package/dist/client/static/js/index-gq5w5w8x.js +2 -0
- package/dist/client/static/js/{index-jaqjvk22.js → index-hkz2mz34.js} +2 -2
- package/dist/client/static/js/{index-gzp4j2h5.js → index-hnb66d3s.js} +2 -2
- package/dist/client/static/js/{index-h0rmkz9n.js → index-j718pxb3.js} +2 -2
- package/dist/client/static/js/{index-3sqndc9n.js → index-jkay7aw7.js} +2 -2
- package/dist/client/static/js/{index-05hx4ftf.js → index-k5zfzgez.js} +2 -2
- package/dist/client/static/js/{index-vgcm2g0g.js → index-kty4ncsr.js} +2 -2
- package/dist/client/static/js/{index-3d21hpk7.js → index-ncpwteyt.js} +2 -2
- package/dist/client/static/js/{index-pxq4v81r.js → index-nw5mvcaj.js} +2 -2
- package/dist/client/static/js/{index-f7paep2f.js → index-pwe6chtp.js} +1 -1
- package/dist/client/static/js/{index-8dtp7mt0.js → index-qf3y3ahx.js} +2 -2
- package/dist/client/static/js/{index-as1wptfa.js → index-qfxn7yh5.js} +2 -2
- package/dist/client/static/js/{index-dn6pqym4.js → index-qn200x1b.js} +6 -6
- package/dist/client/static/js/index-red856x6.js +1 -0
- package/dist/client/static/js/{index-e6any867.js → index-sa1675y0.js} +2 -2
- package/dist/client/static/js/{index-dgjerk4w.js → index-ta6gpcpw.js} +3 -3
- package/dist/client/static/js/{index-ehg2ftnp.js → index-trvqvb1v.js} +2 -2
- package/dist/client/static/js/{index-5b2vsbcf.js → index-twsbv1yn.js} +1 -1
- package/dist/client/static/js/{index-1nwwvv29.js → index-vjmg7kn5.js} +2 -2
- package/dist/client/static/js/{index-nzhwd6t3.js → index-wbws16ag.js} +2 -2
- package/dist/client/static/js/{index-gmq5pbcv.js → index-x1fqhhpp.js} +64 -64
- package/dist/client/static/js/{index-p21mvqc2.js → index-y2z8nsvw.js} +2 -2
- package/dist/client/static/js/{index-t0yv1375.js → index-z0fkfphe.js} +2 -2
- package/dist/client/static/js/{index-dmv2zasz.js → index-z4530r3c.js} +2 -2
- package/dist/client/static/js/{index-mrw7qweg.js → index-zedt16w7.js} +1 -1
- package/dist/client/static/js/{index-r6e44vkx.js → index-zq0qxb17.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-e66pw8d9.js → infoDiagram-VRGFBTTK-7q58qdf1.js} +2 -2
- package/dist/client/static/js/ini-5f4zqtqr.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ehc0q24d.js → ishikawaDiagram-OU5B5YK6-9jmeszag.js} +3 -3
- package/dist/client/static/js/java-jj41mty3.js +1 -0
- package/dist/client/static/js/javascript-n9w9p97f.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hye05qtd.js → journeyDiagram-ZHPQQLJL-0d7xe845.js} +5 -5
- package/dist/client/static/js/json-rnh2h17x.js +1 -0
- package/dist/client/static/js/jsx-4gecrt29.js +1 -0
- package/dist/client/static/js/{julia-mgsev9df.js → julia-yv2j8qd0.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-vce614m8.js → kanban-definition-PNTS6WVX-7p83rwdn.js} +5 -5
- package/dist/client/static/js/lua-zszaw2f7.js +1 -0
- package/dist/client/static/js/markdown-nm6gw4v4.js +1 -0
- package/dist/client/static/js/{mermaid.core-gc79re5p.js → mermaid.core-hwhzw0wv.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-ft1whaf5.js → mindmap-definition-NLK3R4M7-hy0rtr7t.js} +8 -8
- package/dist/client/static/js/one-dark-pro-4b8er03c.js +1 -0
- package/dist/client/static/js/one-light-e6r3vsz4.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-2s4ykhaa.js → pegDiagram-GJSIUBJH-kd8t53tx.js} +1 -1
- package/dist/client/static/js/{perl-6n93vjsa.js → perl-917pjq5a.js} +1 -1
- package/dist/client/static/js/{php-w23nmbtc.js → php-hwz75qzt.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-7h8dp0z3.js → pieDiagram-5QR66LMP-h3x03f80.js} +3 -3
- package/dist/client/static/js/properties-rkptax7r.js +1 -0
- package/dist/client/static/js/python-qf1se1mj.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-pteyxjxr.js → quadrantDiagram-O4NWA36T-y2b1ncbg.js} +6 -6
- package/dist/client/static/js/r-ms0cygq2.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-68z9wdt0.js → railroadDiagram-XR7U4H2S-x188rcxf.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-c08nmey6.js → requirementDiagram-PLB6GJNP-g5e9fk17.js} +10 -10
- package/dist/client/static/js/{ruby-ag3b3t9t.js → ruby-er7ayhte.js} +1 -1
- package/dist/client/static/js/{rust-ke5ec0w5.js → rust-1v8xbxn9.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2r3kvjs5.js → sankeyDiagram-IPEJSGJF-y9ht91gf.js} +4 -4
- package/dist/client/static/js/{sass-x0eez0kp.js → sass-n47tt136.js} +1 -1
- package/dist/client/static/js/{scss-qycakpjn.js → scss-kvev49ga.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-ctjycd88.js → sequenceDiagram-PO4LG4MO-pp8s63rt.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-97ndea95.js → sizeCapture-INFHLROL-k6dhfxex.js} +1 -1
- package/dist/client/static/js/sql-hd42h8wx.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-aqnmsb96.js → stateDiagram-v2-GCMORJYK-y3akpsm4.js} +3 -3
- package/dist/client/static/js/{svelte-tg19by0f.js → svelte-2pmz35vx.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-v50cx1nx.js → swimlanes-2SLR337P-89081dr3.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3q2a15wc.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-1ggrtdcj.js → timeline-definition-EJHVYXUP-tz6r8g3q.js} +6 -6
- package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +1 -0
- package/dist/client/static/js/tsx-gx7td06z.js +1 -0
- package/dist/client/static/js/typescript-1a808spn.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ybcwhpzs.js → usecaseDiagram-POWQR4AR-yq2y1b09.js} +44 -44
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-p9ggrt07.js → vennDiagram-UO4OBE2U-qdmjf6x3.js} +7 -7
- package/dist/client/static/js/{vue-mhj4sme0.js → vue-d5gpjfgn.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-v79nb9kx.js → wardleyDiagram-VNRHLVJA-3n2sm7rj.js} +3 -3
- package/dist/client/static/js/xml-3117mxd9.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-43thqscz.js → xychartDiagram-PMCCYNJV-d7n2av2t.js} +5 -5
- package/dist/client/static/js/yaml-dmvh8vyt.js +1 -0
- package/extensions/kabmo-modes/index.ts +1 -1
- package/extensions/kabmo-modes/parked.test.ts +2 -2
- package/extensions/kabmo-modes/parked.ts +10 -9
- package/extensions/kabmo-modes/plan.test.ts +4 -4
- package/extensions/kabmo-modes/plan.ts +6 -6
- package/extensions/kabmo-modes/session.ts +2 -2
- package/package.json +1 -1
- package/src/client/components/common/FolderPicker.tsx +1 -1
- package/src/client/components/common/Modal.tsx +8 -3
- package/src/client/components/common/NotificationPermissionDialog.test.tsx +8 -3
- package/src/client/components/common/NotificationPermissionDialog.tsx +7 -9
- package/src/client/components/common/PWAInstallButton.tsx +1 -1
- package/src/client/components/common/header-panel-buttons/index.tsx +5 -1
- package/src/client/components/common/shell-update-button/Modal.tsx +31 -36
- package/src/client/components/common/shell-update-button/index.test.tsx +5 -2
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +15 -0
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +16 -0
- package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +4 -6
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +9 -43
- package/src/client/components/mobile/RightSidebar.tsx +27 -10
- package/src/client/components/mobile/SessionSidebar.tsx +112 -137
- package/src/client/components/mobile/drawer-strip.tsx +85 -0
- package/src/client/components/mobile/left-drawer-nav.test.tsx +350 -0
- package/src/client/components/mobile/mobile-drawer-reveals.test.tsx +194 -0
- package/src/client/components/mobile/mobile-drawer-reveals.ts +138 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -24
- package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +57 -0
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +14 -87
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +2 -7
- package/src/client/components/mobile/mobile-right-sidebar/Header.test.tsx +157 -0
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +109 -105
- package/src/client/components/mobile/mobile-right-sidebar/OutlineButton.tsx +1 -1
- package/src/client/components/mobile/mobile-right-sidebar/Overflow.tsx +95 -0
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +212 -0
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +7 -9
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/use-dock.ts +29 -8
- package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +96 -0
- package/src/client/components/settings/Band.test.tsx +83 -0
- package/src/client/components/settings/Band.tsx +96 -0
- package/src/client/components/settings/Modal.tsx +44 -69
- package/src/client/components/settings/apply-side-effects.ts +15 -4
- package/src/client/components/settings/band-height.test.tsx +16 -3
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +35 -9
- package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
- package/src/client/components/settings/categories/ChatSettings.test.tsx +32 -9
- package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +40 -223
- package/src/client/components/settings/categories/appearance-settings/nav-choice.tsx +176 -0
- package/src/client/components/settings/categories/appearance-settings/nav-miniatures.tsx +93 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
- package/src/client/components/settings/categories/notification-settings/PermissionNotice.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +1 -1
- package/src/client/components/settings/drill.tsx +113 -0
- package/src/client/components/settings/master-detail/GroupDetail.tsx +14 -6
- package/src/client/components/settings/master-detail/GroupSidebar.tsx +9 -1
- package/src/client/components/settings/master-detail/index.tsx +45 -25
- package/src/client/components/workspace/chat-timeline/MobileTurnJump.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +4 -0
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.test.ts +23 -6
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +19 -2
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/index.tsx +5 -9
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +127 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +225 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx +5 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +4 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +40 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Footer.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +8 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +5 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +16 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +16 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +37 -12
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +4 -3
- package/src/client/components/workspace/diff-panel/index.tsx +1 -1
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +1 -1
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
- package/src/client/components/workspace/file-explorer/Modals.tsx +4 -4
- package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/CloseButton.tsx +38 -0
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +16 -25
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +30 -9
- package/src/client/components/workspace/model-dropdown/Header.tsx +33 -21
- package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -4
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +139 -0
- package/src/client/components/workspace/model-dropdown/placement.test.tsx +9 -7
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/NavModal.tsx +1 -1
- package/src/client/data/settings/omp-schema.json +103 -42
- package/src/client/hooks/chat/timeline/ask-form-frame.ts +33 -0
- package/src/client/hooks/chat/timeline/ask-frame-asks.ts +68 -0
- package/src/client/hooks/chat/timeline/ask-frame-buckets.ts +77 -0
- package/src/client/hooks/chat/timeline/ask-frames-context.ts +68 -0
- package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +170 -0
- package/src/client/hooks/chat/timeline/ask-frames.test.ts +1 -1
- package/src/client/hooks/chat/timeline/ask-frames.ts +36 -93
- package/src/client/hooks/workspace/left-dock.ts +19 -0
- package/src/client/hooks/workspace/mobile-panel-nav.ts +90 -0
- package/src/client/hooks/workspace/panel-nav.test.ts +42 -21
- package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +283 -0
- package/src/client/hooks/workspace/panel-tabs-reveal.ts +162 -0
- package/src/client/hooks/workspace/panel-tabs.ts +19 -2
- package/src/client/lib/ui/phone-row.test.ts +52 -0
- package/src/client/lib/ui/phone-row.ts +71 -0
- package/src/client/press-state.test.ts +179 -0
- package/src/client/tailwind.css +146 -0
- package/src/server/lib/bundler/titlebar-css.test.ts +10 -1
- package/src/server/lib/omp/rpc/constants.test.ts +6 -1
- package/src/shared/lib/chat/ask-form/data.ts +155 -0
- package/src/shared/lib/chat/ask-form/fields.ts +4 -0
- package/src/shared/lib/chat/ask-form/index.ts +8 -0
- package/src/shared/lib/chat/ask-form/types.ts +12 -0
- package/src/shared/lib/chat/timeline/tool-verbs.ts +28 -1
- package/src/shared/lib/chat/tool/tool-commands.test.ts +102 -0
- package/src/shared/lib/chat/tool/tool-commands.ts +124 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +34 -1
- package/src/shared/lib/omp/dialog-methods.ts +6 -0
- package/src/shared/lib/omp/session/wait-idle.ts +7 -3
- package/src/shared/lib/settings/defaults.ts +3 -2
- package/src/shared/lib/workspace/panel-nav.test.ts +26 -19
- package/src/shared/lib/workspace/panel-nav.ts +20 -9
- package/src/shared/types/omp/agent.ts +20 -3
- package/src/shared/types/settings/state.ts +17 -5
- package/dist/client/static/js/ImageView-vchn6wyq.js +0 -1
- package/dist/client/static/js/LayoutWrapper-1x0gnppc.js +0 -2
- package/dist/client/static/js/Modal-tteg7vtb.js +0 -59
- package/dist/client/static/js/architecture-7GRP2DOG-bch3nye9.js +0 -1
- package/dist/client/static/js/bash-mevzaywf.js +0 -1
- package/dist/client/static/js/c-y1y6v00q.js +0 -1
- package/dist/client/static/js/cpp-wk9z0c5g.js +0 -1
- package/dist/client/static/js/css-3w3p9s67.js +0 -1
- package/dist/client/static/js/css-g85rwzty.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-vqy5jtnk.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-65ph4s3m.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-nh2tb65b.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-t45ekjb6.js +0 -1
- package/dist/client/static/js/graphql-027z8sc0.js +0 -1
- package/dist/client/static/js/html-fqda6wxx.js +0 -1
- package/dist/client/static/js/index-0vk6v4y4.js +0 -2
- package/dist/client/static/js/index-47wn2gjx.js +0 -2
- package/dist/client/static/js/index-4b5b6g0k.js +0 -1
- package/dist/client/static/js/index-5mrqfs82.js +0 -12
- package/dist/client/static/js/index-6bm4pw90.css +0 -1
- package/dist/client/static/js/index-a11ptyzf.js +0 -1
- package/dist/client/static/js/index-f98dhbt4.js +0 -4
- package/dist/client/static/js/index-kg2sk8cf.js +0 -1
- package/dist/client/static/js/index-q76jfb54.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-mw29xbwf.js +0 -1
- package/dist/client/static/js/ini-3cx6tmv4.js +0 -1
- package/dist/client/static/js/java-zs6qh1dm.js +0 -1
- package/dist/client/static/js/javascript-b9mkygak.js +0 -1
- package/dist/client/static/js/json-qn73s8xb.js +0 -1
- package/dist/client/static/js/jsx-gahhfczw.js +0 -1
- package/dist/client/static/js/lua-d8enp14s.js +0 -1
- package/dist/client/static/js/markdown-qetaj4vp.js +0 -1
- package/dist/client/static/js/one-dark-pro-rvg5xm1a.js +0 -1
- package/dist/client/static/js/one-light-2b5w3ksh.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-md85wpjq.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-4grcqnp8.js +0 -1
- package/dist/client/static/js/properties-g6tpq003.js +0 -1
- package/dist/client/static/js/python-cy06fzhg.js +0 -1
- package/dist/client/static/js/r-vw8berfv.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-7j9prhg1.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-g8x2jps1.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-cbg7k68h.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-xfvjk9f8.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-7w97805z.js +0 -1
- package/dist/client/static/js/sql-bwnasywx.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-e227mz39.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-xhf1r6c3.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-4n3j7ekq.js +0 -1
- package/dist/client/static/js/tsx-3dzv8h6k.js +0 -1
- package/dist/client/static/js/typescript-44vs0wn4.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-fb0py35r.js +0 -1
- package/dist/client/static/js/xml-yvv5fn3k.js +0 -1
- package/dist/client/static/js/yaml-avewh7n5.js +0 -1
- package/src/client/hooks/workspace/mobile-right-panel-nav.ts +0 -63
- package/src/shared/lib/ui/safe-area.test.ts +0 -28
- package/src/shared/lib/ui/safe-area.ts +0 -42
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where one ask's claimed dialogs sit among its questions.
|
|
8
|
+
*
|
|
9
|
+
* Split from `ask-frames.ts` (which decides WHICH ask a frame belongs to) so
|
|
10
|
+
* each file states one rule. This half takes the frames already owned by one
|
|
11
|
+
* tool call and answers the question the card asks: for each question, the
|
|
12
|
+
* dialogs it raised, in order.
|
|
13
|
+
*
|
|
14
|
+
* Three shapes arrive and each is placed by its own key:
|
|
15
|
+
*
|
|
16
|
+
* - a GROUPED frame (`method:"ask"`) covers every question it names, so it is
|
|
17
|
+
* pushed onto each of their buckets rather than onto one;
|
|
18
|
+
* - a frame claimed by its ROWS already knows its question (`optionPlacements`);
|
|
19
|
+
* - anything else is the per-question walk's business (`groupAskFrames`), which
|
|
20
|
+
* follows omp's own forward-moving order.
|
|
21
|
+
*
|
|
22
|
+
* A frame with neither a title nor a row match is not walked at all: it is
|
|
23
|
+
* handed back as `loose`, because the card must draw it as the live control
|
|
24
|
+
* rather than guess a question and print the wrong one as open.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
28
|
+
import type { AskQuestion } from '@/shared/lib/chat/ask-form/types';
|
|
29
|
+
import { groupAskFrames } from '@/shared/lib/chat/ask-questions';
|
|
30
|
+
|
|
31
|
+
export interface BucketedFrames {
|
|
32
|
+
/** One bucket per question, in form order. */
|
|
33
|
+
perQuestion: ExtensionUiDialogRequest[][];
|
|
34
|
+
/**
|
|
35
|
+
* Frames matched by NEITHER key, which the card draws as the live control
|
|
36
|
+
* (see `looseByTool`). They are deliberately absent from every question
|
|
37
|
+
* bucket: guessing one would print the wrong question as open.
|
|
38
|
+
*/
|
|
39
|
+
unmatched: ExtensionUiDialogRequest[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function bucketAskFrames(
|
|
43
|
+
questions: AskQuestion[],
|
|
44
|
+
frames: readonly ExtensionUiDialogRequest[],
|
|
45
|
+
/** Frames claimed by neither key, which the card draws as the live control. */
|
|
46
|
+
unmatched: ReadonlySet<ExtensionUiDialogRequest>,
|
|
47
|
+
/** Question index per frame claimed by its option rows. */
|
|
48
|
+
optionPlacements: ReadonlyMap<ExtensionUiDialogRequest, number>,
|
|
49
|
+
): BucketedFrames {
|
|
50
|
+
const placed: ExtensionUiDialogRequest[][] = questions.map((): ExtensionUiDialogRequest[] => []);
|
|
51
|
+
/** Frames the per-question walk still has to place. */
|
|
52
|
+
const walking: ExtensionUiDialogRequest[] = [];
|
|
53
|
+
const unplaced: ExtensionUiDialogRequest[] = [];
|
|
54
|
+
for (const frame of frames) {
|
|
55
|
+
if (Array.isArray(frame.questions) && frame.questions.length > 0) {
|
|
56
|
+
for (const grouped of frame.questions) {
|
|
57
|
+
const index = questions.findIndex((question) => question.id === grouped.id);
|
|
58
|
+
if (index >= 0) placed[index].push(frame);
|
|
59
|
+
else walking.push(frame);
|
|
60
|
+
}
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const byOptions = optionPlacements.get(frame);
|
|
64
|
+
if (byOptions !== undefined) {
|
|
65
|
+
if (placed[byOptions]) placed[byOptions].push(frame);
|
|
66
|
+
else walking.push(frame);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (unmatched.has(frame)) {
|
|
70
|
+
unplaced.push(frame);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
walking.push(frame);
|
|
74
|
+
}
|
|
75
|
+
const walked = groupAskFrames(questions, walking);
|
|
76
|
+
return { perQuestion: questions.map((_, index) => [...placed[index], ...walked[index]]), unmatched: unplaced };
|
|
77
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The context the timeline provides so any ask card can reach the dialogs omp
|
|
8
|
+
* is blocked on: what `splitAskFrames` routed to it, and the one responder that
|
|
9
|
+
* puts an answer on the wire.
|
|
10
|
+
*
|
|
11
|
+
* Split from `ask-frames.ts` (which owns the ROUTING) because the two answer
|
|
12
|
+
* different questions: routing decides which card a frame belongs to, and this
|
|
13
|
+
* is the plumbing that hands the result down the tree. A component needs one or
|
|
14
|
+
* the other, never both.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { createContext, useContext } from 'preact/compat';
|
|
18
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
19
|
+
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
20
|
+
|
|
21
|
+
export interface AskFramesSplit {
|
|
22
|
+
/** The ask's dialogs, bucketed per question, keyed by ask tool-call id. */
|
|
23
|
+
framesByTool: Map<string, ExtensionUiDialogRequest[][]>;
|
|
24
|
+
/**
|
|
25
|
+
* Field dialogs that belong to an open ask but matched no question, keyed by
|
|
26
|
+
* tool id. A form parser can drift from omp's on a shape neither was written
|
|
27
|
+
* for; the frame must still be answerable on the card, and the modal has no
|
|
28
|
+
* field body. The card draws these last, as the live control.
|
|
29
|
+
*/
|
|
30
|
+
looseByTool: Map<string, ExtensionUiDialogRequest[]>;
|
|
31
|
+
/** Ask dialogs no card can own — the timeline draws them inline. */
|
|
32
|
+
orphanAsks: ExtensionUiDialogRequest[];
|
|
33
|
+
/**
|
|
34
|
+
* The whole-form dialog of an ask call (omp 19.1.0's `method:"form"`), keyed
|
|
35
|
+
* by tool id. ONE frame answers every control, so it is not bucketed per
|
|
36
|
+
* question like the per-field walk's dialogs.
|
|
37
|
+
*/
|
|
38
|
+
formByTool: Map<string, ExtensionUiDialogRequest>;
|
|
39
|
+
/** Oldest non-ask request nothing claimed — the one the modal renders. */
|
|
40
|
+
modalRequest: ExtensionUiDialogRequest | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface AskFramesHandle {
|
|
44
|
+
framesByTool: AskFramesSplit['framesByTool'];
|
|
45
|
+
/** Ask field dialogs a card owns but no question matched (see `looseByTool`). */
|
|
46
|
+
looseByTool: AskFramesSplit['looseByTool'];
|
|
47
|
+
/** Ask dialogs with no tool card to render them (see `orphanAsks`). */
|
|
48
|
+
orphanAsks: AskFramesSplit['orphanAsks'];
|
|
49
|
+
/** The ask's whole-form dialog, when it has one (see `formByTool`). */
|
|
50
|
+
formByTool: AskFramesSplit['formByTool'];
|
|
51
|
+
/** Answer one ask dialog and drop it from the pending queue. */
|
|
52
|
+
respond: (request: ExtensionUiDialogRequest, response: ExtensionDialogResponse) => void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const EMPTY: AskFramesHandle = {
|
|
56
|
+
framesByTool: new Map(),
|
|
57
|
+
looseByTool: new Map(),
|
|
58
|
+
orphanAsks: [],
|
|
59
|
+
formByTool: new Map(),
|
|
60
|
+
respond: () => {},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const AskFramesContext = createContext<AskFramesHandle>(EMPTY);
|
|
64
|
+
|
|
65
|
+
/** Pending ask dialogs for the timeline that provides them. */
|
|
66
|
+
export function useAskFrames(): AskFramesHandle {
|
|
67
|
+
return useContext(AskFramesContext);
|
|
68
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* omp 19.1.0's `method:"form"` frame — the RPC host's `ui.formDialog`.
|
|
8
|
+
*
|
|
9
|
+
* The `ask` tool stopped walking its HTML form one blocking dialog at a time
|
|
10
|
+
* and now sends the whole form once, keyed by the same `html` the tool call's
|
|
11
|
+
* arguments carry, answered by ONE `{ data }` reply. Two facts matter here and
|
|
12
|
+
* neither is visible to a type check:
|
|
13
|
+
*
|
|
14
|
+
* 1. The frame must be CLAIMED by its call. Unclaimed, it reached the modal —
|
|
15
|
+
* a panel with no form body — while the agent stayed blocked.
|
|
16
|
+
* 2. The `data` payload must satisfy omp's validation (`parseFormDialogResponse`):
|
|
17
|
+
* an unknown key, a disabled option, an array where a single string is
|
|
18
|
+
* expected, or a missing required field is refused and the run parks.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { describe, expect, test } from 'bun:test';
|
|
22
|
+
|
|
23
|
+
import { splitAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
24
|
+
import { buildFormData, formAnswers, isArrayQuestion } from '@/shared/lib/chat/ask-form/data';
|
|
25
|
+
import { parseAskForm } from '@/shared/lib/chat/ask-form';
|
|
26
|
+
import type { AskQuestion } from '@/shared/lib/chat/ask-form/types';
|
|
27
|
+
import type { ChatMessageData } from '@/shared/types';
|
|
28
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
29
|
+
|
|
30
|
+
const HTML = `<form>
|
|
31
|
+
<fieldset>
|
|
32
|
+
<legend>Flavour</legend>
|
|
33
|
+
<label><input type="radio" name="flavour" value="yes" checked> Yes</label>
|
|
34
|
+
<label><input type="radio" name="flavour" value="no"> No</label>
|
|
35
|
+
</fieldset>
|
|
36
|
+
<label>Serving <input type="number" name="serving" value="1" required></label>
|
|
37
|
+
<label><input type="checkbox" name="extras" value="ice"> Ice</label>
|
|
38
|
+
<label><input type="checkbox" name="extras" value="lemon"> Lemon</label>
|
|
39
|
+
</form>`;
|
|
40
|
+
|
|
41
|
+
function askTool(html: string) {
|
|
42
|
+
return {
|
|
43
|
+
id: 'call-ask',
|
|
44
|
+
type: 'custom' as const,
|
|
45
|
+
title: 'ask',
|
|
46
|
+
name: 'ask',
|
|
47
|
+
input: { html },
|
|
48
|
+
status: 'running' as const,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function message(html: string): ChatMessageData {
|
|
53
|
+
return { id: 'm1', role: 'ai', content: '', toolCalls: [askTool(html)] } as unknown as ChatMessageData;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const formFrame: ExtensionUiDialogRequest = {
|
|
57
|
+
type: 'extension_ui_request',
|
|
58
|
+
id: 'frame-form',
|
|
59
|
+
method: 'form',
|
|
60
|
+
html: HTML,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
describe('splitAskFrames with a form frame', () => {
|
|
64
|
+
test('claims the ask by its html and never reaches the modal', () => {
|
|
65
|
+
const split = splitAskFrames([message(HTML)], [formFrame], true);
|
|
66
|
+
expect(split.formByTool.get('call-ask')).toBe(formFrame);
|
|
67
|
+
expect(split.orphanAsks).toEqual([]);
|
|
68
|
+
expect(split.modalRequest).toBeNull();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('a form no ask raised is an inline orphan, not a modal', () => {
|
|
72
|
+
const split = splitAskFrames([], [formFrame], true);
|
|
73
|
+
expect(split.formByTool.size).toBe(0);
|
|
74
|
+
expect(split.orphanAsks).toEqual([formFrame]);
|
|
75
|
+
expect(split.modalRequest).toBeNull();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('falls back to the single open ask when the html differs only in whitespace', () => {
|
|
79
|
+
const reindented = HTML.replace(/\n\s*/g, ' ');
|
|
80
|
+
const split = splitAskFrames([message(HTML)], [{ ...formFrame, html: reindented }], true);
|
|
81
|
+
expect(split.formByTool.get('call-ask')?.id).toBe('frame-form');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('an empty queue reports an empty form map', () => {
|
|
85
|
+
expect(splitAskFrames([message(HTML)], [], true).formByTool.size).toBe(0);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('buildFormData', () => {
|
|
90
|
+
const questions = parseAskForm(HTML);
|
|
91
|
+
|
|
92
|
+
test('the form parses into one question per control name', () => {
|
|
93
|
+
expect(questions.map((question) => question.id)).toEqual(['flavour', 'serving', 'extras']);
|
|
94
|
+
expect(questions[0].multi).toBe(false);
|
|
95
|
+
expect(questions[2].multi).toBe(true);
|
|
96
|
+
expect(isArrayQuestion(questions[2])).toBe(true);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('carries required and disabled through the parser', () => {
|
|
100
|
+
expect(questions[1].required).toBe(true);
|
|
101
|
+
const withDisabled = parseAskForm(
|
|
102
|
+
'<form><fieldset><legend>Pick</legend>' +
|
|
103
|
+
'<label><input type="radio" name="a" value="1" disabled> One</label>' +
|
|
104
|
+
'<label><input type="radio" name="a" value="2"> Two</label></fieldset></form>',
|
|
105
|
+
);
|
|
106
|
+
expect(withDisabled[0].options[0].disabled).toBe(true);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test('a single choice submits one string and a group an array', () => {
|
|
110
|
+
const built = buildFormData(questions, {
|
|
111
|
+
0: { selected: ['Yes'], text: '' },
|
|
112
|
+
1: { selected: [], text: '2' },
|
|
113
|
+
2: { selected: ['Ice', 'Lemon'], text: '' },
|
|
114
|
+
});
|
|
115
|
+
expect(built).toEqual({ data: { flavour: 'yes', serving: '2', extras: ['ice', 'lemon'] } });
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('a typed answer stands in for the single choice', () => {
|
|
119
|
+
const built = buildFormData(questions, {
|
|
120
|
+
0: { selected: [], text: 'oat' },
|
|
121
|
+
1: { selected: [], text: '1' },
|
|
122
|
+
});
|
|
123
|
+
expect('data' in built && built.data.flavour).toBe('oat');
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test('Other text joins a checkbox group as an extra entry', () => {
|
|
127
|
+
const built = buildFormData(questions, {
|
|
128
|
+
0: { selected: ['No'], text: '' },
|
|
129
|
+
1: { selected: [], text: '3' },
|
|
130
|
+
2: { selected: ['Ice'], text: 'sprinkles' },
|
|
131
|
+
});
|
|
132
|
+
expect('data' in built && built.data.extras).toEqual(['ice', 'sprinkles']);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test('a required field left empty names the question instead of sending', () => {
|
|
136
|
+
const built = buildFormData(questions, { 0: { selected: ['Yes'], text: '' } });
|
|
137
|
+
expect(built).toEqual({ missing: questions[1].question });
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test('nothing answered at all is refused rather than sent as {}', () => {
|
|
141
|
+
const optional = parseAskForm('<form><label>Note <input name="note"></label></form>');
|
|
142
|
+
expect(buildFormData(optional, {})).toEqual({ missing: 'Answer at least one question.' });
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('a disabled option is never sent', () => {
|
|
146
|
+
const withDisabled = parseAskForm(
|
|
147
|
+
'<form><fieldset><legend>Pick</legend>' +
|
|
148
|
+
'<label><input type="radio" name="a" value="1" disabled> One</label>' +
|
|
149
|
+
'<label><input type="radio" name="a" value="2"> Two</label></fieldset></form>',
|
|
150
|
+
);
|
|
151
|
+
const built = buildFormData(withDisabled, { 0: { selected: ['One'], text: '' } });
|
|
152
|
+
expect(built).toEqual({ missing: 'Answer at least one question.' });
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
test('formAnswers reports every control in form order', () => {
|
|
156
|
+
const answers = formAnswers(questions, { 1: { selected: [], text: '4' } });
|
|
157
|
+
expect(answers.map((answer) => answer.name)).toEqual(['flavour', 'serving', 'extras']);
|
|
158
|
+
expect(answers[1].value).toBe('4');
|
|
159
|
+
// The radio group is not `required`, so an unanswered one is simply absent
|
|
160
|
+
// from the payload rather than named as a blocker.
|
|
161
|
+
expect(answers[0]).toEqual({ name: 'flavour', value: '' });
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
describe('AskQuestion required flag', () => {
|
|
166
|
+
test('is absent on a form whose controls are all optional', () => {
|
|
167
|
+
const questions: AskQuestion[] = parseAskForm('<form><label>Note <input name="note"></label></form>');
|
|
168
|
+
expect(questions[0].required).toBeUndefined();
|
|
169
|
+
});
|
|
170
|
+
});
|
|
@@ -74,7 +74,7 @@ describe('splitAskFrames', () => {
|
|
|
74
74
|
const gate = confirmFrame('g1', 'Run bash?');
|
|
75
75
|
|
|
76
76
|
// The regression: the frame has been replayed, its tool call has not.
|
|
77
|
-
expect(splitAskFrames([], [question], false)).toEqual({ framesByTool: new Map(), looseByTool: new Map(), orphanAsks: [], modalRequest: null });
|
|
77
|
+
expect(splitAskFrames([], [question], false)).toEqual({ framesByTool: new Map(), looseByTool: new Map(), orphanAsks: [], formByTool: new Map(), modalRequest: null });
|
|
78
78
|
// The hold is uniform — a gate cannot be told from an ask before history
|
|
79
79
|
// either, and it is re-decided the moment the history settles.
|
|
80
80
|
expect(splitAskFrames([], [gate], false).modalRequest).toBeNull();
|
|
@@ -43,49 +43,14 @@
|
|
|
43
43
|
* modal — never the card claim — until there is a timeline to decide against.
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
import { createContext, useContext } from 'preact/compat';
|
|
47
46
|
import type { ChatMessageData } from '@/shared/types';
|
|
48
47
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
49
|
-
import { askQuestionForFrame, askQuestionForOptions, askQuestionForTitle, askQuestionSharesText,
|
|
50
|
-
import {
|
|
51
|
-
import type {
|
|
48
|
+
import { askQuestionForFrame, askQuestionForOptions, askQuestionForTitle, askQuestionSharesText, normalizeAskText } from '@/shared/lib/chat/ask-questions';
|
|
49
|
+
import { bucketAskFrames } from '@/client/hooks/chat/timeline/ask-frame-buckets';
|
|
50
|
+
import type { AskFramesSplit } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
51
|
+
import { collectAsks } from '@/client/hooks/chat/timeline/ask-frame-asks';
|
|
52
|
+
import { claimFormFrame } from '@/client/hooks/chat/timeline/ask-form-frame';
|
|
52
53
|
import { isApprovalGateFrame } from '@/shared/lib/chat/omp/approval-gate';
|
|
53
|
-
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
54
|
-
|
|
55
|
-
export interface AskFramesSplit {
|
|
56
|
-
/** The ask's dialogs, bucketed per question, keyed by ask tool-call id. */
|
|
57
|
-
framesByTool: Map<string, ExtensionUiDialogRequest[][]>;
|
|
58
|
-
/**
|
|
59
|
-
* Field dialogs that belong to an open ask but matched no question, keyed by
|
|
60
|
-
* tool id. A form parser can drift from omp's on a shape neither was written
|
|
61
|
-
* for; the frame must still be answerable on the card, and the modal has no
|
|
62
|
-
* field body. The card draws these last, as the live control.
|
|
63
|
-
*/
|
|
64
|
-
looseByTool: Map<string, ExtensionUiDialogRequest[]>;
|
|
65
|
-
/** Ask dialogs no card can own — the timeline draws them inline. */
|
|
66
|
-
orphanAsks: ExtensionUiDialogRequest[];
|
|
67
|
-
/** Oldest non-ask request nothing claimed — the one the modal renders. */
|
|
68
|
-
modalRequest: ExtensionUiDialogRequest | null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface AskFramesHandle {
|
|
72
|
-
framesByTool: AskFramesSplit['framesByTool'];
|
|
73
|
-
/** Ask field dialogs a card owns but no question matched (see `looseByTool`). */
|
|
74
|
-
looseByTool: AskFramesSplit['looseByTool'];
|
|
75
|
-
/** Ask dialogs with no tool card to render them (see `orphanAsks`). */
|
|
76
|
-
orphanAsks: AskFramesSplit['orphanAsks'];
|
|
77
|
-
/** Answer one ask dialog and drop it from the pending queue. */
|
|
78
|
-
respond: (request: ExtensionUiDialogRequest, response: ExtensionDialogResponse) => void;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const EMPTY: AskFramesHandle = { framesByTool: new Map(), looseByTool: new Map(), orphanAsks: [], respond: () => {} };
|
|
82
|
-
|
|
83
|
-
export const AskFramesContext = createContext<AskFramesHandle>(EMPTY);
|
|
84
|
-
|
|
85
|
-
/** Pending ask dialogs for the timeline that provides them. */
|
|
86
|
-
export function useAskFrames(): AskFramesHandle {
|
|
87
|
-
return useContext(AskFramesContext);
|
|
88
|
-
}
|
|
89
54
|
|
|
90
55
|
export function splitAskFrames(
|
|
91
56
|
messages: ChatMessageData[],
|
|
@@ -96,7 +61,8 @@ export function splitAskFrames(
|
|
|
96
61
|
): AskFramesSplit {
|
|
97
62
|
const framesByTool = new Map<string, ExtensionUiDialogRequest[][]>();
|
|
98
63
|
const looseByTool = new Map<string, ExtensionUiDialogRequest[]>();
|
|
99
|
-
|
|
64
|
+
const formByTool = new Map<string, ExtensionUiDialogRequest>();
|
|
65
|
+
if (pending.length === 0) return { framesByTool, looseByTool, orphanAsks: [], formByTool, modalRequest: null };
|
|
100
66
|
|
|
101
67
|
// Match against the asks that can still own a dialog: a reloaded session
|
|
102
68
|
// reads its tool calls back from the JSONL, where a call still parked on a
|
|
@@ -110,23 +76,7 @@ export function splitAskFrames(
|
|
|
110
76
|
// ask, and one whose every question already carries a recorded answer, is
|
|
111
77
|
// therefore not a candidate at all. A parked call read back from the JSONL is
|
|
112
78
|
// neither: omp writes no result until the question is answered.
|
|
113
|
-
const
|
|
114
|
-
// Every ask, settled ones included: a dialog whose call just failed is still
|
|
115
|
-
// the ask's dialog, so it belongs on the timeline (an inline orphan), never
|
|
116
|
-
// in the modal. Keeping them apart from `openAsks` is what lets ownership
|
|
117
|
-
// prefer the live call while recognition still avoids the modal.
|
|
118
|
-
const allAsks: { toolId: string; questions: AskQuestion[] }[] = [];
|
|
119
|
-
for (const message of messages) {
|
|
120
|
-
for (const tool of message.toolCalls ?? []) {
|
|
121
|
-
if (!isAskToolCall(tool)) continue;
|
|
122
|
-
const questions = parseAskQuestions(tool);
|
|
123
|
-
if (questions.length === 0) continue;
|
|
124
|
-
allAsks.push({ toolId: tool.id, questions });
|
|
125
|
-
if (isAskSettled(tool)) continue;
|
|
126
|
-
if (parseAskResult(tool, questions).every((answer) => answer !== null)) continue;
|
|
127
|
-
openAsks.push({ toolId: tool.id, questions });
|
|
128
|
-
}
|
|
129
|
-
}
|
|
79
|
+
const { openAsks, allAsks } = collectAsks(messages);
|
|
130
80
|
|
|
131
81
|
const owned = new Map<string, ExtensionUiDialogRequest[]>();
|
|
132
82
|
const handled = new Set<ExtensionUiDialogRequest>();
|
|
@@ -194,6 +144,27 @@ export function splitAskFrames(
|
|
|
194
144
|
continue;
|
|
195
145
|
}
|
|
196
146
|
|
|
147
|
+
// A FORM frame (omp 19.1.0's `ui.formDialog`, which the `ask` tool now
|
|
148
|
+
// uses) carries no `title` and no per-question ids: its `html` is the SAME
|
|
149
|
+
// string the tool call's arguments carry, which makes it the exact key.
|
|
150
|
+
// It answers every control of the form in one `{ data }` reply, so it
|
|
151
|
+
// belongs to the call as a whole rather than to one question.
|
|
152
|
+
if (request.method === 'form' && typeof request.html === 'string') {
|
|
153
|
+
const owner = claimFormFrame(request.html, openAsks);
|
|
154
|
+
if (owner) {
|
|
155
|
+
handled.add(request);
|
|
156
|
+
lastOwner = owner.toolId;
|
|
157
|
+
formByTool.set(owner.toolId, request);
|
|
158
|
+
} else if (historyLoaded) {
|
|
159
|
+
// Cardless: an extension's own `formDialog` (not the ask tool) has no
|
|
160
|
+
// card of its own. The timeline draws it inline rather than the modal,
|
|
161
|
+
// which has no form body.
|
|
162
|
+
orphanAsks.push(request);
|
|
163
|
+
handled.add(request);
|
|
164
|
+
}
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
|
|
197
168
|
let owner: string | null = null;
|
|
198
169
|
let titleMatched = false;
|
|
199
170
|
if (typeof request.title === 'string' && request.title) {
|
|
@@ -286,39 +257,9 @@ export function splitAskFrames(
|
|
|
286
257
|
|
|
287
258
|
for (const [toolId, frames] of owned) {
|
|
288
259
|
const questions = openAsks.find((candidate) => candidate.toolId === toolId)?.questions ?? [];
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const loose: ExtensionUiDialogRequest[] = [];
|
|
293
|
-
const unmatched = new Set(unplaced.get(toolId) ?? []);
|
|
294
|
-
for (const frame of frames) {
|
|
295
|
-
if (Array.isArray(frame.questions) && frame.questions.length > 0) {
|
|
296
|
-
for (const grouped of frame.questions) {
|
|
297
|
-
const index = questions.findIndex((question) => question.id === grouped.id);
|
|
298
|
-
if (index >= 0) placed[index].push(frame);
|
|
299
|
-
else loose.push(frame);
|
|
300
|
-
}
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
// A frame claimed by its rows already knows the question it belongs to.
|
|
304
|
-
const byOptions = optionPlacements.get(frame);
|
|
305
|
-
if (byOptions !== undefined) {
|
|
306
|
-
if (placed[byOptions]) placed[byOptions].push(frame);
|
|
307
|
-
else loose.push(frame);
|
|
308
|
-
continue;
|
|
309
|
-
}
|
|
310
|
-
// A frame with neither a title nor a row match has no question to walk
|
|
311
|
-
// to; the card draws it as the live control (see `looseByTool`) rather
|
|
312
|
-
// than guessing a question and printing the wrong one as open.
|
|
313
|
-
if (unmatched.has(frame)) continue;
|
|
314
|
-
loose.push(frame);
|
|
315
|
-
}
|
|
316
|
-
// Everything that was not part of a grouped frame keeps the per-question
|
|
317
|
-
// walk it has always used.
|
|
318
|
-
const walked = groupAskFrames(questions, loose);
|
|
319
|
-
framesByTool.set(toolId, questions.map((_, index) => [...placed[index], ...walked[index]]));
|
|
320
|
-
const unplacedFrames = unplaced.get(toolId);
|
|
321
|
-
if (unplacedFrames && unplacedFrames.length > 0) looseByTool.set(toolId, unplacedFrames);
|
|
260
|
+
const buckets = bucketAskFrames(questions, frames, new Set(unplaced.get(toolId) ?? []), optionPlacements);
|
|
261
|
+
framesByTool.set(toolId, buckets.perQuestion);
|
|
262
|
+
if (buckets.unmatched.length > 0) looseByTool.set(toolId, buckets.unmatched);
|
|
322
263
|
}
|
|
323
264
|
|
|
324
265
|
// The frame stays queued either way — only the modal waits for the history,
|
|
@@ -326,8 +267,10 @@ export function splitAskFrames(
|
|
|
326
267
|
// in BOTH states: it is answered by a card or by the orphan row, and the
|
|
327
268
|
// modal has no body for it. Anything this split already handed to an inline
|
|
328
269
|
// surface is excluded too — a dialog must never be drawn twice.
|
|
270
|
+
// A `form` frame is excluded for the same reason as `ask`: the modal has no
|
|
271
|
+
// form body, so an unclaimed one is drawn inline by the timeline.
|
|
329
272
|
const modalRequest = historyLoaded
|
|
330
|
-
? pending.find((request) => !handled.has(request) && request.method !== 'ask') ?? null
|
|
273
|
+
? pending.find((request) => !handled.has(request) && request.method !== 'ask' && request.method !== 'form') ?? null
|
|
331
274
|
: null;
|
|
332
|
-
return { framesByTool, looseByTool, orphanAsks, modalRequest };
|
|
275
|
+
return { framesByTool, looseByTool, orphanAsks, formByTool, modalRequest };
|
|
333
276
|
}
|
|
@@ -57,6 +57,25 @@ function publish(): void {
|
|
|
57
57
|
for (const listener of listeners) listener();
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Turn the rail on because a setting just made it load-bearing.
|
|
62
|
+
*
|
|
63
|
+
* The phone's LEFT drawer only has a strip while the rail is on
|
|
64
|
+
* (`use-dock.ts` mirrors `LeftColumn`'s `railEnabled && style === 'tabs'`), so
|
|
65
|
+
* choosing `tabs` with the rail off produced a card that said "active" over a
|
|
66
|
+
* drawer that drew nothing — the switch had no effect and the setting looked
|
|
67
|
+
* broken. The coupling lives here, with the store, for the same reason
|
|
68
|
+
* `persistPanelSide` does: a second caller must not be able to produce a style
|
|
69
|
+
* nobody can see.
|
|
70
|
+
*
|
|
71
|
+
* A no-op when the rail is already on, so it cannot publish a spurious change.
|
|
72
|
+
*/
|
|
73
|
+
export function revealLeftDock(): void {
|
|
74
|
+
if (readLeftDock().enabled) return;
|
|
75
|
+
writeLeftDock({ enabled: true });
|
|
76
|
+
publish();
|
|
77
|
+
}
|
|
78
|
+
|
|
60
79
|
export interface LeftDockHandle extends LeftDockState {
|
|
61
80
|
/** Draw the dock's activity bar. Off by default. */
|
|
62
81
|
setEnabled: (enabled: boolean) => void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The one reader/writer of a PHONE drawer's navigation style.
|
|
8
|
+
*
|
|
9
|
+
* One module for BOTH drawers, keyed by side, because the fact is the same for
|
|
10
|
+
* each and the desktop columns already state it that way
|
|
11
|
+
* (`client/hooks/workspace/panel-nav.ts` carries `left` and `right`). A second
|
|
12
|
+
* copy for the left drawer is how the two would drift about which event they
|
|
13
|
+
* announce or which key they persist under.
|
|
14
|
+
*
|
|
15
|
+
* The drawer is mounted only while it is a screen, so the value has to survive
|
|
16
|
+
* its own unmount — `appSettings` is a boot-time prop and would only show a new
|
|
17
|
+
* style after a reload. The settings modal calls `applyMobilePanelNav` when the
|
|
18
|
+
* value moves, which announces the event; `useMobilePanelNav` is the one
|
|
19
|
+
* subscriber, in the drawer.
|
|
20
|
+
*
|
|
21
|
+
* Deliberately NOT folded into `applyPanelNav(side, style)`: that event carries
|
|
22
|
+
* a desktop SIDE, and a phone change must not repaint a desktop column into a
|
|
23
|
+
* tree it was not asked for.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { useCallback, useState } from 'preact/hooks';
|
|
27
|
+
import { readKabmoSetting } from '@/shared/lib/settings/client';
|
|
28
|
+
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
29
|
+
import type { SettingsState } from '@/shared/types';
|
|
30
|
+
import {
|
|
31
|
+
MOBILE_PANEL_NAV_KEYS,
|
|
32
|
+
resolveMobilePanelNav,
|
|
33
|
+
type MobilePanelNav,
|
|
34
|
+
type PanelNavSide,
|
|
35
|
+
} from '@/shared/lib/workspace/panel-nav';
|
|
36
|
+
|
|
37
|
+
/** The key, checked against the settings field it must match to persist at all. */
|
|
38
|
+
export const MOBILE_PANEL_NAV_SETTING_KEY: Record<PanelNavSide, keyof SettingsState> = {
|
|
39
|
+
left: MOBILE_PANEL_NAV_KEYS.left satisfies keyof SettingsState,
|
|
40
|
+
right: MOBILE_PANEL_NAV_KEYS.right satisfies keyof SettingsState,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** Window event carrying `{ side, style }` as `detail`. */
|
|
44
|
+
export const MOBILE_PANEL_NAV_CHANGED_EVENT = 'omp:mobile-panel-nav-changed';
|
|
45
|
+
|
|
46
|
+
/** The stored style for one drawer, resolved against what this build can draw. */
|
|
47
|
+
export function currentMobilePanelNav(
|
|
48
|
+
side: PanelNavSide,
|
|
49
|
+
appSettings?: Record<string, any>,
|
|
50
|
+
): MobilePanelNav {
|
|
51
|
+
return resolveMobilePanelNav(
|
|
52
|
+
readKabmoSetting<unknown>(MOBILE_PANEL_NAV_SETTING_KEY[side], appSettings),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Announce a new style for one drawer; the persisted copy is the settings
|
|
58
|
+
* modal's own write.
|
|
59
|
+
*
|
|
60
|
+
* The SIDE travels in the detail, so a change to one drawer cannot repaint the
|
|
61
|
+
* other — the same rule `applyPanelNav` follows for the desktop columns, and the
|
|
62
|
+
* reason a single drawer-wide event would be wrong now that both have a style.
|
|
63
|
+
*/
|
|
64
|
+
export function applyMobilePanelNav(side: PanelNavSide, style: unknown): void {
|
|
65
|
+
if (typeof window === 'undefined') return;
|
|
66
|
+
window.dispatchEvent(
|
|
67
|
+
new CustomEvent(MOBILE_PANEL_NAV_CHANGED_EVENT, {
|
|
68
|
+
detail: { side, style: resolveMobilePanelNav(style) },
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The style one drawer should draw, kept live across settings edits. */
|
|
74
|
+
export function useMobilePanelNav(side: PanelNavSide): MobilePanelNav {
|
|
75
|
+
const [style, setStyle] = useState<MobilePanelNav>(() => currentMobilePanelNav(side));
|
|
76
|
+
useKabmoEvent(MOBILE_PANEL_NAV_CHANGED_EVENT, (event) => {
|
|
77
|
+
const detail = (event as CustomEvent<{ side?: unknown; style?: unknown }>).detail;
|
|
78
|
+
// A change addressed to the other drawer is not this drawer's news: an
|
|
79
|
+
// unconditional set would repaint both, and a drawer that re-mounts its
|
|
80
|
+
// tree loses whatever the user had open in it.
|
|
81
|
+
if (detail?.side !== side) return;
|
|
82
|
+
setStyle(resolveMobilePanelNav(detail.style));
|
|
83
|
+
});
|
|
84
|
+
return style;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** A writer the settings modal can hand one drawer's change to. */
|
|
88
|
+
export function useMobilePanelNavApply(): (side: PanelNavSide, style: unknown) => void {
|
|
89
|
+
return useCallback((side: PanelNavSide, style: unknown) => applyMobilePanelNav(side, style), []);
|
|
90
|
+
}
|