@kabmo-labs/kabmo 0.60.0 → 0.62.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/README.md +53 -49
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +1157 -825
- package/dist/client/static/js/{Body-p82s28sj.js → Body-z6kstvk6.js} +3 -3
- package/dist/client/static/js/{CsvGrid-erc5mcvc.js → CsvGrid-f73c0s4e.js} +2 -2
- package/dist/client/static/js/{DocxView-x3faj0jv.js → DocxView-a1pb7nsb.js} +3 -3
- package/dist/client/static/js/{DrawioView-t7fh3ens.js → DrawioView-r61gcg24.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-zy7x7jmm.js → HtmlPreview-vt7j0b05.js} +1 -1
- package/dist/client/static/js/ImageView-4nhr5dtm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-vwhy0vhj.js +2 -0
- package/dist/client/static/js/MergeDiffView-f4h9ss71.js +1 -0
- package/dist/client/static/js/Modal-cadmjkak.js +60 -0
- package/dist/client/static/js/{PdfView-kqx472q7.js → PdfView-mppt2gkd.js} +1 -1
- package/dist/client/static/js/SessionsView-vvsaw9f0.js +1 -0
- package/dist/client/static/js/{SheetView-0n9fze50.js → SheetView-5s9zfx9g.js} +9 -9
- package/dist/client/static/js/{SvgPreview-6xc6ts46.js → SvgPreview-ff78xn3e.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-2xdkkqwg.js → abnfDiagram-O67JEVCF-p29sh3w2.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-83w3kytq.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ja8cx19z.js → architectureDiagram-NJMV4G6O-nbpdyea3.js} +3 -3
- package/dist/client/static/js/{astro-yphdvdty.js → astro-qtfmc8x7.js} +1 -1
- package/dist/client/static/js/bash-wcy12qjx.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-ytf7s99c.js → blockDiagram-BEXU5L5S-t8xbexa6.js} +6 -6
- package/dist/client/static/js/c-vvantfth.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-5a0kdx0z.js → c4Diagram-YGBWAQC7-9fwf2zxk.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-hd98dvjw.js → classDiagram-v2-NBCMYWYE-nbapgqbs.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-man3fqcj.js → cose-bilkent-JH36ORCC-k54mmydp.js} +1 -1
- package/dist/client/static/js/cpp-5x63r6g0.js +1 -0
- package/dist/client/static/js/css-j2j6f03w.js +1 -0
- package/dist/client/static/js/css-qk59j6rj.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-80z02zrj.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-2f0kbbv2.js → cynefinDiagram-VND7K2PF-qdg32wah.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-k7pyhgzn.js → dagre-6A5THRUB-qzshg1vs.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-qx0afa2m.js → diagram-22UHCM2B-197hemfa.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-ydpe77sv.js → diagram-3UASUU5V-236gnjr6.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-e63v984n.js → diagram-ATOU4E4O-vjgpyaaq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-8c765h3a.js → diagram-CDSNMT55-ywvzcx7z.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-3pq0n7v8.js → diagram-MLGK6HIB-9ey7ev7j.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-638atzxz.js → diagram-MPIPVDR6-vrqbb6r7.js} +2 -2
- package/dist/client/static/js/{dockerfile-yehc914q.js → dockerfile-4nked309.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3gv43zvm.js → ebnfDiagram-ZINNZB2B-hvnkevqy.js} +1 -1
- package/dist/client/static/js/{elixir-3nwnd9yw.js → elixir-3jvh6v4k.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-6s5pggfc.js → elk-276RUBZZ-nej6yy1c.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-x7cqyb89.js → erDiagram-OPXOYQCR-ww453xcy.js} +5 -5
- package/dist/client/static/js/{erlang-p5c4n3t0.js → erlang-4fz73a1q.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-y9pq2709.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-e6v7513q.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-g97te4v1.js → ganttDiagram-FUAMR5RP-abc5wy70.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-fzaf9azs.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-sw4f94tc.js → gitGraphDiagram-X574FWY7-4acqzj2h.js} +7 -7
- package/dist/client/static/js/graphql-hpkvdvk7.js +1 -0
- package/dist/client/static/js/html-x12gb1wk.js +1 -0
- package/dist/client/static/js/{index-v88m5sva.js → index-0g82ph6h.js} +2 -2
- package/dist/client/static/js/{index-vejz38qt.js → index-0w1jzang.js} +5 -5
- package/dist/client/static/js/{index-bpcg34jp.js → index-1svt0cdw.js} +2 -2
- package/dist/client/static/js/{index-hgfyx8dt.js → index-1tb4py5v.js} +2 -2
- package/dist/client/static/js/index-2gt9krtj.js +4 -0
- package/dist/client/static/js/index-2x9m7s1a.js +1 -0
- package/dist/client/static/js/index-3fvqmz3m.js +4 -0
- package/dist/client/static/js/{index-pdz6j2g2.js → index-42wvbkm5.js} +2 -2
- package/dist/client/static/js/index-477vtt51.js +2 -0
- package/dist/client/static/js/{index-ca6tmamh.js → index-4px56qaz.js} +2 -2
- package/dist/client/static/js/{index-excgtjhx.js → index-5anvw7xg.js} +36 -36
- package/dist/client/static/js/index-5nb9k2ph.js +1 -0
- package/dist/client/static/js/{index-97sw4d9n.js → index-615je3km.js} +2 -2
- package/dist/client/static/js/{index-111bq6rs.js → index-66qxrh5n.js} +1 -1
- package/dist/client/static/js/{index-a145x0w2.js → index-7kct1sz1.js} +2 -2
- package/dist/client/static/js/{index-hwv7bfxc.js → index-8e0d8y30.js} +2 -2
- package/dist/client/static/js/{index-s4j2ghmx.js → index-90bq56xw.js} +2 -2
- package/dist/client/static/js/{index-wsy6y5em.js → index-b1gzh60t.js} +11 -11
- package/dist/client/static/js/{index-10vzyga1.js → index-bypkmjrz.js} +2 -2
- package/dist/client/static/js/{index-n8r7r86r.js → index-c1vd63yd.js} +2 -2
- package/dist/client/static/js/index-c9f0hejv.js +3 -0
- package/dist/client/static/js/{index-2dmew334.js → index-cgqj15g0.js} +2 -2
- package/dist/client/static/js/{index-mtav0rpf.js → index-cts5re1t.js} +2 -2
- package/dist/client/static/js/index-dxc14kmm.js +1 -0
- package/dist/client/static/js/{index-hwdkxe4n.js → index-dxyjxhm1.js} +2 -2
- package/dist/client/static/js/{index-43gmn7yb.js → index-edpyqz9f.js} +1 -1
- package/dist/client/static/js/{index-pdgc9ccr.js → index-eesepb70.js} +2 -2
- package/dist/client/static/js/{index-vec7m1yd.js → index-evh437bz.js} +2 -2
- package/dist/client/static/js/index-ey6v4t5b.js +1 -0
- package/dist/client/static/js/{index-025s3fp8.js → index-fsd7n336.js} +2 -2
- package/dist/client/static/js/{index-yfcy4cf6.js → index-h7a7fqag.js} +2 -2
- package/dist/client/static/js/{index-11qn05g9.js → index-hffgwnvz.js} +2 -2
- package/dist/client/static/js/index-j734ev6q.js +482 -0
- package/dist/client/static/js/{index-vcq6zfxx.js → index-jcbp1d9d.js} +6 -6
- package/dist/client/static/js/index-jg5h18sm.js +2 -0
- package/dist/client/static/js/{index-6qn9kygb.js → index-jtdve6xw.js} +7 -7
- package/dist/client/static/js/{index-4xbc0j7t.js → index-k0bqrb1y.js} +1 -1
- package/dist/client/static/js/{index-bdtftrym.js → index-kegevd10.js} +2 -2
- package/dist/client/static/js/{index-fr6wsqk8.js → index-kqcfxkch.js} +2 -2
- package/dist/client/static/js/{index-2n2evsg0.js → index-kv1xnem9.js} +2 -2
- package/dist/client/static/js/{index-8zct30zd.js → index-m54ctmxr.js} +1 -1
- package/dist/client/static/js/index-mgzbypt5.js +314 -0
- package/dist/client/static/js/{index-cf69bhjx.js → index-mh52531j.js} +2 -2
- package/dist/client/static/js/{index-0ze5bwvw.js → index-mhz5ywa4.js} +5 -5
- package/dist/client/static/js/{index-3j2he86h.js → index-nnwdbg3t.js} +2 -2
- package/dist/client/static/js/{index-9rz6kzsv.js → index-nxd6z7f9.js} +2 -2
- package/dist/client/static/js/{index-jfqd838j.js → index-pjrbt77c.js} +2 -2
- package/dist/client/static/js/index-r7h4pm42.js +2 -0
- package/dist/client/static/js/index-ratrdgc9.js +2 -0
- package/dist/client/static/js/{index-cfvc1zpk.js → index-rhmvh9w5.js} +2 -2
- package/dist/client/static/js/{index-twwsn91p.js → index-sqzjwy9h.js} +2 -2
- package/dist/client/static/js/{index-37apvxgj.js → index-tckzkw0f.js} +2 -2
- package/dist/client/static/js/index-tza9h3q6.css +1 -0
- package/dist/client/static/js/{index-qccydkze.js → index-vhjfr093.js} +2 -2
- package/dist/client/static/js/{index-z8k42dwz.js → index-w0j96eyy.js} +8 -8
- package/dist/client/static/js/{index-qkqkygrf.js → index-ws04kxy9.js} +1 -1
- package/dist/client/static/js/{index-a3bpmw2r.js → index-x1yqmzpr.js} +2 -2
- package/dist/client/static/js/{index-fb2fjndj.js → index-x2f7wykb.js} +6 -6
- package/dist/client/static/js/index-y8405hdg.js +10 -0
- package/dist/client/static/js/{index-sx83ans2.js → index-yxk7dgnb.js} +2 -2
- package/dist/client/static/js/{index-bkn6jtn1.js → index-zavecxak.js} +2 -2
- package/dist/client/static/js/{index-dv01prse.js → index-zg7q3kcb.js} +2 -2
- package/dist/client/static/js/{index-enm77k5z.js → index-zhn9vv3z.js} +2 -2
- package/dist/client/static/js/{index-ywp0sd1e.js → index-zy963qbh.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-t7pbg7rt.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-pw2qaa27.js → infoDiagram-VRGFBTTK-9pe7w3r5.js} +2 -2
- package/dist/client/static/js/ini-522adp5a.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-d13jhvxy.js → ishikawaDiagram-OU5B5YK6-38arfrx5.js} +2 -2
- package/dist/client/static/js/java-z0rgs7v6.js +1 -0
- package/dist/client/static/js/javascript-fv87f565.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-20gb8a04.js → journeyDiagram-ZHPQQLJL-kcwzjgtz.js} +4 -4
- package/dist/client/static/js/json-1czq1ped.js +1 -0
- package/dist/client/static/js/jsx-1fch2jyr.js +1 -0
- package/dist/client/static/js/{julia-rpd1y9vh.js → julia-pzzxbptm.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-s78e158c.js → kanban-definition-PNTS6WVX-nmegwy9w.js} +15 -15
- package/dist/client/static/js/lua-nn8bpjev.js +1 -0
- package/dist/client/static/js/markdown-38tqrgkn.js +1 -0
- package/dist/client/static/js/{mermaid.core-xbm27k28.js → mermaid.core-3aae27b9.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-6y7xe2zm.js → mindmap-definition-NLK3R4M7-zsaq4e65.js} +12 -12
- package/dist/client/static/js/one-dark-pro-trnff03z.js +1 -0
- package/dist/client/static/js/one-light-ck31ptqs.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-rwac7scq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-dmvewetf.js → pegDiagram-GJSIUBJH-2b6whj1p.js} +1 -1
- package/dist/client/static/js/{perl-kmtz9dnv.js → perl-zdkbbjd2.js} +1 -1
- package/dist/client/static/js/{php-bttrsbxy.js → php-ktaxff6g.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-gjz20apz.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-1q9e7rcm.js → pieDiagram-5QR66LMP-y09ar7vz.js} +3 -3
- package/dist/client/static/js/properties-kncqeqhn.js +1 -0
- package/dist/client/static/js/python-gx8ggmyh.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-mvrem3n6.js → quadrantDiagram-O4NWA36T-mapfzs06.js} +3 -3
- package/dist/client/static/js/r-x8rftkm3.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-akwdknab.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-m5v4rfhx.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-k2gmqcjb.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zdsfjf4.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-e98evqb6.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-axttcfhw.js → railroadDiagram-XR7U4H2S-70qy7qdh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-5qx7erta.js → requirementDiagram-PLB6GJNP-2vb2gp3e.js} +3 -3
- package/dist/client/static/js/{ruby-dve3y59w.js → ruby-ytqv3pqz.js} +1 -1
- package/dist/client/static/js/{rust-b3ckax3e.js → rust-6sddyxnt.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-es87a3j6.js → sankeyDiagram-IPEJSGJF-9jd8ebrn.js} +3 -3
- package/dist/client/static/js/{sass-emxqt5p2.js → sass-dvbra5b6.js} +1 -1
- package/dist/client/static/js/{scss-4j4t3r6y.js → scss-sy7w8916.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-dgpnjrtk.js → sequenceDiagram-PO4LG4MO-w7z84f80.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-kyw0p86n.js → sizeCapture-INFHLROL-q8w7ehgx.js} +1 -1
- package/dist/client/static/js/sql-99y0qnag.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vnsbw8y9.js → stateDiagram-v2-GCMORJYK-4978hapr.js} +3 -3
- package/dist/client/static/js/{svelte-dbsx1ehx.js → svelte-xvs3fkza.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-060q1rep.js → swimlanes-2SLR337P-eshg5fjy.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-914e28hd.js +8 -0
- package/dist/client/static/js/timeline-definition-EJHVYXUP-5h5q357k.js +120 -0
- package/dist/client/static/js/treeView-Q6P3EWNA-fkm3a7gx.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-hm4ktxjf.js +1 -0
- package/dist/client/static/js/tsx-phngprp0.js +1 -0
- package/dist/client/static/js/typescript-m62a7zr2.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-18sp73v7.js → usecaseDiagram-POWQR4AR-4j69y3zx.js} +20 -20
- package/dist/client/static/js/vennDiagram-UO4OBE2U-pa9p5jpw.js +34 -0
- package/dist/client/static/js/{vue-hyr58df9.js → vue-p4g4avm3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-3y2rvdmy.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-q0kwmbzh.js → wardleyDiagram-VNRHLVJA-hjddd656.js} +3 -3
- package/dist/client/static/js/xml-59n0cjn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-y0gpmg6m.js → xychartDiagram-PMCCYNJV-8ng5m849.js} +4 -4
- package/dist/client/static/js/yaml-9fw908s4.js +1 -0
- package/dist/client/tailwindcss-oxide.linux-x64-gnu-c0fa36dv.node +0 -0
- package/dist/client/tailwindcss-oxide.linux-x64-musl-kr04sh0e.node +0 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/app.tsx +2 -5
- package/marketplace/plugins/command-runner/src/panel/CustomForm.tsx +35 -52
- package/marketplace/plugins/command-runner/src/panel/Groups.tsx +6 -5
- package/marketplace/plugins/command-runner/src/panel/Header.tsx +18 -54
- package/marketplace/plugins/command-runner/src/panel/Output.tsx +3 -7
- package/marketplace/plugins/command-runner/src/panel/Row.tsx +19 -38
- package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -4
- package/marketplace/plugins/git-forge/package.json +2 -2
- package/marketplace/plugins/git-forge/src/app.tsx +2 -0
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +8 -15
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +35 -66
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +7 -13
- package/marketplace/plugins/git-forge/src/panel/List.tsx +28 -56
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +7 -9
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +21 -31
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +26 -40
- package/marketplace/plugins/git-forge/src/panel/index.tsx +0 -1
- package/marketplace/plugins/github-actions/package.json +2 -2
- package/marketplace/plugins/github-actions/src/app.tsx +2 -0
- package/marketplace/plugins/github-actions/src/panel/Actions.tsx +9 -17
- package/marketplace/plugins/github-actions/src/panel/LogView.tsx +4 -13
- package/marketplace/plugins/github-actions/src/panel/Row.tsx +4 -5
- package/marketplace/plugins/github-actions/src/panel/RunView.tsx +8 -15
- package/marketplace/plugins/github-actions/src/panel/index.test.tsx +3 -2
- package/marketplace/plugins/github-actions/src/panel/index.tsx +31 -37
- package/marketplace/plugins/kanban/package.json +2 -2
- package/marketplace/plugins/kanban/src/app.tsx +2 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +88 -98
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +6 -10
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +22 -18
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +59 -70
- package/marketplace/plugins/kanban/src/panel/index.tsx +37 -52
- package/marketplace/plugins/kanban/src/panel/use-board.ts +2 -0
- package/marketplace/plugins/session-info/package.json +2 -2
- package/marketplace/plugins/session-info/src/app.tsx +6 -3
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/KillConfirm.test.tsx +6 -4
- package/marketplace/plugins/stats/src/KillConfirm.tsx +26 -76
- package/marketplace/plugins/stats/src/ProcessTable.tsx +8 -6
- package/marketplace/plugins/stats/src/RefreshButton.tsx +7 -5
- package/marketplace/plugins/stats/src/app.tsx +11 -9
- package/package.json +10 -10
- package/src/cli/lib/commands/plugin.js +8 -5
- package/src/client/bootstrap.d.ts +5 -0
- package/src/client/chat-title-overlay.test.ts +53 -0
- package/src/client/components/auth/login-screen/index.tsx +31 -3
- package/src/client/components/common/SignOutButton.tsx +4 -5
- package/src/client/components/common/account-badge/index.tsx +31 -0
- package/src/client/components/common/footer-version/index.tsx +40 -0
- package/src/client/components/common/fullscreen-viewer/fullscreen-viewer.test.tsx +24 -0
- package/src/client/components/common/fullscreen-viewer/index.tsx +22 -31
- package/src/client/components/common/header-controls/MoreMenu.tsx +5 -56
- package/src/client/components/common/header-controls/index.test.tsx +2 -6
- package/src/client/components/common/header-controls/index.tsx +9 -25
- package/src/client/components/common/header-controls/phone-row.test.tsx +3 -16
- package/src/client/components/common/shell-update-button/index.tsx +2 -2
- package/src/client/components/common/zoom-pan-stage/index.tsx +54 -50
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +4 -5
- package/src/client/components/layout/desktop-layout/index.tsx +2 -4
- package/src/client/components/layout/left-bar/index.tsx +25 -3
- package/src/client/components/layout/rail-toggle.test.tsx +112 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.accent.test.tsx +81 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +11 -3
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +36 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +42 -61
- package/src/client/components/layout/session-sidebar/FooterHost.tsx +5 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +30 -10
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +4 -0
- package/src/client/components/layout/session-sidebar/modern/index.tsx +8 -1
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +25 -4
- package/src/client/components/layout/session-title-bar/index.tsx +13 -5
- package/src/client/components/layout/top-bars.test.tsx +4 -2
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/RightSidebar.tsx +12 -3
- package/src/client/components/mobile/SessionSidebar.tsx +6 -2
- package/src/client/components/mobile/drawer-layout.test.tsx +7 -3
- package/src/client/components/mobile/drawer-strip.tsx +9 -2
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +29 -9
- package/src/client/components/mobile/mobile-main-view/Header.tsx +43 -12
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +12 -1
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +1 -0
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +9 -1
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +4 -2
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Footer.tsx +48 -46
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +18 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +4 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +4 -6
- package/src/client/components/mobile/right-drawer-nav.test.tsx +53 -1
- package/src/client/components/settings/Band.tsx +5 -2
- package/src/client/components/settings/Modal.tsx +8 -5
- package/src/client/components/settings/Sidebar.tsx +5 -3
- package/src/client/components/settings/apply-side-effects.ts +5 -0
- package/src/client/components/settings/categories/AccountSettings.tsx +266 -0
- package/src/client/components/settings/categories/ProjectSettings.tsx +2 -0
- package/src/client/components/settings/categories/account-settings/Dialogs.tsx +223 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +3 -4
- package/src/client/components/settings/categories/appearance-settings/ChromeStyleSection.tsx +66 -39
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +7 -4
- package/src/client/components/settings/categories/project-settings/DetailsForm.tsx +14 -1
- package/src/client/components/settings/categories/project-settings/ProjectSharing.tsx +130 -0
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +5 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/SessionSkeleton.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.test.ts +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.ts +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +34 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +4 -1
- package/src/client/components/workspace/editor/Tab.tsx +19 -26
- package/src/client/components/workspace/editor/Tabs.test.ts +13 -7
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -0
- package/src/client/components/workspace/git-panel/commit-modal/floating.test.ts +46 -0
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -0
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +4 -5
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +40 -37
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +76 -49
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +9 -9
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +14 -1
- package/src/client/components/workspace/panel-tabs/index.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +22 -5
- package/src/client/components/workspace/plugin-panel/chrome.test.tsx +89 -0
- package/src/client/components/workspace/plugin-panel/chrome.tsx +62 -0
- package/src/client/data/settings/omp-schema.json +40 -4
- package/src/client/floating-phone.test.ts +189 -0
- package/src/client/floating.css +205 -2
- package/src/client/floating.test.ts +43 -0
- package/src/client/glass.css +47 -0
- package/src/client/hooks/chat/omp/index.ts +6 -5
- package/src/client/hooks/chat/omp/prompt-send.test.ts +18 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +26 -8
- package/src/client/hooks/chat/omp/session-list.tsx +20 -8
- package/src/client/hooks/chat/timeline/deferred-model.ts +13 -5
- package/src/client/hooks/chat/timeline/index.ts +2 -0
- package/src/client/hooks/chat/timeline/send-props.ts +14 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send-switch.test.ts +92 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +37 -7
- package/src/client/hooks/chat/timeline/send.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send.ts +62 -42
- package/src/client/hooks/editor/image-generation.ts +24 -0
- package/src/client/hooks/editor/resolve-viewer.test.ts +26 -20
- package/src/client/hooks/editor/resolve-viewer.ts +14 -5
- package/src/client/hooks/editor/use-file-editor.test.ts +34 -0
- package/src/client/hooks/editor/use-file-editor.ts +6 -2
- package/src/client/hooks/settings/accounts.ts +162 -0
- package/src/client/hooks/ui/auth.ts +58 -3
- package/src/client/hooks/ui/border-style.test.ts +5 -4
- package/src/client/hooks/ui/border-style.ts +3 -2
- package/src/client/hooks/ui/mobile-chrome-style.ts +68 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +1 -2
- package/src/client/hooks/ui/navbar-controls.ts +0 -3
- package/src/client/hooks/ui/zoom-gesture.ts +104 -0
- package/src/client/lib/desktop/titlebar.test.ts +21 -0
- package/src/client/lib/desktop/titlebar.ts +34 -0
- package/src/client/lib/plugins/bootstrap.test.ts +20 -0
- package/src/client/lib/plugins/bootstrap.tsx +10 -15
- package/src/client/lib/plugins/kit-components.test.tsx +119 -0
- package/src/client/lib/plugins/kit-components.tsx +79 -0
- package/src/client/lib/plugins/kit.ts +8 -0
- package/src/client/lib/plugins/slots.test.ts +34 -0
- package/src/client/lib/plugins/slots.ts +31 -4
- package/src/client/lib/plugins/stylesheets.ts +10 -11
- package/src/client/lib/ui/pinch.test.ts +74 -0
- package/src/client/lib/ui/pinch.ts +104 -0
- package/src/client/lib/ui/safe-area.test.ts +25 -0
- package/src/client/lib/ui/safe-area.ts +23 -0
- package/src/client/main.tsx +8 -1
- package/src/client/tailwind.css +54 -1
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/shell-attributes.server.ts +12 -4
- package/src/server/lib/assets/shell-attributes.test.ts +19 -18
- package/src/server/lib/auth/client-address.test.ts +2 -2
- package/src/server/lib/auth/guard.test.ts +2 -2
- package/src/server/lib/auth/guard.ts +81 -97
- package/src/server/lib/auth/handover-guard.test.ts +1 -1
- package/src/server/lib/auth/rate-limit.test.ts +2 -2
- package/src/server/lib/auth/token.test.ts +1 -1
- package/src/server/lib/auth/workspace-gate.server.ts +34 -0
- package/src/server/lib/bundler/css.test.ts +16 -0
- package/src/server/lib/connect/devices.server.test.ts +12 -0
- package/src/server/lib/connect/devices.server.ts +63 -19
- package/src/server/lib/connect/pairing.server.ts +5 -3
- package/src/server/lib/connect/status.server.ts +2 -2
- package/src/server/lib/db/schema.test.ts +3 -3
- package/src/server/lib/db/schema.ts +6 -0
- package/src/server/lib/harness/update-spawn.server.test.ts +97 -0
- package/src/server/lib/harness/update-spawn.server.ts +10 -0
- package/src/server/lib/models/provider-icon-override.server.test.ts +140 -0
- package/src/server/lib/models/provider-icon-override.server.ts +197 -0
- package/src/server/lib/models/provider-icon-store.server.ts +8 -0
- package/src/server/lib/models/provider-icon.server.ts +31 -6
- package/src/server/lib/omp/session/artifacts.server.test.ts +11 -7
- package/src/server/lib/omp/session/artifacts.server.ts +21 -17
- package/src/server/lib/panels/build.server.ts +19 -2
- package/src/server/lib/panels/css.server.test.ts +141 -0
- package/src/server/lib/panels/css.server.ts +255 -0
- package/src/server/lib/panels/plugin-ui-contract.test.ts +64 -0
- package/src/server/lib/panels/registry-stylesheet.server.test.ts +69 -0
- package/src/server/lib/panels/scan.server.ts +13 -7
- package/src/server/lib/panels/source-warnings.server.test.ts +65 -0
- package/src/server/lib/panels/source-warnings.server.ts +71 -0
- package/src/server/lib/realtime/topics/catalog.server.ts +3 -0
- package/src/server/lib/realtime/topics.server.ts +14 -0
- package/src/server/lib/sessions/last-opened-client.server.ts +1 -1
- package/src/server/lib/workspace/access.server.ts +108 -0
- package/src/server/lib/workspace/project-patch.server.ts +4 -2
- package/src/server/lib/workspace/register-folder.server.ts +19 -5
- package/src/server/lib/workspace/session-access.server.ts +55 -0
- package/src/server/lib/workspace/tenancy-schema.server.ts +40 -0
- package/src/server/plugins/ssr.ts +19 -3
- package/src/server/routes/accounts/index.ts +8 -0
- package/src/server/routes/accounts/management.test.ts +174 -0
- package/src/server/routes/accounts/management.ts +166 -0
- package/src/server/routes/auth/login.ts +22 -8
- package/src/server/routes/auth/logout.ts +1 -1
- package/src/server/routes/auth/password.ts +40 -33
- package/src/server/routes/auth/revoke.test.ts +1 -1
- package/src/server/routes/auth/revoke.ts +26 -8
- package/src/server/routes/auth/routes.test.ts +3 -3
- package/src/server/routes/auth/state.ts +14 -7
- package/src/server/routes/connect/devices.ts +7 -4
- package/src/server/routes/connect/pair.ts +4 -3
- package/src/server/routes/connect/status.ts +4 -2
- package/src/server/routes/connect/tunnels.ts +2 -1
- package/src/server/routes/folders/batch-delete.ts +12 -0
- package/src/server/routes/folders/clone.ts +7 -2
- package/src/server/routes/folders/create.ts +3 -1
- package/src/server/routes/folders/folder.ts +44 -4
- package/src/server/routes/folders/index.ts +3 -0
- package/src/server/routes/folders/shares.ts +62 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/panels/build.ts +1 -1
- package/src/server/routes/panels/css.test.ts +22 -0
- package/src/server/routes/panels/css.ts +5 -7
- package/src/server/routes/realtime/ws.ts +16 -1
- package/src/server/routes/sessions/list.ts +3 -2
- package/src/server/routes/settings/projects.ts +46 -7
- package/src/server/routes/settings/provider-icon.ts +18 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.test.ts +2 -2
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +6 -3
- package/src/shared/lib/icons/tint-hues.generated.ts +38 -37
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +27 -1
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +1 -1
- package/src/shared/lib/realtime/protocol.ts +16 -0
- package/src/shared/lib/settings/defaults.ts +2 -1
- package/src/shared/lib/settings/sections.ts +1 -1
- package/src/shared/lib/theme/border-style.test.ts +11 -9
- package/src/shared/lib/theme/border-style.ts +7 -7
- package/src/shared/lib/theme/chrome-style.test.ts +15 -0
- package/src/shared/lib/theme/chrome-style.ts +16 -1
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/state.ts +6 -5
- package/src/test-support/file-editor.test-util.ts +25 -6
- package/tsconfig.json +21 -0
- package/dist/client/static/js/ImageView-xc90jc1c.js +0 -1
- package/dist/client/static/js/LayoutWrapper-wyqe98kf.js +0 -2
- package/dist/client/static/js/MergeDiffView-bng34cpr.js +0 -1
- package/dist/client/static/js/Modal-89jk7wff.js +0 -60
- package/dist/client/static/js/SessionsView-6bpz1faj.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-sxrkxwbq.js +0 -1
- package/dist/client/static/js/bash-bcbct9gc.js +0 -1
- package/dist/client/static/js/c-fn9jz26e.js +0 -1
- package/dist/client/static/js/cpp-a1q64mke.js +0 -1
- package/dist/client/static/js/css-b92azee8.js +0 -1
- package/dist/client/static/js/css-sn00sq6v.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-g1xwa8b9.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-05p61bka.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7sn6nwjv.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-z1yehwys.js +0 -1
- package/dist/client/static/js/graphql-8d8bn59j.js +0 -1
- package/dist/client/static/js/html-6hdrwtz2.js +0 -1
- package/dist/client/static/js/index-4h2zkrk1.js +0 -2
- package/dist/client/static/js/index-5nm8hm4k.js +0 -2
- package/dist/client/static/js/index-95jfphx5.js +0 -481
- package/dist/client/static/js/index-9pw441wc.js +0 -4
- package/dist/client/static/js/index-bjz54ht6.js +0 -1
- package/dist/client/static/js/index-bqapt2e8.js +0 -2
- package/dist/client/static/js/index-ddkjgv5h.js +0 -2
- package/dist/client/static/js/index-dekvtt2a.js +0 -314
- package/dist/client/static/js/index-fnwaxc6r.js +0 -1
- package/dist/client/static/js/index-h65zrhva.js +0 -1
- package/dist/client/static/js/index-hxsqw7sz.js +0 -4
- package/dist/client/static/js/index-hxy1sadd.js +0 -2
- package/dist/client/static/js/index-ja0ajnvq.js +0 -10
- package/dist/client/static/js/index-qkyy563e.js +0 -1
- package/dist/client/static/js/index-t6nqy2n5.css +0 -1
- package/dist/client/static/js/index-wrk99kks.js +0 -3
- package/dist/client/static/js/info-A6RAGUB7-dqyaxjc1.js +0 -1
- package/dist/client/static/js/ini-g6a5xsaw.js +0 -1
- package/dist/client/static/js/java-n596am4c.js +0 -1
- package/dist/client/static/js/javascript-zc1qnyyp.js +0 -1
- package/dist/client/static/js/json-7k70qbkj.js +0 -1
- package/dist/client/static/js/jsx-sndenqrc.js +0 -1
- package/dist/client/static/js/lua-djd3g9q5.js +0 -1
- package/dist/client/static/js/markdown-r2tpvxpn.js +0 -1
- package/dist/client/static/js/one-dark-pro-7bgqnyhm.js +0 -1
- package/dist/client/static/js/one-light-47y6etng.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-7jxzax4z.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wc9wxr7f.js +0 -1
- package/dist/client/static/js/properties-brn72zdk.js +0 -1
- package/dist/client/static/js/python-g9mghwgm.js +0 -1
- package/dist/client/static/js/r-e247x4mw.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-kwj5padj.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-h8sdx3w5.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2wmwx246.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-h4cdgw3y.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-q7m0tfd0.js +0 -1
- package/dist/client/static/js/sql-0kar81jy.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y77g9dq0.js +0 -8
- package/dist/client/static/js/timeline-definition-EJHVYXUP-8a3yqmx0.js +0 -120
- package/dist/client/static/js/treeView-Q6P3EWNA-yv9640h3.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-7kpzjg21.js +0 -1
- package/dist/client/static/js/tsx-gjxfjnbk.js +0 -1
- package/dist/client/static/js/typescript-bm89v3gk.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-gf4y1r3s.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-mggay64p.js +0 -1
- package/dist/client/static/js/xml-b7824nx0.js +0 -1
- package/dist/client/static/js/yaml-kqqktdv1.js +0 -1
- package/src/server/lib/auth/client-address.ts +0 -89
- package/src/server/lib/auth/config.ts +0 -133
- package/src/server/lib/auth/rate-limit.ts +0 -146
- package/src/server/lib/auth/token.ts +0 -220
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The transcript reserves the session title it scrolls under.
|
|
8
|
+
*
|
|
9
|
+
* The desktop title bar is an OVERLAY (`chat-title-overlay` in
|
|
10
|
+
* `WorkspacePanels`), not a row above the transcript. The first row of a chat
|
|
11
|
+
* that does not fill the pane — a new session's first user prompt — therefore
|
|
12
|
+
* opens at `scrollTop: 0` directly underneath the bar and is painted over by
|
|
13
|
+
* the title. The bar and the reserve read one height, and the floating chrome
|
|
14
|
+
* raises that height by its gutter, so the two cannot drift.
|
|
15
|
+
*
|
|
16
|
+
* The reserve is padding on the SCROLLER, never on the pane: a longer
|
|
17
|
+
* transcript still slides under the bar, which is what its canvas gradient and
|
|
18
|
+
* the glass mask are for.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { describe, expect, test } from 'bun:test';
|
|
22
|
+
import { readClientCss, ruleBody } from '@/test-support/glass-css';
|
|
23
|
+
|
|
24
|
+
describe('session title overlay', () => {
|
|
25
|
+
test('one height sizes the bar and the transcript reserve under it', async () => {
|
|
26
|
+
const [tailwind, floating] = await Promise.all([
|
|
27
|
+
readClientCss('tailwind.css'),
|
|
28
|
+
readClientCss('floating.css'),
|
|
29
|
+
]);
|
|
30
|
+
expect(tailwind).toContain('--chat-title-height: 2.5rem;');
|
|
31
|
+
expect(ruleBody(tailwind, '[data-session-title]')).toContain(
|
|
32
|
+
'height: var(--chat-title-height)',
|
|
33
|
+
);
|
|
34
|
+
// The bar plus the reading gutter the scroller already had at its top.
|
|
35
|
+
expect(ruleBody(tailwind, '.app-window[data-desktop] [data-chat-scroller]')).toContain(
|
|
36
|
+
'padding-top: calc(var(--chat-title-height) + 1rem)',
|
|
37
|
+
);
|
|
38
|
+
// Floating is the same line pushed down by the window's gutter.
|
|
39
|
+
expect(
|
|
40
|
+
ruleBody(floating, "html[data-chrome='floating'] .app-window[data-desktop]"),
|
|
41
|
+
).toContain('--chat-title-height: calc(2.5rem + var(--float-gutter))');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('the glass mask stops at the same height', async () => {
|
|
45
|
+
const glass = await readClientCss('glass.css');
|
|
46
|
+
const timeline = ruleBody(
|
|
47
|
+
glass,
|
|
48
|
+
'html[data-chrome="floating"][data-surface="glass"] .app-window[data-desktop] [data-chat-timeline]',
|
|
49
|
+
);
|
|
50
|
+
expect(timeline).toContain('transparent var(--chat-title-height)');
|
|
51
|
+
expect(timeline).toContain('#000 calc(var(--chat-title-height) + 10px)');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -21,11 +21,15 @@
|
|
|
21
21
|
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
22
22
|
import { useEffect, useState } from 'preact/hooks';
|
|
23
23
|
import type { FunctionComponent } from 'preact/compat';
|
|
24
|
-
import { Eye, EyeOff, Loader2 } from 'lucide-preact';
|
|
25
|
-
import { login, probeSession } from '@/client/hooks/ui/auth';
|
|
24
|
+
import { Eye, EyeOff, Loader2, Users } from 'lucide-preact';
|
|
25
|
+
import { fetchLoginAccounts, login, probeSession } from '@/client/hooks/ui/auth';
|
|
26
26
|
import { BrandWordmark } from '@/client/components/common/brand-wordmark';
|
|
27
|
+
import { SearchSelect } from '@/client/components/common/search-select';
|
|
28
|
+
import type { AccountSummary } from '@kabmo-labs/kabmo-auth/account';
|
|
27
29
|
|
|
28
30
|
export const LoginScreen: FunctionComponent = () => {
|
|
31
|
+
const [accounts, setAccounts] = useState<AccountSummary[]>([]);
|
|
32
|
+
const [accountId, setAccountId] = useState('');
|
|
29
33
|
const [password, setPassword] = useState('');
|
|
30
34
|
const [showPassword, setShowPassword] = useState(false);
|
|
31
35
|
const [trustDevice, setTrustDevice] = useState(false);
|
|
@@ -50,6 +54,11 @@ export const LoginScreen: FunctionComponent = () => {
|
|
|
50
54
|
});
|
|
51
55
|
};
|
|
52
56
|
leaveIfSignedIn();
|
|
57
|
+
void fetchLoginAccounts().then((result) => {
|
|
58
|
+
if (!result) return;
|
|
59
|
+
setAccounts(result.accounts);
|
|
60
|
+
setAccountId((current) => current || result.accounts[0]?.id || '');
|
|
61
|
+
});
|
|
53
62
|
const handleVisibility = () => {
|
|
54
63
|
if (!document.hidden) leaveIfSignedIn();
|
|
55
64
|
};
|
|
@@ -62,7 +71,7 @@ export const LoginScreen: FunctionComponent = () => {
|
|
|
62
71
|
if (!password || busy) return;
|
|
63
72
|
setBusy(true);
|
|
64
73
|
setError('');
|
|
65
|
-
const result = await login(password, trustDevice);
|
|
74
|
+
const result = await login(accountId || accounts[0]?.id || '', password, trustDevice);
|
|
66
75
|
// A success reloads the page, so reaching here means it failed.
|
|
67
76
|
setBusy(false);
|
|
68
77
|
if (!result.ok) {
|
|
@@ -90,6 +99,25 @@ export const LoginScreen: FunctionComponent = () => {
|
|
|
90
99
|
<p className="text-xs text-ink/60">This instance is password protected.</p>
|
|
91
100
|
</div>
|
|
92
101
|
|
|
102
|
+
{accounts.length > 1 && (
|
|
103
|
+
<div className="space-y-1.5">
|
|
104
|
+
<span className="block text-xs font-semibold text-ink">Sign in as</span>
|
|
105
|
+
<SearchSelect
|
|
106
|
+
value={accountId}
|
|
107
|
+
options={accounts.map((entry) => ({ value: entry.id, label: entry.name }))}
|
|
108
|
+
triggerLabel={accounts.find((entry) => entry.id === accountId)?.name ?? 'Choose an account'}
|
|
109
|
+
placeholder="Choose an account"
|
|
110
|
+
ariaLabel="Sign in as"
|
|
111
|
+
onChange={setAccountId}
|
|
112
|
+
allowEmpty={false}
|
|
113
|
+
heading="Account"
|
|
114
|
+
searchPlaceholder="Search accounts…"
|
|
115
|
+
icon={() => <Users size={14} className="text-ink/60 flex-shrink-0" />}
|
|
116
|
+
triggerClassName="w-full flex items-center justify-between gap-2 px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper text-sm text-ink transition-colors cursor-pointer focus:outline-none focus:border-ink/50"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
|
|
93
121
|
<div className="relative">
|
|
94
122
|
<input
|
|
95
123
|
type={showPassword ? 'text' : 'password'}
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Sign out of this browser, from
|
|
7
|
+
* Sign out of this browser, from the sidebar footer.
|
|
8
8
|
*
|
|
9
|
-
* ONE component for both
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* hit area, exactly as the reload control does.
|
|
9
|
+
* ONE component for both layouts' footers, so the accessible name cannot
|
|
10
|
+
* disagree between the desktop strip and the phone drawer. Each layout passes
|
|
11
|
+
* only its own hit area.
|
|
13
12
|
*
|
|
14
13
|
* ## Why a lock, and why the label says what it does
|
|
15
14
|
*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The signed-in account, in the sidebar footer.
|
|
8
|
+
*
|
|
9
|
+
* A name is shown, not an opaque avatar: the footer is the one place in the app
|
|
10
|
+
* that says who this browser is acting as. It truncates rather than wrapping,
|
|
11
|
+
* and the title carries the full value.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { UserRound } from 'lucide-preact';
|
|
15
|
+
import { useAccount, useAuthEnabled } from '@/client/hooks/ui/auth';
|
|
16
|
+
|
|
17
|
+
export function AccountBadge({ className = '', labelClassName = '' }: { className?: string; labelClassName?: string }) {
|
|
18
|
+
const authEnabled = useAuthEnabled();
|
|
19
|
+
const account = useAccount();
|
|
20
|
+
if (!authEnabled || !account) return null;
|
|
21
|
+
return (
|
|
22
|
+
<span
|
|
23
|
+
className={`inline-flex min-w-0 items-center gap-1.5 text-ink/60 ${className}`}
|
|
24
|
+
title={`Signed in as ${account.name}`}
|
|
25
|
+
aria-label={`Signed in as ${account.name}`}
|
|
26
|
+
>
|
|
27
|
+
<UserRound size={14} className="shrink-0 text-ink/45" />
|
|
28
|
+
<span className={`max-w-[112px] truncate text-[11px] font-medium text-ink/70 ${labelClassName}`}>{account.name}</span>
|
|
29
|
+
</span>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The footer's version stamp and update offer.
|
|
8
|
+
*
|
|
9
|
+
* The offer is a word where the footer has room and a glyph where it does not;
|
|
10
|
+
* both forms keep the same accessible name, so the control never becomes an
|
|
11
|
+
* unnamed icon.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { ArrowUpCircle } from 'lucide-preact';
|
|
15
|
+
import packageJson from '@/../package.json';
|
|
16
|
+
|
|
17
|
+
interface FooterVersionInfoProps {
|
|
18
|
+
updateAvailable?: boolean;
|
|
19
|
+
onUpdateClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function FooterVersionInfo({ updateAvailable, onUpdateClick }: FooterVersionInfoProps) {
|
|
23
|
+
return (
|
|
24
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
25
|
+
<span className="hidden font-mono text-[10px] text-ink/40 @[320px]:inline">v{packageJson.version}</span>
|
|
26
|
+
{updateAvailable && (
|
|
27
|
+
<button
|
|
28
|
+
type="button"
|
|
29
|
+
onClick={onUpdateClick}
|
|
30
|
+
title="Update available"
|
|
31
|
+
aria-label="Update available"
|
|
32
|
+
className="inline-flex items-center gap-1 rounded-full border border-ink/20 px-1 py-0.5 text-[10px] font-semibold text-ink transition-colors hover:border-ink/40 @[480px]:px-2"
|
|
33
|
+
>
|
|
34
|
+
<ArrowUpCircle size={12} className="@[480px]:hidden" />
|
|
35
|
+
<span className="hidden @[480px]:inline">update</span>
|
|
36
|
+
</button>
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -77,6 +77,30 @@ describe('FullscreenViewer', () => {
|
|
|
77
77
|
expect(percent()).toBe('100%');
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
+
// Two touch contacts spreading apart must drive the same scale the pill
|
|
81
|
+
// does, through the shared gesture hook — the wiring a pinch regression
|
|
82
|
+
// (frozen viewer, zoom about a corner) shows up in.
|
|
83
|
+
test('a two-finger pinch scales the view about the contacts', () => {
|
|
84
|
+
const root = mount(viewer(() => {}));
|
|
85
|
+
const stage = root.ownerDocument.querySelector('.fullscreen-viewer-stage') as HTMLElement;
|
|
86
|
+
const pointer = (type: string, pointerId: number, clientX: number) =>
|
|
87
|
+
stage.dispatchEvent(
|
|
88
|
+
new window.PointerEvent(type, { bubbles: true, button: 0, pointerId, pointerType: 'touch', clientX, clientY: 100 }),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
act(() => {
|
|
92
|
+
pointer('pointerdown', 1, 100);
|
|
93
|
+
pointer('pointerdown', 2, 200);
|
|
94
|
+
pointer('pointermove', 2, 300);
|
|
95
|
+
});
|
|
96
|
+
expect(percent()).toBe('200%');
|
|
97
|
+
|
|
98
|
+
act(() => {
|
|
99
|
+
pointer('pointermove', 2, 200);
|
|
100
|
+
});
|
|
101
|
+
expect(percent()).toBe('100%');
|
|
102
|
+
});
|
|
103
|
+
|
|
80
104
|
test('keyboard: +/- zoom and Esc closes', () => {
|
|
81
105
|
let closed = 0;
|
|
82
106
|
const root = mount(viewer(() => closed++));
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
* fit exactly like a diagram whose size was read from the markup.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { ComponentChildren,
|
|
22
|
+
import type { ComponentChildren, TargetedWheelEvent } from 'preact';
|
|
23
|
+
import { useZoomGesture } from '@/client/hooks/ui/zoom-gesture';
|
|
24
|
+
import type { PinchFrame } from '@/client/lib/ui/pinch';
|
|
23
25
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';
|
|
24
26
|
import { createPortal } from 'preact/compat';
|
|
25
27
|
import { Maximize2, Minus, Plus, X } from 'lucide-preact';
|
|
@@ -40,12 +42,6 @@ interface View {
|
|
|
40
42
|
y: number;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
interface Drag {
|
|
44
|
-
pointerId: number;
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
45
|
interface Size {
|
|
50
46
|
width: number;
|
|
51
47
|
height: number;
|
|
@@ -80,10 +76,8 @@ export interface FullscreenViewerProps {
|
|
|
80
76
|
export function FullscreenViewer({ onClose, ariaLabel, measureKey, overlay, children }: FullscreenViewerProps) {
|
|
81
77
|
const stageRef = useRef<HTMLDivElement>(null);
|
|
82
78
|
const canvasRef = useRef<HTMLDivElement>(null);
|
|
83
|
-
const dragRef = useRef<Drag | null>(null);
|
|
84
79
|
const [size, setSize] = useState<Size | null>(null);
|
|
85
80
|
const [view, setView] = useState<View>({ scale: 1, x: 0, y: 0 });
|
|
86
|
-
const [dragging, setDragging] = useState(false);
|
|
87
81
|
/** Whether the reader moved the view themselves: a later measurement then
|
|
88
82
|
* must not yank their zoom back to a fit. An image that decodes after mount
|
|
89
83
|
* grows from 0 to its natural size, so the first real measurement HAS to
|
|
@@ -168,29 +162,26 @@ export function FullscreenViewer({ onClose, ariaLabel, measureKey, overlay, chil
|
|
|
168
162
|
[zoomBy],
|
|
169
163
|
);
|
|
170
164
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
165
|
+
/** A pinch scales about the two fingers and pans with their midpoint. */
|
|
166
|
+
const applyPinch = useCallback((frame: PinchFrame) => {
|
|
167
|
+
setView((current) => {
|
|
168
|
+
const stage = stageRef.current?.getBoundingClientRect();
|
|
169
|
+
const zoomed = zoomTo(current, current.scale * frame.scale, frame.x, frame.y, stage);
|
|
170
|
+
return { scale: zoomed.scale, x: zoomed.x + frame.dx, y: zoomed.y + frame.dy };
|
|
171
|
+
});
|
|
177
172
|
}, []);
|
|
178
173
|
|
|
179
|
-
const
|
|
180
|
-
const drag = dragRef.current;
|
|
181
|
-
if (!drag || drag.pointerId !== event.pointerId) return;
|
|
182
|
-
const dx = event.clientX - drag.x;
|
|
183
|
-
const dy = event.clientY - drag.y;
|
|
184
|
-
drag.x = event.clientX;
|
|
185
|
-
drag.y = event.clientY;
|
|
174
|
+
const panBy = useCallback((dx: number, dy: number) => {
|
|
186
175
|
setView((current) => ({ ...current, x: current.x + dx, y: current.y + dy }));
|
|
187
176
|
}, []);
|
|
188
177
|
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
178
|
+
const { dragging, onPointerDown, onPointerMove, onPointerUp, onPointerCancel } = useZoomGesture({
|
|
179
|
+
onStart: () => {
|
|
180
|
+
userAdjustedRef.current = true;
|
|
181
|
+
},
|
|
182
|
+
onPan: panBy,
|
|
183
|
+
onPinch: applyPinch,
|
|
184
|
+
});
|
|
194
185
|
|
|
195
186
|
const handleDoubleClick = useCallback(() => {
|
|
196
187
|
if (Math.abs(view.scale - 1) < 0.01) {
|
|
@@ -258,10 +249,10 @@ export function FullscreenViewer({ onClose, ariaLabel, measureKey, overlay, chil
|
|
|
258
249
|
ref={stageRef}
|
|
259
250
|
tabIndex={-1}
|
|
260
251
|
className={`fullscreen-viewer-stage absolute inset-0 overflow-hidden outline-none ${dragging ? 'cursor-grabbing' : 'cursor-grab'}`}
|
|
261
|
-
onPointerDown={
|
|
262
|
-
onPointerMove={
|
|
263
|
-
onPointerUp={
|
|
264
|
-
onPointerCancel={
|
|
252
|
+
onPointerDown={onPointerDown}
|
|
253
|
+
onPointerMove={onPointerMove}
|
|
254
|
+
onPointerUp={onPointerUp}
|
|
255
|
+
onPointerCancel={onPointerCancel}
|
|
265
256
|
onDblClick={handleDoubleClick}
|
|
266
257
|
>
|
|
267
258
|
<div className="absolute inset-0 flex items-center justify-center">
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The phone header's `⋯` menu: the
|
|
7
|
+
* The phone header's `⋯` menu: the controls that do not need a slot.
|
|
8
8
|
*
|
|
9
|
-
* Reload
|
|
10
|
-
*
|
|
11
|
-
* four controls that ARE used mid-conversation (context, panel, and whatever a
|
|
12
|
-
* plugin contributes). Behind `⋯` they still cost 36px — but 36px ONCE, for
|
|
13
|
-
* both, against 72px standing in the row.
|
|
9
|
+
* Reload is rare, and costs 36px of a header already sharing 320–412px between
|
|
10
|
+
* the wordmark, the session title and the controls used mid-conversation.
|
|
14
11
|
*
|
|
15
12
|
* This is the same answer the sidebar toolbar reached when its row ran out of
|
|
16
13
|
* room (`ToolbarOverflowMenu`): hiding a control outright makes it unreachable
|
|
@@ -18,19 +15,11 @@
|
|
|
18
15
|
* nothing on screen to say so. A menu keeps it one click away and names it in
|
|
19
16
|
* words rather than as a glyph.
|
|
20
17
|
*
|
|
21
|
-
* ## Sign-out confirms HERE, not in the row it came from
|
|
22
|
-
*
|
|
23
|
-
* `SignOutButton` is a two-press control because it sits a pixel from reload.
|
|
24
|
-
* A menu already costs an open and a click, so the confirmation is the first
|
|
25
|
-
* row press: the row turns into `Click again to sign out` and the second press
|
|
26
|
-
* ends the session. The safety property is unchanged — one stray click still
|
|
27
|
-
* cannot sign the user out — and focus never leaves the menu.
|
|
28
18
|
*/
|
|
29
19
|
|
|
30
|
-
import { Ellipsis,
|
|
20
|
+
import { Ellipsis, RefreshCw } from 'lucide-preact';
|
|
31
21
|
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
32
22
|
import { useOnClickOutside } from '@/client/hooks/ui/on-click-outside';
|
|
33
|
-
import { logout, useAuthEnabled, useAuthState } from '@/client/hooks/ui/auth';
|
|
34
23
|
import { PluginIdProvider } from '@kabmo-labs/kabmo-ui';
|
|
35
24
|
import { requestOpenPanel } from '@/shared/lib/workspace/panel-open';
|
|
36
25
|
import { CONTROL_BOX } from '@/client/lib/ui/control-plate';
|
|
@@ -56,51 +45,25 @@ export function HeaderMoreMenu({
|
|
|
56
45
|
/** Controls the user switched off; their rows are gone from this menu too. */
|
|
57
46
|
hidden?: string[];
|
|
58
47
|
}) {
|
|
59
|
-
const authEnabled = useAuthEnabled();
|
|
60
|
-
const authState = useAuthState();
|
|
61
48
|
const [open, setOpen] = useState(false);
|
|
62
|
-
const [confirming, setConfirming] = useState(false);
|
|
63
|
-
const [busy, setBusy] = useState(false);
|
|
64
49
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
65
50
|
useOnClickOutside(rootRef, () => setOpen(false));
|
|
66
51
|
|
|
67
|
-
const canSignOut = authEnabled && authState !== 'required';
|
|
68
52
|
// The open flag is mirrored into a ref so the Escape listener can be bound
|
|
69
53
|
// ONCE, at mount. Binding it from an effect keyed on `open` lost the first
|
|
70
|
-
// keypress after the click that opened the menu
|
|
71
|
-
// — and a menu that swallows Escape intermittently is worse than one that
|
|
72
|
-
// never does, because the user cannot tell which they are looking at.
|
|
54
|
+
// keypress after the click that opened the menu.
|
|
73
55
|
const openRef = useRef(open);
|
|
74
56
|
openRef.current = open;
|
|
75
57
|
|
|
76
|
-
// A menu left open while the session ends elsewhere would offer an action for
|
|
77
|
-
// a session that no longer exists — the same rule `SignOutButton` applies.
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
if (!canSignOut) setConfirming(false);
|
|
80
|
-
}, [canSignOut]);
|
|
81
|
-
|
|
82
58
|
useEffect(() => {
|
|
83
59
|
const onKeyDown = (event: globalThis.KeyboardEvent) => {
|
|
84
60
|
if (event.key !== 'Escape' || !openRef.current) return;
|
|
85
61
|
setOpen(false);
|
|
86
|
-
setConfirming(false);
|
|
87
62
|
};
|
|
88
63
|
document.addEventListener('keydown', onKeyDown);
|
|
89
64
|
return () => document.removeEventListener('keydown', onKeyDown);
|
|
90
65
|
}, []);
|
|
91
66
|
|
|
92
|
-
const signOut = async () => {
|
|
93
|
-
if (busy) return;
|
|
94
|
-
if (!confirming) {
|
|
95
|
-
setConfirming(true);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
setBusy(true);
|
|
99
|
-
// `logout` reloads into the login screen; a failure still leaves no usable
|
|
100
|
-
// session, so there is nothing to recover here.
|
|
101
|
-
await logout();
|
|
102
|
-
};
|
|
103
|
-
|
|
104
67
|
return (
|
|
105
68
|
<div className="relative" ref={rootRef}>
|
|
106
69
|
<button
|
|
@@ -163,20 +126,6 @@ export function HeaderMoreMenu({
|
|
|
163
126
|
</button>
|
|
164
127
|
))}
|
|
165
128
|
|
|
166
|
-
{canSignOut && !hidden.includes(NAVBAR_CONTROL.signout) && (
|
|
167
|
-
<button
|
|
168
|
-
type="button"
|
|
169
|
-
role="menuitem"
|
|
170
|
-
onClick={signOut}
|
|
171
|
-
disabled={busy}
|
|
172
|
-
className={ROW_CLASS}
|
|
173
|
-
aria-expanded={confirming}
|
|
174
|
-
data-confirming={confirming ? 'true' : undefined}
|
|
175
|
-
>
|
|
176
|
-
{confirming ? <LockOpen size={14} /> : <Lock size={14} />}
|
|
177
|
-
<span>{confirming ? 'Click again to sign out' : 'Sign out'}</span>
|
|
178
|
-
</button>
|
|
179
|
-
)}
|
|
180
129
|
</div>
|
|
181
130
|
)}
|
|
182
131
|
</div>
|
|
@@ -210,7 +210,7 @@ async function mount(
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
describe('HeaderControls', () => {
|
|
213
|
-
test('desktop draws install, plugin slots, reload, context,
|
|
213
|
+
test('desktop draws install, plugin slots, reload, context, right side', async () => {
|
|
214
214
|
await mount('desktop');
|
|
215
215
|
|
|
216
216
|
expect(controlNames()).toEqual([
|
|
@@ -218,7 +218,6 @@ describe('HeaderControls', () => {
|
|
|
218
218
|
'Demo Stats',
|
|
219
219
|
'Reload page',
|
|
220
220
|
'Context usage',
|
|
221
|
-
'Sign out',
|
|
222
221
|
'Toggle Right Side',
|
|
223
222
|
]);
|
|
224
223
|
});
|
|
@@ -234,7 +233,7 @@ describe('HeaderControls', () => {
|
|
|
234
233
|
const groups = [...root.children] as HTMLElement[];
|
|
235
234
|
expect(groups).toHaveLength(2);
|
|
236
235
|
expect(controlNames(groups[0])).toEqual(['Context usage', 'Demo Stats', 'Install Kabmo']);
|
|
237
|
-
expect(controlNames(groups[1])).toEqual(['Reload page', '
|
|
236
|
+
expect(controlNames(groups[1])).toEqual(['Reload page', 'Toggle Right Side']);
|
|
238
237
|
});
|
|
239
238
|
|
|
240
239
|
test('a native shell leads the right group with the server selector', async () => {
|
|
@@ -250,7 +249,6 @@ describe('HeaderControls', () => {
|
|
|
250
249
|
expect(controlNames(groups[1])).toEqual([
|
|
251
250
|
'Servers',
|
|
252
251
|
'Reload page',
|
|
253
|
-
'Sign out',
|
|
254
252
|
'Toggle Right Side',
|
|
255
253
|
]);
|
|
256
254
|
} finally {
|
|
@@ -282,7 +280,6 @@ describe('HeaderControls', () => {
|
|
|
282
280
|
expect(controlNames()).toEqual([
|
|
283
281
|
'Install Kabmo',
|
|
284
282
|
'Demo Stats',
|
|
285
|
-
'Sign out',
|
|
286
283
|
'Toggle Right Side',
|
|
287
284
|
]);
|
|
288
285
|
});
|
|
@@ -327,7 +324,6 @@ describe('HeaderControls', () => {
|
|
|
327
324
|
'Demo Stats',
|
|
328
325
|
'Reload page',
|
|
329
326
|
'Context usage',
|
|
330
|
-
'Sign out',
|
|
331
327
|
'Open Right Panel',
|
|
332
328
|
]);
|
|
333
329
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PanelRight } from 'lucide-preact';
|
|
2
2
|
import { PWAInstallButton } from '@/client/components/common/PWAInstallButton';
|
|
3
3
|
import { ReloadPageButton } from '@/client/components/common/ReloadPageButton';
|
|
4
|
-
import { SignOutButton } from '@/client/components/common/SignOutButton';
|
|
5
4
|
import { ContextUsageButton } from '@/client/components/common/context-usage-button';
|
|
6
5
|
import { HeaderPanelButtons } from '@/client/components/common/header-panel-buttons';
|
|
7
6
|
import { ServerControl } from '@/client/components/common/server-control';
|
|
@@ -9,7 +8,6 @@ import type { HeaderEntries } from '@/client/components/common/header-panel-butt
|
|
|
9
8
|
import { HeaderMoreMenu } from '@/client/components/common/header-controls/MoreMenu';
|
|
10
9
|
import { WindowControls } from '@/client/components/common/window-controls';
|
|
11
10
|
import { drawsWindowControls } from '@/client/lib/desktop/titlebar';
|
|
12
|
-
import { useAuthEnabled, useAuthState } from '@/client/hooks/ui/auth';
|
|
13
11
|
import { useViewportAtLeast } from '@/client/hooks/ui/media-query';
|
|
14
12
|
import { CONTROL_BOX, CONTROL_GLYPH_PX, CONTROL_ROW_GAP } from '@/client/lib/ui/control-plate';
|
|
15
13
|
import { NAVBAR_CONTROL, navbarPluginControlId, type NavbarControlId } from '@/client/hooks/ui/navbar-controls';
|
|
@@ -31,7 +29,7 @@ export type HeaderLayout = 'desktop' | 'mobile';
|
|
|
31
29
|
* A wider phone or a rotated one gets them back — the fold is not a device
|
|
32
30
|
* class, it is the width at which the row stops fitting.
|
|
33
31
|
*/
|
|
34
|
-
const MOBILE_FULL_ROW_PX =
|
|
32
|
+
const MOBILE_FULL_ROW_PX = 400;
|
|
35
33
|
|
|
36
34
|
export interface HeaderControlsProps {
|
|
37
35
|
layout: HeaderLayout;
|
|
@@ -102,8 +100,7 @@ const ICON_SIZE: Record<HeaderLayout, number> = CONTROL_GLYPH_PX;
|
|
|
102
100
|
* 2. Plugin header slots
|
|
103
101
|
* 3. Reload page — desktop; behind `⋯` on a phone
|
|
104
102
|
* 4. Context usage
|
|
105
|
-
* 5.
|
|
106
|
-
* 6. Right side — the editor column, the right panel and their
|
|
103
|
+
* 5. Right side — the editor column, the right panel and their
|
|
107
104
|
* rail, as ONE toggle; the editor column's own
|
|
108
105
|
* switch lives on the panel's corner instead
|
|
109
106
|
* 7. More actions (`⋯`) — phone only, in the slot the two moved controls
|
|
@@ -113,8 +110,8 @@ const ICON_SIZE: Record<HeaderLayout, number> = CONTROL_GLYPH_PX;
|
|
|
113
110
|
* so `split` spends the width between them instead of hugging the right one:
|
|
114
111
|
*
|
|
115
112
|
* LEFT, readouts and selectors — context usage → plugin slots → install
|
|
116
|
-
* RIGHT, page actions — server selector → reload →
|
|
117
|
-
*
|
|
113
|
+
* RIGHT, page actions — server selector → reload → right-side
|
|
114
|
+
* toggle → page-drawn window controls
|
|
118
115
|
*
|
|
119
116
|
* The right-side toggle is the last app control, so it keeps the activity
|
|
120
117
|
* rail's axis. The Windows/Linux caption cluster follows it because those
|
|
@@ -129,8 +126,8 @@ const ICON_SIZE: Record<HeaderLayout, number> = CONTROL_GLYPH_PX;
|
|
|
129
126
|
* and the session title — the only functional thing in the left group. Reload
|
|
130
127
|
* and sign-out are rare (a reload is Cmd/Ctrl+R; a sign-out happens once a
|
|
131
128
|
* session), while context and the right panel are read and pressed mid-turn.
|
|
132
|
-
* Measured with
|
|
133
|
-
*
|
|
129
|
+
* Measured with every control standing in the row, the title got 89px at 390
|
|
130
|
+
* and 19px at 320 — one letter and an ellipsis.
|
|
134
131
|
*
|
|
135
132
|
* The fold is therefore a WIDTH, not a layout: `MOBILE_FULL_ROW_PX` is the
|
|
136
133
|
* narrowest header that still fits every control beside a full 150px picker,
|
|
@@ -155,33 +152,22 @@ export function HeaderControls({
|
|
|
155
152
|
const isPluginHidden = (pluginId: string) => hidden.includes(navbarPluginControlId(pluginId));
|
|
156
153
|
const inlineEntries = entries.inline.filter((entry) => !isPluginHidden(entry.pluginId));
|
|
157
154
|
const foldedEntries = entries.folded.filter((entry) => !isPluginHidden(entry.pluginId));
|
|
158
|
-
const
|
|
159
|
-
const authState = useAuthState();
|
|
160
|
-
const signOutShown = authEnabled && authState !== 'required';
|
|
161
|
-
// Called unconditionally: a hook inside the ternary below would run in a
|
|
162
|
-
// different order on the two layouts.
|
|
163
|
-
const wideRow = useViewportAtLeast(signOutShown ? MOBILE_FULL_ROW_PX.withSignOut : MOBILE_FULL_ROW_PX.without);
|
|
155
|
+
const wideRow = useViewportAtLeast(MOBILE_FULL_ROW_PX);
|
|
164
156
|
const wideEnoughForAll = layout === 'desktop' || wideRow;
|
|
165
|
-
// A phone folds the
|
|
157
|
+
// A phone folds the rare reload control only while the row cannot hold it.
|
|
166
158
|
const folded = layout === 'mobile' && !wideEnoughForAll;
|
|
167
|
-
// The `⋯` trigger is drawn only while it has a row to offer: with both
|
|
168
|
-
// folded controls switched off and no plugin entry folded, an empty menu is
|
|
169
|
-
// a button that opens nothing.
|
|
170
159
|
const moreRows =
|
|
171
|
-
(folded &&
|
|
172
|
-
foldedEntries.length > 0;
|
|
160
|
+
(folded && !isHidden(NAVBAR_CONTROL.reload)) || foldedEntries.length > 0;
|
|
173
161
|
|
|
174
162
|
const installShown = layout === 'desktop' && !isHidden(NAVBAR_CONTROL.install);
|
|
175
163
|
const reloadShown = (layout === 'desktop' || !folded) && !isHidden(NAVBAR_CONTROL.reload);
|
|
176
164
|
const contextShown = !isHidden(NAVBAR_CONTROL.context);
|
|
177
|
-
const signOutInRow = (layout === 'desktop' || !folded) && !isHidden(NAVBAR_CONTROL.signout) && signOutShown;
|
|
178
165
|
const rightPanelShown = !isHidden(NAVBAR_CONTROL.rightPanel);
|
|
179
166
|
|
|
180
167
|
const install = installShown ? <PWAInstallButton /> : null;
|
|
181
168
|
const plugins = <HeaderPanelButtons layout={layout} entries={inlineEntries} />;
|
|
182
169
|
const reload = reloadShown ? <ReloadPageButton size={size} className={iconClass} /> : null;
|
|
183
170
|
const context = contextShown ? <ContextUsageButton sessionId={sessionId} layout={layout} /> : null;
|
|
184
|
-
const signout = signOutInRow ? <SignOutButton size={size} className={iconClass} /> : null;
|
|
185
171
|
const rightPanel = rightPanelShown ? (layout === 'mobile' ? (
|
|
186
172
|
<button
|
|
187
173
|
type="button"
|
|
@@ -235,7 +221,6 @@ export function HeaderControls({
|
|
|
235
221
|
<div className={`flex items-center ${CONTROL_ROW_GAP}`}>
|
|
236
222
|
<ServerControl variant="nav" />
|
|
237
223
|
{reload}
|
|
238
|
-
{signout}
|
|
239
224
|
{rightPanel}
|
|
240
225
|
{more}
|
|
241
226
|
{windowControls}
|
|
@@ -254,7 +239,6 @@ export function HeaderControls({
|
|
|
254
239
|
row fits every control at 400px open and 436px with the lock. */}
|
|
255
240
|
{reload}
|
|
256
241
|
{context}
|
|
257
|
-
{signout}
|
|
258
242
|
{rightPanel}
|
|
259
243
|
{more}
|
|
260
244
|
{windowControls}
|
|
@@ -228,7 +228,6 @@ describe('the phone row', () => {
|
|
|
228
228
|
'Demo Stats',
|
|
229
229
|
'Reload page',
|
|
230
230
|
'Context usage',
|
|
231
|
-
'Sign out',
|
|
232
231
|
'Open Right Panel',
|
|
233
232
|
]);
|
|
234
233
|
});
|
|
@@ -237,30 +236,18 @@ describe('the phone row', () => {
|
|
|
237
236
|
await mountPhone(360);
|
|
238
237
|
|
|
239
238
|
expect(controlNames()).not.toContain('Reload page');
|
|
240
|
-
expect(controlNames()).not.toContain('Sign out');
|
|
241
239
|
|
|
242
240
|
const trigger = container.querySelector('button[aria-label="More actions"]') as HTMLElement;
|
|
243
241
|
expect(trigger.getAttribute('aria-expanded')).toBe('false');
|
|
244
242
|
const menu = await openMenu();
|
|
245
243
|
expect(menu.textContent).toContain('Reload page');
|
|
246
|
-
expect(menu.textContent).toContain('Sign out');
|
|
247
244
|
expect(trigger.getAttribute('aria-expanded')).toBe('true');
|
|
248
245
|
});
|
|
249
246
|
|
|
250
|
-
test('a control switched off
|
|
247
|
+
test('a control switched off leaves no empty ⋯ menu', async () => {
|
|
251
248
|
await mountPhone(360, ['reload']);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
expect(menu.textContent).not.toContain('Reload page');
|
|
255
|
-
// Sign out is still off the row, so the menu keeps its row and the trigger
|
|
256
|
-
// still has something to offer.
|
|
257
|
-
expect(menu.textContent).toContain('Sign out');
|
|
258
|
-
|
|
259
|
-
render(null, container);
|
|
260
|
-
container.remove();
|
|
261
|
-
await mountPhone(360, ['reload', 'signout']);
|
|
262
|
-
// Nothing folded and nothing left in the menu: the trigger is not drawn,
|
|
263
|
-
// rather than opening an empty panel.
|
|
249
|
+
// Reload is the only folded control now that sign-out lives in the footer,
|
|
250
|
+
// so hiding it leaves the trigger with nothing to open.
|
|
264
251
|
expect(container.querySelector('button[aria-label="More actions"]')).toBeNull();
|
|
265
252
|
});
|
|
266
253
|
});
|