@kabmo-labs/kabmo 0.31.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +446 -427
- package/dist/client/static/js/CsvGrid-4gx0jevc.js +2 -0
- package/dist/client/static/js/DocxView-0667nr8h.js +58 -0
- package/dist/client/static/js/DrawioView-522v0d0r.js +5 -0
- package/dist/client/static/js/ImageView-t8xp60hm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-xjnveecv.js +2 -0
- package/dist/client/static/js/Modal-k2jr9hc4.js +38 -0
- package/dist/client/static/js/PdfView-3fx172xh.js +1 -0
- package/dist/client/static/js/SessionsView-n3agmf5t.js +1 -0
- package/dist/client/static/js/SheetView-nmrdb1b8.js +140 -0
- package/dist/client/static/js/SvgPreview-0xsc6xam.js +1 -0
- package/dist/client/static/js/__vite-browser-external-2447137e-mq6vaetg.js +0 -0
- package/dist/client/static/js/abnfDiagram-O67JEVCF-jj31rs62.js +1 -0
- package/dist/client/static/js/andromeeda-17pn42cc.js +1 -0
- package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-ay3yr7pf.js +36 -0
- package/dist/client/static/js/astro-qgx1r159.js +1 -0
- package/dist/client/static/js/aurora-x-hxy97145.js +1 -0
- package/dist/client/static/js/ayu-dark-x0jd4baz.js +1 -0
- package/dist/client/static/js/ayu-light-12fg03q0.js +1 -0
- package/dist/client/static/js/ayu-mirage-52h7xjbv.js +1 -0
- package/dist/client/static/js/bash-m0qjsyy0.js +1 -0
- package/dist/client/static/js/blockDiagram-BEXU5L5S-4x33e16k.js +140 -0
- package/dist/client/static/js/c-wkgxb1t1.js +1 -0
- package/dist/client/static/js/c4Diagram-YGBWAQC7-dtb81cgz.js +38 -0
- package/dist/client/static/js/catppuccin-frappe-fqgpn512.js +1 -0
- package/dist/client/static/js/catppuccin-latte-tr2x6gmz.js +1 -0
- package/dist/client/static/js/catppuccin-macchiato-rm7kh084.js +1 -0
- package/dist/client/static/js/catppuccin-mocha-hw0dzp99.js +1 -0
- package/dist/client/static/js/classDiagram-v2-NBCMYWYE-vk5a2n9w.js +217 -0
- package/dist/client/static/js/clike-h8p24dc6.js +1 -0
- package/dist/client/static/js/clojure-tf457n84.js +1 -0
- package/dist/client/static/js/clojure-w19rx1x5.js +1 -0
- package/dist/client/static/js/cmake-qpejsvqg.js +1 -0
- package/dist/client/static/js/cose-bilkent-JH36ORCC-6rbjbe19.js +1 -0
- package/dist/client/static/js/cpp-y0t6mynx.js +1 -0
- package/dist/client/static/js/csharp-dap1ppts.js +1 -0
- package/dist/client/static/js/css-t4ngafan.js +1 -0
- package/dist/client/static/js/css-tf1s0nb7.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +1 -0
- package/dist/client/static/js/cynefinDiagram-VND7K2PF-vyjksedr.js +62 -0
- package/dist/client/static/js/dagre-6A5THRUB-7hey38z5.js +4 -0
- package/dist/client/static/js/dark-plus-weqfnwnf.js +1 -0
- package/dist/client/static/js/dart-dxn88tw0.js +1 -0
- package/dist/client/static/js/diagram-22UHCM2B-aes06jde.js +200 -0
- package/dist/client/static/js/diagram-3UASUU5V-3cfkgm3x.js +24 -0
- package/dist/client/static/js/diagram-ATOU4E4O-z8mfhwpy.js +3 -0
- package/dist/client/static/js/diagram-CDSNMT55-t4821ctz.js +30 -0
- package/dist/client/static/js/diagram-MLGK6HIB-23yxbfrx.js +24 -0
- package/dist/client/static/js/diagram-MPIPVDR6-chhtf7v0.js +41 -0
- package/dist/client/static/js/diff-r1sqd2db.js +1 -0
- package/dist/client/static/js/dockerfile-5b87ghm7.js +1 -0
- package/dist/client/static/js/dockerfile-d43jt8fq.js +1 -0
- package/dist/client/static/js/dracula-k5pe1hsy.js +1 -0
- package/dist/client/static/js/dracula-soft-xqzm7g02.js +1 -0
- package/dist/client/static/js/ebnfDiagram-ZINNZB2B-9jejcvfr.js +1 -0
- package/dist/client/static/js/elixir-rpa1g4gy.js +1 -0
- package/dist/client/static/js/elk-276RUBZZ-xhhtkf58.js +2 -0
- package/dist/client/static/js/erDiagram-OPXOYQCR-mt2apjjb.js +99 -0
- package/dist/client/static/js/erlang-1ch2hjv9.js +1 -0
- package/dist/client/static/js/erlang-6m6tpt72.js +1 -0
- package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +1 -0
- package/dist/client/static/js/everforest-dark-v44f35e9.js +1 -0
- package/dist/client/static/js/everforest-light-c7m7g4z4.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +1 -0
- package/dist/client/static/js/ganttDiagram-FUAMR5RP-8cm7a29w.js +292 -0
- package/dist/client/static/js/ghostty-web-2gt2tp72.js +13 -0
- package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +1 -0
- package/dist/client/static/js/gitGraphDiagram-X574FWY7-5s0gbnx2.js +106 -0
- package/dist/client/static/js/github-dark-default-1000qs8y.js +1 -0
- package/dist/client/static/js/github-dark-dimmed-vfghfgh1.js +1 -0
- package/dist/client/static/js/github-dark-fvd3e45k.js +1 -0
- package/dist/client/static/js/github-dark-high-contrast-2j07czxg.js +1 -0
- package/dist/client/static/js/github-light-9r4ahj0m.js +1 -0
- package/dist/client/static/js/github-light-default-6d4nszch.js +1 -0
- package/dist/client/static/js/github-light-high-contrast-qwzscwzg.js +1 -0
- package/dist/client/static/js/go-nfrqbjpq.js +1 -0
- package/dist/client/static/js/go-rtqh5zp3.js +1 -0
- package/dist/client/static/js/graphql-692h0n2x.js +1 -0
- package/dist/client/static/js/groovy-63s5pygd.js +1 -0
- package/dist/client/static/js/groovy-s992001c.js +1 -0
- package/dist/client/static/js/gruvbox-dark-hard-ctttkbm1.js +1 -0
- package/dist/client/static/js/gruvbox-dark-medium-vh8mkpgj.js +1 -0
- package/dist/client/static/js/gruvbox-dark-soft-9f1ph8sj.js +1 -0
- package/dist/client/static/js/gruvbox-light-hard-n3ma2f5b.js +1 -0
- package/dist/client/static/js/gruvbox-light-medium-hkamn7bg.js +1 -0
- package/dist/client/static/js/gruvbox-light-soft-r39t4g97.js +1 -0
- package/dist/client/static/js/haskell-ev7ynt8z.js +1 -0
- package/dist/client/static/js/haskell-phxh4hcg.js +1 -0
- package/dist/client/static/js/hcl-wndsmevr.js +1 -0
- package/dist/client/static/js/horizon-bright-wz5mjtp4.js +1 -0
- package/dist/client/static/js/horizon-pr13gmaz.js +1 -0
- package/dist/client/static/js/houston-mrdq0gj4.js +1 -0
- package/dist/client/static/js/html-pv88ny12.js +1 -0
- package/dist/client/static/js/index-0j518hqm.js +2 -0
- package/dist/client/static/js/index-2gfc25tq.js +1 -0
- package/dist/client/static/js/index-2xj14800.js +2 -0
- package/dist/client/static/js/index-360d7j0d.js +1 -0
- package/dist/client/static/js/index-3vhznzgr.js +2 -0
- package/dist/client/static/js/index-4s8ttfxj.js +474 -0
- package/dist/client/static/js/index-532btjmp.js +2 -0
- package/dist/client/static/js/index-59jb53v3.js +2 -0
- package/dist/client/static/js/index-5x95n3hx.js +1 -0
- package/dist/client/static/js/index-5y7c62sm.js +7 -0
- package/dist/client/static/js/index-61tm0v57.js +1 -0
- package/dist/client/static/js/index-629kfbcb.js +2 -0
- package/dist/client/static/js/index-6q80csr0.js +2 -0
- package/dist/client/static/js/index-7fdp9c7m.js +2 -0
- package/dist/client/static/js/index-7n68yx6m.js +2 -0
- package/dist/client/static/js/index-9sd0vjmh.js +2 -0
- package/dist/client/static/js/index-9t82sx0w.js +2 -0
- package/dist/client/static/js/index-a0bdavdr.js +2 -0
- package/dist/client/static/js/index-a293pdg7.js +2 -0
- package/dist/client/static/js/index-a6k2hqke.js +1 -0
- package/dist/client/static/js/index-a733k69t.js +2 -0
- package/dist/client/static/js/index-ay34b398.js +214 -0
- package/dist/client/static/js/index-bbggh3f8.js +2 -0
- package/dist/client/static/js/index-brj8qwa6.js +2 -0
- package/dist/client/static/js/index-c0x6s6f7.js +3 -0
- package/dist/client/static/js/index-c93sp4yh.js +1 -0
- package/dist/client/static/js/index-dnp07j57.js +1 -0
- package/dist/client/static/js/index-dq1kdt03.js +2 -0
- package/dist/client/static/js/index-dt7e1328.js +2 -0
- package/dist/client/static/js/index-e94a1en0.css +1 -0
- package/dist/client/static/js/index-ehcpzk5b.js +2 -0
- package/dist/client/static/js/index-ejgd8w3s.js +179 -0
- package/dist/client/static/js/index-fdbfzshx.js +2 -0
- package/dist/client/static/js/index-g33knza2.js +2 -0
- package/dist/client/static/js/index-gbfg0anm.js +2 -0
- package/dist/client/static/js/index-h06bcfds.js +1 -0
- package/dist/client/static/js/index-h6jxmkxk.js +129 -0
- package/dist/client/static/js/index-h7pn9qw6.js +2 -0
- package/dist/client/static/js/index-hc2jmzpx.js +314 -0
- package/dist/client/static/js/index-jppt5mgc.js +2 -0
- package/dist/client/static/js/index-jz9fpznk.js +9 -0
- package/dist/client/static/js/index-kg86e3sy.js +12 -0
- package/dist/client/static/js/index-kpspnztv.js +2 -0
- package/dist/client/static/js/index-nmmxb4va.js +2 -0
- package/dist/client/static/js/index-p7btwjvj.js +3 -0
- package/dist/client/static/js/index-pf5sbesf.js +2 -0
- package/dist/client/static/js/index-pf7syd7t.js +3 -0
- package/dist/client/static/js/index-qkscve6n.js +2 -0
- package/dist/client/static/js/index-qnwqaczk.js +4 -0
- package/dist/client/static/js/index-rg8jpbsw.js +2 -0
- package/dist/client/static/js/index-sa9cp6km.js +2 -0
- package/dist/client/static/js/index-vd0e25p0.js +1 -0
- package/dist/client/static/js/index-vnvrzwht.js +240 -0
- package/dist/client/static/js/index-vtbbfwx0.js +2 -0
- package/dist/client/static/js/index-w7xbfv44.js +2 -0
- package/dist/client/static/js/index-wzma5n54.js +2 -0
- package/dist/client/static/js/index-x07kp3jz.js +2 -0
- package/dist/client/static/js/index-xj9649ac.js +332 -0
- package/dist/client/static/js/index-xya34x4v.js +2 -0
- package/dist/client/static/js/index-ye3sr7db.js +89 -0
- package/dist/client/static/js/index-z4v1xmh1.js +2 -0
- package/dist/client/static/js/index-z5s27s26.js +1 -0
- package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +1 -0
- package/dist/client/static/js/infoDiagram-VRGFBTTK-3w1yz32c.js +2 -0
- package/dist/client/static/js/ini-cg0a5wm3.js +1 -0
- package/dist/client/static/js/ishikawaDiagram-OU5B5YK6-ckt471dy.js +70 -0
- package/dist/client/static/js/java-vcck089n.js +1 -0
- package/dist/client/static/js/javascript-18thb3jp.js +1 -0
- package/dist/client/static/js/javascript-4kw2j9t3.js +1 -0
- package/dist/client/static/js/journeyDiagram-ZHPQQLJL-kfvn4w7e.js +139 -0
- package/dist/client/static/js/json-j5q8nt57.js +1 -0
- package/dist/client/static/js/json5-hmb38a78.js +1 -0
- package/dist/client/static/js/jsx-ht9zyzwa.js +1 -0
- package/dist/client/static/js/julia-0j0gsjvc.js +1 -0
- package/dist/client/static/js/julia-ft9kd90a.js +1 -0
- package/dist/client/static/js/kanagawa-dragon-nya1w1ke.js +1 -0
- package/dist/client/static/js/kanagawa-lotus-hwn4nbn5.js +1 -0
- package/dist/client/static/js/kanagawa-wave-7rsxqd8r.js +1 -0
- package/dist/client/static/js/kanban-definition-PNTS6WVX-0q36cm83.js +89 -0
- package/dist/client/static/js/katex-eh1m1m1d.js +257 -0
- package/dist/client/static/js/kotlin-bw3n4j1v.js +1 -0
- package/dist/client/static/js/laserwave-37chepry.js +1 -0
- package/dist/client/static/js/less-w8v48sx0.js +1 -0
- package/dist/client/static/js/light-plus-mcbbmtzj.js +1 -0
- package/dist/client/static/js/lua-6at2ddf6.js +1 -0
- package/dist/client/static/js/lua-ke895s2q.js +1 -0
- package/dist/client/static/js/main-rx9grv92.js +7 -0
- package/dist/client/static/js/makefile-22weg265.js +1 -0
- package/dist/client/static/js/markdown-gwmsh53r.js +1 -0
- package/dist/client/static/js/material-theme-darker-pcm1tb69.js +1 -0
- package/dist/client/static/js/material-theme-lighter-cbdrfj3g.js +1 -0
- package/dist/client/static/js/material-theme-ocean-3rs19bm6.js +1 -0
- package/dist/client/static/js/material-theme-palenight-rxhkgd4c.js +1 -0
- package/dist/client/static/js/material-theme-x46yf0tm.js +1 -0
- package/dist/client/static/js/mermaid.core-b1ssa824.js +12 -0
- package/dist/client/static/js/min-dark-f279fhzv.js +1 -0
- package/dist/client/static/js/min-light-s53yjy4e.js +1 -0
- package/dist/client/static/js/mindmap-definition-NLK3R4M7-e2ym5en8.js +96 -0
- package/dist/client/static/js/mllike-cnahv8ak.js +1 -0
- package/dist/client/static/js/monokai-yr7h8283.js +1 -0
- package/dist/client/static/js/night-owl-8d01zsx4.js +1 -0
- package/dist/client/static/js/night-owl-light-7jbd0p3j.js +1 -0
- package/dist/client/static/js/nix-7e31jz1m.js +1 -0
- package/dist/client/static/js/nord-h1bak1eb.js +1 -0
- package/dist/client/static/js/objective-c-8r3dxert.js +1 -0
- package/dist/client/static/js/ocaml-bpjgcgwa.js +1 -0
- package/dist/client/static/js/one-dark-pro-4geyzhjj.js +1 -0
- package/dist/client/static/js/one-light-tqssjm9t.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +1 -0
- package/dist/client/static/js/pegDiagram-GJSIUBJH-t8bbdyhe.js +1 -0
- package/dist/client/static/js/perl-3t5fm1te.js +1 -0
- package/dist/client/static/js/perl-7n7e9ncg.js +1 -0
- package/dist/client/static/js/php-32vy69vd.js +1 -0
- package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +1 -0
- package/dist/client/static/js/pieDiagram-5QR66LMP-envv4brj.js +39 -0
- package/dist/client/static/js/plastic-8kfqgcmr.js +1 -0
- package/dist/client/static/js/poimandres-rjcckfek.js +1 -0
- package/dist/client/static/js/powershell-m5qb6mjj.js +1 -0
- package/dist/client/static/js/powershell-rrzhqtmb.js +1 -0
- package/dist/client/static/js/properties-mzvvbqg5.js +1 -0
- package/dist/client/static/js/properties-qq2pcfyk.js +1 -0
- package/dist/client/static/js/protobuf-578974t5.js +1 -0
- package/dist/client/static/js/protobuf-ggczeare.js +1 -0
- package/dist/client/static/js/python-3w64wsyd.js +1 -0
- package/dist/client/static/js/python-wbdfs2gc.js +1 -0
- package/dist/client/static/js/quadrantDiagram-O4NWA36T-72rk137a.js +7 -0
- package/dist/client/static/js/r-32re2zwb.js +1 -0
- package/dist/client/static/js/r-z4m38eb1.js +1 -0
- package/dist/client/static/js/racket-dhm8rebp.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +1 -0
- package/dist/client/static/js/railroadDiagram-XR7U4H2S-1ej0f5hr.js +1 -0
- package/dist/client/static/js/red-zgbwyj31.js +1 -0
- package/dist/client/static/js/requirementDiagram-PLB6GJNP-rvdaknpd.js +84 -0
- package/dist/client/static/js/rose-pine-azwmazxg.js +1 -0
- package/dist/client/static/js/rose-pine-dawn-3t3j9bnk.js +1 -0
- package/dist/client/static/js/rose-pine-moon-35ecvxkf.js +1 -0
- package/dist/client/static/js/ruby-5ty7fys7.js +1 -0
- package/dist/client/static/js/ruby-nq98w40a.js +1 -0
- package/dist/client/static/js/rust-2geezrcs.js +1 -0
- package/dist/client/static/js/rust-psncxtga.js +1 -0
- package/dist/client/static/js/sankeyDiagram-IPEJSGJF-nxvhtdaw.js +40 -0
- package/dist/client/static/js/sass-k1jjq4y7.js +1 -0
- package/dist/client/static/js/sass-mey5150f.js +1 -0
- package/dist/client/static/js/scala-atdk263v.js +1 -0
- package/dist/client/static/js/scheme-181kqjff.js +1 -0
- package/dist/client/static/js/scheme-jvs3e9c8.js +1 -0
- package/dist/client/static/js/scss-zphrqp25.js +1 -0
- package/dist/client/static/js/sequenceDiagram-PO4LG4MO-n5cn5qrt.js +169 -0
- package/dist/client/static/js/shell-5rhwzbr3.js +1 -0
- package/dist/client/static/js/sizeCapture-INFHLROL-r074kj7s.js +1 -0
- package/dist/client/static/js/slack-dark-j9p83tbc.js +1 -0
- package/dist/client/static/js/slack-ochin-fe90gs3m.js +1 -0
- package/dist/client/static/js/snazzy-light-pj44bwcm.js +1 -0
- package/dist/client/static/js/solarized-dark-54jyr51c.js +1 -0
- package/dist/client/static/js/solarized-light-ca8r58m6.js +1 -0
- package/dist/client/static/js/solidity-bx92jb30.js +1 -0
- package/dist/client/static/js/sql-g8wcshpc.js +1 -0
- package/dist/client/static/js/sql-wsvbkyd1.js +1 -0
- package/dist/client/static/js/stateDiagram-v2-GCMORJYK-vxghxdb0.js +291 -0
- package/dist/client/static/js/stylus-fht9fjbw.js +1 -0
- package/dist/client/static/js/stylus-xh0f7m9m.js +1 -0
- package/dist/client/static/js/svelte-3ewx0hzx.js +1 -0
- package/dist/client/static/js/swift-0rtnm3tm.js +1 -0
- package/dist/client/static/js/swift-rr9wc5y7.js +1 -0
- package/dist/client/static/js/swimlanes-2SLR337P-qkkv894p.js +1 -0
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +8 -0
- package/dist/client/static/js/synthwave-84-yq047vcq.js +1 -0
- package/dist/client/static/js/timeline-definition-EJHVYXUP-5tbq4ex2.js +120 -0
- package/dist/client/static/js/tokyo-night-jfy87bj1.js +1 -0
- package/dist/client/static/js/toml-b5g7qp6k.js +1 -0
- package/dist/client/static/js/toml-prjdc335.js +1 -0
- package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +1 -0
- package/dist/client/static/js/tsx-0p183w2f.js +1 -0
- package/dist/client/static/js/typescript-t9a5jyvv.js +1 -0
- package/dist/client/static/js/usecaseDiagram-POWQR4AR-6p8hf0b7.js +370 -0
- package/dist/client/static/js/vennDiagram-UO4OBE2U-7k5jsxf9.js +34 -0
- package/dist/client/static/js/vesper-0e7jx631.js +1 -0
- package/dist/client/static/js/vitesse-black-avx6j9e8.js +1 -0
- package/dist/client/static/js/vitesse-dark-5ypr9e1f.js +1 -0
- package/dist/client/static/js/vitesse-light-sze15mny.js +1 -0
- package/dist/client/static/js/vue-06rdf4wh.js +1 -0
- package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +1 -0
- package/dist/client/static/js/wardleyDiagram-VNRHLVJA-km2x4er8.js +78 -0
- package/dist/client/static/js/xml-81hxjjt4.js +1 -0
- package/dist/client/static/js/xml-f6syr877.js +1 -0
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-kr3sgr4m.js +7 -0
- package/dist/client/static/js/yaml-qwwswzvs.js +1 -0
- package/dist/client/static/js/yaml-yssayv8a.js +1 -0
- package/dist/client/static/js/zig-yf26r6vn.js +1 -0
- package/package.json +5 -2
- package/src/client/App.tsx +16 -0
- package/src/client/components/common/anchored-menu/index.test.tsx +3 -3
- package/src/client/components/common/anchored-menu/index.tsx +10 -16
- package/src/client/components/common/command-palette/ChordHint.tsx +36 -0
- package/src/client/components/common/command-palette/index.test.tsx +126 -0
- package/src/client/components/common/command-palette/index.tsx +216 -0
- package/src/client/components/common/context-usage-button/index.tsx +26 -17
- package/src/client/components/common/key-binding-cheatsheet/index.tsx +147 -0
- package/src/client/components/common/server-control/Panel.tsx +8 -9
- package/src/client/components/common/session-actions-menu/index.test.tsx +26 -0
- package/src/client/components/common/session-actions-menu/index.tsx +25 -16
- package/src/client/components/common/session-row/RunElapsed.tsx +50 -0
- package/src/client/components/common/session-row/TimeCell.tsx +38 -0
- package/src/client/components/common/session-row/TrailingSlot.tsx +26 -12
- package/src/client/components/common/session-row/index.tsx +5 -0
- package/src/client/components/common/session-row/session-row.test.tsx +26 -1
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +2 -0
- package/src/client/components/layout/desktop-layout/index.tsx +2 -2
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +2 -1
- package/src/client/components/layout/session-sidebar/Footer.tsx +13 -2
- package/src/client/components/layout/session-sidebar/SessionItem.test.ts +17 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +13 -7
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +20 -33
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +2 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +16 -26
- package/src/client/components/mobile/SessionSidebar.tsx +2 -0
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +122 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +25 -26
- package/src/client/components/mobile/mobile-session-sidebar/Footer.tsx +11 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +2 -1
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +10 -5
- package/src/client/components/mobile/worktree-session.ts +4 -1
- package/src/client/components/settings/Modal.tsx +3 -0
- package/src/client/components/settings/Sidebar.tsx +3 -2
- package/src/client/components/settings/categories/ChatSettings.test.tsx +2 -2
- package/src/client/components/settings/categories/ChatSettings.tsx +0 -2
- package/src/client/components/settings/categories/KeyboardSettings.tsx +31 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +9 -0
- package/src/client/components/settings/categories/SkillCatalogSettings.tsx +34 -16
- package/src/client/components/settings/categories/SkillSettings.tsx +22 -1
- package/src/client/components/settings/categories/chat-settings/groups.ts +2 -11
- package/src/client/components/settings/categories/{chat-settings/KeybindingsSection.tsx → keyboard-settings/ComposerKeys.tsx} +2 -2
- package/src/client/components/settings/categories/keyboard-settings/KeyRecorder.tsx +106 -0
- package/src/client/components/settings/categories/keyboard-settings/ShortcutTable.tsx +137 -0
- package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +13 -41
- package/src/client/components/settings/categories/skill-catalog/SkillCard.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/catalog-ui.test.tsx +3 -6
- package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +43 -2
- package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +9 -0
- package/src/client/components/settings/categories/skill-settings/pane.test.tsx +28 -0
- package/src/client/components/settings/categories/skill-settings/row-meta.ts +3 -0
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +16 -15
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +38 -5
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.wait.test.tsx +158 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +28 -33
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +24 -67
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.search.test.tsx +4 -2
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +101 -78
- package/src/client/components/workspace/chat-timeline/chat-input/props.ts +3 -3
- package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +11 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.test.tsx +20 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +5 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolScreenshots.test.tsx +113 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolScreenshots.tsx +198 -0
- package/src/client/components/workspace/editor/Body.tsx +0 -15
- package/src/client/components/workspace/editor/FileDocument.tsx +0 -26
- package/src/client/components/workspace/editor/FilePane.tsx +0 -15
- package/src/client/components/workspace/editor/Pane.tsx +4 -1
- package/src/client/components/workspace/editor/index.tsx +5 -8
- package/src/client/hooks/chat/btw/mode.ts +5 -1
- package/src/client/hooks/chat/omp/session-list.test.ts +13 -0
- package/src/client/hooks/chat/omp/session-list.tsx +33 -8
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +9 -3
- package/src/client/hooks/chat/timeline/new-chat.ts +4 -1
- package/src/client/hooks/chat/timeline/pending-dispatch.ts +6 -10
- package/src/client/hooks/chat/waiting/composer-wait.ts +2 -2
- package/src/client/hooks/chat/waiting/dispatch.ts +4 -1
- package/src/client/hooks/commands/use-command-catalog.ts +52 -0
- package/src/client/hooks/commands/use-command-context.ts +21 -0
- package/src/client/hooks/commands/use-command-runtime.test.ts +117 -0
- package/src/client/hooks/commands/use-command-runtime.ts +62 -0
- package/src/client/hooks/commands/use-overlays.ts +35 -0
- package/src/client/hooks/commands/use-palette-items.ts +156 -0
- package/src/client/hooks/commands/use-plugin-commands.ts +69 -0
- package/src/client/hooks/editor/find-harness.test-util.ts +20 -3
- package/src/client/hooks/editor/use-editor-command-target.ts +46 -0
- package/src/client/hooks/editor/use-editor-find.test.ts +4 -9
- package/src/client/hooks/editor/use-editor-panel-keys.ts +24 -93
- package/src/client/hooks/editor/use-editor-panel-ui.ts +0 -10
- package/src/client/hooks/settings/skill-catalog.ts +3 -3
- package/src/client/hooks/settings/skill-git-import.ts +3 -11
- package/src/client/hooks/ui/icon-style.ts +10 -5
- package/src/client/hooks/ui/notification-events.test.ts +126 -0
- package/src/client/hooks/ui/notification-events.ts +61 -0
- package/src/client/hooks/ui/second-tick.ts +55 -0
- package/src/client/hooks/ui/theme.ts +9 -5
- package/src/client/hooks/workspace/batch-delete-run.ts +5 -1
- package/src/client/hooks/workspace/commands.ts +51 -0
- package/src/client/hooks/workspace/session-delete.ts +5 -1
- package/src/client/lib/commands/context.ts +51 -0
- package/src/client/lib/commands/dispatcher.ts +101 -0
- package/src/client/lib/commands/editor-target.ts +36 -0
- package/src/client/lib/commands/keymap.test.ts +68 -0
- package/src/client/lib/commands/keymap.ts +151 -0
- package/src/client/lib/commands/overlays.ts +87 -0
- package/src/client/lib/commands/registry.ts +69 -0
- package/src/client/lib/notifications/os.test.ts +24 -0
- package/src/client/lib/notifications/os.ts +16 -0
- package/src/client/lib/notifications/watch.ts +48 -0
- package/src/client/lib/plugins/slots.ts +1 -0
- package/src/client/lib/router/branch-params.test.ts +62 -0
- package/src/client/lib/router/branch-params.ts +48 -0
- package/src/client/main.tsx +7 -0
- package/src/client/tailwind.css +5 -38
- package/src/server/db.server.test.ts +10 -4
- package/src/server/index.ts +12 -8
- package/src/server/lib/assets/shell-settings.server.test.ts +35 -0
- package/src/server/lib/assets/shell-settings.server.ts +33 -0
- package/src/server/lib/assets/theme-css.server.test.ts +58 -0
- package/src/server/lib/assets/theme-css.server.ts +52 -0
- package/src/server/lib/auth/guard.ts +6 -1
- package/src/server/lib/browser/runtime.test.ts +21 -16
- package/src/server/lib/db/client.test.ts +89 -0
- package/src/server/lib/db/client.ts +31 -0
- package/src/server/lib/db/compact-chat-overlay.ts +7 -1
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/db/workspace-sync.ts +7 -7
- package/src/server/lib/harness/acp/session-permissions.ts +4 -0
- package/src/server/lib/lifecycle/fd-pressure.test.ts +43 -0
- package/src/server/lib/lifecycle/fd-pressure.ts +38 -0
- package/src/server/lib/lifecycle/listener.ts +4 -4
- package/src/server/lib/lifecycle/shell-entry.server.ts +29 -0
- package/src/server/lib/lifecycle/shell-route.ts +5 -4
- package/src/server/lib/notifications/feed.server.test.ts +127 -0
- package/src/server/lib/notifications/feed.server.ts +195 -0
- package/src/server/lib/notifications/schema.server.ts +47 -0
- package/src/server/lib/notifications/store.server.test.ts +118 -0
- package/src/server/lib/notifications/store.server.ts +103 -0
- package/src/server/lib/observer-ws.test.ts +49 -0
- package/src/server/lib/observer-ws.ts +2 -1
- package/src/server/lib/omp/config/definitions.test.ts +17 -18
- package/src/server/lib/omp/config/skills-catalog.ts +109 -73
- package/src/server/lib/omp/config/skills-git-repo.ts +10 -12
- package/src/server/lib/omp/rpc/frame-fold-frames.test.ts +2 -0
- package/src/server/lib/omp/rpc/manager.ts +4 -1
- package/src/server/lib/omp/rpc/run-model.test.ts +2 -0
- package/src/server/lib/omp/session/sidebar-data.server.ts +1 -0
- package/src/server/lib/realtime/hub.server.test.ts +27 -1
- package/src/server/lib/realtime/hub.server.ts +6 -2
- package/src/server/lib/realtime/hub.types.ts +9 -1
- package/src/server/lib/realtime/topics/catalog.server.ts +5 -0
- package/src/server/lib/realtime/topics/peer-relay.server.test.ts +17 -14
- package/src/server/lib/realtime/topics.server.test.ts +2 -1
- package/src/server/plugins/shell.server.test.ts +4 -4
- package/src/server/plugins/shell.server.ts +83 -22
- package/src/server/plugins/ssr.ts +33 -19
- package/src/server/plugins/static.ts +5 -7
- package/src/server/routes/health/probe.ts +7 -8
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/notifications/index.ts +6 -0
- package/src/server/routes/notifications/stream.test.ts +116 -0
- package/src/server/routes/notifications/stream.ts +88 -0
- package/src/server/routes/settings/skills-catalog-actions.ts +11 -31
- package/src/server/routes/settings/skills.test.ts +14 -0
- package/src/server/routes/settings/skills.ts +29 -21
- package/src/shared/lib/code/highlight-cache.test.ts +19 -8
- package/src/shared/lib/commands/catalog.ts +114 -0
- package/src/shared/lib/commands/chord.test.ts +66 -0
- package/src/shared/lib/commands/chord.ts +193 -0
- package/src/shared/lib/commands/conflicts.test.ts +43 -0
- package/src/shared/lib/commands/conflicts.ts +53 -0
- package/src/shared/lib/commands/record.test.ts +24 -0
- package/src/shared/lib/commands/record.ts +44 -0
- package/src/shared/lib/commands/resolve.test.ts +54 -0
- package/src/shared/lib/commands/resolve.ts +45 -0
- package/src/shared/lib/commands/score.test.ts +41 -0
- package/src/shared/lib/commands/score.ts +53 -0
- package/src/shared/lib/commands/types.ts +60 -0
- package/src/shared/lib/commands/user-keybindings.test.ts +33 -0
- package/src/shared/lib/commands/user-keybindings.ts +64 -0
- package/src/shared/lib/commands/when.test.ts +46 -0
- package/src/shared/lib/commands/when.ts +221 -0
- package/src/shared/lib/icons/icon-paint-authority.test.ts +9 -0
- package/src/shared/lib/icons/icon-paint-authority.ts +25 -8
- package/src/shared/lib/notifications/events.test.ts +77 -0
- package/src/shared/lib/notifications/events.ts +104 -0
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +3 -2
- package/src/shared/lib/omp/session/schema-migrations.ts +4 -0
- package/src/shared/lib/omp/session/stream-state.server.test.ts +37 -1
- package/src/shared/lib/omp/session/stream-state.server.ts +42 -5
- package/src/shared/lib/omp/skill-source.test.ts +24 -0
- package/src/shared/lib/omp/skill-source.ts +20 -0
- package/src/shared/lib/panels/slot-labels.ts +6 -1
- package/src/shared/lib/realtime/protocol.ts +11 -0
- package/src/shared/lib/theme/css.ts +11 -0
- package/src/shared/lib/ui/menu-anchor.test.ts +17 -5
- package/src/shared/lib/ui/menu-anchor.ts +22 -5
- package/src/shared/lib/workspace/refresh-cadence.test.ts +34 -1
- package/src/shared/lib/workspace/relative-time.ts +22 -0
- package/src/shared/types/realtime.ts +10 -0
- package/src/shared/types/settings/skill.ts +1 -9
- package/src/shared/types/settings/state.ts +1 -0
- package/src/shared/types/workspace.ts +5 -0
- package/src/test-support/peer-harness.ts +40 -6
- package/dist/client/static/js/index-naa91727.css +0 -1
- package/dist/client/static/js/index-r3bhgvkt.js +0 -5696
- package/src/client/components/layout/session-sidebar/new-session-context.test.ts +0 -55
- package/src/client/components/workspace/editor/CommandPalette.test.ts +0 -242
- package/src/client/components/workspace/editor/CommandPalette.tsx +0 -138
- package/src/client/components/workspace/editor/QuickOpenModal.tsx +0 -146
- package/src/client/hooks/ui/input-required-alert.ts +0 -50
- package/src/client/hooks/ui/notifications.ts +0 -54
- package/src/client/hooks/ui/run-outcome-alert.ts +0 -48
- package/src/client/hooks/ui/ui-alert.test.ts +0 -235
- package/src/client/hooks/workspace/keybindings.ts +0 -44
- package/src/shared/lib/notifications/outcomes.test.ts +0 -96
- package/src/shared/lib/notifications/outcomes.ts +0 -64
- package/src/shared/lib/ui/mobile-overlay.ts +0 -61
|
@@ -3,7 +3,6 @@ import type { RefObject } from 'preact';
|
|
|
3
3
|
import { PreviewPane } from '@/client/components/workspace/editor/PreviewPane';
|
|
4
4
|
import { CodeSurface, type CodeSurfaceHandle } from '@/client/components/common/code-surface';
|
|
5
5
|
import { FindWidget } from '@/client/components/workspace/editor/FindWidget';
|
|
6
|
-
import { CommandPalette } from '@/client/components/workspace/editor/CommandPalette';
|
|
7
6
|
import { useScrollRestore } from '@/client/hooks/editor/use-scroll-restore';
|
|
8
7
|
import { useHeadingJump } from '@/client/hooks/editor/use-heading-jump';
|
|
9
8
|
import { indentUnitFor, useEditorIndent } from '@/client/hooks/editor/indent-settings';
|
|
@@ -11,7 +10,6 @@ import { useEditorTyping } from '@/client/hooks/editor/typing-settings';
|
|
|
11
10
|
import { EditorStatusBar } from '@/client/components/workspace/editor/StatusBar';
|
|
12
11
|
import { useWheelZoom } from '@/client/hooks/editor/wheel-zoom';
|
|
13
12
|
import { GoToLineModal } from '@/client/components/workspace/editor/GoToLineModal';
|
|
14
|
-
import { QuickOpenModal } from '@/client/components/workspace/editor/QuickOpenModal';
|
|
15
13
|
import type { CaretPosition } from '@/client/hooks/editor/caret-position';
|
|
16
14
|
import { lineStartOffset } from '@/shared/lib/code/editor/lines';
|
|
17
15
|
import type { UseFileEditorResult } from '@/client/hooks/editor/use-file-editor';
|
|
@@ -30,14 +28,9 @@ interface FileDocumentProps {
|
|
|
30
28
|
editor: UseFileEditorResult;
|
|
31
29
|
find: EditorFindState;
|
|
32
30
|
surfaceRef: RefObject<CodeSurfaceHandle>;
|
|
33
|
-
paletteOpen: boolean;
|
|
34
|
-
onClosePalette: () => void;
|
|
35
31
|
/** Bumped when the user asks for "go to line"; a counter, so one bump is one open. */
|
|
36
32
|
goToLineRequest: number;
|
|
37
33
|
/** The file picker is open. */
|
|
38
|
-
quickOpen: boolean;
|
|
39
|
-
onCloseQuickOpen: () => void;
|
|
40
|
-
onOpenPath?: (path: string) => void;
|
|
41
34
|
rootPath?: string | null;
|
|
42
35
|
repoPath?: string | null;
|
|
43
36
|
onRunCommand: (command: EditorCommand) => void;
|
|
@@ -78,12 +71,7 @@ export function FileDocument({
|
|
|
78
71
|
editor,
|
|
79
72
|
find,
|
|
80
73
|
surfaceRef,
|
|
81
|
-
paletteOpen,
|
|
82
|
-
onClosePalette,
|
|
83
74
|
goToLineRequest,
|
|
84
|
-
quickOpen,
|
|
85
|
-
onCloseQuickOpen,
|
|
86
|
-
onOpenPath,
|
|
87
75
|
rootPath = null,
|
|
88
76
|
repoPath = null,
|
|
89
77
|
onRunCommand,
|
|
@@ -199,20 +187,6 @@ export function FileDocument({
|
|
|
199
187
|
return (
|
|
200
188
|
<div className="relative flex-1 min-h-0 flex flex-col">
|
|
201
189
|
{find.open ? <FindWidget find={find} /> : null}
|
|
202
|
-
{paletteOpen ? <CommandPalette onRun={onRunCommand} onClose={onClosePalette} /> : null}
|
|
203
|
-
{quickOpen && onOpenPath ? (
|
|
204
|
-
<QuickOpenModal
|
|
205
|
-
root={rootPath}
|
|
206
|
-
repo={repoPath}
|
|
207
|
-
onOpen={(path) => {
|
|
208
|
-
onCloseQuickOpen();
|
|
209
|
-
// Through `handleOpenFile`, so the tab gets the id scheme every other
|
|
210
|
-
// opener shares rather than one computed here.
|
|
211
|
-
onOpenPath(path);
|
|
212
|
-
}}
|
|
213
|
-
onClose={onCloseQuickOpen}
|
|
214
|
-
/>
|
|
215
|
-
) : null}
|
|
216
190
|
{goToLineOpen ? (
|
|
217
191
|
<GoToLineModal
|
|
218
192
|
lineCount={editor.content ? editor.content.split('\n').length : 1}
|
|
@@ -37,16 +37,11 @@ interface FilePaneProps {
|
|
|
37
37
|
setIsMaximized: (next: boolean) => void;
|
|
38
38
|
zoomLevel: number;
|
|
39
39
|
setZoomLevel: (update: (current: number) => number) => void;
|
|
40
|
-
paletteOpen: boolean;
|
|
41
|
-
setPaletteOpen: (open: boolean) => void;
|
|
42
40
|
/** Bumped when the user asks for "go to line"; this pane owns the dialog. */
|
|
43
41
|
goToLineRequest: number;
|
|
44
42
|
/** Open the Save As dialog. */
|
|
45
43
|
onSaveAs: () => void;
|
|
46
44
|
/** The file picker is open. */
|
|
47
|
-
quickOpen: boolean;
|
|
48
|
-
onCloseQuickOpen: () => void;
|
|
49
|
-
onOpenPath?: (path: string) => void;
|
|
50
45
|
rootPath?: string | null;
|
|
51
46
|
repoPath?: string | null;
|
|
52
47
|
runCommand: (command: EditorCommand) => void;
|
|
@@ -90,13 +85,8 @@ export function FilePane({
|
|
|
90
85
|
setIsMaximized,
|
|
91
86
|
zoomLevel,
|
|
92
87
|
setZoomLevel,
|
|
93
|
-
paletteOpen,
|
|
94
|
-
setPaletteOpen,
|
|
95
88
|
goToLineRequest,
|
|
96
89
|
onSaveAs,
|
|
97
|
-
quickOpen,
|
|
98
|
-
onCloseQuickOpen,
|
|
99
|
-
onOpenPath,
|
|
100
90
|
rootPath = null,
|
|
101
91
|
repoPath = null,
|
|
102
92
|
runCommand,
|
|
@@ -315,12 +305,7 @@ export function FilePane({
|
|
|
315
305
|
editor={editor}
|
|
316
306
|
find={find}
|
|
317
307
|
surfaceRef={surfaceRef}
|
|
318
|
-
paletteOpen={paletteOpen}
|
|
319
|
-
onClosePalette={() => setPaletteOpen(false)}
|
|
320
308
|
goToLineRequest={goToLineRequest}
|
|
321
|
-
quickOpen={quickOpen}
|
|
322
|
-
onCloseQuickOpen={onCloseQuickOpen}
|
|
323
|
-
onOpenPath={onOpenPath}
|
|
324
309
|
rootPath={rootPath}
|
|
325
310
|
repoPath={repoPath}
|
|
326
311
|
onRunCommand={runCommand}
|
|
@@ -36,6 +36,8 @@ interface EditorPaneProps {
|
|
|
36
36
|
className?: string;
|
|
37
37
|
isMaximized: boolean;
|
|
38
38
|
onKeyDownCapture: (event: never) => void;
|
|
39
|
+
/** Publish this pane as the target of the global editor commands. */
|
|
40
|
+
onFocusCapture: () => void;
|
|
39
41
|
asSplitPane: boolean;
|
|
40
42
|
/** The tab strip. Dropped in a split pane. */
|
|
41
43
|
tabs: ComponentChildren;
|
|
@@ -59,6 +61,7 @@ export function EditorPane({
|
|
|
59
61
|
className = '',
|
|
60
62
|
isMaximized,
|
|
61
63
|
onKeyDownCapture,
|
|
64
|
+
onFocusCapture,
|
|
62
65
|
asSplitPane,
|
|
63
66
|
tabs,
|
|
64
67
|
activeFile,
|
|
@@ -78,7 +81,7 @@ export function EditorPane({
|
|
|
78
81
|
: `flex flex-col h-full bg-canvas ${className}`;
|
|
79
82
|
|
|
80
83
|
return (
|
|
81
|
-
<div className={containerClass} onKeyDownCapture={onKeyDownCapture}>
|
|
84
|
+
<div className={containerClass} onKeyDownCapture={onKeyDownCapture} onFocusCapture={onFocusCapture}>
|
|
82
85
|
{asSplitPane ? null : tabs}
|
|
83
86
|
|
|
84
87
|
<EditorNotices
|
|
@@ -25,6 +25,7 @@ import { EditorPane } from '@/client/components/workspace/editor/Pane';
|
|
|
25
25
|
import { SplitColumn } from '@/client/components/workspace/editor/SplitColumn';
|
|
26
26
|
import { useSplitEditor } from '@/client/hooks/editor/use-split-editor';
|
|
27
27
|
import { useEditorPanelKeys } from '@/client/hooks/editor/use-editor-panel-keys';
|
|
28
|
+
import { useEditorCommandTarget } from '@/client/hooks/editor/use-editor-command-target';
|
|
28
29
|
import { useCloseGuard } from '@/client/hooks/editor/use-close-guard';
|
|
29
30
|
import { useFileReviewMode } from '@/client/hooks/editor/use-file-review-mode';
|
|
30
31
|
import { useEditorPanelUi } from '@/client/hooks/editor/use-editor-panel-ui';
|
|
@@ -206,13 +207,12 @@ export function Editor({
|
|
|
206
207
|
|
|
207
208
|
const panelKeys = useEditorPanelKeys({
|
|
208
209
|
find,
|
|
209
|
-
paletteOpen: panelUi.paletteOpen,
|
|
210
|
-
setPaletteOpen: panelUi.setPaletteOpen,
|
|
211
210
|
runCommand,
|
|
212
|
-
saveNow: editor.saveNow,
|
|
213
|
-
openQuickOpen: () => panelUi.setQuickOpen(true),
|
|
214
211
|
reopenClosed: onReopenClosed,
|
|
215
212
|
});
|
|
213
|
+
// The focused pane is what `workspace.saveFile` and the palette's editor rows
|
|
214
|
+
// act on. Published on focus, because a split column mounts two panes.
|
|
215
|
+
const editorTarget = useEditorCommandTarget({ saveNow: editor.saveNow, runCommand });
|
|
216
216
|
|
|
217
217
|
// The column belongs to a plugin while the layout says so. There is no tab
|
|
218
218
|
// strip in that mode: the plugin owns the whole surface, the way a right-panel
|
|
@@ -247,12 +247,8 @@ export function Editor({
|
|
|
247
247
|
setIsMaximized,
|
|
248
248
|
zoomLevel,
|
|
249
249
|
setZoomLevel,
|
|
250
|
-
paletteOpen: panelUi.paletteOpen,
|
|
251
|
-
setPaletteOpen: panelUi.setPaletteOpen,
|
|
252
250
|
goToLineRequest: panelUi.goToLineRequest,
|
|
253
251
|
onSaveAs: () => panelUi.setSaveAsOpen(true),
|
|
254
|
-
quickOpen: panelUi.quickOpen,
|
|
255
|
-
onCloseQuickOpen: () => panelUi.setQuickOpen(false),
|
|
256
252
|
onOpenPath,
|
|
257
253
|
rootPath,
|
|
258
254
|
repoPath,
|
|
@@ -308,6 +304,7 @@ export function Editor({
|
|
|
308
304
|
className={className}
|
|
309
305
|
isMaximized={isMaximized}
|
|
310
306
|
onKeyDownCapture={panelKeys.onKeyDownCapture}
|
|
307
|
+
onFocusCapture={editorTarget.onFocusCapture}
|
|
311
308
|
asSplitPane={asSplitPane}
|
|
312
309
|
tabs={tabs}
|
|
313
310
|
activeFile={activeFile}
|
|
@@ -26,6 +26,7 @@ import { useBtwSession, type BtwLiveAnswer } from '@/client/hooks/chat/btw';
|
|
|
26
26
|
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
27
27
|
import { useSessionState } from '@/client/hooks/workspace/session-state';
|
|
28
28
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
29
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
29
30
|
import { PHASE_VERBS } from '@/shared/lib/chat/timeline/tool-phrases';
|
|
30
31
|
|
|
31
32
|
/** Question sent when a question arrived carrying only images. */
|
|
@@ -152,7 +153,10 @@ export function useBtwMode(sessionId: string | null): BtwMode {
|
|
|
152
153
|
setOpen(false);
|
|
153
154
|
setSelectedTopicId(null);
|
|
154
155
|
setSearchParams((prev) => {
|
|
155
|
-
|
|
156
|
+
// The promoted topic is a real session, not the draft whose branch hints
|
|
157
|
+
// may still be in the URL (a backed-out fork) — they would describe it as
|
|
158
|
+
// a fork of another chat.
|
|
159
|
+
const next = clearBranchParams(prev);
|
|
156
160
|
next.set('sessionId', created);
|
|
157
161
|
if (next.has('subagent')) next.delete('subagent');
|
|
158
162
|
return next;
|
|
@@ -66,6 +66,19 @@ describe('SidebarDataProvider reads both sidebar topics', () => {
|
|
|
66
66
|
expect(renderedStatus(harness.holder.api)).toBeUndefined();
|
|
67
67
|
harness.server.stop();
|
|
68
68
|
});
|
|
69
|
+
|
|
70
|
+
test('carries the live run start, and drops it with the run', async () => {
|
|
71
|
+
const harness = await mountProvider();
|
|
72
|
+
const startedAt = 1_700_000_000_000;
|
|
73
|
+
await harness.push(undefined, { 'omp-1': { streamStatus: 'stream', runStartedAt: startedAt } });
|
|
74
|
+
// The row's clock counts from the server's start, so a reload or a second
|
|
75
|
+
// tab resumes the same number instead of restarting at zero.
|
|
76
|
+
expect(harness.holder.api?.runStartedAtMap['omp-1']).toBe(startedAt);
|
|
77
|
+
|
|
78
|
+
await harness.push(undefined, { 'omp-1': { streamStatus: 'finish' } });
|
|
79
|
+
expect(harness.holder.api?.runStartedAtMap['omp-1']).toBeUndefined();
|
|
80
|
+
harness.server.stop();
|
|
81
|
+
});
|
|
69
82
|
});
|
|
70
83
|
|
|
71
84
|
/**
|
|
@@ -29,8 +29,7 @@ import { createContext } from 'preact/compat';
|
|
|
29
29
|
import type { ReactNode } from 'preact/compat';
|
|
30
30
|
import { useRealtimeTopic } from '@/client/hooks/ui/realtime';
|
|
31
31
|
import { useSidebarFullReload } from '@/client/hooks/chat/omp/sidebar-reload';
|
|
32
|
-
import {
|
|
33
|
-
import { useRunOutcomeAlert } from '@/client/hooks/ui/run-outcome-alert';
|
|
32
|
+
import { useNotificationEvents } from '@/client/hooks/ui/notification-events';
|
|
34
33
|
|
|
35
34
|
import { realtimeClient } from '@/shared/lib/realtime/client';
|
|
36
35
|
import { TOPIC_SIDEBAR, TOPIC_SIDEBAR_ACTIVITY, TOPIC_SIDEBAR_STATUS } from '@/shared/lib/realtime/protocol';
|
|
@@ -102,6 +101,15 @@ export interface SidebarDataHandle {
|
|
|
102
101
|
* read the same answer.
|
|
103
102
|
*/
|
|
104
103
|
streamStatusMap: Record<string, 'stream' | 'finish' | 'abort'>;
|
|
104
|
+
/**
|
|
105
|
+
* Epoch ms each LIVE run entered `stream`, keyed like `streamStatusMap`.
|
|
106
|
+
*
|
|
107
|
+
* A separate map rather than a richer status value: every consumer compares
|
|
108
|
+
* the status to the literal `'stream'`, and widening that map would make
|
|
109
|
+
* those comparisons silently truthy for a terminal badge. Built from the same
|
|
110
|
+
* payload at the same moment, so the two cannot describe different runs.
|
|
111
|
+
*/
|
|
112
|
+
runStartedAtMap: Record<string, number>;
|
|
105
113
|
/**
|
|
106
114
|
* Text the user just sent for this session, shown by the sidebar's
|
|
107
115
|
* PLACEHOLDER row while omp's transcript scan cannot name the session yet
|
|
@@ -209,12 +217,11 @@ export function SidebarDataProvider({ children, initialFolders = [] }: { childre
|
|
|
209
217
|
// Without this the list moved with nothing on screen saying so.
|
|
210
218
|
const isRefreshing = refreshing || structure.refreshing || activity.refreshing;
|
|
211
219
|
|
|
212
|
-
//
|
|
213
|
-
//
|
|
214
|
-
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
useRunOutcomeAlert(folders);
|
|
220
|
+
// Every system banner the server records, in every session — including one
|
|
221
|
+
// this tab never opened. The events are decided by the server (see
|
|
222
|
+
// `hooks/ui/notification-events`), not inferred from this list, so a page that
|
|
223
|
+
// was frozen while they happened cannot replay them as a burst.
|
|
224
|
+
useNotificationEvents();
|
|
218
225
|
|
|
219
226
|
const markSeen = useCallback((sessionId: number | string) => {
|
|
220
227
|
const key = String(sessionId);
|
|
@@ -256,6 +263,22 @@ export function SidebarDataProvider({ children, initialFolders = [] }: { childre
|
|
|
256
263
|
for (const [id, entry] of Object.entries(status.data ?? {})) {
|
|
257
264
|
if (entry.streamStatus) streamStatusMap[id] = entry.streamStatus;
|
|
258
265
|
}
|
|
266
|
+
// The start of each live run, from the same two sources and in the same
|
|
267
|
+
// pass: a row's clock must not restart when the structure scan catches up
|
|
268
|
+
// with a run the status payload already named.
|
|
269
|
+
const runStartedAtMap: Record<string, number> = {};
|
|
270
|
+
for (const folder of folders) {
|
|
271
|
+
for (const session of folder.sessions ?? []) {
|
|
272
|
+
if (session.streamStatus === 'stream' && typeof session.runStartedAt === 'number') {
|
|
273
|
+
runStartedAtMap[String(session.id)] = session.runStartedAt;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
for (const [id, entry] of Object.entries(status.data ?? {})) {
|
|
278
|
+
if (entry.streamStatus === 'stream' && typeof entry.runStartedAt === 'number') {
|
|
279
|
+
runStartedAtMap[id] = entry.runStartedAt;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
259
282
|
// The one overlay: a one-shot terminal badge this mount already acked. It
|
|
260
283
|
// can only REMOVE a status — `stream` itself is never invented client-side,
|
|
261
284
|
// so the spinner and the generating indicator stop when the server's row
|
|
@@ -267,6 +290,7 @@ export function SidebarDataProvider({ children, initialFolders = [] }: { childre
|
|
|
267
290
|
return {
|
|
268
291
|
folders: stripped,
|
|
269
292
|
streamStatusMap,
|
|
293
|
+
runStartedAtMap,
|
|
270
294
|
isMock,
|
|
271
295
|
initializing,
|
|
272
296
|
failed,
|
|
@@ -295,6 +319,7 @@ export function useSidebarData(): SidebarDataHandle {
|
|
|
295
319
|
return {
|
|
296
320
|
folders: [],
|
|
297
321
|
streamStatusMap: {},
|
|
322
|
+
runStartedAtMap: {},
|
|
298
323
|
isMock: false,
|
|
299
324
|
initializing: true,
|
|
300
325
|
// No provider means no channel was ever asked; claiming a failure would be
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
24
24
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
25
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
25
26
|
import { DEFAULT_SESSION_SORT_OPTION, isValidSessionSortOption, sortFolders } from '@/shared/lib/workspace/sidebar-sort';
|
|
26
27
|
import { useSessionStatusAck } from '@/client/hooks/chat/omp/session-statuses';
|
|
27
28
|
import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
|
|
@@ -250,10 +251,15 @@ export function useSessionSidebarController(
|
|
|
250
251
|
onSelectSession(id);
|
|
251
252
|
} else {
|
|
252
253
|
setSearchParams(prev => {
|
|
253
|
-
|
|
254
|
+
// The branch hints belong to a PENDING draft's URL. Selecting a real
|
|
255
|
+
// session must not leave them behind: they would describe this chat as
|
|
256
|
+
// a fork of another, and the next New Session would inherit the source
|
|
257
|
+
// transcript the user already backed out of.
|
|
258
|
+
const next = clearBranchParams(prev);
|
|
259
|
+
next.set('sessionId', id.toString());
|
|
254
260
|
// Navigating away from a session must also exit its transcript view.
|
|
255
|
-
if (
|
|
256
|
-
return
|
|
261
|
+
if (next.has('subagent')) next.delete('subagent');
|
|
262
|
+
return next;
|
|
257
263
|
}, { replace: true });
|
|
258
264
|
}
|
|
259
265
|
onAfterSelect?.();
|
|
@@ -25,6 +25,7 @@ import { useCallback, useEffect, useRef } from 'preact/hooks';
|
|
|
25
25
|
import type { Dispatch, SetStateAction } from 'preact/compat';
|
|
26
26
|
import type { Attachment, ChatMessageData, PromptDispatchResult, WorkspaceFolderData } from '@/shared/types';
|
|
27
27
|
import type { SetSearchParams } from '@/client/lib/router/search-params';
|
|
28
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
28
29
|
import { activeProjectForSession } from '@/shared/lib/workspace/active-project';
|
|
29
30
|
import { startPendingSession, patchPendingEntry } from '@/client/hooks/chat/omp/pending-sessions';
|
|
30
31
|
import { setHarnessPick } from '@/client/hooks/chat/timeline/session-harness';
|
|
@@ -82,7 +83,9 @@ export function useNewChatSubmit(
|
|
|
82
83
|
}
|
|
83
84
|
parkedRef.current = { pendingId, text, attachments, ...(harness ? { harness } : {}) };
|
|
84
85
|
setSearchParams((prev) => {
|
|
85
|
-
|
|
86
|
+
// New Chat starts a top-level chat: a fork that was backed out of left
|
|
87
|
+
// `forkFrom`/`forkAt` in the URL, and this chat would be drawn as it.
|
|
88
|
+
const next = clearBranchParams(prev);
|
|
86
89
|
next.set('sessionId', pendingId);
|
|
87
90
|
// Carry the workspace the chat was started from: the first send SPAWNS a
|
|
88
91
|
// real omp session in that folder's cwd, and a dialog opened from a
|
|
@@ -20,6 +20,7 @@ import type { Attachment, ChatMessageData, PromptDispatchResult } from '@/shared
|
|
|
20
20
|
import type { ArmedGoal } from '@/shared/lib/omp/mode/actions';
|
|
21
21
|
import type { ChatTimelineSendDeps } from '@/client/hooks/chat/timeline/send-props';
|
|
22
22
|
import { adoptPendingSession, pendingEntryFor } from '@/client/hooks/chat/omp/pending-sessions';
|
|
23
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
23
24
|
import { recordSpawnHarness } from '@/client/hooks/chat/timeline/spawn-harness';
|
|
24
25
|
import { childSpawnBody } from '@/client/hooks/chat/timeline/child-spawn';
|
|
25
26
|
import { forkRequestBody } from '@/client/hooks/chat/timeline/fork-request';
|
|
@@ -184,11 +185,8 @@ export async function dispatchPendingChat(
|
|
|
184
185
|
deps.pendingHarnessRef.current = null;
|
|
185
186
|
persistUserTurn(body.sessionId, input.newUserMsg);
|
|
186
187
|
deps.setSearchParams((prev) => {
|
|
187
|
-
const next =
|
|
188
|
+
const next = clearBranchParams(prev);
|
|
188
189
|
next.set('sessionId', body.sessionId!);
|
|
189
|
-
next.delete('forkFrom');
|
|
190
|
-
next.delete('forkAt');
|
|
191
|
-
next.delete('parentSessionId');
|
|
192
190
|
return next;
|
|
193
191
|
}, { replace: true });
|
|
194
192
|
prependInheritedHistory(
|
|
@@ -243,11 +241,10 @@ export async function dispatchPendingChat(
|
|
|
243
241
|
deps.pendingHarnessRef.current = null;
|
|
244
242
|
persistUserTurn(body.sessionId, input.newUserMsg);
|
|
245
243
|
deps.setSearchParams((prev) => {
|
|
246
|
-
|
|
244
|
+
// The branch hints belonged to the pending chat; a real session's URL must
|
|
245
|
+
// not keep them, or the next draft opened here is read as this branch.
|
|
246
|
+
const next = clearBranchParams(prev);
|
|
247
247
|
next.set('sessionId', body.sessionId!);
|
|
248
|
-
// The parameter belonged to the pending chat; a real session's URL must
|
|
249
|
-
// not keep a stale parent hint for a later pending chat.
|
|
250
|
-
next.delete('parentSessionId');
|
|
251
248
|
return next;
|
|
252
249
|
}, { replace: true });
|
|
253
250
|
return { ok: true, busy: false };
|
|
@@ -292,9 +289,8 @@ export async function dispatchPendingChat(
|
|
|
292
289
|
deps.pendingHarnessRef.current = null;
|
|
293
290
|
persistUserTurn(session.sessionId, input.newUserMsg);
|
|
294
291
|
deps.setSearchParams((prev) => {
|
|
295
|
-
const next =
|
|
292
|
+
const next = clearBranchParams(prev);
|
|
296
293
|
next.set('sessionId', session.sessionId);
|
|
297
|
-
next.delete('parentSessionId');
|
|
298
294
|
return next;
|
|
299
295
|
}, { replace: true });
|
|
300
296
|
return { ok: true, busy: false };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Two facts have to agree: the candidates are the sessions with a run in flight
|
|
10
10
|
* (never this chat), and the held banner belongs to whichever chat the row
|
|
11
|
-
* names. Keeping them in one hook is what stops the
|
|
11
|
+
* names. Keeping them in one hook is what stops the header picker and the
|
|
12
12
|
* banner from reading two different lists — and it keeps `ChatTimeline` under
|
|
13
13
|
* the per-file ceiling.
|
|
14
14
|
*/
|
|
@@ -33,7 +33,7 @@ export interface ComposerWaitOptions {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface ComposerWait {
|
|
36
|
-
/** Props for the composer
|
|
36
|
+
/** Props for the composer header's picker. */
|
|
37
37
|
waiting: {
|
|
38
38
|
value: WaitingCandidate | null;
|
|
39
39
|
candidates: WaitingCandidate[];
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import { markPendingSessionDraft, pendingSessionWait } from '@/client/hooks/chat/omp/pending-waiting';
|
|
26
26
|
import { restoreHeldDraft } from '@/client/hooks/chat/waiting/restore';
|
|
27
27
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
28
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
28
29
|
import type { ToastTone } from '@/shared/lib/ui/toast-duration';
|
|
29
30
|
|
|
30
31
|
export interface WaitingDispatchOptions {
|
|
@@ -74,7 +75,9 @@ export function useWaitingDispatch({ onNotice }: WaitingDispatchOptions = {}): v
|
|
|
74
75
|
// while the dispatch happened elsewhere.
|
|
75
76
|
setSearchParams((prev) => {
|
|
76
77
|
if (prev.get('sessionId') !== pendingId) return prev;
|
|
77
|
-
|
|
78
|
+
// The real session now owns this chat; the draft's branch hints do
|
|
79
|
+
// not belong to it (its fork/child edge is already in the store).
|
|
80
|
+
const next = clearBranchParams(prev);
|
|
78
81
|
next.set('sessionId', prompt.sessionId as string);
|
|
79
82
|
return next;
|
|
80
83
|
}, { replace: true });
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The command catalog and the effective keymap, as a reactive read.
|
|
8
|
+
*
|
|
9
|
+
* Both stores publish on change (a plugin registering a command, a user
|
|
10
|
+
* remapping one), and every surface that lists commands — the palette, the
|
|
11
|
+
* settings table, the cheatsheet — needs the same fresh answer. One hook, so
|
|
12
|
+
* the three cannot disagree about what exists.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { useEffect, useMemo, useState } from 'preact/hooks';
|
|
16
|
+
import { formatChord } from '@/shared/lib/commands/chord';
|
|
17
|
+
import type { CommandMeta, KeybindingRule, UserKeybindings } from '@/shared/lib/commands/types';
|
|
18
|
+
import { isMacPlatform } from '@/shared/lib/util/platform';
|
|
19
|
+
import { allCommands, effectiveRules, subscribeKeymap, userKeybindings } from '@/client/lib/commands/keymap';
|
|
20
|
+
import { subscribeCommands } from '@/client/lib/commands/registry';
|
|
21
|
+
|
|
22
|
+
export interface CommandCatalog {
|
|
23
|
+
commands: readonly CommandMeta[];
|
|
24
|
+
rules: KeybindingRule[];
|
|
25
|
+
/** command id → the chord it currently answers to, printed. */
|
|
26
|
+
chords: Map<string, string>;
|
|
27
|
+
/** The user's overrides, so a table can mark a row as custom. */
|
|
28
|
+
overrides: UserKeybindings;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function useCommandCatalog(): CommandCatalog {
|
|
32
|
+
const [version, setVersion] = useState(0);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const bump = () => setVersion((previous) => previous + 1);
|
|
36
|
+
const offRegistry = subscribeCommands(bump);
|
|
37
|
+
const offKeymap = subscribeKeymap(bump);
|
|
38
|
+
return () => {
|
|
39
|
+
offRegistry();
|
|
40
|
+
offKeymap();
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
return useMemo(() => {
|
|
45
|
+
const isMac = isMacPlatform();
|
|
46
|
+
const rules = effectiveRules();
|
|
47
|
+
const chords = new Map<string, string>();
|
|
48
|
+
for (const rule of rules) chords.set(rule.command, formatChord(rule.chord, isMac));
|
|
49
|
+
return { commands: allCommands(), rules, chords, overrides: userKeybindings() };
|
|
50
|
+
// `version` is the subscription's signal; the stores are read fresh here.
|
|
51
|
+
}, [version]);
|
|
52
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useEffect } from 'preact/hooks';
|
|
7
|
+
import { setCommandContext } from '@/client/lib/commands/context';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Publish one context key for as long as the calling component is mounted.
|
|
11
|
+
*
|
|
12
|
+
* The cleanup writes `undefined` rather than `false`: a key nobody publishes
|
|
13
|
+
* must read as absent, so a `when` clause naming it is false instead of
|
|
14
|
+
* accidentally true.
|
|
15
|
+
*/
|
|
16
|
+
export function useCommandContext(key: string, value: boolean | string | number | undefined): void {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setCommandContext(key, value);
|
|
19
|
+
return () => setCommandContext(key, undefined);
|
|
20
|
+
}, [key, value]);
|
|
21
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The app-wide command runtime, and the one owner `editor.run` has.
|
|
8
|
+
*
|
|
9
|
+
* A split column mounts the editor panel TWICE, and each pane used to register
|
|
10
|
+
* `editor.run` itself. The second registration threw `command "editor.run" is
|
|
11
|
+
* already registered`, and Bun's dev overlay drew that error over the whole
|
|
12
|
+
* viewport — so the editor split spec's next click was intercepted by
|
|
13
|
+
* `<bun-hmr>` and timed out. These cases pin both halves of the shape that
|
|
14
|
+
* replaced it: the runtime is the only registrant, and the command reaches the
|
|
15
|
+
* pane the user last focused.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { afterAll, afterEach, describe, expect, test } from 'bun:test';
|
|
19
|
+
import { Window } from 'happy-dom';
|
|
20
|
+
import { h, render } from 'preact';
|
|
21
|
+
import { act } from 'preact/test-utils';
|
|
22
|
+
|
|
23
|
+
import { useCommandRuntime } from '@/client/hooks/commands/use-command-runtime';
|
|
24
|
+
import { useEditorCommandTarget } from '@/client/hooks/editor/use-editor-command-target';
|
|
25
|
+
import { useEditorPanelKeys } from '@/client/hooks/editor/use-editor-panel-keys';
|
|
26
|
+
import { hasCommand, runCommand } from '@/client/lib/commands/registry';
|
|
27
|
+
import type { EditorFindState } from '@/client/hooks/editor/use-editor-find';
|
|
28
|
+
import type { EditorCommand } from '@/shared/lib/code/editor/keymap';
|
|
29
|
+
|
|
30
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'HTMLElement', 'Element', 'Node', 'Event', 'CustomEvent'] as const;
|
|
31
|
+
const win = new Window({ url: 'http://localhost' });
|
|
32
|
+
const native: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
33
|
+
for (const key of DOM_GLOBALS) {
|
|
34
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
35
|
+
native[key] = target[key];
|
|
36
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Each mounted pane's focus publisher, so a case can focus one by name. */
|
|
40
|
+
const focus: Record<string, () => void> = {};
|
|
41
|
+
let container: HTMLDivElement;
|
|
42
|
+
|
|
43
|
+
afterAll(() => {
|
|
44
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
45
|
+
for (const key of DOM_GLOBALS) target[key] = native[key];
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
afterEach(() => {
|
|
49
|
+
render(null, container);
|
|
50
|
+
container.remove();
|
|
51
|
+
for (const key of Object.keys(focus)) delete focus[key];
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/** A stand-in for `Editor`: it mounts the panel keys AND publishes a target. */
|
|
55
|
+
function Pane({ name, log }: { name: string; log: string[] }) {
|
|
56
|
+
const runCommand = (command: EditorCommand) => log.push(`${name}:${command}`);
|
|
57
|
+
// The keys hook only ever reads `find` inside its callbacks, and no case here
|
|
58
|
+
// dispatches a key, so an empty surface is enough to mount it for real.
|
|
59
|
+
useEditorPanelKeys({ find: null as unknown as EditorFindState, runCommand });
|
|
60
|
+
const target = useEditorCommandTarget({
|
|
61
|
+
saveNow: () => log.push(`${name}:save`),
|
|
62
|
+
runCommand,
|
|
63
|
+
});
|
|
64
|
+
focus[name] = target.onFocusCapture;
|
|
65
|
+
return h('div', { 'data-pane': name });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function mount(log: string[]): void {
|
|
69
|
+
container = document.createElement('div') as unknown as HTMLDivElement;
|
|
70
|
+
document.body.appendChild(container as never);
|
|
71
|
+
function App() {
|
|
72
|
+
useCommandRuntime();
|
|
73
|
+
// Two panes, exactly like a split column.
|
|
74
|
+
return h('div', null, h(Pane, { name: 'left', log }), h(Pane, { name: 'right', log }));
|
|
75
|
+
}
|
|
76
|
+
act(() => render(h(App, {}), container));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
describe('the app command runtime', () => {
|
|
80
|
+
test('two editor panes mount without claiming editor.run twice', () => {
|
|
81
|
+
const log: string[] = [];
|
|
82
|
+
mount(log);
|
|
83
|
+
|
|
84
|
+
expect(Object.keys(focus)).toEqual(['left', 'right']);
|
|
85
|
+
expect(hasCommand('editor.run')).toBe(true);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('editor.run reaches the pane that was focused last', () => {
|
|
89
|
+
const log: string[] = [];
|
|
90
|
+
mount(log);
|
|
91
|
+
|
|
92
|
+
act(() => focus.right());
|
|
93
|
+
act(() => {
|
|
94
|
+
runCommand('editor.run', { command: 'goToLine' });
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
act(() => focus.left());
|
|
98
|
+
act(() => {
|
|
99
|
+
runCommand('editor.run', { command: 'toggleWordWrap' });
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
expect(log).toEqual(['right:goToLine', 'left:toggleWordWrap']);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('editor.run with no command argument runs nothing', () => {
|
|
106
|
+
const log: string[] = [];
|
|
107
|
+
mount(log);
|
|
108
|
+
|
|
109
|
+
act(() => focus.left());
|
|
110
|
+
act(() => {
|
|
111
|
+
runCommand('editor.run');
|
|
112
|
+
runCommand('editor.run', {});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
expect(log).toEqual([]);
|
|
116
|
+
});
|
|
117
|
+
});
|