@kabmo-labs/kabmo 0.59.1 → 0.61.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 +397 -397
- package/dist/client/static/js/{Body-5yedtmnk.js → Body-ab8wswhm.js} +3 -3
- package/dist/client/static/js/{CsvGrid-39m8pp1c.js → CsvGrid-czssywvz.js} +2 -2
- package/dist/client/static/js/{DocxView-vd99cv12.js → DocxView-ke0dwdmt.js} +3 -3
- package/dist/client/static/js/{DrawioView-6nq4412n.js → DrawioView-a1whhy84.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-cs51gszy.js → HtmlPreview-dr32dwjy.js} +1 -1
- package/dist/client/static/js/ImageView-zf4kh5wp.js +1 -0
- package/dist/client/static/js/LayoutWrapper-dncbzcea.js +2 -0
- package/dist/client/static/js/MergeDiffView-btdx9yb9.js +1 -0
- package/dist/client/static/js/Modal-5cxfw2rv.js +60 -0
- package/dist/client/static/js/{PdfView-0zab721q.js → PdfView-2kdn91f9.js} +1 -1
- package/dist/client/static/js/SessionsView-vbn0nvx4.js +1 -0
- package/dist/client/static/js/{SheetView-2wdn5hkd.js → SheetView-ettr9pdw.js} +9 -9
- package/dist/client/static/js/{SvgPreview-fmrfxd7z.js → SvgPreview-hzcejjry.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-41scfh9v.js → abnfDiagram-O67JEVCF-kdmv4y72.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-sxrkxwbq.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-fp6etjvt.js → architectureDiagram-NJMV4G6O-qyrwaq0x.js} +11 -11
- package/dist/client/static/js/{astro-ryr2ajmg.js → astro-yphdvdty.js} +1 -1
- package/dist/client/static/js/bash-bcbct9gc.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-pespk9mt.js → blockDiagram-BEXU5L5S-tszxy2g7.js} +8 -8
- package/dist/client/static/js/c-fn9jz26e.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-rt4z91dx.js → c4Diagram-YGBWAQC7-0ye36hhv.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-6bzaq8sd.js → classDiagram-v2-NBCMYWYE-szgk1shv.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-z3fhgcba.js → cose-bilkent-JH36ORCC-0s9s4mmv.js} +1 -1
- package/dist/client/static/js/cpp-a1q64mke.js +1 -0
- package/dist/client/static/js/css-b92azee8.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-g1xwa8b9.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-8endeh4p.js → cynefinDiagram-VND7K2PF-664g28ze.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-2a2f32dv.js → dagre-6A5THRUB-ga4rp1jx.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-wgbyr6b7.js → diagram-22UHCM2B-aagj46ty.js} +15 -15
- package/dist/client/static/js/{diagram-3UASUU5V-5122b41x.js → diagram-3UASUU5V-20qk6whk.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-1gt9fr7e.js → diagram-ATOU4E4O-1vg1tfca.js} +2 -2
- package/dist/client/static/js/{diagram-CDSNMT55-v6hs59jb.js → diagram-CDSNMT55-90d6jrqs.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-yey2m5nm.js → diagram-MLGK6HIB-8je4z8m1.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-hg4f3q4d.js → diagram-MPIPVDR6-0kzpexsj.js} +2 -2
- package/dist/client/static/js/{dockerfile-56tfnp5r.js → dockerfile-5nrbr0ef.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-2mhc9aar.js → ebnfDiagram-ZINNZB2B-47yg36zx.js} +1 -1
- package/dist/client/static/js/{elixir-fyxw6d70.js → elixir-3nwnd9yw.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-wedtvz9y.js → elk-276RUBZZ-5hqp6r2d.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-1kysnby9.js → erDiagram-OPXOYQCR-bt9te7r0.js} +3 -3
- package/dist/client/static/js/{erlang-97ayje6m.js → erlang-p5c4n3t0.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-05p61bka.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-500fcx2a.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-j4g65rpm.js → ganttDiagram-FUAMR5RP-kzc13swm.js} +5 -5
- package/dist/client/static/js/gitGraph-4MIJSDKK-z1yehwys.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-vcwmj4b3.js → gitGraphDiagram-X574FWY7-bjf8aa3j.js} +14 -14
- package/dist/client/static/js/graphql-8d8bn59j.js +1 -0
- package/dist/client/static/js/html-6hdrwtz2.js +1 -0
- package/dist/client/static/js/{index-5e4e18tg.js → index-025s3fp8.js} +2 -2
- package/dist/client/static/js/{index-jaf968hx.js → index-0kcnghxn.js} +4 -4
- package/dist/client/static/js/{index-8tzt0dek.js → index-11qn05g9.js} +2 -2
- package/dist/client/static/js/{index-sqyvj03y.js → index-1fmjhm2d.js} +9 -9
- package/dist/client/static/js/{index-42q5gg7t.js → index-24a40rw8.js} +1 -1
- package/dist/client/static/js/{index-np2rfq06.js → index-2dmew334.js} +2 -2
- package/dist/client/static/js/{index-wkxsypj1.js → index-2zhmmtye.js} +2 -2
- package/dist/client/static/js/{index-m62sf9wn.js → index-3x7cbxwq.js} +1 -1
- package/dist/client/static/js/{index-fg0ne74z.js → index-475dc6h9.js} +2 -2
- package/dist/client/static/js/{index-1mkn5fbf.js → index-4vtc4xct.js} +197 -197
- package/dist/client/static/js/{index-spnrx2c0.js → index-5srvxsht.js} +1 -1
- package/dist/client/static/js/{index-tz5ewsza.js → index-653x8zdq.js} +9 -9
- package/dist/client/static/js/index-6c1s0v4b.js +1 -0
- package/dist/client/static/js/{index-hgzf4ask.js → index-776n5n29.js} +5 -5
- package/dist/client/static/js/{index-a70sk36c.js → index-85jfn1fz.js} +2 -2
- package/dist/client/static/js/{index-yrwm437g.js → index-97sw4d9n.js} +2 -2
- package/dist/client/static/js/{index-csxnqgzw.js → index-9g2nzgpx.js} +6 -6
- package/dist/client/static/js/{index-y4cx8cqf.js → index-a145x0w2.js} +2 -2
- package/dist/client/static/js/{index-mhrkjbjq.js → index-bdtftrym.js} +2 -2
- package/dist/client/static/js/{index-db6s66jr.js → index-bkn6jtn1.js} +2 -2
- package/dist/client/static/js/{index-kt77dwsg.js → index-bq9f0mxp.js} +7 -7
- package/dist/client/static/js/{index-ndqtff48.js → index-ca6tmamh.js} +2 -2
- package/dist/client/static/js/index-cvm2ha01.js +1 -0
- package/dist/client/static/js/index-d11mbz2q.js +4 -0
- package/dist/client/static/js/{index-3kedv94b.js → index-dabnbvbc.js} +2 -2
- package/dist/client/static/js/{index-sg65xdey.js → index-enm77k5z.js} +2 -2
- package/dist/client/static/js/{index-nf4hq5tg.js → index-excgtjhx.js} +14 -14
- package/dist/client/static/js/{index-51rbgeh9.js → index-fb2fjndj.js} +5 -5
- package/dist/client/static/js/index-fen0x3qh.js +1 -0
- package/dist/client/static/js/{index-vs2y8gxr.js → index-fr6wsqk8.js} +2 -2
- package/dist/client/static/js/{index-xqz7bqcn.js → index-gwgh27h3.js} +87 -87
- package/dist/client/static/js/{index-2h7xh93h.js → index-h7agc069.js} +1 -1
- package/dist/client/static/js/{index-69mnn71v.js → index-hwv7bfxc.js} +2 -2
- package/dist/client/static/js/{index-461ga40v.js → index-hxy1sadd.js} +2 -2
- package/dist/client/static/js/{index-s7p2wdr1.js → index-jz4012t5.js} +1 -1
- package/dist/client/static/js/{index-gajpd90b.js → index-k9yf2txw.js} +2 -2
- package/dist/client/static/js/{index-dw9epydj.js → index-kj70d2q9.js} +2 -2
- package/dist/client/static/js/{index-7enfdvh0.js → index-krdz5vby.js} +2 -2
- package/dist/client/static/js/{index-42k78whj.js → index-kyr612aa.js} +1 -1
- package/dist/client/static/js/{index-fvphmwkf.js → index-m24sebb0.js} +2 -2
- package/dist/client/static/js/{index-d9sfavx1.js → index-mtav0rpf.js} +2 -2
- package/dist/client/static/js/{index-58z2hatp.js → index-n8r7r86r.js} +1 -1
- package/dist/client/static/js/index-pg87cgpy.js +2 -0
- package/dist/client/static/js/{index-r42f3r1p.js → index-q1a40v20.js} +2 -2
- package/dist/client/static/js/{index-jct0jryd.js → index-qccydkze.js} +2 -2
- package/dist/client/static/js/index-qmvstmvh.js +1 -0
- package/dist/client/static/js/{index-pn0ja904.js → index-r38e0rya.js} +2 -2
- package/dist/client/static/js/{index-92h38pwg.js → index-s4j2ghmx.js} +2 -2
- package/dist/client/static/js/index-sr14vwn5.js +2 -0
- package/dist/client/static/js/{index-z82nd2bd.js → index-sx83ans2.js} +2 -2
- package/dist/client/static/js/index-t6nqy2n5.css +1 -0
- package/dist/client/static/js/{index-fsa18ns9.js → index-twwsn91p.js} +2 -2
- package/dist/client/static/js/{index-nwbr15b3.js → index-v88m5sva.js} +2 -2
- package/dist/client/static/js/{index-qc3de995.js → index-vgcw01yk.js} +1 -1
- package/dist/client/static/js/{index-pr8wsq24.js → index-vn59zz0k.js} +2 -2
- package/dist/client/static/js/{index-hrez92pw.js → index-wf5j0009.js} +7 -7
- package/dist/client/static/js/{index-q3k8r0ms.js → index-wsy6y5em.js} +9 -9
- package/dist/client/static/js/{index-d201jvs9.js → index-xy0m8te9.js} +1 -1
- package/dist/client/static/js/index-y6zbkh4p.js +2 -0
- package/dist/client/static/js/{index-h1xbx74w.js → index-yfcy4cf6.js} +2 -2
- package/dist/client/static/js/{index-y5pkqrga.js → index-z5s9tmj8.js} +2 -2
- package/dist/client/static/js/{index-vs3g6njv.js → index-zr3965k9.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-dqyaxjc1.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-7craq9x2.js → infoDiagram-VRGFBTTK-jy5zvvj8.js} +1 -1
- package/dist/client/static/js/ini-g6a5xsaw.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ncjty2re.js → ishikawaDiagram-OU5B5YK6-pfky1nnf.js} +3 -3
- package/dist/client/static/js/java-n596am4c.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-yx222bzt.js → journeyDiagram-ZHPQQLJL-mvaf7rfh.js} +4 -4
- package/dist/client/static/js/json-7k70qbkj.js +1 -0
- package/dist/client/static/js/jsx-sndenqrc.js +1 -0
- package/dist/client/static/js/{julia-agc5kfvg.js → julia-rpd1y9vh.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-a2f84qmn.js → kanban-definition-PNTS6WVX-hw2xwe6e.js} +5 -5
- package/dist/client/static/js/lua-djd3g9q5.js +1 -0
- package/dist/client/static/js/markdown-r2tpvxpn.js +1 -0
- package/dist/client/static/js/{mermaid.core-9vfwthw3.js → mermaid.core-hsw87hmq.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-fsxysg6f.js → mindmap-definition-NLK3R4M7-wfe4d846.js} +7 -7
- package/dist/client/static/js/one-dark-pro-ckq5capv.js +1 -0
- package/dist/client/static/js/one-light-a908z398.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-7jxzax4z.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-77wxmp9g.js → pegDiagram-GJSIUBJH-cvnmxgst.js} +1 -1
- package/dist/client/static/js/{perl-v5vbtzgf.js → perl-kmtz9dnv.js} +1 -1
- package/dist/client/static/js/{php-83qwy98t.js → php-bttrsbxy.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-wc9wxr7f.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-gvgfhez0.js → pieDiagram-5QR66LMP-0n3gz7sv.js} +2 -2
- package/dist/client/static/js/properties-brn72zdk.js +1 -0
- package/dist/client/static/js/python-g9mghwgm.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-9zkbt5h8.js → quadrantDiagram-O4NWA36T-9qqh6xvv.js} +4 -4
- package/dist/client/static/js/r-e247x4mw.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-kwj5padj.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-h8sdx3w5.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2wmwx246.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-h4cdgw3y.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-q7m0tfd0.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-w55bsyw6.js → railroadDiagram-XR7U4H2S-5f3x3762.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-828s1e5g.js → requirementDiagram-PLB6GJNP-a68bv6kh.js} +12 -12
- package/dist/client/static/js/{ruby-994n5j6e.js → ruby-dve3y59w.js} +1 -1
- package/dist/client/static/js/{rust-csv5f258.js → rust-qjhdt4b0.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-34f3fyvg.js → sankeyDiagram-IPEJSGJF-ry7xcphh.js} +4 -4
- package/dist/client/static/js/{sass-p6g7qdv2.js → sass-emxqt5p2.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-nnta2hn0.js → sequenceDiagram-PO4LG4MO-mekzzhet.js} +21 -21
- package/dist/client/static/js/{sizeCapture-INFHLROL-gpcramga.js → sizeCapture-INFHLROL-pvc16ame.js} +1 -1
- package/dist/client/static/js/sql-0kar81jy.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-3f2en220.js → stateDiagram-v2-GCMORJYK-3ytxby83.js} +3 -3
- package/dist/client/static/js/{svelte-bek3h1sz.js → svelte-dbsx1ehx.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-jgqt12z9.js → swimlanes-2SLR337P-c2zfp416.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-9gm67sq4.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-sgchcs11.js → timeline-definition-EJHVYXUP-xtvv4za2.js} +6 -6
- package/dist/client/static/js/treeView-Q6P3EWNA-yv9640h3.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-7kpzjg21.js +1 -0
- package/dist/client/static/js/typescript-bm89v3gk.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-znkg9pkq.js → usecaseDiagram-POWQR4AR-sz6b7bnv.js} +51 -51
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-dncg96ej.js → vennDiagram-UO4OBE2U-56q0qs51.js} +5 -5
- package/dist/client/static/js/{vue-y44m889c.js → vue-hyr58df9.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mggay64p.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-77xz2d49.js → wardleyDiagram-VNRHLVJA-xvtyvde9.js} +5 -5
- package/dist/client/static/js/xml-b7824nx0.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-40j1aqyf.js → xychartDiagram-PMCCYNJV-jcs20s84.js} +6 -6
- package/dist/client/static/js/yaml-kqqktdv1.js +1 -0
- package/package.json +4 -4
- package/src/client/borders.css +28 -15
- package/src/client/components/common/Modal.tsx +10 -2
- package/src/client/components/common/Toast.tsx +8 -3
- package/src/client/components/common/anchored-menu/index.tsx +10 -3
- package/src/client/components/common/command-palette/index.tsx +9 -3
- package/src/client/components/common/fullscreen-viewer/index.tsx +1 -1
- package/src/client/components/common/header-controls/index.test.tsx +40 -3
- package/src/client/components/common/header-controls/index.tsx +106 -56
- package/src/client/components/common/search-select/search-select.test.tsx +10 -1
- package/src/client/components/common/workspace-mark/index.test.tsx +67 -0
- package/src/client/components/common/workspace-mark/index.tsx +48 -0
- package/src/client/components/layout/ActivityBar.test.ts +1 -1
- package/src/client/components/layout/ActivityBarDrag.test.ts +1 -1
- package/src/client/components/layout/LeftActivityBar.test.ts +48 -3
- package/src/client/components/layout/LeftDock.tsx +33 -14
- package/src/client/components/layout/PanelButton.test.tsx +119 -0
- package/src/client/components/layout/PanelButton.tsx +2 -4
- package/src/client/components/layout/activity-bar/Row.tsx +125 -0
- package/src/client/components/layout/{ActivityBar.tsx → activity-bar/index.tsx} +81 -20
- package/src/client/components/layout/controls-bar/index.tsx +183 -0
- package/src/client/components/layout/desktop-layout/BarSlot.tsx +18 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.test.tsx +187 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +81 -64
- package/src/client/components/layout/desktop-layout/LeftRail.tsx +60 -0
- package/src/client/components/layout/desktop-layout/LeftTabsColumn.tsx +91 -0
- package/src/client/components/layout/desktop-layout/ResizeHandle.tsx +19 -3
- package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +60 -0
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +77 -28
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +114 -104
- package/src/client/components/layout/desktop-layout/index.tsx +48 -45
- package/src/client/components/layout/desktop-layout/resizer/index.tsx +25 -83
- package/src/client/components/layout/desktop-layout/resizer/panel-motion.ts +61 -0
- package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +40 -2
- package/src/client/components/layout/desktop-layout/resizer/separator.tsx +89 -0
- package/src/client/components/layout/left-bar/index.tsx +88 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +5 -2
- package/src/client/components/layout/session-sidebar/Footer.tsx +28 -11
- package/src/client/components/layout/session-sidebar/FooterHost.tsx +167 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +2 -2
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +8 -3
- package/src/client/components/layout/session-sidebar/footer-host.test.tsx +133 -0
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +5 -2
- package/src/client/components/layout/session-title-bar/index.tsx +199 -0
- package/src/client/components/layout/top-bars.test.tsx +338 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +13 -2
- package/src/client/components/mobile/SessionSidebar.tsx +10 -8
- package/src/client/components/mobile/drawer-layout.test.tsx +67 -0
- package/src/client/components/mobile/drawer-strip.tsx +37 -14
- package/src/client/components/mobile/left-drawer-nav.test.tsx +19 -127
- package/src/client/components/settings/LazyModal.tsx +8 -2
- package/src/client/components/settings/Modal.tsx +6 -2
- package/src/client/components/settings/apply-side-effects.ts +5 -0
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +1 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +6 -5
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/ChromeStyleSection.tsx +105 -0
- package/src/client/components/settings/categories/appearance-settings/groups.ts +3 -2
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +8 -1
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +8 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -25
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +1 -1
- package/src/client/components/workspace/editor/Tab.tsx +160 -0
- package/src/client/components/workspace/editor/Tabs.test.ts +40 -0
- package/src/client/components/workspace/editor/Tabs.tsx +52 -102
- package/src/client/components/workspace/editor/index.tsx +2 -0
- package/src/client/components/workspace/editor/props.ts +6 -0
- package/src/client/components/workspace/file-explorer/OutlineResize.test.tsx +225 -0
- package/src/client/components/workspace/file-explorer/OutlineSection.tsx +43 -3
- package/src/client/components/workspace/file-explorer/index.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +1 -1
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +50 -20
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +172 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +18 -9
- package/src/client/components/workspace/search-panel/Body.tsx +3 -3
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
- package/src/client/data/settings/omp-schema.json +205 -9
- package/src/client/floating.css +276 -0
- package/src/client/floating.test.ts +151 -0
- package/src/client/hooks/chat/timeline/session-pagination.ts +13 -9
- package/src/client/hooks/editor/use-outline-resize.ts +145 -0
- package/src/client/hooks/ui/border-style.test.ts +19 -7
- package/src/client/hooks/ui/border-style.ts +2 -3
- package/src/client/hooks/ui/chrome-style.test.ts +140 -0
- package/src/client/hooks/ui/chrome-style.ts +75 -0
- package/src/client/hooks/ui/media-query.ts +29 -0
- package/src/client/hooks/ui/presence.test.ts +104 -0
- package/src/client/hooks/ui/presence.ts +62 -0
- package/src/client/hooks/ui/style-attributes.test.ts +7 -6
- package/src/client/hooks/ui/surface-style.ts +2 -2
- package/src/client/hooks/ui/titlebar-inset.test.ts +56 -0
- package/src/client/hooks/ui/titlebar-inset.ts +31 -0
- package/src/client/hooks/workspace/available-width.ts +25 -1
- package/src/client/hooks/workspace/panel-peek.test.ts +124 -0
- package/src/client/hooks/workspace/panel-peek.ts +151 -0
- package/src/client/hooks/workspace/panel-rail.test.ts +86 -0
- package/src/client/hooks/workspace/panel-rail.ts +108 -0
- package/src/client/hooks/workspace/panel-resize.ts +8 -2
- package/src/client/hooks/workspace/rail-peek.test.ts +119 -0
- package/src/client/hooks/workspace/rail-peek.ts +68 -0
- package/src/client/hooks/workspace/right-panel-card.test.ts +71 -0
- package/src/client/hooks/workspace/right-panel-card.ts +69 -0
- package/src/client/hooks/workspace/right-panel-geometry.ts +172 -0
- package/src/client/hooks/workspace/right-side.ts +7 -0
- package/src/client/lib/desktop/titlebar.test.ts +6 -0
- package/src/client/lib/desktop/titlebar.ts +16 -0
- package/src/client/main.tsx +11 -0
- package/src/client/motion.test.ts +36 -0
- package/src/client/tailwind.css +67 -0
- package/src/server/lib/assets/shell-attributes.server.ts +14 -4
- package/src/server/lib/assets/shell-attributes.test.ts +35 -21
- package/src/server/lib/bundler/titlebar-css.test.ts +3 -2
- package/src/server/lib/realtime/topics/peer-relay.server.test.ts +19 -3
- package/src/server/lib/updates/omp.test.ts +40 -1
- package/src/server/lib/updates/omp.ts +29 -2
- package/src/server/plugins/ssr.ts +2 -0
- package/src/server/routes/settings/mcp.test.ts +16 -0
- package/src/server/routes/settings/mcp.ts +4 -0
- package/src/shared/lib/code/outline/resize.test.ts +57 -0
- package/src/shared/lib/code/outline/resize.ts +67 -0
- package/src/shared/lib/models/provider/glyph.test.ts +3 -1
- package/src/shared/lib/models/provider/glyph.ts +1 -0
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +103 -3
- package/src/shared/lib/omp/config/schema.test.ts +9 -0
- package/src/shared/lib/omp/config/schema.ts +8 -0
- package/src/shared/lib/settings/defaults.ts +2 -0
- package/src/shared/lib/theme/border-style.test.ts +12 -14
- package/src/shared/lib/theme/border-style.ts +25 -18
- package/src/shared/lib/theme/chrome-style.test.ts +31 -0
- package/src/shared/lib/theme/chrome-style.ts +74 -0
- package/src/shared/lib/theme/surface-style.test.ts +4 -5
- package/src/shared/lib/theme/surface-style.ts +6 -5
- package/src/shared/lib/ui/motion.ts +29 -0
- package/src/shared/lib/workspace/floating-chrome.ts +23 -0
- package/src/shared/lib/workspace/session-state/store.ts +3 -0
- package/src/shared/lib/workspace/workspace-panel-widths.test.ts +73 -0
- package/src/shared/lib/workspace/workspace-panel-widths.ts +79 -17
- package/src/shared/types/settings/state.ts +10 -9
- package/src/test-support/left-drawer-harness.test-util.ts +169 -0
- package/src/test-support/peer-harness.ts +44 -36
- package/dist/client/static/js/ImageView-nc2n0w6s.js +0 -1
- package/dist/client/static/js/LayoutWrapper-j7786frq.js +0 -2
- package/dist/client/static/js/MergeDiffView-0rn5zsy5.js +0 -1
- package/dist/client/static/js/Modal-7ag7a9qq.js +0 -60
- package/dist/client/static/js/SessionsView-t9rhx472.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +0 -1
- package/dist/client/static/js/bash-zknkkwkw.js +0 -1
- package/dist/client/static/js/c-0w02jkxb.js +0 -1
- package/dist/client/static/js/cpp-p5b4vean.js +0 -1
- package/dist/client/static/js/css-9jzbvdyz.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-vd4z6bvy.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +0 -1
- package/dist/client/static/js/graphql-xzykn0ba.js +0 -1
- package/dist/client/static/js/html-2zc3shky.js +0 -1
- package/dist/client/static/js/index-6vbra7p9.js +0 -1
- package/dist/client/static/js/index-9mgpbwfr.js +0 -1
- package/dist/client/static/js/index-c5401dqs.js +0 -4
- package/dist/client/static/js/index-dbsy29gn.js +0 -2
- package/dist/client/static/js/index-e39m185a.js +0 -2
- package/dist/client/static/js/index-fnaq8baz.js +0 -1
- package/dist/client/static/js/index-mttx9327.css +0 -1
- package/dist/client/static/js/index-n7bmqeqz.js +0 -1
- package/dist/client/static/js/index-skp6991n.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +0 -1
- package/dist/client/static/js/ini-62r3vxaf.js +0 -1
- package/dist/client/static/js/java-kacycary.js +0 -1
- package/dist/client/static/js/json-yrwpn6bd.js +0 -1
- package/dist/client/static/js/jsx-b40ag8q1.js +0 -1
- package/dist/client/static/js/lua-bk961f37.js +0 -1
- package/dist/client/static/js/markdown-b7rgzgd6.js +0 -1
- package/dist/client/static/js/one-dark-pro-7v4by00h.js +0 -1
- package/dist/client/static/js/one-light-5rfzh8p4.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +0 -1
- package/dist/client/static/js/properties-k8gbzggp.js +0 -1
- package/dist/client/static/js/python-343tspad.js +0 -1
- package/dist/client/static/js/r-ycdwmv8g.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +0 -1
- package/dist/client/static/js/sql-kwpd5w07.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xx1z57df.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +0 -1
- package/dist/client/static/js/typescript-4dchbnya.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +0 -1
- package/dist/client/static/js/xml-xs6qz3ya.js +0 -1
- package/dist/client/static/js/yaml-174nk5bn.js +0 -1
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +0 -238
- package/src/client/components/layout/session-sidebar/Header.test.ts +0 -98
- package/src/client/components/layout/session-sidebar/Header.tsx +0 -60
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
* global, so a width of 0 would shorten every box by 2px and shift the whole
|
|
17
17
|
* layout — the defect this assertion exists to catch, because it would look
|
|
18
18
|
* like "the setting moved the panels" rather than "the setting is wrong".
|
|
19
|
+
* 3. **Only LAYOUT rules clear.** A one-sided border paints a rule between two
|
|
20
|
+
* regions; a closed `.border` paints a badge, a card or a chip, and that
|
|
21
|
+
* outline is the thing's own edge. If `.border` ever rejoins the clearing
|
|
22
|
+
* list, the borderless shell loses every badge edge again.
|
|
19
23
|
*/
|
|
20
24
|
|
|
21
25
|
import { afterAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
@@ -61,11 +65,10 @@ describe('applyBorderStyle', () => {
|
|
|
61
65
|
expect(document.documentElement.hasAttribute('data-borders')).toBe(false);
|
|
62
66
|
});
|
|
63
67
|
|
|
64
|
-
test('an unknown value resolves to
|
|
65
|
-
applyBorderStyle('borderless');
|
|
68
|
+
test('an unknown value resolves to borderless and writes the attribute', () => {
|
|
66
69
|
applyBorderStyle('naked');
|
|
67
70
|
|
|
68
|
-
expect(document.documentElement.
|
|
71
|
+
expect(document.documentElement.getAttribute('data-borders')).toBe('borderless');
|
|
69
72
|
});
|
|
70
73
|
});
|
|
71
74
|
|
|
@@ -77,11 +80,11 @@ describe('the boot path', () => {
|
|
|
77
80
|
expect(document.documentElement.getAttribute('data-borders')).toBe('borderless');
|
|
78
81
|
});
|
|
79
82
|
|
|
80
|
-
test('an install with no stored preference boots
|
|
83
|
+
test('an install with no stored preference boots borderless', () => {
|
|
81
84
|
primeKabmoSettings({});
|
|
82
85
|
initBorderStyle();
|
|
83
86
|
|
|
84
|
-
expect(document.documentElement.
|
|
87
|
+
expect(document.documentElement.getAttribute('data-borders')).toBe('borderless');
|
|
85
88
|
});
|
|
86
89
|
|
|
87
90
|
test('the settings key names a real field, so the write survives a reload', () => {
|
|
@@ -142,8 +145,9 @@ describe('borders.css', () => {
|
|
|
142
145
|
test('a form control keeps its own edge through the exemption list', async () => {
|
|
143
146
|
const css = await declarations();
|
|
144
147
|
const rule = css.slice(css.indexOf(':is('), css.indexOf('border-color: transparent'));
|
|
145
|
-
// A field with no edge is a field you cannot find
|
|
146
|
-
//
|
|
148
|
+
// A field with no edge is a field you cannot find. `button` is not exempt
|
|
149
|
+
// as a TAG: a button's own outline is a closed `.border`, which the next
|
|
150
|
+
// test pins as a control edge that survives.
|
|
147
151
|
for (const tag of ['input', 'textarea', 'select', 'kbd', '[role="switch"]', '[contenteditable="true"]']) {
|
|
148
152
|
expect({ tag, exempt: rule.includes(tag) }).toEqual({ tag, exempt: true });
|
|
149
153
|
}
|
|
@@ -152,6 +156,14 @@ describe('borders.css', () => {
|
|
|
152
156
|
expect(rule).toContain('.border-dashed');
|
|
153
157
|
});
|
|
154
158
|
|
|
159
|
+
test('a closed outline is a badge edge, not a layout rule', async () => {
|
|
160
|
+
const css = await declarations();
|
|
161
|
+
const rule = css.slice(css.indexOf(':is('), css.indexOf('border-color: transparent'));
|
|
162
|
+
// `.border` is the bare, all-sides utility: a badge, a card and a chip use
|
|
163
|
+
// it, and none of them may lose its edge when the layout rules go.
|
|
164
|
+
expect(rule).toMatch(/\.border\s*\)/);
|
|
165
|
+
});
|
|
166
|
+
|
|
155
167
|
test('the chat transcript is the one subtree the clearing rules skip', async () => {
|
|
156
168
|
const all = selectors(await declarations());
|
|
157
169
|
// Both clearing rules — the rung border and the row divider — must exclude
|
|
@@ -36,9 +36,8 @@ import {
|
|
|
36
36
|
* document carrying `hairline` and a document carrying nothing are the same
|
|
37
37
|
* state — which is what makes the rule set in `tailwind.css` the single
|
|
38
38
|
* statement of the ruled look. The comparison is against that ABSENT state, not
|
|
39
|
-
* against `DEFAULT_BORDER_STYLE`:
|
|
40
|
-
*
|
|
41
|
-
* says borderless.
|
|
39
|
+
* against `DEFAULT_BORDER_STYLE`: the default is `borderless`, and omitting the
|
|
40
|
+
* attribute for it would paint rules while the setting says borderless.
|
|
42
41
|
*/
|
|
43
42
|
export function applyBorderStyle(style: unknown): void {
|
|
44
43
|
if (typeof document === 'undefined') return;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The chrome style reaches the layout through the SAME document attribute CSS
|
|
8
|
+
* reads. This pins both halves of that claim:
|
|
9
|
+
*
|
|
10
|
+
* - `applyChromeStyle` writes/clears `<html data-chrome>` and announces the
|
|
11
|
+
* change, because a mounted layout has to re-place the controls bar the
|
|
12
|
+
* moment the style moves;
|
|
13
|
+
* - `useChromeStyle` reads that attribute — not the stored setting — so a
|
|
14
|
+
* settings write and a document state cannot disagree.
|
|
15
|
+
*
|
|
16
|
+
* The regression this prevents is the floating shell's right-side toggle
|
|
17
|
+
* drawing two controls bars (or none): the fallback title toggle and the
|
|
18
|
+
* detached controls card both key off the style.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
22
|
+
import { Window } from 'happy-dom';
|
|
23
|
+
import { h, render } from 'preact';
|
|
24
|
+
import { act } from 'preact/test-utils';
|
|
25
|
+
import {
|
|
26
|
+
applyChromeStyle,
|
|
27
|
+
CHROME_STYLE_CHANGED_EVENT,
|
|
28
|
+
initChromeStyle,
|
|
29
|
+
readDocumentChromeStyle,
|
|
30
|
+
useChromeStyle,
|
|
31
|
+
} from '@/client/hooks/ui/chrome-style';
|
|
32
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
33
|
+
import { primeKabmoSettings } from '@/shared/lib/settings/client';
|
|
34
|
+
import type { ChromeStyle } from '@/shared/lib/theme/chrome-style';
|
|
35
|
+
|
|
36
|
+
let container: HTMLElement;
|
|
37
|
+
let observed: ChromeStyle | null = null;
|
|
38
|
+
|
|
39
|
+
function StyleProbe() {
|
|
40
|
+
observed = useChromeStyle();
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function mountProbe(): void {
|
|
45
|
+
container = document.createElement('div');
|
|
46
|
+
document.body.appendChild(container);
|
|
47
|
+
act(() => {
|
|
48
|
+
render(h(StyleProbe, {}), container);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
afterEach(() => {
|
|
53
|
+
if (container) {
|
|
54
|
+
render(null, container);
|
|
55
|
+
container.remove();
|
|
56
|
+
}
|
|
57
|
+
document.documentElement.removeAttribute('data-chrome');
|
|
58
|
+
observed = null;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
beforeAll(() => {
|
|
62
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
afterAll(() => {
|
|
66
|
+
restoreDomGlobals();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('the chrome style attribute', () => {
|
|
70
|
+
test('floating is written as the attribute CSS keys on', () => {
|
|
71
|
+
const seen: string[] = [];
|
|
72
|
+
const listener = (event: Event) => seen.push((event as CustomEvent<string>).detail);
|
|
73
|
+
window.addEventListener(CHROME_STYLE_CHANGED_EVENT, listener);
|
|
74
|
+
|
|
75
|
+
applyChromeStyle('floating');
|
|
76
|
+
|
|
77
|
+
expect(document.documentElement.getAttribute('data-chrome')).toBe('floating');
|
|
78
|
+
expect(seen).toEqual(['floating']);
|
|
79
|
+
window.removeEventListener(CHROME_STYLE_CHANGED_EVENT, listener);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test('classic CLEARS the attribute instead of writing it', () => {
|
|
83
|
+
applyChromeStyle('floating');
|
|
84
|
+
|
|
85
|
+
applyChromeStyle('classic');
|
|
86
|
+
|
|
87
|
+
expect(document.documentElement.hasAttribute('data-chrome')).toBe(false);
|
|
88
|
+
expect(readDocumentChromeStyle()).toBe('classic');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('an unknown value resolves to the floating default and writes the attribute', () => {
|
|
92
|
+
document.documentElement.removeAttribute('data-chrome');
|
|
93
|
+
|
|
94
|
+
applyChromeStyle('neon');
|
|
95
|
+
|
|
96
|
+
expect(document.documentElement.getAttribute('data-chrome')).toBe('floating');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('re-applying the same style announces nothing', () => {
|
|
100
|
+
applyChromeStyle('floating');
|
|
101
|
+
let calls = 0;
|
|
102
|
+
const listener = () => { calls += 1; };
|
|
103
|
+
window.addEventListener(CHROME_STYLE_CHANGED_EVENT, listener);
|
|
104
|
+
|
|
105
|
+
applyChromeStyle('floating');
|
|
106
|
+
|
|
107
|
+
expect(calls).toBe(0);
|
|
108
|
+
window.removeEventListener(CHROME_STYLE_CHANGED_EVENT, listener);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('the boot path applies the stored setting', () => {
|
|
112
|
+
primeKabmoSettings({ chromeStyle: 'floating' });
|
|
113
|
+
|
|
114
|
+
initChromeStyle();
|
|
115
|
+
|
|
116
|
+
expect(document.documentElement.getAttribute('data-chrome')).toBe('floating');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test('an install with no stored preference boots floating', () => {
|
|
120
|
+
primeKabmoSettings({});
|
|
121
|
+
|
|
122
|
+
initChromeStyle();
|
|
123
|
+
|
|
124
|
+
expect(document.documentElement.getAttribute('data-chrome')).toBe('floating');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe('useChromeStyle', () => {
|
|
129
|
+
test('reads the document, initially and after a live change', () => {
|
|
130
|
+
applyChromeStyle('floating');
|
|
131
|
+
mountProbe();
|
|
132
|
+
expect(observed).toBe('floating');
|
|
133
|
+
|
|
134
|
+
act(() => applyChromeStyle('classic'));
|
|
135
|
+
expect(observed).toBe('classic');
|
|
136
|
+
|
|
137
|
+
act(() => applyChromeStyle('floating'));
|
|
138
|
+
expect(observed).toBe('floating');
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The single writer for the desktop chrome arrangement.
|
|
8
|
+
*
|
|
9
|
+
* The style is an ATTRIBUTE on `<html>` and CSS is its main consumer, exactly
|
|
10
|
+
* like the surface material and the hairline set. It is written at boot
|
|
11
|
+
* (`initChromeStyle`, before the first render) so a floating install never
|
|
12
|
+
* paints the flat frame first, and on every settings change
|
|
13
|
+
* (`applyChromeStyle`).
|
|
14
|
+
*
|
|
15
|
+
* A REACT reader is needed too, and it reads the same attribute rather than the
|
|
16
|
+
* stored setting: a fact that reaches CSS cannot be re-stated as a prop without
|
|
17
|
+
* the two drifting. The right side's controls bar is the case that forces it —
|
|
18
|
+
* `floating.css` moves it out of the collapsed column, so the layout must not
|
|
19
|
+
* also draw the title bar's fallback toggle.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { useState } from 'preact/hooks';
|
|
23
|
+
import { readKabmoSetting } from '@/shared/lib/settings/client';
|
|
24
|
+
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
25
|
+
import {
|
|
26
|
+
CHROME_ATTRIBUTE,
|
|
27
|
+
CHROME_STYLE_SETTING_KEY,
|
|
28
|
+
CHROME_STYLE_WITHOUT_ATTRIBUTE,
|
|
29
|
+
DEFAULT_CHROME_STYLE,
|
|
30
|
+
resolveChromeStyle,
|
|
31
|
+
type ChromeStyle,
|
|
32
|
+
} from '@/shared/lib/theme/chrome-style';
|
|
33
|
+
|
|
34
|
+
/** Announced after `applyChromeStyle` moved the document attribute. */
|
|
35
|
+
export const CHROME_STYLE_CHANGED_EVENT = 'omp:chrome-style-changed';
|
|
36
|
+
|
|
37
|
+
/** The document attribute's value, resolved to a style this build can draw. */
|
|
38
|
+
export function readDocumentChromeStyle(): ChromeStyle {
|
|
39
|
+
if (typeof document === 'undefined') return DEFAULT_CHROME_STYLE;
|
|
40
|
+
const raw = document.documentElement.getAttribute(CHROME_ATTRIBUTE);
|
|
41
|
+
// An absent attribute is what CSS paints as `classic`, NOT the shipped
|
|
42
|
+
// default: resolving it to `floating` would make the hook disagree with the
|
|
43
|
+
// document the writer just cleared.
|
|
44
|
+
return raw === null ? CHROME_STYLE_WITHOUT_ATTRIBUTE : resolveChromeStyle(raw);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Point the document at `style`. */
|
|
48
|
+
export function applyChromeStyle(style: unknown): void {
|
|
49
|
+
if (typeof document === 'undefined') return;
|
|
50
|
+
const root = document.documentElement;
|
|
51
|
+
const resolved = resolveChromeStyle(style);
|
|
52
|
+
const previous = root.getAttribute(CHROME_ATTRIBUTE);
|
|
53
|
+
if (resolved === CHROME_STYLE_WITHOUT_ATTRIBUTE) root.removeAttribute(CHROME_ATTRIBUTE);
|
|
54
|
+
else root.setAttribute(CHROME_ATTRIBUTE, resolved);
|
|
55
|
+
const next = resolved === CHROME_STYLE_WITHOUT_ATTRIBUTE ? null : resolved;
|
|
56
|
+
if (previous === next) return;
|
|
57
|
+
// The attribute is the source the hook reads; the event only wakes a mounted
|
|
58
|
+
// layout. Dispatching after the write is what makes the re-read agree with
|
|
59
|
+
// CSS in the same frame.
|
|
60
|
+
if (typeof window !== 'undefined') {
|
|
61
|
+
window.dispatchEvent(new CustomEvent(CHROME_STYLE_CHANGED_EVENT, { detail: resolved }));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Apply the stored style before the first render. */
|
|
66
|
+
export function initChromeStyle(): void {
|
|
67
|
+
applyChromeStyle(readKabmoSetting<unknown>(CHROME_STYLE_SETTING_KEY));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The chrome style the document currently carries, subscribed. */
|
|
71
|
+
export function useChromeStyle(): ChromeStyle {
|
|
72
|
+
const [style, setStyle] = useState(readDocumentChromeStyle);
|
|
73
|
+
useKabmoEvent(CHROME_STYLE_CHANGED_EVENT, () => setStyle(readDocumentChromeStyle()));
|
|
74
|
+
return style;
|
|
75
|
+
}
|
|
@@ -66,3 +66,32 @@ export function useViewportAtLeast(px: number): boolean {
|
|
|
66
66
|
|
|
67
67
|
return matches;
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Whether the reader asked for reduced motion.
|
|
72
|
+
*
|
|
73
|
+
* Subscribed, because the OS setting can change while the app is open and a
|
|
74
|
+
* value read once would keep animating a panel after the user turned motion
|
|
75
|
+
* off. The CSS side has its own `prefers-reduced-motion` blocks; this hook is
|
|
76
|
+
* for the transitions a browser cannot see — an inline `transition` on a panel
|
|
77
|
+
* and the timer that keeps a closing overlay mounted.
|
|
78
|
+
*/
|
|
79
|
+
export function usePrefersReducedMotion(): boolean {
|
|
80
|
+
const query = '(prefers-reduced-motion: reduce)';
|
|
81
|
+
const [reduced, setReduced] = useState(() =>
|
|
82
|
+
typeof window === 'undefined' || typeof window.matchMedia !== 'function'
|
|
83
|
+
? false
|
|
84
|
+
: window.matchMedia(query).matches,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;
|
|
89
|
+
const media = window.matchMedia(query);
|
|
90
|
+
const update = () => setReduced(media.matches);
|
|
91
|
+
update();
|
|
92
|
+
media.addEventListener('change', update);
|
|
93
|
+
return () => media.removeEventListener('change', update);
|
|
94
|
+
}, []);
|
|
95
|
+
|
|
96
|
+
return reduced;
|
|
97
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, jest, test } from 'bun:test';
|
|
7
|
+
import { h, render } from 'preact';
|
|
8
|
+
import { act } from 'preact/test-utils';
|
|
9
|
+
import { Window } from 'happy-dom';
|
|
10
|
+
|
|
11
|
+
import { usePresence } from '@/client/hooks/ui/presence';
|
|
12
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
13
|
+
|
|
14
|
+
const EXIT_MS = 12;
|
|
15
|
+
|
|
16
|
+
let container: HTMLElement;
|
|
17
|
+
let win: Window;
|
|
18
|
+
let open = true;
|
|
19
|
+
|
|
20
|
+
function Probe() {
|
|
21
|
+
const presence = usePresence(open, EXIT_MS);
|
|
22
|
+
if (!presence.mounted) return null;
|
|
23
|
+
return h('div', {
|
|
24
|
+
'data-testid': 'surface',
|
|
25
|
+
'data-leaving': String(presence.leaving),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const surface = () => container.querySelector('[data-testid="surface"]');
|
|
30
|
+
|
|
31
|
+
function advance(ms: number) {
|
|
32
|
+
act(() => {
|
|
33
|
+
jest.advanceTimersByTime(ms);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
jest.useFakeTimers();
|
|
39
|
+
win = new Window({ url: 'http://localhost' });
|
|
40
|
+
installDomGlobals(win);
|
|
41
|
+
container = document.createElement('div');
|
|
42
|
+
document.body.appendChild(container);
|
|
43
|
+
open = true;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
act(() => render(null, container));
|
|
48
|
+
container.remove();
|
|
49
|
+
restoreDomGlobals();
|
|
50
|
+
jest.useRealTimers();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe('usePresence', () => {
|
|
54
|
+
test('an open surface is mounted and not leaving', () => {
|
|
55
|
+
act(() => render(h(Probe, {}), container));
|
|
56
|
+
expect(surface()).not.toBeNull();
|
|
57
|
+
expect(surface()?.getAttribute('data-leaving')).toBe('false');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('closing keeps the node mounted with the leaving flag until the exit lands', () => {
|
|
61
|
+
act(() => render(h(Probe, {}), container));
|
|
62
|
+
|
|
63
|
+
open = false;
|
|
64
|
+
act(() => render(h(Probe, {}), container));
|
|
65
|
+
// The exit has DOM to animate: this is the whole reason the hook exists.
|
|
66
|
+
expect(surface()).not.toBeNull();
|
|
67
|
+
expect(surface()?.getAttribute('data-leaving')).toBe('true');
|
|
68
|
+
|
|
69
|
+
advance(EXIT_MS + 1);
|
|
70
|
+
expect(surface()).toBeNull();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('reopening during the exit cancels the unmount', () => {
|
|
74
|
+
act(() => render(h(Probe, {}), container));
|
|
75
|
+
|
|
76
|
+
open = false;
|
|
77
|
+
act(() => render(h(Probe, {}), container));
|
|
78
|
+
|
|
79
|
+
open = true;
|
|
80
|
+
act(() => render(h(Probe, {}), container));
|
|
81
|
+
expect(surface()).not.toBeNull();
|
|
82
|
+
expect(surface()?.getAttribute('data-leaving')).toBe('false');
|
|
83
|
+
|
|
84
|
+
advance(EXIT_MS + 1);
|
|
85
|
+
expect(surface()).not.toBeNull();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('reduced motion unmounts without keeping a focusable surface alive', () => {
|
|
89
|
+
// The hook reads the query at mount; a stub that always matches is the
|
|
90
|
+
// reader who turned motion off before opening the app.
|
|
91
|
+
win.matchMedia = ((query: string) =>
|
|
92
|
+
({
|
|
93
|
+
matches: query.includes('prefers-reduced-motion'),
|
|
94
|
+
media: query,
|
|
95
|
+
addEventListener: () => {},
|
|
96
|
+
removeEventListener: () => {},
|
|
97
|
+
}) as unknown as MediaQueryList) as unknown as typeof win.matchMedia;
|
|
98
|
+
|
|
99
|
+
act(() => render(h(Probe, {}), container));
|
|
100
|
+
open = false;
|
|
101
|
+
act(() => render(h(Probe, {}), container));
|
|
102
|
+
expect(surface()).toBeNull();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Whether a closing surface is still on screen, so it can animate out.
|
|
8
|
+
*
|
|
9
|
+
* Preact unmounts a node the moment its owner stops rendering it, which is why
|
|
10
|
+
* every overlay in this app disappeared in one frame on close: the exit had no
|
|
11
|
+
* DOM to paint. `usePresence` keeps the CALLER's node mounted for the exit
|
|
12
|
+
* duration and reports `leaving`, so the caller can apply the exit class and
|
|
13
|
+
* unmount only after it has run.
|
|
14
|
+
*
|
|
15
|
+
* Three rules are load-bearing:
|
|
16
|
+
*
|
|
17
|
+
* - **Enter is not a phase here.** It is a CSS animation on the node the caller
|
|
18
|
+
* renders (`presence-enter`), which runs exactly once when the element is
|
|
19
|
+
* inserted. A JS "entering" state that flips to "open" on the next frame is a
|
|
20
|
+
* race with the first paint and, on a freshly inserted node, may not animate
|
|
21
|
+
* at all.
|
|
22
|
+
* - **Closing is a state, not a timer on the node.** `mounted` stays true from
|
|
23
|
+
* the render that closes until the exit duration elapses, so the caller keeps
|
|
24
|
+
* the node in the tree with its exit styles applied.
|
|
25
|
+
* - **Reduced motion unmounts immediately.** An exit a reader asked not to see
|
|
26
|
+
* must not keep a focusable surface alive for 160ms.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
30
|
+
import { usePrefersReducedMotion } from '@/client/hooks/ui/media-query';
|
|
31
|
+
|
|
32
|
+
export interface Presence {
|
|
33
|
+
/** The caller should render the node. True while open and while leaving. */
|
|
34
|
+
mounted: boolean;
|
|
35
|
+
/** The node is running its exit and should carry the leaving class. */
|
|
36
|
+
leaving: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function usePresence(open: boolean, exitMs: number): Presence {
|
|
40
|
+
const reduced = usePrefersReducedMotion();
|
|
41
|
+
const [mounted, setMounted] = useState(open);
|
|
42
|
+
const mountedRef = useRef(mounted);
|
|
43
|
+
mountedRef.current = mounted;
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (open) {
|
|
47
|
+
setMounted(true);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (!mountedRef.current) return;
|
|
51
|
+
const duration = reduced ? 0 : exitMs;
|
|
52
|
+
if (duration <= 0) {
|
|
53
|
+
setMounted(false);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const timer = setTimeout(() => setMounted(false), duration);
|
|
57
|
+
return () => clearTimeout(timer);
|
|
58
|
+
}, [open, exitMs, reduced]);
|
|
59
|
+
|
|
60
|
+
const leaving = mounted && !open;
|
|
61
|
+
return { mounted: mounted || open, leaving };
|
|
62
|
+
}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* prop — so the facts worth pinning are the ones a wrong implementation breaks
|
|
11
11
|
* silently: the style CSS paints with no attribute (`classic` / `monochrome`)
|
|
12
12
|
* must CLEAR it, an unknown stored value must resolve to the shipped default
|
|
13
|
-
* (`
|
|
14
|
-
* settings snapshot rather than hardcode the default.
|
|
13
|
+
* (`classic` / `color`) and write whatever that default requires, and the boot
|
|
14
|
+
* path must read the primed settings snapshot rather than hardcode the default.
|
|
15
15
|
*
|
|
16
16
|
* The settings client keeps a module-level snapshot, so each case primes it
|
|
17
17
|
* explicitly instead of relying on file order.
|
|
@@ -74,10 +74,11 @@ describe('applySurfaceStyle', () => {
|
|
|
74
74
|
expect(document.documentElement.hasAttribute('data-surface')).toBe(false);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
test('an unknown value resolves to the
|
|
77
|
+
test('an unknown value resolves to the classic default and clears the attribute', () => {
|
|
78
|
+
applySurfaceStyle('glass');
|
|
78
79
|
applySurfaceStyle('liquid');
|
|
79
80
|
|
|
80
|
-
expect(document.documentElement.
|
|
81
|
+
expect(document.documentElement.hasAttribute('data-surface')).toBe(false);
|
|
81
82
|
});
|
|
82
83
|
});
|
|
83
84
|
|
|
@@ -111,12 +112,12 @@ describe('the boot path', () => {
|
|
|
111
112
|
expect(document.documentElement.getAttribute('data-icon-style')).toBe('color');
|
|
112
113
|
});
|
|
113
114
|
|
|
114
|
-
test('an install with no stored preference boots
|
|
115
|
+
test('an install with no stored preference boots classic and full colour', () => {
|
|
115
116
|
primeKabmoSettings({});
|
|
116
117
|
initSurfaceStyle();
|
|
117
118
|
initIconStyle();
|
|
118
119
|
|
|
119
|
-
expect(document.documentElement.
|
|
120
|
+
expect(document.documentElement.hasAttribute('data-surface')).toBe(false);
|
|
120
121
|
expect(document.documentElement.getAttribute('data-icon-style')).toBe('color');
|
|
121
122
|
});
|
|
122
123
|
});
|
|
@@ -36,8 +36,8 @@ import {
|
|
|
36
36
|
* document carrying `classic` and a document carrying nothing are the same
|
|
37
37
|
* state — which is what makes the `:root` fallback in CSS the single statement
|
|
38
38
|
* of the opaque look. The comparison is against that ABSENT state, not against
|
|
39
|
-
* `DEFAULT_SURFACE_STYLE
|
|
40
|
-
*
|
|
39
|
+
* `DEFAULT_SURFACE_STYLE` — the two coincide today, but CSS, not the
|
|
40
|
+
* preference, decides whether the attribute may be omitted.
|
|
41
41
|
*/
|
|
42
42
|
export function applySurfaceStyle(style: unknown): void {
|
|
43
43
|
if (typeof document === 'undefined') return;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shell's left inset, published for CSS.
|
|
8
|
+
*
|
|
9
|
+
* The floating app-name card starts where the shell's own window controls end,
|
|
10
|
+
* and that geometry is the stylesheet's job (the chrome style can change without
|
|
11
|
+
* a re-render). The failure this pins is silent: a missing property leaves
|
|
12
|
+
* `var(--titlebar-inset-left, 0px)` at `0px`, so the card is drawn UNDER the
|
|
13
|
+
* traffic lights exactly as before the fix.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
19
|
+
import { applyTitlebarInset, TITLEBAR_INSET_LEFT_VAR } from '@/client/hooks/ui/titlebar-inset';
|
|
20
|
+
import type { DesktopInfo } from '@/client/lib/shell/desktop';
|
|
21
|
+
|
|
22
|
+
/** The REAL desktop shape: macOS and Linux post through the handler iOS uses. */
|
|
23
|
+
function withShell(identity: DesktopInfo | null) {
|
|
24
|
+
window.__kabmoCall = async () => null;
|
|
25
|
+
window.webkit = { messageHandlers: { kabmo: { postMessage: () => {} } } };
|
|
26
|
+
if (identity) window.__kabmoDesktop = identity;
|
|
27
|
+
else delete window.__kabmoDesktop;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe('titlebar inset property', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
installDomGlobals(new Window({ url: 'http://localhost' }) as never);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
afterEach(() => {
|
|
36
|
+
restoreDomGlobals();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('macOS publishes the traffic lights’ width', () => {
|
|
40
|
+
withShell({ platform: 'macos', shellVersion: '0.1.0', overlayTitlebar: true, trafficLightInset: '5rem' });
|
|
41
|
+
applyTitlebarInset();
|
|
42
|
+
expect(document.documentElement.style.getPropertyValue(TITLEBAR_INSET_LEFT_VAR)).toBe('5rem');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('a browser leaves the PWA overlay arithmetic, which is 0px without WCO', () => {
|
|
46
|
+
withShell(null);
|
|
47
|
+
applyTitlebarInset();
|
|
48
|
+
expect(document.documentElement.style.getPropertyValue(TITLEBAR_INSET_LEFT_VAR)).toBe('env(titlebar-area-x, 0px)');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('a shell that reports no inset invents none', () => {
|
|
52
|
+
withShell({ platform: 'windows', shellVersion: '0.1.0', overlayTitlebar: true, windowControls: true });
|
|
53
|
+
applyTitlebarInset();
|
|
54
|
+
expect(document.documentElement.style.getPropertyValue(TITLEBAR_INSET_LEFT_VAR)).toBe('env(titlebar-area-x, 0px)');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The single writer for the width a native shell's own window controls occupy
|
|
8
|
+
* over the page's LEFT edge.
|
|
9
|
+
*
|
|
10
|
+
* A flat header can run under those controls because only its CONTENT has to
|
|
11
|
+
* clear them (`titlebarInsetLeft` pads it). A floating chrome CARD cannot: its
|
|
12
|
+
* paper and 1px border would be painted behind the buttons, so the card itself
|
|
13
|
+
* has to start where the controls end. That is geometry the stylesheet owns —
|
|
14
|
+
* the chrome style can change without a re-render, and `floating.css` is the
|
|
15
|
+
* only consumer — so the width reaches CSS as ONE document-level property
|
|
16
|
+
* instead of an inline style per call site.
|
|
17
|
+
*
|
|
18
|
+
* Written at boot, before the first render, like every other chrome attribute:
|
|
19
|
+
* a floating install must not paint one frame with the card under the lights.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { shellTrafficInsetLeft } from '@/client/lib/desktop/titlebar';
|
|
23
|
+
|
|
24
|
+
/** Document property `floating.css` reads to offset the app-name card. */
|
|
25
|
+
export const TITLEBAR_INSET_LEFT_VAR = '--titlebar-inset-left';
|
|
26
|
+
|
|
27
|
+
/** Point the document at the shell's left inset. Idempotent. */
|
|
28
|
+
export function applyTitlebarInset(): void {
|
|
29
|
+
if (typeof document === 'undefined') return;
|
|
30
|
+
document.documentElement.style.setProperty(TITLEBAR_INSET_LEFT_VAR, shellTrafficInsetLeft());
|
|
31
|
+
}
|