@kabmo-labs/kabmo 0.58.1 → 0.59.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.
Files changed (399) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +513 -495
  3. package/dist/client/static/js/{Body-ysmhxbvk.js → Body-5yedtmnk.js} +3 -3
  4. package/dist/client/static/js/{CsvGrid-w90pxyn2.js → CsvGrid-39m8pp1c.js} +2 -2
  5. package/dist/client/static/js/{DocxView-evxn6kaq.js → DocxView-vd99cv12.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-tmdevwf4.js → DrawioView-6nq4412n.js} +2 -2
  7. package/dist/client/static/js/{HtmlPreview-bpsn2z9p.js → HtmlPreview-cs51gszy.js} +1 -1
  8. package/dist/client/static/js/ImageView-nc2n0w6s.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-j7786frq.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-0rn5zsy5.js +1 -0
  11. package/dist/client/static/js/Modal-7ag7a9qq.js +60 -0
  12. package/dist/client/static/js/{PdfView-txxn6qff.js → PdfView-0zab721q.js} +1 -1
  13. package/dist/client/static/js/SessionsView-t9rhx472.js +1 -0
  14. package/dist/client/static/js/{SheetView-52b33e6f.js → SheetView-2wdn5hkd.js} +11 -11
  15. package/dist/client/static/js/{SvgPreview-hrk4pfm1.js → SvgPreview-fmrfxd7z.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-at77sybc.js → abnfDiagram-O67JEVCF-41scfh9v.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-raw33jgg.js → architectureDiagram-NJMV4G6O-fp6etjvt.js} +3 -3
  19. package/dist/client/static/js/{astro-qha7sceh.js → astro-ryr2ajmg.js} +1 -1
  20. package/dist/client/static/js/bash-zknkkwkw.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-b6e90fbk.js → blockDiagram-BEXU5L5S-pespk9mt.js} +4 -4
  22. package/dist/client/static/js/c-0w02jkxb.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-msg9y1c6.js → c4Diagram-YGBWAQC7-rt4z91dx.js} +2 -2
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-jmrd1h8r.js → classDiagram-v2-NBCMYWYE-6bzaq8sd.js} +4 -4
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-na65ebq3.js → cose-bilkent-JH36ORCC-z3fhgcba.js} +1 -1
  26. package/dist/client/static/js/cpp-p5b4vean.js +1 -0
  27. package/dist/client/static/js/css-9jzbvdyz.js +1 -0
  28. package/dist/client/static/js/css-sn00sq6v.js +1 -0
  29. package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +1 -0
  30. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-9xkkw71m.js → cynefinDiagram-VND7K2PF-8endeh4p.js} +2 -2
  31. package/dist/client/static/js/{dagre-6A5THRUB-p59f19tv.js → dagre-6A5THRUB-2a2f32dv.js} +2 -2
  32. package/dist/client/static/js/{diagram-22UHCM2B-2e2rcvn7.js → diagram-22UHCM2B-wgbyr6b7.js} +9 -9
  33. package/dist/client/static/js/{diagram-3UASUU5V-r9ds8vgr.js → diagram-3UASUU5V-5122b41x.js} +1 -1
  34. package/dist/client/static/js/{diagram-ATOU4E4O-jgwxv7v8.js → diagram-ATOU4E4O-1gt9fr7e.js} +3 -3
  35. package/dist/client/static/js/{diagram-CDSNMT55-20m35eqq.js → diagram-CDSNMT55-v6hs59jb.js} +4 -4
  36. package/dist/client/static/js/{diagram-MLGK6HIB-vt3kxt2m.js → diagram-MLGK6HIB-yey2m5nm.js} +1 -1
  37. package/dist/client/static/js/{diagram-MPIPVDR6-c47rgxf1.js → diagram-MPIPVDR6-hg4f3q4d.js} +2 -2
  38. package/dist/client/static/js/{dockerfile-gtcyey0q.js → dockerfile-56tfnp5r.js} +1 -1
  39. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-aszw3xy3.js → ebnfDiagram-ZINNZB2B-2mhc9aar.js} +1 -1
  40. package/dist/client/static/js/{elixir-w92v180e.js → elixir-fyxw6d70.js} +1 -1
  41. package/dist/client/static/js/{elk-276RUBZZ-gbvr3gry.js → elk-276RUBZZ-wedtvz9y.js} +2 -2
  42. package/dist/client/static/js/{erDiagram-OPXOYQCR-1hqca8qe.js → erDiagram-OPXOYQCR-1kysnby9.js} +6 -6
  43. package/dist/client/static/js/{erlang-v7344938.js → erlang-97ayje6m.js} +1 -1
  44. package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +1 -0
  45. package/dist/client/static/js/flowDiagram-KWPJA3E3-vd4z6bvy.js +1 -0
  46. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-07v22te5.js → ganttDiagram-FUAMR5RP-j4g65rpm.js} +3 -3
  47. package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +1 -0
  48. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-y068jtz9.js → gitGraphDiagram-X574FWY7-vcwmj4b3.js} +8 -8
  49. package/dist/client/static/js/graphql-xzykn0ba.js +1 -0
  50. package/dist/client/static/js/html-2zc3shky.js +1 -0
  51. package/dist/client/static/js/{index-r8d4bk86.js → index-10vzyga1.js} +2 -2
  52. package/dist/client/static/js/index-1mkn5fbf.js +481 -0
  53. package/dist/client/static/js/{index-medk4f18.js → index-2h7xh93h.js} +2 -2
  54. package/dist/client/static/js/{index-fhtnvqgf.js → index-3j2he86h.js} +2 -2
  55. package/dist/client/static/js/{index-zhgh7a31.js → index-3kedv94b.js} +2 -2
  56. package/dist/client/static/js/{index-374xq5a4.js → index-42k78whj.js} +1 -1
  57. package/dist/client/static/js/{index-c9aqx3ht.js → index-42q5gg7t.js} +1 -1
  58. package/dist/client/static/js/index-461ga40v.js +2 -0
  59. package/dist/client/static/js/{index-9qf2h9jb.js → index-51rbgeh9.js} +12 -12
  60. package/dist/client/static/js/{index-tdg7hz80.js → index-58z2hatp.js} +2 -2
  61. package/dist/client/static/js/{index-4tbdws4r.js → index-5e4e18tg.js} +2 -2
  62. package/dist/client/static/js/{index-th61y26d.js → index-69mnn71v.js} +2 -2
  63. package/dist/client/static/js/index-6vbra7p9.js +1 -0
  64. package/dist/client/static/js/{index-007sewcn.js → index-7enfdvh0.js} +2 -2
  65. package/dist/client/static/js/{index-gaa39w5q.js → index-8tzt0dek.js} +2 -2
  66. package/dist/client/static/js/{index-ewryzs4g.js → index-92h38pwg.js} +2 -2
  67. package/dist/client/static/js/{index-vw8b29ek.js → index-9mgpbwfr.js} +1 -1
  68. package/dist/client/static/js/{index-80kx6dm6.js → index-a3bpmw2r.js} +2 -2
  69. package/dist/client/static/js/{index-fv7nybnf.js → index-a70sk36c.js} +2 -2
  70. package/dist/client/static/js/index-c5401dqs.js +4 -0
  71. package/dist/client/static/js/{index-xmg1x6zv.js → index-csxnqgzw.js} +5 -5
  72. package/dist/client/static/js/{index-qefssj0m.js → index-d201jvs9.js} +1 -1
  73. package/dist/client/static/js/{index-y0f3wbc3.js → index-d9sfavx1.js} +2 -2
  74. package/dist/client/static/js/{index-5hvt233n.js → index-db6s66jr.js} +2 -2
  75. package/dist/client/static/js/index-dbsy29gn.js +2 -0
  76. package/dist/client/static/js/{index-j830qk07.js → index-dw9epydj.js} +2 -2
  77. package/dist/client/static/js/{index-s4dpkds5.js → index-e39m185a.js} +2 -2
  78. package/dist/client/static/js/{index-dxq1tbwm.js → index-fg0ne74z.js} +2 -2
  79. package/dist/client/static/js/{index-hb7a7m9m.js → index-fnaq8baz.js} +1 -1
  80. package/dist/client/static/js/{index-tq3t3qm4.js → index-fsa18ns9.js} +2 -2
  81. package/dist/client/static/js/{index-wxqcnsrq.js → index-fvphmwkf.js} +2 -2
  82. package/dist/client/static/js/{index-94d416ee.js → index-gajpd90b.js} +2 -2
  83. package/dist/client/static/js/{index-rxt8sf9a.js → index-h1xbx74w.js} +2 -2
  84. package/dist/client/static/js/{index-1e0rt7c6.js → index-hgzf4ask.js} +5 -5
  85. package/dist/client/static/js/{index-wn28m9h7.js → index-hrez92pw.js} +8 -8
  86. package/dist/client/static/js/{index-zs7kw0be.js → index-jaf968hx.js} +4 -4
  87. package/dist/client/static/js/{index-sxag9ptg.js → index-jct0jryd.js} +2 -2
  88. package/dist/client/static/js/{index-5xxbbzqa.js → index-kt77dwsg.js} +7 -7
  89. package/dist/client/static/js/{index-8d8ce00v.js → index-m62sf9wn.js} +2 -2
  90. package/dist/client/static/js/{index-6x0kn8pb.js → index-mhrkjbjq.js} +2 -2
  91. package/dist/client/static/js/index-mttx9327.css +1 -0
  92. package/dist/client/static/js/{index-1e710snk.js → index-n7bmqeqz.js} +1 -1
  93. package/dist/client/static/js/{index-3ymw778n.js → index-ndqtff48.js} +2 -2
  94. package/dist/client/static/js/{index-cmjyet7w.js → index-nf4hq5tg.js} +27 -27
  95. package/dist/client/static/js/{index-3p732mvs.js → index-np2rfq06.js} +2 -2
  96. package/dist/client/static/js/{index-2s17netq.js → index-nwbr15b3.js} +2 -2
  97. package/dist/client/static/js/{index-nptbz7sv.js → index-pn0ja904.js} +1 -1
  98. package/dist/client/static/js/{index-azz46nwc.js → index-pr8wsq24.js} +2 -2
  99. package/dist/client/static/js/{index-7sq6cjt1.js → index-q3k8r0ms.js} +11 -11
  100. package/dist/client/static/js/{index-an7fq7f6.js → index-qc3de995.js} +1 -1
  101. package/dist/client/static/js/{index-f61c25vn.js → index-r42f3r1p.js} +3 -3
  102. package/dist/client/static/js/{index-e4nge3f4.js → index-s7p2wdr1.js} +1 -1
  103. package/dist/client/static/js/{index-vny4ymjf.js → index-sg65xdey.js} +1 -1
  104. package/dist/client/static/js/index-skp6991n.js +2 -0
  105. package/dist/client/static/js/index-spnrx2c0.js +2 -0
  106. package/dist/client/static/js/{index-fe92hqmb.js → index-sqyvj03y.js} +4 -4
  107. package/dist/client/static/js/{index-cpp43af3.js → index-tz5ewsza.js} +9 -9
  108. package/dist/client/static/js/{index-v8xhgfeq.js → index-vs2y8gxr.js} +2 -2
  109. package/dist/client/static/js/{index-e0kahttb.js → index-vs3g6njv.js} +1 -1
  110. package/dist/client/static/js/index-wkxsypj1.js +2 -0
  111. package/dist/client/static/js/{index-gqrt766t.js → index-xqz7bqcn.js} +61 -61
  112. package/dist/client/static/js/{index-jxsha63v.js → index-y4cx8cqf.js} +2 -2
  113. package/dist/client/static/js/{index-kzzvrqnv.js → index-y5pkqrga.js} +2 -2
  114. package/dist/client/static/js/{index-3m1dksmy.js → index-yrwm437g.js} +2 -2
  115. package/dist/client/static/js/{index-7ynf3s2w.js → index-z82nd2bd.js} +2 -2
  116. package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +1 -0
  117. package/dist/client/static/js/{infoDiagram-VRGFBTTK-1x83h4k4.js → infoDiagram-VRGFBTTK-7craq9x2.js} +2 -2
  118. package/dist/client/static/js/ini-62r3vxaf.js +1 -0
  119. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-et6z3c28.js → ishikawaDiagram-OU5B5YK6-ncjty2re.js} +2 -2
  120. package/dist/client/static/js/java-kacycary.js +1 -0
  121. package/dist/client/static/js/javascript-zc1qnyyp.js +1 -0
  122. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-sw669e7a.js → journeyDiagram-ZHPQQLJL-yx222bzt.js} +2 -2
  123. package/dist/client/static/js/json-yrwpn6bd.js +1 -0
  124. package/dist/client/static/js/jsx-b40ag8q1.js +1 -0
  125. package/dist/client/static/js/{julia-z14p8jsx.js → julia-agc5kfvg.js} +1 -1
  126. package/dist/client/static/js/{kanban-definition-PNTS6WVX-aqxg95kx.js → kanban-definition-PNTS6WVX-a2f84qmn.js} +6 -6
  127. package/dist/client/static/js/lua-bk961f37.js +1 -0
  128. package/dist/client/static/js/markdown-b7rgzgd6.js +1 -0
  129. package/dist/client/static/js/mermaid.core-9vfwthw3.js +12 -0
  130. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-530anpc4.js → mindmap-definition-NLK3R4M7-fsxysg6f.js} +4 -4
  131. package/dist/client/static/js/one-dark-pro-7v4by00h.js +1 -0
  132. package/dist/client/static/js/one-light-5rfzh8p4.js +1 -0
  133. package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +1 -0
  134. package/dist/client/static/js/{pegDiagram-GJSIUBJH-5zar6hvy.js → pegDiagram-GJSIUBJH-77wxmp9g.js} +1 -1
  135. package/dist/client/static/js/{perl-1na2x6yd.js → perl-v5vbtzgf.js} +1 -1
  136. package/dist/client/static/js/{php-x75tt7w3.js → php-83qwy98t.js} +1 -1
  137. package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +1 -0
  138. package/dist/client/static/js/{pieDiagram-5QR66LMP-3bx8syvw.js → pieDiagram-5QR66LMP-gvgfhez0.js} +3 -3
  139. package/dist/client/static/js/properties-k8gbzggp.js +1 -0
  140. package/dist/client/static/js/python-343tspad.js +1 -0
  141. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-yaarpr2e.js → quadrantDiagram-O4NWA36T-9zkbt5h8.js} +2 -2
  142. package/dist/client/static/js/r-ycdwmv8g.js +1 -0
  143. package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +1 -0
  144. package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +1 -0
  145. package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +1 -0
  146. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +1 -0
  147. package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +1 -0
  148. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-ag41q4nt.js → railroadDiagram-XR7U4H2S-w55bsyw6.js} +1 -1
  149. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g8sr48h4.js → requirementDiagram-PLB6GJNP-828s1e5g.js} +3 -3
  150. package/dist/client/static/js/{ruby-3h22qahv.js → ruby-994n5j6e.js} +1 -1
  151. package/dist/client/static/js/{rust-r27demr5.js → rust-csv5f258.js} +1 -1
  152. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-t1wbd1hh.js → sankeyDiagram-IPEJSGJF-34f3fyvg.js} +3 -3
  153. package/dist/client/static/js/{sass-8bq5r2tz.js → sass-p6g7qdv2.js} +1 -1
  154. package/dist/client/static/js/{scss-c04ezwnn.js → scss-4j4t3r6y.js} +1 -1
  155. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-407mjqty.js → sequenceDiagram-PO4LG4MO-nnta2hn0.js} +7 -7
  156. package/dist/client/static/js/{sizeCapture-INFHLROL-w38zb9ky.js → sizeCapture-INFHLROL-gpcramga.js} +1 -1
  157. package/dist/client/static/js/sql-kwpd5w07.js +1 -0
  158. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-4cvgymkc.js → stateDiagram-v2-GCMORJYK-3f2en220.js} +3 -3
  159. package/dist/client/static/js/{svelte-egg3x4tw.js → svelte-bek3h1sz.js} +1 -1
  160. package/dist/client/static/js/{swimlanes-2SLR337P-w7ts2rzw.js → swimlanes-2SLR337P-jgqt12z9.js} +1 -1
  161. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xx1z57df.js +8 -0
  162. package/dist/client/static/js/{timeline-definition-EJHVYXUP-nq46nzy9.js → timeline-definition-EJHVYXUP-sgchcs11.js} +3 -3
  163. package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +1 -0
  164. package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +1 -0
  165. package/dist/client/static/js/tsx-gjxfjnbk.js +1 -0
  166. package/dist/client/static/js/typescript-4dchbnya.js +1 -0
  167. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-q144snzb.js → usecaseDiagram-POWQR4AR-znkg9pkq.js} +15 -15
  168. package/dist/client/static/js/{vennDiagram-UO4OBE2U-2wemak2p.js → vennDiagram-UO4OBE2U-dncg96ej.js} +4 -4
  169. package/dist/client/static/js/{vue-d7p4wv35.js → vue-y44m889c.js} +1 -1
  170. package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +1 -0
  171. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-bb2qvvgr.js → wardleyDiagram-VNRHLVJA-77xz2d49.js} +4 -4
  172. package/dist/client/static/js/xml-xs6qz3ya.js +1 -0
  173. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9dr05fdq.js → xychartDiagram-PMCCYNJV-40j1aqyf.js} +4 -4
  174. package/dist/client/static/js/yaml-174nk5bn.js +1 -0
  175. package/package.json +7 -7
  176. package/src/client/borders.css +15 -3
  177. package/src/client/components/common/ComposerTextarea.test.tsx +13 -1
  178. package/src/client/components/common/ComposerTextarea.tsx +8 -2
  179. package/src/client/components/common/MarkdownRenderer.tsx +11 -2
  180. package/src/client/components/common/harness-glyph/harness-glyph.test.ts +0 -4
  181. package/src/client/components/common/harness-glyph/index.tsx +4 -5
  182. package/src/client/components/common/markdown-inline-file.test.tsx +90 -15
  183. package/src/client/components/common/session-actions-menu/index.test.tsx +45 -0
  184. package/src/client/components/common/session-actions-menu/index.tsx +6 -1
  185. package/src/client/components/common/session-row/TrailingSlot.tsx +8 -1
  186. package/src/client/components/common/session-row/index.tsx +4 -0
  187. package/src/client/components/common/session-row/session-row.test.tsx +5 -0
  188. package/src/client/components/layout/desktop-layout/RightColumn.tsx +4 -1
  189. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +28 -35
  190. package/src/client/components/layout/desktop-layout/index.tsx +5 -3
  191. package/src/client/components/layout/desktop-layout/resizer/index.tsx +13 -3
  192. package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +41 -0
  193. package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +21 -1
  194. package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +1 -0
  195. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -2
  196. package/src/client/components/layout/session-sidebar/ClassicView.tsx +2 -0
  197. package/src/client/components/layout/session-sidebar/SessionList.tsx +4 -0
  198. package/src/client/components/layout/session-sidebar/SessionsView.tsx +22 -1
  199. package/src/client/components/layout/session-sidebar/modern/RevealRow.tsx +36 -5
  200. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +45 -28
  201. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +10 -3
  202. package/src/client/components/layout/session-sidebar/modern/index.tsx +2 -0
  203. package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +28 -1
  204. package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +27 -11
  205. package/src/client/components/layout/session-sidebar/search-results.test.tsx +29 -16
  206. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +1 -0
  207. package/src/client/components/layout/session-sidebar/variant-props.ts +2 -0
  208. package/src/client/components/mobile/LayoutWrapper.tsx +9 -0
  209. package/src/client/components/mobile/SessionSidebar.tsx +4 -0
  210. package/src/client/components/mobile/left-drawer-nav.test.tsx +1 -1
  211. package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +4 -0
  212. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +3 -0
  213. package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +85 -0
  214. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +30 -14
  215. package/src/client/components/mobile/mobile-session-sidebar/List.tsx +4 -0
  216. package/src/client/components/settings/apply-side-effects.test.ts +31 -0
  217. package/src/client/components/settings/apply-side-effects.ts +7 -0
  218. package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +3 -2
  219. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.test.tsx +95 -0
  220. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +35 -0
  221. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +1 -0
  222. package/src/client/components/workspace/chat-timeline/MessageItem.gutter.test.ts +26 -0
  223. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +6 -3
  224. package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +17 -0
  225. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +9 -3
  226. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +39 -2
  227. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +19 -4
  228. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +28 -21
  229. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.wait.test.tsx +48 -0
  230. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +44 -21
  231. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +24 -0
  232. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +44 -18
  233. package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +2 -1
  234. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +35 -0
  235. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +33 -12
  236. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +24 -0
  237. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +14 -3
  238. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +24 -1
  239. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +78 -135
  240. package/src/client/components/workspace/chat-timeline/chat-input/VoiceButton.tsx +58 -0
  241. package/src/client/components/workspace/chat-timeline/chat-input/action-base.ts +42 -0
  242. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -0
  243. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.test.ts +108 -0
  244. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.tsx +122 -0
  245. package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +78 -20
  246. package/src/client/components/workspace/chat-timeline/chat-input/styles/index.tsx +11 -5
  247. package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +19 -0
  248. package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
  249. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  250. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.test.tsx +125 -0
  251. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +84 -27
  252. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +18 -0
  253. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +14 -5
  254. package/src/client/components/workspace/model-dropdown/CloseButton.tsx +2 -2
  255. package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +2 -2
  256. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +40 -10
  257. package/src/client/components/workspace/model-dropdown/Header.tsx +33 -18
  258. package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -1
  259. package/src/client/components/workspace/model-dropdown/ThinkingLevels.tsx +51 -0
  260. package/src/client/components/workspace/model-dropdown/Trigger.tsx +99 -0
  261. package/src/client/components/workspace/model-dropdown/bands.ts +51 -0
  262. package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +39 -5
  263. package/src/client/components/workspace/model-dropdown/index.tsx +20 -47
  264. package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +34 -4
  265. package/src/client/components/workspace/model-dropdown/thinking-levels.test.tsx +108 -0
  266. package/src/client/components/workspace/model-dropdown/trigger.test.ts +54 -8
  267. package/src/client/hooks/chat/composer/attachments.test.ts +12 -0
  268. package/src/client/hooks/chat/composer/attachments.ts +16 -4
  269. package/src/client/hooks/chat/composer/pipeline.test.ts +14 -0
  270. package/src/client/hooks/chat/composer/pipeline.ts +15 -6
  271. package/src/client/hooks/chat/omp/session-list.activity.test.ts +20 -0
  272. package/src/client/hooks/chat/omp/session-merges.ts +18 -6
  273. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -0
  274. package/src/client/hooks/chat/timeline/scope.test.ts +17 -0
  275. package/src/client/hooks/chat/timeline/scope.ts +6 -1
  276. package/src/client/hooks/chat/timeline/send-refusal.test.ts +19 -0
  277. package/src/client/hooks/chat/timeline/send-steer.test.ts +17 -0
  278. package/src/client/hooks/chat/timeline/send.ts +17 -0
  279. package/src/client/hooks/editor/quick-open.ts +41 -0
  280. package/src/client/hooks/ui/border-style.test.ts +13 -0
  281. package/src/client/hooks/ui/markdown-render.ts +11 -6
  282. package/src/client/hooks/ui/open-inline-file.test.ts +16 -0
  283. package/src/client/hooks/ui/open-inline-file.ts +4 -2
  284. package/src/client/hooks/ui/show-more.ts +11 -1
  285. package/src/client/hooks/ui/ui-feedback.test.ts +11 -0
  286. package/src/client/hooks/ui/verified-inline-files.test.tsx +143 -0
  287. package/src/client/hooks/ui/verified-inline-files.ts +165 -0
  288. package/src/client/hooks/workspace/mobile-workspace-panels.test.tsx +116 -0
  289. package/src/client/hooks/workspace/mobile-workspace-panels.ts +73 -0
  290. package/src/client/hooks/workspace/panel-resize.test.ts +127 -0
  291. package/src/client/hooks/workspace/panel-resize.ts +81 -0
  292. package/src/client/hooks/workspace/session-list-limit.test.ts +80 -0
  293. package/src/client/hooks/workspace/session-list-limit.ts +69 -0
  294. package/src/client/hooks/workspace/session-pin.ts +58 -0
  295. package/src/client/hooks/workspace/workspace-panels-mode.test.tsx +87 -0
  296. package/src/client/hooks/workspace/workspace-panels-mode.ts +76 -0
  297. package/src/client/lib/router/branch-params.test.ts +17 -1
  298. package/src/client/lib/router/branch-params.ts +18 -0
  299. package/src/client/lib/ui/pressed.ts +15 -0
  300. package/src/client/tailwind.css +30 -10
  301. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +25 -9
  302. package/src/server/lib/db/schema.test.ts +1 -1
  303. package/src/server/lib/db/schema.ts +17 -0
  304. package/src/server/lib/harness/activity.server.test.ts +81 -0
  305. package/src/server/lib/harness/activity.server.ts +55 -0
  306. package/src/server/lib/harness/spawn.server.ts +9 -0
  307. package/src/server/lib/omp/session/delete.server.ts +4 -2
  308. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +24 -2
  309. package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +14 -0
  310. package/src/server/lib/sessions/last-opened.server.test.ts +17 -0
  311. package/src/server/lib/sessions/last-opened.server.ts +18 -1
  312. package/src/server/routes/sessions/index.ts +3 -2
  313. package/src/server/routes/sessions/routes.test.ts +29 -46
  314. package/src/server/routes/sessions/session.ts +40 -62
  315. package/src/server/routes/sessions/state.test.ts +89 -0
  316. package/src/server/routes/sessions/state.ts +86 -0
  317. package/src/shared/lib/chat/attachment-budget.test.ts +74 -0
  318. package/src/shared/lib/chat/attachment-budget.ts +111 -0
  319. package/src/shared/lib/chat/attachments.test.ts +0 -17
  320. package/src/shared/lib/chat/attachments.ts +0 -53
  321. package/src/shared/lib/chat/timeline/block-chrome.test.ts +35 -0
  322. package/src/shared/lib/chat/timeline/block-chrome.ts +21 -0
  323. package/src/shared/lib/markdown/degenerate-emphasis.test.ts +64 -0
  324. package/src/shared/lib/markdown/degenerate-emphasis.ts +90 -0
  325. package/src/shared/lib/markdown/inline-file.test.ts +79 -22
  326. package/src/shared/lib/markdown/inline-file.ts +57 -25
  327. package/src/shared/lib/markdown/marked.ts +5 -1
  328. package/src/shared/lib/settings/defaults.ts +2 -0
  329. package/src/shared/lib/theme/border-style.ts +1 -1
  330. package/src/shared/lib/workspace/active-project.test.ts +17 -1
  331. package/src/shared/lib/workspace/active-project.ts +9 -0
  332. package/src/shared/lib/workspace/project-settings-delete.test.ts +97 -0
  333. package/src/shared/lib/workspace/project-settings.test.ts +2 -34
  334. package/src/shared/lib/workspace/project-settings.ts +6 -0
  335. package/src/shared/lib/workspace/session-list-limit.test.ts +31 -0
  336. package/src/shared/lib/workspace/session-list-limit.ts +32 -0
  337. package/src/shared/lib/workspace/sidebar-sort.test.ts +21 -0
  338. package/src/shared/lib/workspace/workspace-panel-widths.ts +1 -1
  339. package/src/shared/lib/workspace/workspace-session.test.ts +34 -0
  340. package/src/shared/lib/workspace/workspace-session.ts +40 -0
  341. package/src/shared/types/settings/state.ts +10 -0
  342. package/dist/client/static/js/ImageView-ssazqckj.js +0 -1
  343. package/dist/client/static/js/LayoutWrapper-qwpfq4dq.js +0 -2
  344. package/dist/client/static/js/MergeDiffView-en6aazw8.js +0 -1
  345. package/dist/client/static/js/Modal-zjnhj9nb.js +0 -60
  346. package/dist/client/static/js/SessionsView-eryjtmb2.js +0 -1
  347. package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +0 -1
  348. package/dist/client/static/js/bash-n5d0esqg.js +0 -1
  349. package/dist/client/static/js/c-pk766wx0.js +0 -1
  350. package/dist/client/static/js/cpp-3pt91jvm.js +0 -1
  351. package/dist/client/static/js/css-q2k6afe3.js +0 -1
  352. package/dist/client/static/js/css-sp1cgdbr.js +0 -1
  353. package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +0 -1
  354. package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +0 -1
  355. package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +0 -1
  356. package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +0 -1
  357. package/dist/client/static/js/graphql-qx4tt6ze.js +0 -1
  358. package/dist/client/static/js/html-5e0g8664.js +0 -1
  359. package/dist/client/static/js/index-4ddgpqm0.css +0 -1
  360. package/dist/client/static/js/index-5g2j626a.js +0 -1
  361. package/dist/client/static/js/index-cc7qbfvn.js +0 -477
  362. package/dist/client/static/js/index-f27wvdky.js +0 -4
  363. package/dist/client/static/js/index-m5n0zsft.js +0 -2
  364. package/dist/client/static/js/index-rqt8mem9.js +0 -2
  365. package/dist/client/static/js/index-s9k82stc.js +0 -2
  366. package/dist/client/static/js/index-skwem10a.js +0 -2
  367. package/dist/client/static/js/index-tv9rn2nd.js +0 -2
  368. package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +0 -1
  369. package/dist/client/static/js/ini-bdk46a3d.js +0 -1
  370. package/dist/client/static/js/java-3g3925cf.js +0 -1
  371. package/dist/client/static/js/javascript-av46zx4c.js +0 -1
  372. package/dist/client/static/js/json-hdyzmffz.js +0 -1
  373. package/dist/client/static/js/jsx-y8r9mrdq.js +0 -1
  374. package/dist/client/static/js/lua-wf5k6p3r.js +0 -1
  375. package/dist/client/static/js/markdown-9bf16dx7.js +0 -1
  376. package/dist/client/static/js/mermaid.core-6cgqsgcf.js +0 -12
  377. package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +0 -1
  378. package/dist/client/static/js/one-light-2n5y8592.js +0 -1
  379. package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +0 -1
  380. package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +0 -1
  381. package/dist/client/static/js/properties-xk4dn00p.js +0 -1
  382. package/dist/client/static/js/python-7sgz05n4.js +0 -1
  383. package/dist/client/static/js/r-w4qxm0pv.js +0 -1
  384. package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +0 -1
  385. package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +0 -1
  386. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +0 -1
  387. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +0 -1
  388. package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +0 -1
  389. package/dist/client/static/js/sql-sd00wgem.js +0 -1
  390. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-v82nym6b.js +0 -8
  391. package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +0 -1
  392. package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +0 -1
  393. package/dist/client/static/js/tsx-h5yzg80q.js +0 -1
  394. package/dist/client/static/js/typescript-qy1sbhea.js +0 -1
  395. package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +0 -1
  396. package/dist/client/static/js/xml-mrk4xakv.js +0 -1
  397. package/dist/client/static/js/yaml-xaza6dra.js +0 -1
  398. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +0 -110
  399. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +0 -86
@@ -0,0 +1,165 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Which inline file references a chat message wrote actually name a file.
8
+ *
9
+ * The detector (`inline-file.ts`) accepts anything that LOOKS like a path, and
10
+ * the agent does not always write one that resolves: a partial name, a path
11
+ * from another checkout, a file it never created. Marking all of them made the
12
+ * chip a promise the click could not keep — the tab opened empty and the editor
13
+ * said the file was missing.
14
+ *
15
+ * So the marker is gated on this hook. A reference WITH a directory is a
16
+ * workspace-relative location, which `/api/fs/exists` stats exactly. A BARE
17
+ * name has no location, so it is resolved through the quick-open index the
18
+ * click itself uses (`chooseFileTarget`): an exact entry, or a basename match,
19
+ * is a file that can be opened; nothing is not.
20
+ *
21
+ * Only a POSITIVE answer marks a chip. A failed probe, an absent workspace and
22
+ * an unreadable index all leave it plain text — an inert chip is honest, a
23
+ * clickable one that opens a missing tab is the bug this exists to prevent.
24
+ */
25
+
26
+ import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
27
+ import { loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
28
+ import { pluginContext } from '@/client/lib/plugins/context';
29
+ import { chooseFileTarget } from '@/shared/lib/fs/open-reference';
30
+ import type { InlineFileReference } from '@/shared/lib/markdown/inline-file';
31
+
32
+ /** Probes for the same scope and path share one request. */
33
+ const inFlightProbes = new Map<string, Promise<boolean>>();
34
+
35
+ /**
36
+ * A settled verdict is reused for this long, so ten messages that mention the
37
+ * same file cost one `stat`, not ten. Short on purpose: a file created after a
38
+ * stale "missing" must become clickable soon.
39
+ */
40
+ const VERDICT_REUSE_MS = 5_000;
41
+
42
+ interface CachedVerdict {
43
+ settledAt: number;
44
+ exists: boolean;
45
+ }
46
+
47
+ const verdictCache = new Map<string, CachedVerdict>();
48
+
49
+ /**
50
+ * Whether `path` names a file under `root`.
51
+ *
52
+ * The route is the same one `useMissingFiles` asks, so "a chip is clickable"
53
+ * and "a tab is not missing" cannot disagree about what exists. A refusal is
54
+ * NOT an answer: only an explicit `exists: true` verifies.
55
+ */
56
+ export function probeInlineFileExists(root: string, path: string): Promise<boolean> {
57
+ const key = `${root}\u0000${path}`;
58
+ const cached = verdictCache.get(key);
59
+ if (cached && Date.now() - cached.settledAt < VERDICT_REUSE_MS) {
60
+ return Promise.resolve(cached.exists);
61
+ }
62
+ const pending = inFlightProbes.get(key);
63
+ if (pending) return pending;
64
+ const params = new URLSearchParams({ path, root });
65
+ const probe = (async () => {
66
+ try {
67
+ const res = await fetch(`/api/fs/exists?${params.toString()}`);
68
+ const data = (await res.json().catch(() => null)) as { exists?: unknown } | null;
69
+ return res.ok && data?.exists === true;
70
+ } catch {
71
+ return false;
72
+ }
73
+ })().then((exists) => {
74
+ verdictCache.set(key, { settledAt: Date.now(), exists });
75
+ return exists;
76
+ }).finally(() => inFlightProbes.delete(key));
77
+ inFlightProbes.set(key, probe);
78
+ return probe;
79
+ }
80
+
81
+ /** Drop the shared verdicts. Tests that change a scope's files call this. */
82
+ export function forgetInlineFileVerdicts(): void {
83
+ verdictCache.clear();
84
+ inFlightProbes.clear();
85
+ }
86
+
87
+ interface Verdicts {
88
+ /** The workspace the verdicts belong to; a different root starts over. */
89
+ root: string | null;
90
+ byPath: Map<string, boolean>;
91
+ }
92
+
93
+ /**
94
+ * The reference paths that exist, for the current message and workspace.
95
+ *
96
+ * Verdicts live in a ref so a streaming re-render does not re-ask about spans
97
+ * that are already settled; `revision` is the only thing that repaints. A path
98
+ * that appears later (the agent finished writing the sentence) is probed once.
99
+ */
100
+ export function useVerifiedInlineFiles(references: readonly InlineFileReference[]): ReadonlySet<string> {
101
+ const root = pluginContext().workspacePath;
102
+ const verdicts = useRef<Verdicts>({ root, byPath: new Map() });
103
+ const inFlight = useRef(new Set<string>());
104
+ const alive = useRef(true);
105
+ const [revision, setRevision] = useState(0);
106
+
107
+ useEffect(() => {
108
+ alive.current = true;
109
+ return () => {
110
+ alive.current = false;
111
+ };
112
+ }, []);
113
+
114
+ const paths = useMemo(() => {
115
+ const unique = new Set<string>();
116
+ for (const reference of references) unique.add(reference.path);
117
+ return [...unique];
118
+ }, [references]);
119
+ // A string dep keeps the effect stable while the parse produces a new array
120
+ // with the same content (every streaming tick does).
121
+ const pathKey = paths.join('\n');
122
+
123
+ useEffect(() => {
124
+ if (verdicts.current.root !== root) {
125
+ verdicts.current = { root, byPath: new Map() };
126
+ inFlight.current = new Set();
127
+ }
128
+ if (!root) return;
129
+ const current = verdicts.current.byPath;
130
+ const unknown = paths.filter((path) => !current.has(path) && !inFlight.current.has(path));
131
+ if (unknown.length === 0) return;
132
+ for (const path of unknown) inFlight.current.add(path);
133
+ const scope = root;
134
+
135
+ void (async () => {
136
+ const needsIndex = unknown.some((path) => !path.includes('/'));
137
+ const entries = needsIndex ? await loadQuickOpenIndex(scope) : [];
138
+ const answers = await Promise.all(
139
+ unknown.map(async (path): Promise<[string, boolean]> => [
140
+ path,
141
+ path.includes('/')
142
+ ? await probeInlineFileExists(scope, path)
143
+ : chooseFileTarget({ path }, entries).kind !== 'literal',
144
+ ]),
145
+ );
146
+ // The component may have unmounted, or the workspace switched, while the
147
+ // requests were in flight; a verdict for the wrong scope is not stored.
148
+ if (verdicts.current.root !== scope) return;
149
+ for (const [path, exists] of answers) {
150
+ inFlight.current.delete(path);
151
+ verdicts.current.byPath.set(path, exists);
152
+ }
153
+ if (alive.current) setRevision((value) => value + 1);
154
+ })();
155
+ }, [pathKey, root]);
156
+
157
+ return useMemo(() => {
158
+ const verified = new Set<string>();
159
+ if (verdicts.current.root === root) {
160
+ for (const [path, exists] of verdicts.current.byPath) if (exists) verified.add(path);
161
+ }
162
+ return verified;
163
+ // `revision` is the repaint signal for the mutable verdict map.
164
+ }, [revision, root, pathKey]);
165
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's folder workspace entry: a press writes the folder's synthetic id
8
+ * and opens the panel drawer, and a settled workspace id reopens the drawer
9
+ * after a reload. A real session must do neither.
10
+ */
11
+
12
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
13
+ import { Window } from 'happy-dom';
14
+ import { h, render } from 'preact';
15
+ import { act } from 'preact/test-utils';
16
+
17
+ import {
18
+ useMobileWorkspacePanels,
19
+ type MobileWorkspacePanelsOptions,
20
+ } from '@/client/hooks/workspace/mobile-workspace-panels';
21
+ import type { MobileDrawerReveals } from '@/client/components/mobile/mobile-drawer-reveals';
22
+ import { resetSessionStateStore } from '@/shared/lib/workspace/session-state/store';
23
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
24
+
25
+ let container: HTMLElement | undefined;
26
+ let open: ((folderId: number) => void) | null = null;
27
+
28
+ function drawers(count: { opened: number }): MobileDrawerReveals {
29
+ return {
30
+ right: 0,
31
+ left: 0,
32
+ openSessionDrawer: () => {},
33
+ openRightDrawer: () => { count.opened += 1; },
34
+ openNamedPanel: () => {},
35
+ };
36
+ }
37
+
38
+ function Probe(props: MobileWorkspacePanelsOptions) {
39
+ open = useMobileWorkspacePanels(props);
40
+ return null;
41
+ }
42
+
43
+ async function mount(options: MobileWorkspacePanelsOptions) {
44
+ container = document.body.appendChild(document.createElement('div'));
45
+ await act(async () => { render(h(Probe, options), container as HTMLElement); });
46
+ await act(async () => {});
47
+ }
48
+
49
+ beforeAll(() => {
50
+ installDomGlobals(new Window({ url: 'http://localhost' }));
51
+ });
52
+
53
+ beforeEach(() => {
54
+ resetSessionStateStore();
55
+ open = null;
56
+ });
57
+
58
+ afterAll(() => {
59
+ restoreDomGlobals();
60
+ });
61
+
62
+ afterEach(() => {
63
+ if (container) render(null, container);
64
+ container?.remove();
65
+ container = undefined;
66
+ });
67
+
68
+ describe('useMobileWorkspacePanels', () => {
69
+ test('a press writes the workspace id and opens the panel drawer', async () => {
70
+ const count = { opened: 0 };
71
+ let screen = 'main';
72
+ let search = '';
73
+ await mount({
74
+ stateSessionId: 'real-1',
75
+ drawers: drawers(count),
76
+ setSearchParams: (next) => {
77
+ const value = typeof next === 'function' ? next(new URLSearchParams()) : next;
78
+ search = String(value);
79
+ },
80
+ setCurrentScreen: (next) => { screen = next; },
81
+ });
82
+
83
+ await act(async () => { open?.(7); });
84
+
85
+ expect(search).toContain('sessionId=workspace-7');
86
+ expect(search).toContain('folderId=7');
87
+ expect(screen).toBe('right');
88
+ expect(count.opened).toBe(0);
89
+ });
90
+
91
+ test('a repeat press on an already-settled workspace reveals the drawer', async () => {
92
+ const count = { opened: 0 };
93
+ await mount({
94
+ stateSessionId: 'workspace-7',
95
+ drawers: drawers(count),
96
+ setSearchParams: () => {},
97
+ setCurrentScreen: () => {},
98
+ });
99
+ // The mount effect is the reload/cold-restore path.
100
+ expect(count.opened).toBe(1);
101
+
102
+ await act(async () => { open?.(7); });
103
+ expect(count.opened).toBe(2);
104
+ });
105
+
106
+ test('a real session opens nothing on mount', async () => {
107
+ const count = { opened: 0 };
108
+ await mount({
109
+ stateSessionId: 'real-1',
110
+ drawers: drawers(count),
111
+ setSearchParams: () => {},
112
+ setCurrentScreen: () => {},
113
+ });
114
+ expect(count.opened).toBe(0);
115
+ });
116
+ });
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's folder-workspace button: write the folder's synthetic session id
8
+ * and bring its panel drawer forward.
9
+ *
10
+ * The drawer is a SCREEN, so the URL write alone is not enough. Two paths open
11
+ * it: the button press (which may be a repeat on the current folder) and a
12
+ * settled session id after a reload or a cold restore. Both seed Files when the
13
+ * folder has never picked a drawer view, because under `tabs` navigation the
14
+ * fallback alone lands on the catalog.
15
+ */
16
+
17
+ import { useCallback, useEffect, useRef } from 'preact/hooks';
18
+ import type { SetSearchParams } from '@/client/lib/router/search-params';
19
+ import { workspaceSessionParams } from '@/client/lib/router/branch-params';
20
+ import type { MobileDrawerReveals, MobileScreen } from '@/client/components/mobile/mobile-drawer-reveals';
21
+ import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
22
+ import { DEFAULT_RIGHT_PANEL_TYPE } from '@/shared/lib/workspace/right-panels';
23
+ import {
24
+ isWorkspaceSessionId,
25
+ workspaceSessionId,
26
+ } from '@/shared/lib/workspace/workspace-session';
27
+
28
+ export interface MobileWorkspacePanelsOptions {
29
+ /** The settled session id from `SessionStateProvider`. */
30
+ stateSessionId: string;
31
+ drawers: MobileDrawerReveals;
32
+ setSearchParams: SetSearchParams;
33
+ setCurrentScreen: (screen: MobileScreen) => void;
34
+ }
35
+
36
+ export function useMobileWorkspacePanels({
37
+ stateSessionId,
38
+ drawers,
39
+ setSearchParams,
40
+ setCurrentScreen,
41
+ }: MobileWorkspacePanelsOptions): (folderId: number) => void {
42
+ const handleOpenWorkspacePanels = useCallback(
43
+ (folderId: number) => {
44
+ const workspaceId = workspaceSessionId(folderId);
45
+ if (getSessionValue(workspaceId, 'layout.mobileRightPanel') === undefined) {
46
+ setSessionKey(workspaceId, 'layout.mobileRightPanel', DEFAULT_RIGHT_PANEL_TYPE);
47
+ }
48
+ setSearchParams(prev => workspaceSessionParams(prev, folderId), { replace: true });
49
+ if (stateSessionId === workspaceId) drawers.openRightDrawer();
50
+ else setCurrentScreen('right');
51
+ },
52
+ [stateSessionId, drawers, setSearchParams, setCurrentScreen],
53
+ );
54
+
55
+ // A workspace session opens on its panels, from a reload or a cold restore:
56
+ // in `tabs` mode the drawer otherwise lands on its catalog. Keyed by the
57
+ // SETTLED session id, not the just-written URL param.
58
+ const revealedRef = useRef<string | null>(null);
59
+ useEffect(() => {
60
+ if (!isWorkspaceSessionId(stateSessionId)) {
61
+ revealedRef.current = null;
62
+ return;
63
+ }
64
+ if (revealedRef.current === stateSessionId) return;
65
+ revealedRef.current = stateSessionId;
66
+ if (getSessionValue(stateSessionId, 'layout.mobileRightPanel') === undefined) {
67
+ setSessionKey(stateSessionId, 'layout.mobileRightPanel', DEFAULT_RIGHT_PANEL_TYPE);
68
+ }
69
+ drawers.openRightDrawer();
70
+ }, [stateSessionId, drawers]);
71
+
72
+ return handleOpenWorkspacePanels;
73
+ }
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The live-resize contract behind the editor width modes.
8
+ *
9
+ * Two facts a mode toggle depends on, and both were defects:
10
+ *
11
+ * - a panel must follow the group instantly while its area or the mode is
12
+ * moving (a CSS transition re-targeted on every observer tick lagged the
13
+ * container, and the filler handed the difference back);
14
+ * - a drag in compact/full view commits the RIGHT panel only, because the
15
+ * editor's width there is the leftover, not a choice.
16
+ */
17
+
18
+ import { afterAll, afterEach, beforeAll, 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
+ import { readPanelWidths, useSnapResize } from '@/client/hooks/workspace/panel-resize';
23
+ import type { PanelImperativeHandle } from '@/client/components/layout/desktop-layout/resizer';
24
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
25
+
26
+ let container: HTMLElement;
27
+ let snap: boolean | null = null;
28
+
29
+ function Probe({ available, chatHidden }: { available: number | null; chatHidden: boolean }) {
30
+ snap = useSnapResize(available, chatHidden);
31
+ return h('div', null, String(snap));
32
+ }
33
+
34
+ async function show(available: number | null, chatHidden: boolean): Promise<void> {
35
+ await act(async () => {
36
+ render(h(Probe, { available, chatHidden }), container);
37
+ });
38
+ }
39
+
40
+ /** A panel ref answering the size a drag would have landed. */
41
+ function sized(px: number | null) {
42
+ return {
43
+ current: {
44
+ resize: () => {},
45
+ getSize: () => (px === null ? null : { inPixels: px }),
46
+ },
47
+ } as unknown as { current: PanelImperativeHandle | null };
48
+ }
49
+
50
+ beforeAll(() => {
51
+ installDomGlobals(new Window({ url: 'http://localhost' }));
52
+ });
53
+
54
+ afterEach(() => {
55
+ if (container) {
56
+ render(null, container);
57
+ container.remove();
58
+ }
59
+ snap = null;
60
+ });
61
+
62
+ afterAll(() => {
63
+ restoreDomGlobals();
64
+ });
65
+
66
+ describe('useSnapResize', () => {
67
+ test('stable values animate; a moved area or mode snaps', async () => {
68
+ container = document.createElement('div');
69
+ document.body.appendChild(container);
70
+
71
+ await show(600, false);
72
+ expect(snap).toBe(false);
73
+ await show(600, false);
74
+ expect(snap).toBe(false);
75
+
76
+ // The group's area moved (a sibling column animating, a window resize).
77
+ await show(700, false);
78
+ expect(snap).toBe(true);
79
+ await show(700, false);
80
+ expect(snap).toBe(false);
81
+
82
+ // Compact/full view changed the paired caps with the area unchanged.
83
+ await show(700, true);
84
+ expect(snap).toBe(true);
85
+ await show(700, true);
86
+ expect(snap).toBe(false);
87
+ });
88
+ });
89
+
90
+ describe('readPanelWidths', () => {
91
+ const base = {
92
+ available: 1000,
93
+ chatHidden: false,
94
+ editorWidthMode: 'editor' as const,
95
+ shownRightPanel: 'files',
96
+ };
97
+
98
+ test('both panels commit their px and their share of the measured area', () => {
99
+ expect(
100
+ readPanelWidths({ ...base, editorPanelRef: sized(400), rightPanelRef: sized(300) }),
101
+ ).toEqual({
102
+ editor: { px: 400, fraction: 0.4 },
103
+ right: { files: { px: 300, fraction: 0.3 } },
104
+ });
105
+ });
106
+
107
+ test('with the chat hidden the editor is leftover width, never committed', () => {
108
+ const patch = readPanelWidths({
109
+ ...base,
110
+ chatHidden: true,
111
+ editorPanelRef: sized(900),
112
+ rightPanelRef: sized(300),
113
+ });
114
+ expect(patch.editor).toBeUndefined();
115
+ expect(patch.right).toEqual({ files: { px: 300, fraction: 0.3 } });
116
+ });
117
+
118
+ test('a collapsed panel contributes no width', () => {
119
+ expect(readPanelWidths({ ...base, editorPanelRef: sized(0), rightPanelRef: sized(null) })).toEqual({});
120
+ });
121
+
122
+ test('before the area is measured only the px fallback is stored', () => {
123
+ expect(
124
+ readPanelWidths({ ...base, available: null, editorPanelRef: sized(400), rightPanelRef: sized(300) }),
125
+ ).toEqual({ editor: { px: 400 }, right: { files: { px: 300 } } });
126
+ });
127
+ });
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The desktop workspace's live-resize rules: when a panel must FOLLOW the
8
+ * group instantly, and which widths a drag commits.
9
+ *
10
+ * Kept beside the width arithmetic because both are consequences of the same
11
+ * fact — the group's area is measured, not known — while the component that
12
+ * uses them owns JSX and nothing else.
13
+ */
14
+
15
+ import type { RefObject } from 'preact';
16
+ import { useRef } from 'preact/hooks';
17
+ import type { PanelImperativeHandle } from '@/client/components/layout/desktop-layout/resizer';
18
+ import type { EditorWidthMode, PanelWidths } from '@/shared/lib/workspace/panel-widths';
19
+
20
+ /**
21
+ * Whether the panels should resize WITHOUT their 200ms width animation.
22
+ *
23
+ * Two changes move a panel as a side effect rather than as the point of the
24
+ * click, and both must land in one pass:
25
+ *
26
+ * - the group's area is moving (a sibling column animating, a window resize).
27
+ * A fixed panel re-targeted its transition on every observer tick, lagged the
28
+ * container, and the filler handed the difference back afterwards;
29
+ * - compact/full view changed the pair's caps while the editor took the freed
30
+ * chat width as the filler. A right panel animating toward its new cap made
31
+ * the editor give those pixels back over the next 200ms.
32
+ *
33
+ * A settled change with the area and the mode unchanged — a view switch, a
34
+ * separator drag's committed width — still animates.
35
+ */
36
+ export function useSnapResize(available: number | null, chatHidden: boolean): boolean {
37
+ const lastAvailableRef = useRef<number | null>(available);
38
+ const availableMoving = lastAvailableRef.current !== available;
39
+ lastAvailableRef.current = available;
40
+ const lastChatHiddenRef = useRef(chatHidden);
41
+ const viewModeChanged = lastChatHiddenRef.current !== chatHidden;
42
+ lastChatHiddenRef.current = chatHidden;
43
+ return availableMoving || viewModeChanged;
44
+ }
45
+
46
+ /**
47
+ * Widths of the fixed panels as they are right now, keyed by slot: the editor
48
+ * (source or diff, whichever is showing) and the right panel under the view it
49
+ * currently holds. The chat column is the group's filler, so it has no width
50
+ * of its own to report.
51
+ *
52
+ * Each is stored as a share of the area it was measured in, so the layout
53
+ * follows a window resize instead of holding a pixel value that was only
54
+ * right on the display it was dragged on.
55
+ */
56
+ export function readPanelWidths(args: {
57
+ editorPanelRef: RefObject<PanelImperativeHandle | null>;
58
+ rightPanelRef: RefObject<PanelImperativeHandle | null>;
59
+ available: number | null;
60
+ chatHidden: boolean;
61
+ editorWidthMode: EditorWidthMode;
62
+ shownRightPanel: string;
63
+ }): PanelWidths {
64
+ const { editorPanelRef, rightPanelRef, available, chatHidden, editorWidthMode, shownRightPanel } = args;
65
+ const patch: PanelWidths = {};
66
+ const editor = editorPanelRef.current?.getSize()?.inPixels;
67
+ const right = rightPanelRef.current?.getSize()?.inPixels;
68
+ // With the chat hidden the editor's width is whatever is left over, not a
69
+ // choice — persisting it would overwrite the width the user set for the
70
+ // ordinary layout with the one this mode produced. A drag made here still
71
+ // moves the RIGHT panel, which is the width that was actually chosen.
72
+ if (!chatHidden && editor != null && editor > 0) {
73
+ patch[editorWidthMode] = { px: Math.round(editor), ...(available ? { fraction: editor / available } : {}) };
74
+ }
75
+ if (right != null && right > 0) {
76
+ patch.right = {
77
+ [shownRightPanel]: { px: Math.round(right), ...(available ? { fraction: right / available } : {}) },
78
+ };
79
+ }
80
+ return patch;
81
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The page size reaches an already-mounted list through an event, not through
8
+ * `appSettings` (a boot-time prop). These cases pin the two halves: the writer
9
+ * announces a CLAMPED count, and the hook follows it without a reload.
10
+ */
11
+
12
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
13
+ import { Window } from 'happy-dom';
14
+ import { h, render } from 'preact';
15
+ import { act } from 'preact/test-utils';
16
+
17
+ import {
18
+ applySessionListLimit,
19
+ currentSessionListLimit,
20
+ SESSION_LIST_LIMIT_CHANGED_EVENT,
21
+ useSessionListLimit,
22
+ } from '@/client/hooks/workspace/session-list-limit';
23
+ import { primeKabmoSettings } from '@/shared/lib/settings/client';
24
+ import { DEFAULT_SESSION_LIST_LIMIT } from '@/shared/lib/workspace/session-list-limit';
25
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
26
+
27
+ let container: HTMLElement | null = null;
28
+ let seen: number | null = null;
29
+
30
+ function Probe() {
31
+ seen = useSessionListLimit();
32
+ return h('span', null, String(seen));
33
+ }
34
+
35
+ beforeAll(() => {
36
+ installDomGlobals(new Window({ url: 'http://localhost' }));
37
+ });
38
+
39
+ afterEach(() => {
40
+ if (container) render(null, container);
41
+ container?.remove();
42
+ container = null;
43
+ seen = null;
44
+ });
45
+
46
+ afterAll(() => {
47
+ restoreDomGlobals();
48
+ });
49
+
50
+ describe('session list limit', () => {
51
+ test('reads the stored count, and the shipped count when it is absent', () => {
52
+ primeKabmoSettings({ sidebarSessionLimit: 25 });
53
+ expect(currentSessionListLimit()).toBe(25);
54
+
55
+ primeKabmoSettings({});
56
+ expect(currentSessionListLimit()).toBe(DEFAULT_SESSION_LIST_LIMIT);
57
+ });
58
+
59
+ test('announces the resolved count so a stored out-of-range value cannot leak', () => {
60
+ const received: unknown[] = [];
61
+ window.addEventListener(SESSION_LIST_LIMIT_CHANGED_EVENT, (event) =>
62
+ received.push((event as CustomEvent).detail),
63
+ );
64
+
65
+ applySessionListLimit(30);
66
+ applySessionListLimit(0);
67
+
68
+ expect(received).toEqual([30, 1]);
69
+ });
70
+
71
+ test('a mounted list follows the announced count', () => {
72
+ primeKabmoSettings({ sidebarSessionLimit: 10 });
73
+ container = document.body.appendChild(document.createElement('div'));
74
+ act(() => render(h(Probe, {}), container as HTMLElement));
75
+ expect(seen).toBe(10);
76
+
77
+ act(() => applySessionListLimit(40));
78
+ expect(seen).toBe(40);
79
+ });
80
+ });