@kabmo-labs/kabmo 0.43.1 → 0.45.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 +337 -337
- package/dist/client/static/js/{CsvGrid-g67pk2zy.js → CsvGrid-z74weshk.js} +2 -2
- package/dist/client/static/js/{DocxView-pyh6p2kb.js → DocxView-dpe5x9ab.js} +5 -5
- package/dist/client/static/js/{DrawioView-g48r6y2m.js → DrawioView-ftzwjf8v.js} +2 -2
- package/dist/client/static/js/ImageView-vchn6wyq.js +1 -0
- package/dist/client/static/js/LayoutWrapper-1x0gnppc.js +2 -0
- package/dist/client/static/js/{Modal-edw446r8.js → Modal-tteg7vtb.js} +20 -20
- package/dist/client/static/js/{PdfView-6z3cgj37.js → PdfView-vjec8z3z.js} +1 -1
- package/dist/client/static/js/SessionsView-g7z3fxbp.js +1 -0
- package/dist/client/static/js/{SheetView-64076z1j.js → SheetView-hhtfkdhe.js} +25 -25
- package/dist/client/static/js/{SvgPreview-dmpgavgd.js → SvgPreview-48n3ex6p.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-nfz5z1vw.js → abnfDiagram-O67JEVCF-bpvzdara.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-bch3nye9.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-jra2jyzw.js → architectureDiagram-NJMV4G6O-xw62cr7j.js} +11 -11
- package/dist/client/static/js/{astro-dpfdhc5e.js → astro-56b0as3q.js} +1 -1
- package/dist/client/static/js/bash-mevzaywf.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-3szktxam.js → blockDiagram-BEXU5L5S-x3a6cgar.js} +6 -6
- package/dist/client/static/js/c-y1y6v00q.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-xe9vbppt.js → c4Diagram-YGBWAQC7-katvaxbj.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-egzhj1xn.js → classDiagram-v2-NBCMYWYE-bjz4mqqh.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-dfrk1wnr.js → cose-bilkent-JH36ORCC-fsn80psf.js} +1 -1
- package/dist/client/static/js/cpp-wk9z0c5g.js +1 -0
- package/dist/client/static/js/css-3w3p9s67.js +1 -0
- package/dist/client/static/js/css-g85rwzty.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-vqy5jtnk.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-xefpcmpg.js → cynefinDiagram-VND7K2PF-cfhbsnkm.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-vtzjnrt9.js → dagre-6A5THRUB-j2wt7ns6.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-4vvn790v.js → diagram-22UHCM2B-abrdj714.js} +21 -21
- package/dist/client/static/js/{diagram-3UASUU5V-tmht3bew.js → diagram-3UASUU5V-dbn15bxn.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-p5wa5ztx.js → diagram-ATOU4E4O-y79pwf7w.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-8myesjfc.js → diagram-CDSNMT55-f8ryt86n.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-9t3x2d5f.js → diagram-MLGK6HIB-ws7wn3q9.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-8ahgnmhy.js → diagram-MPIPVDR6-zmznrg13.js} +2 -2
- package/dist/client/static/js/{dockerfile-x8aa0543.js → dockerfile-qgc921kw.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-5semw111.js → ebnfDiagram-ZINNZB2B-y5q7hy1v.js} +1 -1
- package/dist/client/static/js/{elixir-5ewfhvfh.js → elixir-12pgbgtq.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-jmhs58ww.js → elk-276RUBZZ-vddwbn6q.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-31wvbpdr.js → erDiagram-OPXOYQCR-qdqcx4g4.js} +6 -6
- package/dist/client/static/js/{erlang-jqqa3ehb.js → erlang-811btv6p.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-65ph4s3m.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-nh2tb65b.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-c2dycjrf.js → ganttDiagram-FUAMR5RP-763hk9rm.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-t45ekjb6.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-y4k4pdd8.js → gitGraphDiagram-X574FWY7-bgx1q5nw.js} +10 -10
- package/dist/client/static/js/graphql-027z8sc0.js +1 -0
- package/dist/client/static/js/html-fqda6wxx.js +1 -0
- package/dist/client/static/js/{index-38v0781h.js → index-03j5j1j0.js} +2 -2
- package/dist/client/static/js/{index-3588r3wg.js → index-05hx4ftf.js} +2 -2
- package/dist/client/static/js/index-0vk6v4y4.js +2 -0
- package/dist/client/static/js/{index-7dp90ad1.js → index-1nwwvv29.js} +2 -2
- package/dist/client/static/js/{index-aar68x31.js → index-228yzebd.js} +5 -5
- package/dist/client/static/js/{index-xf36nmbm.js → index-2b1wnvez.js} +2 -2
- package/dist/client/static/js/index-34ff2vq6.js +2 -0
- package/dist/client/static/js/{index-6fpd55cq.js → index-3d21hpk7.js} +2 -2
- package/dist/client/static/js/{index-181p91hf.js → index-3h2mr90j.js} +2 -2
- package/dist/client/static/js/{index-efra065v.js → index-3sqndc9n.js} +2 -2
- package/dist/client/static/js/{index-kc5znr75.js → index-47wn2gjx.js} +2 -2
- package/dist/client/static/js/{index-nt7nhchn.js → index-4b5b6g0k.js} +1 -1
- package/dist/client/static/js/index-5b2vsbcf.js +1 -0
- package/dist/client/static/js/index-5mrqfs82.js +12 -0
- package/dist/client/static/js/{index-m94f4ngb.js → index-61j9qkck.js} +3 -3
- package/dist/client/static/js/index-6bm4pw90.css +1 -0
- package/dist/client/static/js/{index-qhytrsyb.js → index-6sqmhdyv.js} +2 -2
- package/dist/client/static/js/{index-jz93j0at.js → index-8dtp7mt0.js} +2 -2
- package/dist/client/static/js/index-a11ptyzf.js +1 -0
- package/dist/client/static/js/index-acphtw1r.js +2 -0
- package/dist/client/static/js/{index-s78n0dtv.js → index-as1wptfa.js} +2 -2
- package/dist/client/static/js/index-cj39b26c.js +1 -0
- package/dist/client/static/js/index-dgjerk4w.js +3 -0
- package/dist/client/static/js/{index-sesghshh.js → index-dmv2zasz.js} +2 -2
- package/dist/client/static/js/index-dn6pqym4.js +9 -0
- package/dist/client/static/js/{index-ynaxep06.js → index-ehg2ftnp.js} +2 -2
- package/dist/client/static/js/{index-e7yf273s.js → index-f51jxezc.js} +2 -2
- package/dist/client/static/js/index-f7paep2f.js +2 -0
- package/dist/client/static/js/index-f98dhbt4.js +4 -0
- package/dist/client/static/js/{index-ys0xpw3q.js → index-fbct0jcf.js} +2 -2
- package/dist/client/static/js/index-fqatn0vh.js +1 -0
- package/dist/client/static/js/{index-bvjct7sp.js → index-gcwmpfr4.js} +2 -2
- package/dist/client/static/js/{index-cgzw43bc.js → index-gmq5pbcv.js} +67 -67
- package/dist/client/static/js/{index-q81rxwh7.js → index-gzafyqsr.js} +43 -43
- package/dist/client/static/js/{index-gmnmnfm0.js → index-gzp4j2h5.js} +2 -2
- package/dist/client/static/js/{index-cjhvtzdd.js → index-h0rmkz9n.js} +2 -2
- package/dist/client/static/js/{index-sk9ej289.js → index-jaqjvk22.js} +2 -2
- package/dist/client/static/js/{index-pt8440xh.js → index-jpp0zm7t.js} +15 -15
- package/dist/client/static/js/index-kg2sk8cf.js +1 -0
- package/dist/client/static/js/index-mrw7qweg.js +1 -0
- package/dist/client/static/js/index-mwm8aptp.js +1 -0
- package/dist/client/static/js/{index-yvgbr7ek.js → index-n1ga63de.js} +2 -2
- package/dist/client/static/js/{index-cqnpsw2m.js → index-nzhwd6t3.js} +2 -2
- package/dist/client/static/js/{index-vyw4tbn8.js → index-p21mvqc2.js} +2 -2
- package/dist/client/static/js/{index-fjnkzk12.js → index-pfj3sd1n.js} +3 -3
- package/dist/client/static/js/{index-fg965t62.js → index-pxq4v81r.js} +2 -2
- package/dist/client/static/js/index-q76jfb54.js +1 -0
- package/dist/client/static/js/{index-m9s9rg5k.js → index-qt9jc4ck.js} +2 -2
- package/dist/client/static/js/{index-48pb18zj.js → index-r6e44vkx.js} +2 -2
- package/dist/client/static/js/{index-2cbnjc32.js → index-szk3vk8h.js} +2 -2
- package/dist/client/static/js/{index-ycks7gyg.js → index-t0yv1375.js} +2 -2
- package/dist/client/static/js/{index-0c6vpk89.js → index-vgcm2g0g.js} +2 -2
- package/dist/client/static/js/{index-f7djda1g.js → index-vkerrwpa.js} +2 -2
- package/dist/client/static/js/{index-dkwhs38j.js → index-w57zbym7.js} +2 -2
- package/dist/client/static/js/{index-n9scbxy5.js → index-wqrdgt1g.js} +2 -2
- package/dist/client/static/js/{index-j17h4z6f.js → index-x2wvq4ae.js} +2 -2
- package/dist/client/static/js/{index-2b46dzw8.js → index-x7rfmwg8.js} +4 -4
- package/dist/client/static/js/{index-f77c3ag0.js → index-xkwybnf3.js} +200 -200
- package/dist/client/static/js/info-A6RAGUB7-mw29xbwf.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-z3pqx7w8.js → infoDiagram-VRGFBTTK-e66pw8d9.js} +1 -1
- package/dist/client/static/js/ini-3cx6tmv4.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-f5v6z8yr.js → ishikawaDiagram-OU5B5YK6-ehc0q24d.js} +3 -3
- package/dist/client/static/js/java-zs6qh1dm.js +1 -0
- package/dist/client/static/js/javascript-b9mkygak.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-js1yxatk.js → journeyDiagram-ZHPQQLJL-hye05qtd.js} +5 -5
- package/dist/client/static/js/json-qn73s8xb.js +1 -0
- package/dist/client/static/js/jsx-gahhfczw.js +1 -0
- package/dist/client/static/js/{julia-0h9krgsd.js → julia-mgsev9df.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-m0a6069c.js → kanban-definition-PNTS6WVX-vce614m8.js} +7 -7
- package/dist/client/static/js/lua-d8enp14s.js +1 -0
- package/dist/client/static/js/markdown-qetaj4vp.js +1 -0
- package/dist/client/static/js/{mermaid.core-6xvbnm63.js → mermaid.core-gc79re5p.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-a9f9yzc0.js → mindmap-definition-NLK3R4M7-ft1whaf5.js} +3 -3
- package/dist/client/static/js/one-dark-pro-rvg5xm1a.js +1 -0
- package/dist/client/static/js/one-light-2b5w3ksh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-md85wpjq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-4v4pf1h1.js → pegDiagram-GJSIUBJH-2s4ykhaa.js} +1 -1
- package/dist/client/static/js/{perl-rptyx23q.js → perl-6n93vjsa.js} +1 -1
- package/dist/client/static/js/{php-sagvq3wz.js → php-w23nmbtc.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-4grcqnp8.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-a54yrmfm.js → pieDiagram-5QR66LMP-7h8dp0z3.js} +2 -2
- package/dist/client/static/js/properties-g6tpq003.js +1 -0
- package/dist/client/static/js/python-cy06fzhg.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-1twhvnp2.js → quadrantDiagram-O4NWA36T-pteyxjxr.js} +6 -6
- package/dist/client/static/js/r-vw8berfv.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-7j9prhg1.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-g8x2jps1.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-cbg7k68h.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-xfvjk9f8.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-7w97805z.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-83tqfdcy.js → railroadDiagram-XR7U4H2S-68z9wdt0.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-73e3pzw6.js → requirementDiagram-PLB6GJNP-c08nmey6.js} +4 -4
- package/dist/client/static/js/{ruby-9qyx7knh.js → ruby-ag3b3t9t.js} +1 -1
- package/dist/client/static/js/{rust-jds4e4r7.js → rust-ke5ec0w5.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-1bzwj6sb.js → sankeyDiagram-IPEJSGJF-2r3kvjs5.js} +5 -5
- package/dist/client/static/js/{sass-07rteya0.js → sass-x0eez0kp.js} +1 -1
- package/dist/client/static/js/{scss-e2dndbfa.js → scss-qycakpjn.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-yh3h988k.js → sequenceDiagram-PO4LG4MO-ctjycd88.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-1n121yp6.js → sizeCapture-INFHLROL-97ndea95.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-0tdrzn06.js → stateDiagram-v2-GCMORJYK-aqnmsb96.js} +5 -5
- package/dist/client/static/js/{svelte-w365cpwa.js → svelte-tg19by0f.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-77n1ttdw.js → swimlanes-2SLR337P-v50cx1nx.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-e227mz39.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-b6r0k3e8.js → timeline-definition-EJHVYXUP-1ggrtdcj.js} +7 -7
- package/dist/client/static/js/treeView-Q6P3EWNA-xhf1r6c3.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-4n3j7ekq.js +1 -0
- package/dist/client/static/js/tsx-3dzv8h6k.js +1 -0
- package/dist/client/static/js/typescript-44vs0wn4.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-efq58m3m.js → usecaseDiagram-POWQR4AR-ybcwhpzs.js} +39 -39
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-ad4gvd5r.js → vennDiagram-UO4OBE2U-p9ggrt07.js} +8 -8
- package/dist/client/static/js/{vue-d6cesny1.js → vue-mhj4sme0.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-fb0py35r.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-v89tys2p.js → wardleyDiagram-VNRHLVJA-v79nb9kx.js} +4 -4
- package/dist/client/static/js/xml-yvv5fn3k.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-xtgzmknw.js → xychartDiagram-PMCCYNJV-43thqscz.js} +5 -5
- package/dist/client/static/js/yaml-avewh7n5.js +1 -0
- package/marketplace/marketplace.json +7 -0
- package/marketplace/plugins/github-actions/README.md +142 -0
- package/marketplace/plugins/github-actions/icon.svg +12 -0
- package/marketplace/plugins/github-actions/package.json +30 -0
- package/marketplace/plugins/github-actions/settings-schema.json +27 -0
- package/marketplace/plugins/github-actions/src/app.tsx +32 -0
- package/marketplace/plugins/github-actions/src/panel/Actions.tsx +105 -0
- package/marketplace/plugins/github-actions/src/panel/LogView.tsx +76 -0
- package/marketplace/plugins/github-actions/src/panel/Row.tsx +59 -0
- package/marketplace/plugins/github-actions/src/panel/RunView.tsx +197 -0
- package/marketplace/plugins/github-actions/src/panel/format.ts +74 -0
- package/marketplace/plugins/github-actions/src/panel/index.test.tsx +86 -0
- package/marketplace/plugins/github-actions/src/panel/index.tsx +256 -0
- package/marketplace/plugins/github-actions/src/panel/picker.test.tsx +68 -0
- package/marketplace/plugins/github-actions/src/panel/test-fixtures.ts +98 -0
- package/marketplace/plugins/github-actions/src/panel/test-harness.tsx +175 -0
- package/marketplace/plugins/github-actions/src/protocol.ts +156 -0
- package/marketplace/plugins/github-actions/src/server/github.test.ts +264 -0
- package/marketplace/plugins/github-actions/src/server/github.ts +309 -0
- package/marketplace/plugins/github-actions/src/server/http.test.ts +150 -0
- package/marketplace/plugins/github-actions/src/server/http.ts +202 -0
- package/marketplace/plugins/github-actions/src/server/json.ts +44 -0
- package/marketplace/plugins/github-actions/src/server/logtext.test.ts +84 -0
- package/marketplace/plugins/github-actions/src/server/logtext.ts +59 -0
- package/marketplace/plugins/github-actions/src/server/progress.test.ts +96 -0
- package/marketplace/plugins/github-actions/src/server/progress.ts +62 -0
- package/marketplace/plugins/github-actions/src/server/remote.ts +84 -0
- package/marketplace/plugins/github-actions/src/server/scope.ts +51 -0
- package/marketplace/plugins/github-actions/src/server/token.ts +84 -0
- package/marketplace/plugins/github-actions/src/server.ts +163 -0
- package/marketplace/plugins/github-actions/src/state.test.ts +55 -0
- package/marketplace/plugins/github-actions/src/state.ts +63 -0
- package/marketplace/plugins/github-actions/tsconfig.json +16 -0
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/proc/identity.ts +4 -3
- package/package.json +2 -2
- package/src/client/App.tsx +1 -1
- package/src/client/borders.css +143 -0
- package/src/client/components/common/context-usage-button/Ring.tsx +34 -9
- package/src/client/components/common/context-usage-button/index.test.tsx +19 -2
- package/src/client/components/common/context-usage-button/index.tsx +4 -4
- package/src/client/components/common/header-controls/index.test.tsx +26 -59
- package/src/client/components/common/header-controls/index.tsx +41 -52
- package/src/client/components/common/header-controls/phone-row.test.tsx +265 -0
- package/src/client/components/common/header-controls/plugin-entry.test.tsx +25 -3
- package/src/client/components/common/header-controls/shell-chrome.test.tsx +2 -2
- package/src/client/components/layout/LeftDock.tsx +7 -0
- package/src/client/components/layout/desktop-layout/DesktopOverlays.tsx +51 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +117 -15
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +257 -0
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +23 -24
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +50 -78
- package/src/client/components/layout/desktop-layout/index.tsx +73 -73
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +20 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +24 -2
- package/src/client/components/layout/session-sidebar/Header.test.ts +10 -0
- package/src/client/components/layout/session-sidebar/Header.tsx +2 -2
- package/src/client/components/mobile/RightSidebar.tsx +164 -66
- package/src/client/components/mobile/header-titlebar.test.tsx +92 -0
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +2 -3
- package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -10
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +179 -0
- package/src/client/components/mobile/panel-chips.test.tsx +12 -0
- package/src/client/components/mobile/panel-chips.tsx +5 -1
- package/src/client/components/mobile/right-drawer-nav.test.tsx +258 -0
- package/src/client/components/settings/Modal.tsx +14 -9
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +18 -6
- package/src/client/components/settings/SettingsSidebarList.tsx +2 -1
- package/src/client/components/settings/Sidebar.tsx +6 -4
- package/src/client/components/settings/apply-side-effects.test.ts +17 -0
- package/src/client/components/settings/apply-side-effects.ts +32 -5
- package/src/client/components/settings/band-height.test.tsx +122 -0
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +144 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +81 -39
- package/src/client/components/settings/categories/ChatSettings.tsx +9 -15
- package/src/client/components/settings/categories/UsageSettings.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +101 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +134 -0
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/EditorIndentSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +6 -6
- package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +288 -0
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/ThemeSection.tsx +42 -0
- package/src/client/components/settings/categories/appearance-settings/TrayIconSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/groups.test.ts +47 -0
- package/src/client/components/settings/categories/appearance-settings/groups.ts +95 -0
- package/src/client/components/settings/categories/chat-settings/LayoutSection.tsx +31 -14
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/master-detail/GroupDetail.tsx +38 -0
- package/src/client/components/settings/{categories/chat-settings/SidebarList.tsx → master-detail/GroupSidebar.tsx} +35 -12
- package/src/client/components/settings/master-detail/index.tsx +3 -1
- package/src/client/components/settings/pane-header.ts +25 -0
- package/src/client/components/workspace/browser-toolbar/index.test.tsx +39 -1
- package/src/client/components/workspace/browser-toolbar/index.tsx +53 -17
- package/src/client/components/workspace/chat-timeline/ColumnResizeHandle.tsx +107 -0
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +9 -3
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +35 -26
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +6 -0
- package/src/client/components/workspace/chat-timeline/column-resize.test.tsx +292 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +5 -3
- package/src/client/components/workspace/context-panel/index.tsx +10 -4
- package/src/client/components/workspace/editor/EditorHideButton.tsx +41 -0
- package/src/client/components/workspace/editor/EmptyEditor.tsx +11 -2
- package/src/client/components/workspace/editor/PluginColumn.tsx +11 -1
- package/src/client/components/workspace/editor/Tabs.tsx +8 -0
- package/src/client/components/workspace/editor/editor-hide-button.test.ts +144 -0
- package/src/client/components/workspace/editor/index.tsx +8 -2
- package/src/client/components/workspace/editor/props.ts +9 -0
- package/src/client/components/workspace/file-explorer/RowLabel.test.tsx +90 -0
- package/src/client/components/workspace/file-explorer/RowLabel.tsx +1 -4
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +52 -46
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +41 -21
- package/src/client/components/workspace/git-panel/commit-modal/GraphCanvas.tsx +6 -5
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +19 -22
- package/src/client/components/workspace/panel-header/title-policy.test.tsx +62 -0
- package/src/client/components/workspace/panel-header/title-policy.tsx +83 -0
- package/src/client/components/workspace/panel-tabs/Home.density.test.tsx +122 -0
- package/src/client/components/workspace/panel-tabs/Home.test.tsx +137 -0
- package/src/client/components/workspace/panel-tabs/Home.tsx +118 -0
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +173 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +339 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +302 -0
- package/src/client/components/workspace/panel-tabs/index.tsx +105 -0
- package/src/client/components/workspace/panels/builtin.tsx +9 -0
- package/src/client/components/workspace/plan-panel/index.tsx +7 -2
- package/src/client/components/workspace/repo-picker/Modal.tsx +1 -1
- package/src/client/components/workspace/repo-picker/index.test.tsx +32 -8
- package/src/client/components/workspace/repo-picker/index.tsx +2 -2
- package/src/client/components/workspace/search-panel/Body.tsx +7 -1
- package/src/client/components/workspace/search-panel/index.tsx +2 -1
- package/src/client/components/workspace/terminal-panel/Header.tsx +10 -3
- package/src/client/components/workspace/terminal-panel/index.tsx +4 -1
- package/src/client/components/workspace/todo-panel/index.tsx +6 -1
- package/src/client/components/workspace/usage-panel/index.tsx +7 -2
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +43 -4
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +101 -45
- package/src/client/components/workspace/user-browser-panel/TabStrip.tsx +107 -0
- package/src/client/components/workspace/user-browser-panel/index.tsx +31 -6
- package/src/client/glass.test.ts +1 -1
- package/src/client/hooks/browser/use-annotate.ts +6 -5
- package/src/client/hooks/browser/use-user-browser.test.tsx +279 -0
- package/src/client/hooks/browser/use-user-browser.ts +190 -44
- package/src/client/hooks/chat/timeline/column-drag.ts +171 -0
- package/src/client/hooks/chat/timeline/width-mode.test.ts +112 -11
- package/src/client/hooks/chat/timeline/width-mode.ts +91 -18
- package/src/client/hooks/ui/border-style.test.ts +172 -0
- package/src/client/hooks/ui/border-style.ts +60 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +27 -1
- package/src/client/hooks/ui/navbar-controls.ts +95 -20
- package/src/client/hooks/ui/style-attributes.test.ts +2 -0
- package/src/client/hooks/workspace/active-project.ts +46 -0
- package/src/client/hooks/workspace/commit-expansion.test.ts +135 -0
- package/src/client/hooks/workspace/commit-expansion.ts +56 -0
- package/src/client/hooks/workspace/mobile-right-panel-nav.ts +63 -0
- package/src/client/hooks/workspace/panel-nav.test.ts +140 -0
- package/src/client/hooks/workspace/panel-nav.ts +95 -0
- package/src/client/hooks/workspace/panel-tabs.session.test.tsx +235 -0
- package/src/client/hooks/workspace/panel-tabs.ts +194 -0
- package/src/client/hooks/workspace/right-open-request.ts +53 -0
- package/src/client/hooks/workspace/right-side.test.ts +204 -0
- package/src/client/hooks/workspace/right-side.ts +142 -0
- package/src/client/lib/ui/control-plate.ts +33 -0
- package/src/client/main.tsx +9 -4
- package/src/client/tailwind.css +6 -0
- package/src/server/lib/assets/shell-attributes.server.ts +26 -10
- package/src/server/lib/assets/shell-attributes.test.ts +26 -0
- package/src/server/lib/bundler/titlebar-css.test.ts +5 -3
- package/src/server/lib/harness/acp/background-replay.test.ts +16 -1
- package/src/server/lib/harness/acp/background-replay.ts +6 -1
- package/src/server/lib/harness/acp/background-work.ts +44 -31
- package/src/server/lib/harness/acp/session-turns.ts +4 -3
- package/src/server/lib/harness/acp/session-wiring.test.ts +53 -0
- package/src/server/lib/harness/acp/session-wiring.ts +11 -2
- package/src/server/lib/harness/session-lease.server.ts +3 -2
- package/src/server/lib/omp/session/lease-probe.server.test.ts +82 -0
- package/src/server/lib/omp/session/lease-probe.server.ts +180 -0
- package/src/server/lib/omp/session/ownership.server.test.ts +17 -6
- package/src/server/lib/omp/session/ownership.server.ts +7 -5
- package/src/server/plugins/ssr.ts +6 -3
- package/src/shared/lib/browser/user-tabs.test.ts +165 -0
- package/src/shared/lib/browser/user-tabs.ts +172 -0
- package/src/shared/lib/chat/timeline/width-mode.test.ts +34 -2
- package/src/shared/lib/chat/timeline/width-mode.ts +71 -22
- package/src/shared/lib/commands/catalog.ts +2 -2
- package/src/shared/lib/fs/git-status.test.ts +23 -0
- package/src/shared/lib/fs/git-status.ts +15 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +20 -20
- package/src/shared/lib/settings/defaults.ts +8 -1
- package/src/shared/lib/theme/border-style.test.ts +83 -0
- package/src/shared/lib/theme/border-style.ts +122 -0
- package/src/shared/lib/workspace/keymap.ts +2 -1
- package/src/shared/lib/workspace/panel-nav.test.ts +198 -0
- package/src/shared/lib/workspace/panel-nav.ts +148 -0
- package/src/shared/lib/workspace/panel-tabs-close.test.ts +154 -0
- package/src/shared/lib/workspace/panel-tabs.ts +105 -0
- package/src/shared/lib/workspace/session-state/cache.ts +22 -0
- package/src/shared/lib/workspace/session-state/merge.ts +6 -0
- package/src/shared/lib/workspace/session-state/store.ts +23 -0
- package/src/shared/types/settings/state.ts +58 -3
- package/src/test-support/header-controls-harness.ts +22 -0
- package/src/test-support/peer-harness.ts +2 -2
- package/dist/client/static/js/ImageView-rnzf5tve.js +0 -1
- package/dist/client/static/js/LayoutWrapper-rekrgth6.js +0 -2
- package/dist/client/static/js/SessionsView-e84tjbcr.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +0 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +0 -1
- package/dist/client/static/js/c-8jf64j6h.js +0 -1
- package/dist/client/static/js/cpp-vh94zee0.js +0 -1
- package/dist/client/static/js/css-a13jmmnc.js +0 -1
- package/dist/client/static/js/css-p57h1fme.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-36ygrbvm.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +0 -1
- package/dist/client/static/js/graphql-kesh8gk0.js +0 -1
- package/dist/client/static/js/html-sxpfydga.js +0 -1
- package/dist/client/static/js/index-0q2qfcjn.js +0 -1
- package/dist/client/static/js/index-48gh56ka.js +0 -3
- package/dist/client/static/js/index-4rv388z7.js +0 -2
- package/dist/client/static/js/index-52xmdeh2.js +0 -1
- package/dist/client/static/js/index-8kqepehd.js +0 -12
- package/dist/client/static/js/index-cje5gg45.js +0 -1
- package/dist/client/static/js/index-fbcg8y95.js +0 -1
- package/dist/client/static/js/index-g3shdymf.js +0 -1
- package/dist/client/static/js/index-h5n1btqy.js +0 -1
- package/dist/client/static/js/index-m1n4v0z7.js +0 -9
- package/dist/client/static/js/index-rn8w29pv.js +0 -2
- package/dist/client/static/js/index-s00j9042.js +0 -2
- package/dist/client/static/js/index-s7rfbydk.js +0 -4
- package/dist/client/static/js/index-sg6sz3g8.js +0 -1
- package/dist/client/static/js/index-vcrh95gf.css +0 -1
- package/dist/client/static/js/index-w5rw8f7w.js +0 -1
- package/dist/client/static/js/index-x6v37h3j.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +0 -1
- package/dist/client/static/js/ini-1x0ad976.js +0 -1
- package/dist/client/static/js/java-3944nq02.js +0 -1
- package/dist/client/static/js/javascript-zegm06a1.js +0 -1
- package/dist/client/static/js/json-g5ggnd94.js +0 -1
- package/dist/client/static/js/jsx-f6p72qpc.js +0 -1
- package/dist/client/static/js/lua-edn2b3wn.js +0 -1
- package/dist/client/static/js/markdown-9dhg1fax.js +0 -1
- package/dist/client/static/js/one-dark-pro-hteqzfb0.js +0 -1
- package/dist/client/static/js/one-light-dapnh0rs.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +0 -1
- package/dist/client/static/js/properties-fcmj08pv.js +0 -1
- package/dist/client/static/js/python-532d8ezm.js +0 -1
- package/dist/client/static/js/r-ptmdxs2a.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-akjqm31r.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +0 -1
- package/dist/client/static/js/tsx-zfy727zs.js +0 -1
- package/dist/client/static/js/typescript-683kkkaw.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +0 -1
- package/dist/client/static/js/xml-6ct32gys.js +0 -1
- package/dist/client/static/js/yaml-1d5m3bfj.js +0 -1
- package/src/server/lib/omp/session/lease-flock.server.ts +0 -117
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A browser-style column's home page: the catalog as a grid of cards.
|
|
8
|
+
*
|
|
9
|
+
* This is what the column shows when nothing is open, and what the add control
|
|
10
|
+
* opens. It is the CATALOG, not the working set: every view the column could
|
|
11
|
+
* draw is a card, and a view that is already open is a card that says so and
|
|
12
|
+
* cannot be opened twice — which is the duplicate-tab rule stated where the user
|
|
13
|
+
* is most likely to break it.
|
|
14
|
+
*
|
|
15
|
+
* The card is a button, not a link: there is no URL, and `aria-pressed` is the
|
|
16
|
+
* honest state ("this view is already on a tab"). A card the user has already
|
|
17
|
+
* opened stays pressable and focuses its tab, because the alternative — a
|
|
18
|
+
* `disabled` button — cannot be focused, cannot explain itself and, measured in
|
|
19
|
+
* Chromium on the harness tabs, never shows its `title` either.
|
|
20
|
+
*
|
|
21
|
+
* Density: two columns under 420px of panel, three above. A card's whole content
|
|
22
|
+
* is its mark, its label and one line of description, so the grid reflows by
|
|
23
|
+
* itself and there is no measured overflow rule to keep in step.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import type { ResolvedPanel } from '@/client/components/workspace/plugin-panel/catalog';
|
|
27
|
+
import { PanelMark } from '@/client/components/common/panel-mark';
|
|
28
|
+
import { PANEL_MARK_SIZE } from '@/shared/lib/workspace/right-panels';
|
|
29
|
+
|
|
30
|
+
interface PanelHomeProps {
|
|
31
|
+
/** The column's whole catalog, in its own order. */
|
|
32
|
+
panels: readonly ResolvedPanel[];
|
|
33
|
+
/** The ids currently on a tab, so a card can say "sudah terbuka". */
|
|
34
|
+
openIds: ReadonlySet<string>;
|
|
35
|
+
/** Open a view, or focus it when it is already open. */
|
|
36
|
+
onPick: (id: string) => void;
|
|
37
|
+
/** What the column is for, so the empty state is not generic copy. */
|
|
38
|
+
title: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function PanelHome({ panels, openIds, onPick, title }: PanelHomeProps) {
|
|
42
|
+
return (
|
|
43
|
+
<div className="@container flex h-full flex-col overflow-y-auto scrollbar-overlay-container px-3 py-4 select-none">
|
|
44
|
+
{/* Centred in whatever room the column has, and it degrades correctly when
|
|
45
|
+
there is none: `my-auto` on a flex child in a scroll container centres
|
|
46
|
+
the block while it FITS and lets it start at the top the moment it does
|
|
47
|
+
not, so a long catalog scrolls from the first card instead of clipping
|
|
48
|
+
the heading above the viewport. `justify-center` would have done the
|
|
49
|
+
clipping — the classic flex-overflow trap. */}
|
|
50
|
+
<div className="mx-auto my-auto w-full max-w-[460px]">
|
|
51
|
+
<h2 className="text-xs font-semibold text-ink">{title}</h2>
|
|
52
|
+
<p className="mt-1 text-[11px] leading-relaxed text-ink/50">
|
|
53
|
+
Klik kartu untuk membukanya sebagai tab. Satu view hanya punya satu tab.
|
|
54
|
+
</p>
|
|
55
|
+
|
|
56
|
+
{/* TWO columns at this column's 200–268px floor and three only once the
|
|
57
|
+
column is actually wide: a viewport breakpoint would draw three cards
|
|
58
|
+
in a 268px right panel on a 1440px window, which is what the first
|
|
59
|
+
render did. `@[...]` is the container's own width. */}
|
|
60
|
+
<div className="mt-4 grid grid-cols-2 gap-2 @[380px]:grid-cols-3">
|
|
61
|
+
{panels.map((panel) => {
|
|
62
|
+
const opened = openIds.has(panel.id);
|
|
63
|
+
return (
|
|
64
|
+
<button
|
|
65
|
+
key={panel.id}
|
|
66
|
+
type="button"
|
|
67
|
+
onClick={() => onPick(panel.id)}
|
|
68
|
+
aria-pressed={opened}
|
|
69
|
+
aria-label={
|
|
70
|
+
opened ? `${panel.title} — sudah terbuka, klik untuk fokus` : `Buka ${panel.title}`
|
|
71
|
+
}
|
|
72
|
+
title={panel.title}
|
|
73
|
+
className={`flex cursor-pointer flex-col items-center gap-1.5 rounded-xl border px-2 py-3 text-center transition-colors ${
|
|
74
|
+
opened
|
|
75
|
+
? 'border-ink/25 bg-ink/5'
|
|
76
|
+
: 'border-ink/15 bg-paper hover:border-ink/30 hover:bg-ink/5'
|
|
77
|
+
}`}
|
|
78
|
+
>
|
|
79
|
+
<PanelMark
|
|
80
|
+
className="inline-flex"
|
|
81
|
+
panelId={panel.id}
|
|
82
|
+
builtin={panel.builtin}
|
|
83
|
+
icon={panel.builtin ? panel.icon : undefined}
|
|
84
|
+
name={panel.builtin ? panel.label : panel.name}
|
|
85
|
+
{...(panel.iconUrl ? { iconUrl: panel.iconUrl } : {})}
|
|
86
|
+
{...(panel.color ? { color: panel.color } : {})}
|
|
87
|
+
size={PANEL_MARK_SIZE + 4}
|
|
88
|
+
/>
|
|
89
|
+
<span className="line-clamp-1 text-[11px] font-semibold text-ink">{panel.label}</span>
|
|
90
|
+
{/* The second line earns its place or is dropped: `panel.title`
|
|
91
|
+
REPEATED `panel.label` on ten of the twelve views ("Search" over
|
|
92
|
+
"Search"), which read as a duplicated word. It is printed only
|
|
93
|
+
when it says something the label did not — otherwise the card
|
|
94
|
+
falls back to a fact about the view. The floor keeps a row of
|
|
95
|
+
cards level when one of them has nothing to add. */}
|
|
96
|
+
<span className="line-clamp-2 min-h-[26px] text-[10px] leading-snug text-ink/50">
|
|
97
|
+
{opened
|
|
98
|
+
? 'Sudah terbuka'
|
|
99
|
+
: panel.title !== panel.label
|
|
100
|
+
? panel.title
|
|
101
|
+
: panel.requiresWorkspace
|
|
102
|
+
? 'Butuh folder kerja'
|
|
103
|
+
: ''}
|
|
104
|
+
</span>
|
|
105
|
+
</button>
|
|
106
|
+
);
|
|
107
|
+
})}
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
{panels.length === 0 ? (
|
|
111
|
+
<p className="mt-4 text-[11px] italic text-ink/40">
|
|
112
|
+
Tidak ada view yang bisa dibuka di kolom ini.
|
|
113
|
+
</p>
|
|
114
|
+
) : null}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One chip of a panel column's tab strip.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from `TabStrip` so the strip owns the ROW (the add control, the
|
|
10
|
+
* scroller, the trailing actions) and this owns a single tab. The chip is the
|
|
11
|
+
* only element in the strip that is both a control and a drag SOURCE, and both
|
|
12
|
+
* facts carry a platform trap:
|
|
13
|
+
*
|
|
14
|
+
* - `draggable={false}` is indistinguishable from an attribute never written
|
|
15
|
+
* (Preact omits a `false` boolean), so the pinned chip's non-draggability is
|
|
16
|
+
* spelled `undefined` and a test can tell the two apart;
|
|
17
|
+
* - when the strip is the window's drag region, the chip must opt OUT
|
|
18
|
+
* (`titlebar-no-drag`), or Windows turns it into a drag handle and its click
|
|
19
|
+
* never fires.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { X } from 'lucide-preact';
|
|
23
|
+
import type { TargetedDragEvent } from 'preact';
|
|
24
|
+
import type { ResolvedPanel } from '@/client/components/workspace/plugin-panel/catalog';
|
|
25
|
+
import { PanelMark } from '@/client/components/common/panel-mark';
|
|
26
|
+
import { PANEL_MARK_SIZE } from '@/shared/lib/workspace/right-panels';
|
|
27
|
+
import type { ControlLayout } from '@/client/lib/ui/control-plate';
|
|
28
|
+
|
|
29
|
+
export interface TabChipProps {
|
|
30
|
+
panel: ResolvedPanel;
|
|
31
|
+
isActive: boolean;
|
|
32
|
+
/** The strip is on its home page, where no chip is selected. */
|
|
33
|
+
parentHome: boolean;
|
|
34
|
+
/** The chip AFTER this one is the active one, so this separator fades. */
|
|
35
|
+
nextIsActive: boolean;
|
|
36
|
+
/** The pinned view leads the column and cannot be closed or dragged. */
|
|
37
|
+
closable: boolean;
|
|
38
|
+
/** The strip adopts a new order; omitted means this strip is read-only. */
|
|
39
|
+
reorderable: boolean;
|
|
40
|
+
/** The chip being dragged right now, drawn dimmed. */
|
|
41
|
+
dragging: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The strip is the window's drag region, so this chip must opt out of it.
|
|
44
|
+
* Separate from `layout` on purpose: the drag opt-out is a WINDOW fact and
|
|
45
|
+
* the density is a ROW fact, and one standing in for the other is how a chip
|
|
46
|
+
* ends up 28px in a 56px row.
|
|
47
|
+
*/
|
|
48
|
+
noDrag: boolean;
|
|
49
|
+
/** Which density this chip draws at — the strip's own layout. */
|
|
50
|
+
layout: ControlLayout;
|
|
51
|
+
chipRef: (element: HTMLElement | null) => void;
|
|
52
|
+
onSelect: () => void;
|
|
53
|
+
onClose: () => void;
|
|
54
|
+
onDragStart: (event: TargetedDragEvent<HTMLElement>) => void;
|
|
55
|
+
onDragOver: (event: TargetedDragEvent<HTMLElement>) => void;
|
|
56
|
+
onDrop: (event: TargetedDragEvent<HTMLElement>) => void;
|
|
57
|
+
onDragEnd: () => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function TabChip({
|
|
61
|
+
panel,
|
|
62
|
+
isActive,
|
|
63
|
+
parentHome,
|
|
64
|
+
nextIsActive,
|
|
65
|
+
closable,
|
|
66
|
+
reorderable,
|
|
67
|
+
dragging,
|
|
68
|
+
noDrag,
|
|
69
|
+
layout,
|
|
70
|
+
chipRef,
|
|
71
|
+
onSelect,
|
|
72
|
+
onClose,
|
|
73
|
+
onDragStart,
|
|
74
|
+
onDragOver,
|
|
75
|
+
onDrop,
|
|
76
|
+
onDragEnd,
|
|
77
|
+
}: TabChipProps) {
|
|
78
|
+
const label = panel.label || panel.title;
|
|
79
|
+
return (
|
|
80
|
+
// The wrapper is the strip's own flex cell AND the drag opt-out for
|
|
81
|
+
// everything inside it: `app-region` inherits, so marking the chip's
|
|
82
|
+
// controls one at a time is how a future control gets forgotten.
|
|
83
|
+
<div className={`flex flex-none items-center${noDrag ? ' titlebar-no-drag' : ''}`}>
|
|
84
|
+
<div
|
|
85
|
+
role="tab"
|
|
86
|
+
aria-selected={isActive}
|
|
87
|
+
tabIndex={isActive ? 0 : -1}
|
|
88
|
+
data-panel-tab={panel.id}
|
|
89
|
+
ref={chipRef}
|
|
90
|
+
/* The pinned view is neither a drag source nor a drop target: it leads
|
|
91
|
+
the strip by construction, so letting a drag land in front of it
|
|
92
|
+
would promise a position the store puts back. */
|
|
93
|
+
draggable={reorderable && closable ? true : undefined}
|
|
94
|
+
onDragStart={(event) => {
|
|
95
|
+
if (!reorderable || !closable) return;
|
|
96
|
+
onDragStart(event);
|
|
97
|
+
}}
|
|
98
|
+
onDragOver={(event) => {
|
|
99
|
+
if (!reorderable || !closable) return;
|
|
100
|
+
onDragOver(event);
|
|
101
|
+
}}
|
|
102
|
+
onDrop={(event) => {
|
|
103
|
+
if (!reorderable) return;
|
|
104
|
+
onDrop(event);
|
|
105
|
+
}}
|
|
106
|
+
onDragEnd={() => {
|
|
107
|
+
if (!reorderable) return;
|
|
108
|
+
onDragEnd();
|
|
109
|
+
}}
|
|
110
|
+
className={`group relative flex min-w-[80px] max-w-[170px] flex-none items-center rounded-md transition-colors ${
|
|
111
|
+
layout === 'mobile' ? 'h-9' : 'h-7'
|
|
112
|
+
} ${
|
|
113
|
+
isActive ? 'bg-ink/[0.08] text-ink' : 'text-ink/60 hover:bg-ink/5 hover:text-ink'
|
|
114
|
+
} ${reorderable && closable ? 'cursor-grab active:cursor-grabbing' : ''} ${
|
|
115
|
+
dragging ? 'opacity-40' : ''
|
|
116
|
+
}`}
|
|
117
|
+
>
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
tabIndex={-1}
|
|
121
|
+
onClick={onSelect}
|
|
122
|
+
title={panel.title}
|
|
123
|
+
aria-label={panel.title}
|
|
124
|
+
className={`flex h-full min-w-0 flex-1 cursor-pointer items-center gap-1.5 py-1 pl-2 text-left ${
|
|
125
|
+
layout === 'mobile' ? 'pr-8' : 'pr-6'
|
|
126
|
+
}`}
|
|
127
|
+
>
|
|
128
|
+
<PanelMark
|
|
129
|
+
className="inline-flex flex-none"
|
|
130
|
+
panelId={panel.id}
|
|
131
|
+
builtin={panel.builtin}
|
|
132
|
+
icon={panel.builtin ? panel.icon : undefined}
|
|
133
|
+
name={panel.builtin ? panel.label : panel.name}
|
|
134
|
+
{...(panel.iconUrl ? { iconUrl: panel.iconUrl } : {})}
|
|
135
|
+
{...(panel.color ? { color: panel.color } : {})}
|
|
136
|
+
size={PANEL_MARK_SIZE}
|
|
137
|
+
/>
|
|
138
|
+
<span className="truncate text-[11px] font-medium">{label}</span>
|
|
139
|
+
</button>
|
|
140
|
+
{closable ? (
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
tabIndex={-1}
|
|
144
|
+
onClick={onClose}
|
|
145
|
+
title={`Tutup ${label}`}
|
|
146
|
+
aria-label={`Tutup tab ${label}`}
|
|
147
|
+
/* Always visible, on every chip. A close control revealed only on
|
|
148
|
+
hover is a control that does not exist on a touch screen and
|
|
149
|
+
cannot be found by a reader scanning the strip; it also made the
|
|
150
|
+
ACTIVE chip look like the only closable one. The tint still dims
|
|
151
|
+
a background tab so the strip reads in one pass. */
|
|
152
|
+
className={`absolute flex cursor-pointer items-center justify-center rounded transition-colors hover:bg-ink/10 hover:text-ink ${
|
|
153
|
+
layout === 'mobile' ? 'top-0.5 right-0.5 h-7 w-7' : 'top-1 right-1 h-5 w-5'
|
|
154
|
+
} ${isActive ? 'text-ink/45' : 'text-ink/30'}`}
|
|
155
|
+
>
|
|
156
|
+
<X size={11} />
|
|
157
|
+
</button>
|
|
158
|
+
) : null}
|
|
159
|
+
</div>
|
|
160
|
+
{/* The separator belongs to the gap, not the chip: a chip that painted its
|
|
161
|
+
own border would shrink its label by 1px on hover and its neighbour's
|
|
162
|
+
by another. It fades beside the active chip so the pair reads as one
|
|
163
|
+
block, and fades entirely on the home page, where no chip is
|
|
164
|
+
selected. */}
|
|
165
|
+
<span
|
|
166
|
+
aria-hidden="true"
|
|
167
|
+
className={`mx-0.5 h-3.5 w-px bg-ink/15 ${
|
|
168
|
+
isActive || (parentHome && nextIsActive) ? 'opacity-0' : 'opacity-100'
|
|
169
|
+
}`}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The desktop tab strip and the column that hosts it.
|
|
8
|
+
*
|
|
9
|
+
* Three properties, and each is a rule the strip exists to keep:
|
|
10
|
+
*
|
|
11
|
+
* - **the add control opens the CATALOG, not a blank chip.** A strip that
|
|
12
|
+
* appended an unnamed tab would be a tab nobody can identify or close;
|
|
13
|
+
* - **a card the user already opened focuses its tab** instead of appending a
|
|
14
|
+
* second one — the duplicate-tab failure a card grid invites;
|
|
15
|
+
* - **the pinned view has no close control**, because a column with no way back
|
|
16
|
+
* to its own view is a dead end.
|
|
17
|
+
*
|
|
18
|
+
* Rendered with `h()` against happy-dom; the strip is pure props, so no kit
|
|
19
|
+
* services are needed.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
23
|
+
import { Window } from 'happy-dom';
|
|
24
|
+
import { h, render } from 'preact';
|
|
25
|
+
import { act } from 'preact/test-utils';
|
|
26
|
+
import { PanelTabStrip } from '@/client/components/workspace/panel-tabs/TabStrip';
|
|
27
|
+
import type { ResolvedPanel } from '@/client/components/workspace/plugin-panel/catalog';
|
|
28
|
+
import {
|
|
29
|
+
CONTROL_BOX,
|
|
30
|
+
CONTROL_GLYPH_PX,
|
|
31
|
+
CONTROL_ROW_HEIGHT,
|
|
32
|
+
CONTROL_ROW_INSET,
|
|
33
|
+
} from '@/client/lib/ui/control-plate';
|
|
34
|
+
|
|
35
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'Event'] as const;
|
|
36
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
37
|
+
|
|
38
|
+
let container: HTMLElement;
|
|
39
|
+
|
|
40
|
+
beforeAll(() => {
|
|
41
|
+
const win = new Window({ url: 'http://localhost' });
|
|
42
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
43
|
+
for (const key of DOM_GLOBALS) {
|
|
44
|
+
nativeGlobals[key] = target[key];
|
|
45
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
afterAll(() => {
|
|
50
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
51
|
+
for (const key of DOM_GLOBALS) {
|
|
52
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
53
|
+
else target[key] = nativeGlobals[key];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
afterEach(() => {
|
|
58
|
+
render(null, container);
|
|
59
|
+
container.remove();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
function panel(id: string, label: string): ResolvedPanel {
|
|
63
|
+
return {
|
|
64
|
+
id,
|
|
65
|
+
side: 'right',
|
|
66
|
+
title: `${label} — title`,
|
|
67
|
+
label,
|
|
68
|
+
name: '',
|
|
69
|
+
builtin: true,
|
|
70
|
+
requiresWorkspace: false,
|
|
71
|
+
liveWhileHidden: false,
|
|
72
|
+
minWidth: 200,
|
|
73
|
+
defaultWidth: 268,
|
|
74
|
+
defaultFraction: 0.28,
|
|
75
|
+
render: () => null,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const FILES = panel('files', 'Files');
|
|
80
|
+
const GIT = panel('git', 'GIT');
|
|
81
|
+
const SESSIONS = panel('sessions', 'Sessions');
|
|
82
|
+
|
|
83
|
+
function mount(props: Partial<Parameters<typeof PanelTabStrip>[0]> = {}) {
|
|
84
|
+
const calls = { add: 0, select: [] as string[], close: [] as string[] };
|
|
85
|
+
container = document.createElement('div');
|
|
86
|
+
document.body.appendChild(container);
|
|
87
|
+
act(() => {
|
|
88
|
+
render(
|
|
89
|
+
h(PanelTabStrip, {
|
|
90
|
+
tabs: ['files', 'git'],
|
|
91
|
+
panels: new Map([
|
|
92
|
+
['files', FILES],
|
|
93
|
+
['git', GIT],
|
|
94
|
+
]),
|
|
95
|
+
active: 'files',
|
|
96
|
+
onAdd: () => (calls.add += 1),
|
|
97
|
+
onSelect: (id: string) => calls.select.push(id),
|
|
98
|
+
onClose: (id: string) => calls.close.push(id),
|
|
99
|
+
...props,
|
|
100
|
+
}),
|
|
101
|
+
container,
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
return calls;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
describe('PanelTabStrip', () => {
|
|
108
|
+
test('one chip per open tab, marked pressed only for the active one', () => {
|
|
109
|
+
mount();
|
|
110
|
+
const tabs = container.querySelectorAll('[role="tab"]');
|
|
111
|
+
expect(tabs).toHaveLength(2);
|
|
112
|
+
expect(tabs[0]?.getAttribute('aria-selected')).toBe('true');
|
|
113
|
+
expect(tabs[1]?.getAttribute('aria-selected')).toBe('false');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('the add control opens the catalog instead of appending a blank tab', () => {
|
|
117
|
+
const calls = mount();
|
|
118
|
+
const add = container.querySelector('[aria-label="Tambah tab"]') as HTMLElement;
|
|
119
|
+
expect(add).not.toBeNull();
|
|
120
|
+
act(() => add.click());
|
|
121
|
+
expect(calls.add).toBe(1);
|
|
122
|
+
// Nothing was appended and nothing was selected by the add itself.
|
|
123
|
+
expect(container.querySelectorAll('[role="tab"]')).toHaveLength(2);
|
|
124
|
+
expect(calls.select).toEqual([]);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('the close control is VISIBLE on every chip, not only the active one', () => {
|
|
128
|
+
mount();
|
|
129
|
+
// A hover-revealed X does not exist on a touch screen and made the active
|
|
130
|
+
// chip look like the only closable one. Both chips carry `opacity-100`
|
|
131
|
+
// implicitly by having no `opacity-0` class at all.
|
|
132
|
+
const closes = [...container.querySelectorAll('[aria-label^="Tutup tab"]')];
|
|
133
|
+
expect(closes).toHaveLength(2);
|
|
134
|
+
for (const close of closes) expect(close.className).not.toContain('opacity-0');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('a background chip still exposes its close control', () => {
|
|
138
|
+
mount({ active: 'files' });
|
|
139
|
+
const inactive = container.querySelectorAll('[role="tab"]')[1];
|
|
140
|
+
const close = inactive?.querySelector('[aria-label^="Tutup tab"]');
|
|
141
|
+
expect(close).not.toBeNull();
|
|
142
|
+
expect(close?.className).not.toContain('opacity-0');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('a close control exists on every closable chip and names its target', () => {
|
|
146
|
+
const calls = mount();
|
|
147
|
+
const closeButtons = container.querySelectorAll('[aria-label^="Tutup tab"]');
|
|
148
|
+
expect(closeButtons).toHaveLength(2);
|
|
149
|
+
act(() => (closeButtons[1] as HTMLElement).click());
|
|
150
|
+
expect(calls.close).toEqual(['git']);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test('the pinned view has NO close control, so the way back cannot be deleted', () => {
|
|
154
|
+
mount({
|
|
155
|
+
tabs: ['sessions', 'files'],
|
|
156
|
+
panels: new Map([
|
|
157
|
+
['sessions', SESSIONS],
|
|
158
|
+
['files', FILES],
|
|
159
|
+
]),
|
|
160
|
+
active: 'sessions',
|
|
161
|
+
pinned: 'sessions',
|
|
162
|
+
});
|
|
163
|
+
const closeButtons = container.querySelectorAll('[aria-label^="Tutup tab"]');
|
|
164
|
+
expect(closeButtons).toHaveLength(1);
|
|
165
|
+
expect(closeButtons[0]?.getAttribute('aria-label')).toBe('Tutup tab Files');
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test('a tab id with no catalog entry draws no chip rather than an empty one', () => {
|
|
169
|
+
mount({ tabs: ['files', 'gone'], active: 'files' });
|
|
170
|
+
expect(container.querySelectorAll('[role="tab"]')).toHaveLength(1);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test('the strip is one tab stop: only the active chip is reachable with Tab', () => {
|
|
174
|
+
mount();
|
|
175
|
+
const tabs = [...container.querySelectorAll('[role="tab"]')] as HTMLElement[];
|
|
176
|
+
expect(tabs.map((tab) => tab.getAttribute('tabindex'))).toEqual(['0', '-1']);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
test('keeps its accessibility name when a chip shows the short label', () => {
|
|
180
|
+
mount();
|
|
181
|
+
// The chip's own trigger is the FIRST label-bearing control inside the tab;
|
|
182
|
+
// the close button is the second and names itself differently.
|
|
183
|
+
const labels = [...container.querySelectorAll('[role="tab"] button[aria-label^="Files"], [role="tab"] button[aria-label^="GIT"]')]
|
|
184
|
+
.filter((element) => !element.getAttribute('aria-label')?.startsWith('Tutup'))
|
|
185
|
+
.map((element) => element.getAttribute('aria-label'));
|
|
186
|
+
expect(labels).toEqual(['Files — title', 'GIT — title']);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test('on the home page NO chip is selected, because home is not a tab', () => {
|
|
190
|
+
mount({ home: true });
|
|
191
|
+
const tabs = [...container.querySelectorAll('[role="tab"]')];
|
|
192
|
+
expect(tabs.map((tab) => tab.getAttribute('aria-selected'))).toEqual(['false', 'false']);
|
|
193
|
+
// Nothing is a tab stop either: the strip has no current chip to land on.
|
|
194
|
+
expect(tabs.map((tab) => tab.getAttribute('tabindex'))).toEqual(['-1', '-1']);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test('every closable chip is a drag source, and the pinned one is not', () => {
|
|
198
|
+
mount({
|
|
199
|
+
tabs: ['sessions', 'files', 'git'],
|
|
200
|
+
panels: new Map([
|
|
201
|
+
['sessions', SESSIONS],
|
|
202
|
+
['files', FILES],
|
|
203
|
+
['git', GIT],
|
|
204
|
+
]),
|
|
205
|
+
active: 'sessions',
|
|
206
|
+
pinned: 'sessions',
|
|
207
|
+
onReorder: () => {},
|
|
208
|
+
});
|
|
209
|
+
const chips = [...container.querySelectorAll('[role="tab"]')] as HTMLElement[];
|
|
210
|
+
// `undefined` is how a non-draggable chip reads: Preact omits a `false`
|
|
211
|
+
// boolean attribute, so the ABSENCE is the signal.
|
|
212
|
+
expect(chips.map((chip) => chip.getAttribute('draggable'))).toEqual([null, 'true', 'true']);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
test('a strip with no onReorder is read-only, so a phone cannot write an order', () => {
|
|
216
|
+
mount();
|
|
217
|
+
const chips = [...container.querySelectorAll('[role="tab"]')] as HTMLElement[];
|
|
218
|
+
expect(chips.map((chip) => chip.getAttribute('draggable'))).toEqual([null, null]);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
test('a TOUCH device gets a bigger chip and close target than a mouse does', () => {
|
|
222
|
+
mount();
|
|
223
|
+
// Measured in Chromium at 390px: the close control was 20x20 inside a 28px
|
|
224
|
+
// chip, both under the 44px touch floor. The coarse variants are the fix, and
|
|
225
|
+
// a DOM test can only pin the CONTRACT — the pixel sizes are the stylesheet's
|
|
226
|
+
// (verified in the built CSS, under `@media (pointer:coarse)`).
|
|
227
|
+
// The DEFAULT strip is the desktop density: the top navbar's 40px row and
|
|
228
|
+
// its 28px control boxes. A phone caller passes `layout="mobile"` instead,
|
|
229
|
+
// which is the case below.
|
|
230
|
+
const strip = container.querySelector('[role="tablist"]') as HTMLElement;
|
|
231
|
+
const chip = container.querySelector('[role="tab"]') as HTMLElement;
|
|
232
|
+
const close = container.querySelector('[aria-label^="Tutup tab"]') as HTMLElement;
|
|
233
|
+
expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
|
|
234
|
+
expect(strip.className).toContain(CONTROL_ROW_INSET.desktop);
|
|
235
|
+
expect(strip.className).not.toContain('env(safe-area-inset-top');
|
|
236
|
+
expect(chip.className).toContain('h-7');
|
|
237
|
+
expect(close.className).toContain('h-5');
|
|
238
|
+
expect(close.className).toContain('w-5');
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
test('a column action lands outside the scroller, so a narrow strip cannot clip it', () => {
|
|
242
|
+
mount({ actions: h('button', { type: 'button', 'aria-label': 'Muat ulang view' }, 'x') });
|
|
243
|
+
const action = container.querySelector('[aria-label="Muat ulang view"]');
|
|
244
|
+
expect(action).not.toBeNull();
|
|
245
|
+
expect(action?.closest('.no-scrollbar')).toBeNull();
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test('the add control and the actions never scroll with the chips', () => {
|
|
249
|
+
mount({ actions: h('button', { type: 'button', 'aria-label': 'Tutup panel kanan' }, 'x') });
|
|
250
|
+
const scroller = container.querySelector('.no-scrollbar') as HTMLElement;
|
|
251
|
+
const add = container.querySelector('[aria-label="Tambah tab"]') as HTMLElement;
|
|
252
|
+
const action = container.querySelector('[aria-label="Tutup panel kanan"]') as HTMLElement;
|
|
253
|
+
// Both sit in the row, neither in the horizontal scroller: a strip full of
|
|
254
|
+
// chips scrolls under them and the two controls stay reachable.
|
|
255
|
+
expect(add.closest('.no-scrollbar')).toBeNull();
|
|
256
|
+
expect(action.closest('.no-scrollbar')).toBeNull();
|
|
257
|
+
expect(scroller.contains(add)).toBe(false);
|
|
258
|
+
expect(scroller.contains(action)).toBe(false);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
test('dragRegion marks the strip as the window handle and its controls as not', () => {
|
|
262
|
+
mount({
|
|
263
|
+
dragRegion: true,
|
|
264
|
+
actions: h('button', { type: 'button', 'aria-label': 'Tutup panel kanan' }, 'x'),
|
|
265
|
+
});
|
|
266
|
+
const strip = container.querySelector('[role="tablist"]') as HTMLElement;
|
|
267
|
+
expect(strip.className).toContain('titlebar-drag-region');
|
|
268
|
+
// `app-region` INHERITS: a control inside a drag region swallows its own
|
|
269
|
+
// click on Windows. Every control must therefore sit under something that
|
|
270
|
+
// opted out — either on itself or on the chip wrapper it lives in, which is
|
|
271
|
+
// why this asks about an ANCESTOR rather than the control's own class list.
|
|
272
|
+
const controls = [...container.querySelectorAll('button')];
|
|
273
|
+
expect(controls.length).toBeGreaterThan(2);
|
|
274
|
+
for (const control of controls) {
|
|
275
|
+
expect(control.closest('.titlebar-no-drag')).not.toBeNull();
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
test('without dragRegion nothing claims the window handle', () => {
|
|
280
|
+
mount();
|
|
281
|
+
const strip = container.querySelector('[role="tablist"]') as HTMLElement;
|
|
282
|
+
expect(strip.className).not.toContain('titlebar-drag-region');
|
|
283
|
+
expect(container.querySelector('.titlebar-no-drag')).toBeNull();
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The strip is the top navbar's PEER, so it must draw at that row's density —
|
|
289
|
+
* on the phone, at the PHONE header's.
|
|
290
|
+
*
|
|
291
|
+
* Measured on the running app before this was stated once: the drawer's strip
|
|
292
|
+
* was a 40px row with 28px controls while the chat header above it was 56px with
|
|
293
|
+
* 36px controls, so the add control's centre sat at 26px against the header's
|
|
294
|
+
* 30px and the toggle's at 364px against 360px. A 4px step on both edges is
|
|
295
|
+
* what a reader reports as "not aligned with the top navbar".
|
|
296
|
+
*
|
|
297
|
+
* Asserted against the shared constants rather than the literals, so moving the
|
|
298
|
+
* density stays a one-line change in `control-plate.ts` and this test still
|
|
299
|
+
* means "the strip follows the header".
|
|
300
|
+
*/
|
|
301
|
+
describe('strip density follows the top navbar', () => {
|
|
302
|
+
test('the phone strip takes the phone header row, box and inset', () => {
|
|
303
|
+
mount({ layout: 'mobile', dragRegion: true });
|
|
304
|
+
const strip = container.querySelector('[role="tablist"]') as HTMLElement;
|
|
305
|
+
const add = container.querySelector('[aria-label="Tambah tab"]') as HTMLElement;
|
|
306
|
+
const chip = container.querySelector('[role="tab"]') as HTMLElement;
|
|
307
|
+
|
|
308
|
+
expect(strip.className).toContain(CONTROL_ROW_HEIGHT.mobile);
|
|
309
|
+
expect(strip.className).toContain(CONTROL_ROW_INSET.mobile);
|
|
310
|
+
// The add control IS a header control: same box, same glyph.
|
|
311
|
+
expect(add.className).toContain(CONTROL_BOX.mobile);
|
|
312
|
+
expect(add.querySelector('svg')?.getAttribute('width')).toBe(String(CONTROL_GLYPH_PX.mobile));
|
|
313
|
+
// And the chip is the mobile height, not the desktop 28px one.
|
|
314
|
+
expect(chip.className).toContain('h-9');
|
|
315
|
+
expect(chip.className).not.toContain('h-7');
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test('the desktop strip keeps the navbar row it sits under', () => {
|
|
319
|
+
mount();
|
|
320
|
+
const strip = container.querySelector('[role="tablist"]') as HTMLElement;
|
|
321
|
+
const add = container.querySelector('[aria-label="Tambah tab"]') as HTMLElement;
|
|
322
|
+
const chip = container.querySelector('[role="tab"]') as HTMLElement;
|
|
323
|
+
|
|
324
|
+
expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
|
|
325
|
+
expect(strip.className).toContain(CONTROL_ROW_INSET.desktop);
|
|
326
|
+
expect(add.className).toContain(CONTROL_BOX.desktop);
|
|
327
|
+
expect(chip.className).toContain('h-7');
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
test('the phone row is the header height plus the notch, as height AND padding', () => {
|
|
331
|
+
// One string, both halves: a row that only grows pins its content to y=0
|
|
332
|
+
// (chips under the status bar); padding alone is eaten by border-box.
|
|
333
|
+
expect(CONTROL_ROW_HEIGHT.mobile).toContain('3.5rem');
|
|
334
|
+
expect(CONTROL_ROW_HEIGHT.mobile).toContain('pt-[env(safe-area-inset-top,0px)]');
|
|
335
|
+
// The desktop row is the plain navbar height and reserves no notch.
|
|
336
|
+
expect(CONTROL_ROW_HEIGHT.desktop).toBe('h-10');
|
|
337
|
+
expect(CONTROL_ROW_HEIGHT.desktop).not.toContain('env(');
|
|
338
|
+
});
|
|
339
|
+
});
|