@kabmo-labs/kabmo 0.45.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +412 -412
  3. package/dist/client/static/js/{CsvGrid-z74weshk.js → CsvGrid-br4j001k.js} +2 -2
  4. package/dist/client/static/js/{DocxView-dpe5x9ab.js → DocxView-kmtkbmmw.js} +3 -3
  5. package/dist/client/static/js/{DrawioView-ftzwjf8v.js → DrawioView-3df0g3jr.js} +2 -2
  6. package/dist/client/static/js/ImageView-2r8p5z3y.js +1 -0
  7. package/dist/client/static/js/LayoutWrapper-rq3d2a4e.js +2 -0
  8. package/dist/client/static/js/Modal-tmxhxd6q.js +59 -0
  9. package/dist/client/static/js/{PdfView-vjec8z3z.js → PdfView-p5z7c7eg.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-g7z3fxbp.js → SessionsView-t06h6zfx.js} +1 -1
  11. package/dist/client/static/js/{SheetView-hhtfkdhe.js → SheetView-agw459v2.js} +19 -19
  12. package/dist/client/static/js/{SvgPreview-48n3ex6p.js → SvgPreview-b9rfy1h6.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-bpvzdara.js → abnfDiagram-O67JEVCF-wbnhzcnj.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xw62cr7j.js → architectureDiagram-NJMV4G6O-t2sgevea.js} +3 -3
  16. package/dist/client/static/js/{astro-56b0as3q.js → astro-hyj5wege.js} +1 -1
  17. package/dist/client/static/js/bash-8d8z8zrg.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-x3a6cgar.js → blockDiagram-BEXU5L5S-v2nzp54a.js} +5 -5
  19. package/dist/client/static/js/c-acmn1zc9.js +1 -0
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-katvaxbj.js → c4Diagram-YGBWAQC7-7h03146b.js} +3 -3
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-bjz4mqqh.js → classDiagram-v2-NBCMYWYE-m57e9kp1.js} +7 -7
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-fsn80psf.js → cose-bilkent-JH36ORCC-c4tnh4mg.js} +1 -1
  23. package/dist/client/static/js/cpp-620mvjkk.js +1 -0
  24. package/dist/client/static/js/css-bt76kxbq.js +1 -0
  25. package/dist/client/static/js/css-drfs4n12.js +1 -0
  26. package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +1 -0
  27. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-cfhbsnkm.js → cynefinDiagram-VND7K2PF-mjf6njey.js} +1 -1
  28. package/dist/client/static/js/{dagre-6A5THRUB-j2wt7ns6.js → dagre-6A5THRUB-6yma9ch3.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-abrdj714.js → diagram-22UHCM2B-1q4ce2gb.js} +18 -18
  30. package/dist/client/static/js/{diagram-3UASUU5V-dbn15bxn.js → diagram-3UASUU5V-0ttps29p.js} +1 -1
  31. package/dist/client/static/js/{diagram-ATOU4E4O-y79pwf7w.js → diagram-ATOU4E4O-1mzexgv1.js} +3 -3
  32. package/dist/client/static/js/{diagram-CDSNMT55-f8ryt86n.js → diagram-CDSNMT55-4ae89t23.js} +4 -4
  33. package/dist/client/static/js/{diagram-MLGK6HIB-ws7wn3q9.js → diagram-MLGK6HIB-057jaqvh.js} +2 -2
  34. package/dist/client/static/js/{diagram-MPIPVDR6-zmznrg13.js → diagram-MPIPVDR6-p6yyq5sx.js} +2 -2
  35. package/dist/client/static/js/{dockerfile-qgc921kw.js → dockerfile-00hqsk9c.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-y5q7hy1v.js → ebnfDiagram-ZINNZB2B-bsk7dvm4.js} +1 -1
  37. package/dist/client/static/js/{elixir-12pgbgtq.js → elixir-80wq7gak.js} +1 -1
  38. package/dist/client/static/js/{elk-276RUBZZ-vddwbn6q.js → elk-276RUBZZ-dsq91er5.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-qdqcx4g4.js → erDiagram-OPXOYQCR-p7p13mbh.js} +9 -9
  40. package/dist/client/static/js/{erlang-811btv6p.js → erlang-814e8qy5.js} +1 -1
  41. package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +1 -0
  42. package/dist/client/static/js/flowDiagram-KWPJA3E3-7b4w6phx.js +1 -0
  43. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-763hk9rm.js → ganttDiagram-FUAMR5RP-bwgnttyk.js} +4 -4
  44. package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +1 -0
  45. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-bgx1q5nw.js → gitGraphDiagram-X574FWY7-ca0gj5am.js} +13 -13
  46. package/dist/client/static/js/graphql-j1a6zp7m.js +1 -0
  47. package/dist/client/static/js/html-m0megrvb.js +1 -0
  48. package/dist/client/static/js/index-064vdkrs.js +2 -0
  49. package/dist/client/static/js/{index-w57zbym7.js → index-16sd19f0.js} +2 -2
  50. package/dist/client/static/js/{index-qt9jc4ck.js → index-19x11s5w.js} +2 -2
  51. package/dist/client/static/js/{index-2b1wnvez.js → index-1c2jvnyh.js} +2 -2
  52. package/dist/client/static/js/{index-jpp0zm7t.js → index-29npynva.js} +19 -19
  53. package/dist/client/static/js/{index-gcwmpfr4.js → index-2ks0m8ss.js} +2 -2
  54. package/dist/client/static/js/{index-pfj3sd1n.js → index-33qxg79j.js} +7 -7
  55. package/dist/client/static/js/index-3bf7r7z4.js +12 -0
  56. package/dist/client/static/js/index-3qnjdjg2.js +1 -0
  57. package/dist/client/static/js/index-4bqssvt6.js +2 -0
  58. package/dist/client/static/js/{index-03j5j1j0.js → index-561gkvve.js} +2 -2
  59. package/dist/client/static/js/{index-szk3vk8h.js → index-5gf52a6d.js} +2 -2
  60. package/dist/client/static/js/{index-fqatn0vh.js → index-5h8y54t6.js} +1 -1
  61. package/dist/client/static/js/{index-f51jxezc.js → index-5wz0y88c.js} +2 -2
  62. package/dist/client/static/js/{index-x2wvq4ae.js → index-64sqfr4a.js} +2 -2
  63. package/dist/client/static/js/{index-mwm8aptp.js → index-7055hdx1.js} +1 -1
  64. package/dist/client/static/js/index-8pksqzwq.js +1 -0
  65. package/dist/client/static/js/index-95kese1h.js +1 -0
  66. package/dist/client/static/js/{index-acphtw1r.js → index-9d3n04vb.js} +2 -2
  67. package/dist/client/static/js/{index-cj39b26c.js → index-aagt3382.js} +1 -1
  68. package/dist/client/static/js/{index-gzafyqsr.js → index-abs635a1.js} +56 -56
  69. package/dist/client/static/js/{index-xkwybnf3.js → index-amys498v.js} +198 -198
  70. package/dist/client/static/js/{index-vkerrwpa.js → index-bafe7hmd.js} +2 -2
  71. package/dist/client/static/js/{index-34ff2vq6.js → index-bjv5ga2e.js} +2 -2
  72. package/dist/client/static/js/{index-fbct0jcf.js → index-d23eacf2.js} +2 -2
  73. package/dist/client/static/js/{index-wqrdgt1g.js → index-dn7hg4em.js} +2 -2
  74. package/dist/client/static/js/index-dpy3ewrn.css +1 -0
  75. package/dist/client/static/js/{index-61j9qkck.js → index-dr5hca5b.js} +3 -3
  76. package/dist/client/static/js/{index-3h2mr90j.js → index-dxvtjn6a.js} +2 -2
  77. package/dist/client/static/js/index-eqhjs1yv.js +4 -0
  78. package/dist/client/static/js/{index-x7rfmwg8.js → index-ex5dtdx2.js} +6 -6
  79. package/dist/client/static/js/{index-228yzebd.js → index-f7te27n5.js} +5 -5
  80. package/dist/client/static/js/{index-6sqmhdyv.js → index-fj5rsp5v.js} +2 -2
  81. package/dist/client/static/js/{index-n1ga63de.js → index-g7s0wsag.js} +2 -2
  82. package/dist/client/static/js/index-gq5w5w8x.js +2 -0
  83. package/dist/client/static/js/{index-jaqjvk22.js → index-hkz2mz34.js} +2 -2
  84. package/dist/client/static/js/{index-gzp4j2h5.js → index-hnb66d3s.js} +2 -2
  85. package/dist/client/static/js/{index-h0rmkz9n.js → index-j718pxb3.js} +2 -2
  86. package/dist/client/static/js/{index-3sqndc9n.js → index-jkay7aw7.js} +2 -2
  87. package/dist/client/static/js/{index-05hx4ftf.js → index-k5zfzgez.js} +2 -2
  88. package/dist/client/static/js/{index-vgcm2g0g.js → index-kty4ncsr.js} +2 -2
  89. package/dist/client/static/js/{index-3d21hpk7.js → index-ncpwteyt.js} +2 -2
  90. package/dist/client/static/js/{index-pxq4v81r.js → index-nw5mvcaj.js} +2 -2
  91. package/dist/client/static/js/{index-f7paep2f.js → index-pwe6chtp.js} +1 -1
  92. package/dist/client/static/js/{index-8dtp7mt0.js → index-qf3y3ahx.js} +2 -2
  93. package/dist/client/static/js/{index-as1wptfa.js → index-qfxn7yh5.js} +2 -2
  94. package/dist/client/static/js/{index-dn6pqym4.js → index-qn200x1b.js} +6 -6
  95. package/dist/client/static/js/index-red856x6.js +1 -0
  96. package/dist/client/static/js/{index-e6any867.js → index-sa1675y0.js} +2 -2
  97. package/dist/client/static/js/{index-dgjerk4w.js → index-ta6gpcpw.js} +3 -3
  98. package/dist/client/static/js/{index-ehg2ftnp.js → index-trvqvb1v.js} +2 -2
  99. package/dist/client/static/js/{index-5b2vsbcf.js → index-twsbv1yn.js} +1 -1
  100. package/dist/client/static/js/{index-1nwwvv29.js → index-vjmg7kn5.js} +2 -2
  101. package/dist/client/static/js/{index-nzhwd6t3.js → index-wbws16ag.js} +2 -2
  102. package/dist/client/static/js/{index-gmq5pbcv.js → index-x1fqhhpp.js} +64 -64
  103. package/dist/client/static/js/{index-p21mvqc2.js → index-y2z8nsvw.js} +2 -2
  104. package/dist/client/static/js/{index-t0yv1375.js → index-z0fkfphe.js} +2 -2
  105. package/dist/client/static/js/{index-dmv2zasz.js → index-z4530r3c.js} +2 -2
  106. package/dist/client/static/js/{index-mrw7qweg.js → index-zedt16w7.js} +1 -1
  107. package/dist/client/static/js/{index-r6e44vkx.js → index-zq0qxb17.js} +2 -2
  108. package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +1 -0
  109. package/dist/client/static/js/{infoDiagram-VRGFBTTK-e66pw8d9.js → infoDiagram-VRGFBTTK-7q58qdf1.js} +2 -2
  110. package/dist/client/static/js/ini-5f4zqtqr.js +1 -0
  111. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ehc0q24d.js → ishikawaDiagram-OU5B5YK6-9jmeszag.js} +3 -3
  112. package/dist/client/static/js/java-jj41mty3.js +1 -0
  113. package/dist/client/static/js/javascript-n9w9p97f.js +1 -0
  114. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hye05qtd.js → journeyDiagram-ZHPQQLJL-0d7xe845.js} +5 -5
  115. package/dist/client/static/js/json-rnh2h17x.js +1 -0
  116. package/dist/client/static/js/jsx-4gecrt29.js +1 -0
  117. package/dist/client/static/js/{julia-mgsev9df.js → julia-yv2j8qd0.js} +1 -1
  118. package/dist/client/static/js/{kanban-definition-PNTS6WVX-vce614m8.js → kanban-definition-PNTS6WVX-7p83rwdn.js} +5 -5
  119. package/dist/client/static/js/lua-zszaw2f7.js +1 -0
  120. package/dist/client/static/js/markdown-nm6gw4v4.js +1 -0
  121. package/dist/client/static/js/{mermaid.core-gc79re5p.js → mermaid.core-hwhzw0wv.js} +7 -7
  122. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-ft1whaf5.js → mindmap-definition-NLK3R4M7-hy0rtr7t.js} +8 -8
  123. package/dist/client/static/js/one-dark-pro-4b8er03c.js +1 -0
  124. package/dist/client/static/js/one-light-e6r3vsz4.js +1 -0
  125. package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +1 -0
  126. package/dist/client/static/js/{pegDiagram-GJSIUBJH-2s4ykhaa.js → pegDiagram-GJSIUBJH-kd8t53tx.js} +1 -1
  127. package/dist/client/static/js/{perl-6n93vjsa.js → perl-917pjq5a.js} +1 -1
  128. package/dist/client/static/js/{php-w23nmbtc.js → php-hwz75qzt.js} +1 -1
  129. package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +1 -0
  130. package/dist/client/static/js/{pieDiagram-5QR66LMP-7h8dp0z3.js → pieDiagram-5QR66LMP-h3x03f80.js} +3 -3
  131. package/dist/client/static/js/properties-rkptax7r.js +1 -0
  132. package/dist/client/static/js/python-qf1se1mj.js +1 -0
  133. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-pteyxjxr.js → quadrantDiagram-O4NWA36T-y2b1ncbg.js} +6 -6
  134. package/dist/client/static/js/r-ms0cygq2.js +1 -0
  135. package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +1 -0
  136. package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +1 -0
  137. package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +1 -0
  138. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +1 -0
  139. package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +1 -0
  140. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-68z9wdt0.js → railroadDiagram-XR7U4H2S-x188rcxf.js} +1 -1
  141. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-c08nmey6.js → requirementDiagram-PLB6GJNP-g5e9fk17.js} +10 -10
  142. package/dist/client/static/js/{ruby-ag3b3t9t.js → ruby-er7ayhte.js} +1 -1
  143. package/dist/client/static/js/{rust-ke5ec0w5.js → rust-1v8xbxn9.js} +1 -1
  144. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2r3kvjs5.js → sankeyDiagram-IPEJSGJF-y9ht91gf.js} +4 -4
  145. package/dist/client/static/js/{sass-x0eez0kp.js → sass-n47tt136.js} +1 -1
  146. package/dist/client/static/js/{scss-qycakpjn.js → scss-kvev49ga.js} +1 -1
  147. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-ctjycd88.js → sequenceDiagram-PO4LG4MO-pp8s63rt.js} +19 -19
  148. package/dist/client/static/js/{sizeCapture-INFHLROL-97ndea95.js → sizeCapture-INFHLROL-k6dhfxex.js} +1 -1
  149. package/dist/client/static/js/sql-hd42h8wx.js +1 -0
  150. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-aqnmsb96.js → stateDiagram-v2-GCMORJYK-y3akpsm4.js} +3 -3
  151. package/dist/client/static/js/{svelte-tg19by0f.js → svelte-2pmz35vx.js} +1 -1
  152. package/dist/client/static/js/{swimlanes-2SLR337P-v50cx1nx.js → swimlanes-2SLR337P-89081dr3.js} +1 -1
  153. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3q2a15wc.js +8 -0
  154. package/dist/client/static/js/{timeline-definition-EJHVYXUP-1ggrtdcj.js → timeline-definition-EJHVYXUP-tz6r8g3q.js} +6 -6
  155. package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +1 -0
  156. package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +1 -0
  157. package/dist/client/static/js/tsx-gx7td06z.js +1 -0
  158. package/dist/client/static/js/typescript-1a808spn.js +1 -0
  159. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ybcwhpzs.js → usecaseDiagram-POWQR4AR-yq2y1b09.js} +44 -44
  160. package/dist/client/static/js/{vennDiagram-UO4OBE2U-p9ggrt07.js → vennDiagram-UO4OBE2U-qdmjf6x3.js} +7 -7
  161. package/dist/client/static/js/{vue-mhj4sme0.js → vue-d5gpjfgn.js} +1 -1
  162. package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +1 -0
  163. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-v79nb9kx.js → wardleyDiagram-VNRHLVJA-3n2sm7rj.js} +3 -3
  164. package/dist/client/static/js/xml-3117mxd9.js +1 -0
  165. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-43thqscz.js → xychartDiagram-PMCCYNJV-d7n2av2t.js} +5 -5
  166. package/dist/client/static/js/yaml-dmvh8vyt.js +1 -0
  167. package/extensions/kabmo-modes/index.ts +1 -1
  168. package/extensions/kabmo-modes/parked.test.ts +2 -2
  169. package/extensions/kabmo-modes/parked.ts +10 -9
  170. package/extensions/kabmo-modes/plan.test.ts +4 -4
  171. package/extensions/kabmo-modes/plan.ts +6 -6
  172. package/extensions/kabmo-modes/session.ts +2 -2
  173. package/package.json +1 -1
  174. package/src/client/components/common/FolderPicker.tsx +1 -1
  175. package/src/client/components/common/Modal.tsx +8 -3
  176. package/src/client/components/common/NotificationPermissionDialog.test.tsx +8 -3
  177. package/src/client/components/common/NotificationPermissionDialog.tsx +7 -9
  178. package/src/client/components/common/PWAInstallButton.tsx +1 -1
  179. package/src/client/components/common/header-panel-buttons/index.tsx +5 -1
  180. package/src/client/components/common/shell-update-button/Modal.tsx +31 -36
  181. package/src/client/components/common/shell-update-button/index.test.tsx +5 -2
  182. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +15 -0
  183. package/src/client/components/layout/desktop-layout/RightColumn.tsx +16 -0
  184. package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
  185. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +4 -6
  186. package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
  187. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
  188. package/src/client/components/mobile/LayoutWrapper.tsx +9 -43
  189. package/src/client/components/mobile/RightSidebar.tsx +27 -10
  190. package/src/client/components/mobile/SessionSidebar.tsx +112 -137
  191. package/src/client/components/mobile/drawer-strip.tsx +85 -0
  192. package/src/client/components/mobile/left-drawer-nav.test.tsx +350 -0
  193. package/src/client/components/mobile/mobile-drawer-reveals.test.tsx +194 -0
  194. package/src/client/components/mobile/mobile-drawer-reveals.ts +138 -0
  195. package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -24
  196. package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +57 -0
  197. package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +14 -87
  198. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +2 -7
  199. package/src/client/components/mobile/mobile-right-sidebar/Header.test.tsx +157 -0
  200. package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +109 -105
  201. package/src/client/components/mobile/mobile-right-sidebar/OutlineButton.tsx +1 -1
  202. package/src/client/components/mobile/mobile-right-sidebar/Overflow.tsx +95 -0
  203. package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +212 -0
  204. package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +7 -9
  205. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +2 -2
  206. package/src/client/components/mobile/mobile-session-sidebar/use-dock.ts +29 -8
  207. package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +96 -0
  208. package/src/client/components/settings/Band.test.tsx +83 -0
  209. package/src/client/components/settings/Band.tsx +96 -0
  210. package/src/client/components/settings/Modal.tsx +44 -69
  211. package/src/client/components/settings/apply-side-effects.ts +15 -4
  212. package/src/client/components/settings/band-height.test.tsx +16 -3
  213. package/src/client/components/settings/categories/AppearanceSettings.test.tsx +35 -9
  214. package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
  215. package/src/client/components/settings/categories/ChatSettings.test.tsx +32 -9
  216. package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
  217. package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
  218. package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +40 -223
  219. package/src/client/components/settings/categories/appearance-settings/nav-choice.tsx +176 -0
  220. package/src/client/components/settings/categories/appearance-settings/nav-miniatures.tsx +93 -0
  221. package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +1 -1
  222. package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
  223. package/src/client/components/settings/categories/notification-settings/PermissionNotice.tsx +1 -1
  224. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
  225. package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +1 -1
  226. package/src/client/components/settings/drill.tsx +113 -0
  227. package/src/client/components/settings/master-detail/GroupDetail.tsx +14 -6
  228. package/src/client/components/settings/master-detail/GroupSidebar.tsx +9 -1
  229. package/src/client/components/settings/master-detail/index.tsx +45 -25
  230. package/src/client/components/workspace/chat-timeline/MobileTurnJump.tsx +1 -1
  231. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +1 -1
  232. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +4 -0
  233. package/src/client/components/workspace/chat-timeline/ToolCallingSection.test.ts +23 -6
  234. package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
  235. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +19 -2
  236. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +1 -1
  237. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +1 -1
  238. package/src/client/components/workspace/chat-timeline/index.tsx +5 -9
  239. package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
  240. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx +4 -4
  241. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +127 -0
  242. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +225 -0
  243. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx +5 -4
  244. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
  245. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +2 -2
  246. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +4 -3
  247. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +40 -4
  248. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Footer.tsx +1 -1
  249. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +1 -1
  250. package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +5 -1
  251. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +8 -3
  252. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +5 -0
  253. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +16 -7
  254. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +16 -4
  255. package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +37 -12
  256. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +4 -3
  257. package/src/client/components/workspace/diff-panel/index.tsx +1 -1
  258. package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +1 -1
  259. package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
  260. package/src/client/components/workspace/file-explorer/Modals.tsx +4 -4
  261. package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
  262. package/src/client/components/workspace/model-dropdown/CloseButton.tsx +38 -0
  263. package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +16 -25
  264. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +30 -9
  265. package/src/client/components/workspace/model-dropdown/Header.tsx +33 -21
  266. package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -4
  267. package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +139 -0
  268. package/src/client/components/workspace/model-dropdown/placement.test.tsx +9 -7
  269. package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
  270. package/src/client/components/workspace/wiki-panel/NavModal.tsx +1 -1
  271. package/src/client/data/settings/omp-schema.json +103 -42
  272. package/src/client/hooks/chat/timeline/ask-form-frame.ts +33 -0
  273. package/src/client/hooks/chat/timeline/ask-frame-asks.ts +68 -0
  274. package/src/client/hooks/chat/timeline/ask-frame-buckets.ts +77 -0
  275. package/src/client/hooks/chat/timeline/ask-frames-context.ts +68 -0
  276. package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +170 -0
  277. package/src/client/hooks/chat/timeline/ask-frames.test.ts +1 -1
  278. package/src/client/hooks/chat/timeline/ask-frames.ts +36 -93
  279. package/src/client/hooks/workspace/left-dock.ts +19 -0
  280. package/src/client/hooks/workspace/mobile-panel-nav.ts +90 -0
  281. package/src/client/hooks/workspace/panel-nav.test.ts +42 -21
  282. package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +283 -0
  283. package/src/client/hooks/workspace/panel-tabs-reveal.ts +162 -0
  284. package/src/client/hooks/workspace/panel-tabs.ts +19 -2
  285. package/src/client/lib/ui/phone-row.test.ts +52 -0
  286. package/src/client/lib/ui/phone-row.ts +71 -0
  287. package/src/client/press-state.test.ts +179 -0
  288. package/src/client/tailwind.css +146 -0
  289. package/src/server/lib/bundler/titlebar-css.test.ts +10 -1
  290. package/src/server/lib/omp/rpc/constants.test.ts +6 -1
  291. package/src/shared/lib/chat/ask-form/data.ts +155 -0
  292. package/src/shared/lib/chat/ask-form/fields.ts +4 -0
  293. package/src/shared/lib/chat/ask-form/index.ts +8 -0
  294. package/src/shared/lib/chat/ask-form/types.ts +12 -0
  295. package/src/shared/lib/chat/timeline/tool-verbs.ts +28 -1
  296. package/src/shared/lib/chat/tool/tool-commands.test.ts +102 -0
  297. package/src/shared/lib/chat/tool/tool-commands.ts +124 -0
  298. package/src/shared/lib/omp/config/schema-releases.test.ts +34 -1
  299. package/src/shared/lib/omp/dialog-methods.ts +6 -0
  300. package/src/shared/lib/omp/session/wait-idle.ts +7 -3
  301. package/src/shared/lib/settings/defaults.ts +3 -2
  302. package/src/shared/lib/workspace/panel-nav.test.ts +26 -19
  303. package/src/shared/lib/workspace/panel-nav.ts +20 -9
  304. package/src/shared/types/omp/agent.ts +20 -3
  305. package/src/shared/types/settings/state.ts +17 -5
  306. package/dist/client/static/js/ImageView-vchn6wyq.js +0 -1
  307. package/dist/client/static/js/LayoutWrapper-1x0gnppc.js +0 -2
  308. package/dist/client/static/js/Modal-tteg7vtb.js +0 -59
  309. package/dist/client/static/js/architecture-7GRP2DOG-bch3nye9.js +0 -1
  310. package/dist/client/static/js/bash-mevzaywf.js +0 -1
  311. package/dist/client/static/js/c-y1y6v00q.js +0 -1
  312. package/dist/client/static/js/cpp-wk9z0c5g.js +0 -1
  313. package/dist/client/static/js/css-3w3p9s67.js +0 -1
  314. package/dist/client/static/js/css-g85rwzty.js +0 -1
  315. package/dist/client/static/js/cynefin-OW5HDTMX-vqy5jtnk.js +0 -1
  316. package/dist/client/static/js/eventmodeling-NTZA5JFV-65ph4s3m.js +0 -1
  317. package/dist/client/static/js/flowDiagram-KWPJA3E3-nh2tb65b.js +0 -1
  318. package/dist/client/static/js/gitGraph-4MIJSDKK-t45ekjb6.js +0 -1
  319. package/dist/client/static/js/graphql-027z8sc0.js +0 -1
  320. package/dist/client/static/js/html-fqda6wxx.js +0 -1
  321. package/dist/client/static/js/index-0vk6v4y4.js +0 -2
  322. package/dist/client/static/js/index-47wn2gjx.js +0 -2
  323. package/dist/client/static/js/index-4b5b6g0k.js +0 -1
  324. package/dist/client/static/js/index-5mrqfs82.js +0 -12
  325. package/dist/client/static/js/index-6bm4pw90.css +0 -1
  326. package/dist/client/static/js/index-a11ptyzf.js +0 -1
  327. package/dist/client/static/js/index-f98dhbt4.js +0 -4
  328. package/dist/client/static/js/index-kg2sk8cf.js +0 -1
  329. package/dist/client/static/js/index-q76jfb54.js +0 -1
  330. package/dist/client/static/js/info-A6RAGUB7-mw29xbwf.js +0 -1
  331. package/dist/client/static/js/ini-3cx6tmv4.js +0 -1
  332. package/dist/client/static/js/java-zs6qh1dm.js +0 -1
  333. package/dist/client/static/js/javascript-b9mkygak.js +0 -1
  334. package/dist/client/static/js/json-qn73s8xb.js +0 -1
  335. package/dist/client/static/js/jsx-gahhfczw.js +0 -1
  336. package/dist/client/static/js/lua-d8enp14s.js +0 -1
  337. package/dist/client/static/js/markdown-qetaj4vp.js +0 -1
  338. package/dist/client/static/js/one-dark-pro-rvg5xm1a.js +0 -1
  339. package/dist/client/static/js/one-light-2b5w3ksh.js +0 -1
  340. package/dist/client/static/js/packet-AYTQ26CC-md85wpjq.js +0 -1
  341. package/dist/client/static/js/pie-WAS4IAKB-4grcqnp8.js +0 -1
  342. package/dist/client/static/js/properties-g6tpq003.js +0 -1
  343. package/dist/client/static/js/python-cy06fzhg.js +0 -1
  344. package/dist/client/static/js/r-vw8berfv.js +0 -1
  345. package/dist/client/static/js/radar-RG4KPBEZ-7j9prhg1.js +0 -1
  346. package/dist/client/static/js/railroad-74A4TZTK-g8x2jps1.js +0 -1
  347. package/dist/client/static/js/railroad-abnf-HS5TGJTU-cbg7k68h.js +0 -1
  348. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-xfvjk9f8.js +0 -1
  349. package/dist/client/static/js/railroad-peg-WCYAUIDC-7w97805z.js +0 -1
  350. package/dist/client/static/js/sql-bwnasywx.js +0 -1
  351. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-e227mz39.js +0 -8
  352. package/dist/client/static/js/treeView-Q6P3EWNA-xhf1r6c3.js +0 -1
  353. package/dist/client/static/js/treemap-WGGIJYW6-4n3j7ekq.js +0 -1
  354. package/dist/client/static/js/tsx-3dzv8h6k.js +0 -1
  355. package/dist/client/static/js/typescript-44vs0wn4.js +0 -1
  356. package/dist/client/static/js/wardley-WFR3VGLG-fb0py35r.js +0 -1
  357. package/dist/client/static/js/xml-yvv5fn3k.js +0 -1
  358. package/dist/client/static/js/yaml-avewh7n5.js +0 -1
  359. package/src/client/hooks/workspace/mobile-right-panel-nav.ts +0 -63
  360. package/src/shared/lib/ui/safe-area.test.ts +0 -28
  361. package/src/shared/lib/ui/safe-area.ts +0 -42
@@ -0,0 +1,350 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's LEFT drawer, in each of its two chromes.
8
+ *
9
+ * The drawer shipped as a session list with a chip row above it — the phone's
10
+ * version of the desktop activity rail. `mobileLeftPanelNav` adds the desktop's
11
+ * working set: a strip of opened views over a home page, with the session list
12
+ * as the PINNED first chip, which is the same shape `LeftColumn` draws on a
13
+ * desktop.
14
+ *
15
+ * Three properties, and each is what makes the mode honest rather than cosmetic:
16
+ *
17
+ * - the chrome is CHOSEN by the setting, and the other one is absent (not merely
18
+ * hidden) — a chip row and a tab strip together would be two answers to one
19
+ * question;
20
+ * - **Sessions is pinned**: it leads the strip and has no close control, so a
21
+ * drawer cannot be closed down to a home page with no way back to another
22
+ * chat;
23
+ * - the drawer follows the RAIL switch, exactly like the desktop column: with
24
+ * the rail off there is no strip to open a view from, so the style is inert.
25
+ */
26
+
27
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
28
+ import { Window } from 'happy-dom';
29
+ import { h, render } from 'preact';
30
+ import { act } from 'preact/test-utils';
31
+ import { MobileSessionSidebar } from '@/client/components/mobile/SessionSidebar';
32
+ import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
33
+ import { primeKabmoSettings } from '@/shared/lib/settings/client';
34
+ import { resetSessionStateStore } from '@/shared/lib/workspace/session-state/store';
35
+ import { writeLeftDock } from '@/shared/lib/workspace/left-dock';
36
+ import { silenceRealtime, restoreRealtime } from '@/test-support/silent-socket';
37
+
38
+ const DOM_GLOBALS = [
39
+ 'window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement',
40
+ 'Event', 'MouseEvent', 'KeyboardEvent',
41
+ ] as const;
42
+ const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
43
+ const realFetch = globalThis.fetch;
44
+
45
+ let win: Window;
46
+ let container: HTMLElement;
47
+
48
+ beforeAll(() => {
49
+ // Answers EVERY endpoint with an empty JSON object: the drawer reads the
50
+ // session blob, and opening its catalog triggers the update flow's own read.
51
+ // A single canned body is enough for both, and one stub keeps a missing
52
+ // endpoint from failing as an unrelated `undefined` deeper in a hook.
53
+ globalThis.fetch = (async () =>
54
+ new Response(JSON.stringify({ state: {}, kabmo: {}, omp: {} }), {
55
+ status: 200,
56
+ })) as unknown as typeof fetch;
57
+ win = new Window({ url: 'http://localhost' });
58
+ const target = globalThis as unknown as Record<string, unknown>;
59
+ for (const key of DOM_GLOBALS) {
60
+ if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
61
+ target[key] = (win as unknown as Record<string, unknown>)[key];
62
+ }
63
+ });
64
+
65
+ afterAll(async () => {
66
+ await act(async () => {
67
+ await Bun.sleep(60);
68
+ });
69
+ globalThis.fetch = realFetch;
70
+ const target = globalThis as unknown as Record<string, unknown>;
71
+ for (const key of DOM_GLOBALS) {
72
+ const value = nativeGlobals[key];
73
+ if (value === undefined) delete target[key];
74
+ else target[key] = value;
75
+ }
76
+ });
77
+
78
+ beforeEach(() => {
79
+ silenceRealtime();
80
+ refreshCalls.count = 0;
81
+ // The store is a module singleton: a tab set left by one test would seed the
82
+ // next one's drawer.
83
+ resetSessionStateStore();
84
+ container = document.createElement('div');
85
+ document.body.appendChild(container);
86
+ primeKabmoSettings({});
87
+ });
88
+
89
+ afterEach(async () => {
90
+ if (container) {
91
+ await act(() => {
92
+ render(null, container);
93
+ });
94
+ container.remove();
95
+ }
96
+ restoreRealtime();
97
+ });
98
+
99
+ /** A built-in view placed on the dock, so the catalog has something to open. */
100
+ const PLACED = 'files';
101
+
102
+ /** Counts the workspace-refresh requests the drawer makes. */
103
+ const refreshCalls = { count: 0 };
104
+
105
+ /** Mount the drawer with a given style and rail state. */
106
+ async function mount(style: 'classic' | 'tabs', railEnabled = true) {
107
+ primeKabmoSettings({ mobileLeftPanelNav: style });
108
+ // The rail switch and the placement are ONE global setting
109
+ // (`omp_left_panels`), read through `useLeftDock`. Writing them before the
110
+ // mount is what the user's Settings click and a drop do. A placed panel is
111
+ // what gives the catalog a second card to open.
112
+ writeLeftDock({ enabled: railEnabled, panels: [PLACED] });
113
+ await act(async () => {
114
+ render(
115
+ h(SessionStateProvider, {
116
+ sessionId: 'session-left-drawer-nav',
117
+ children: h(MobileSessionSidebar, {
118
+ activeSessionId: null,
119
+ onSelectSession: () => {},
120
+ onNewSession: () => {},
121
+ onNewSessionForFolder: () => {},
122
+ onClose: () => {},
123
+ // The drawer's `onRefresh` is the WORKSPACE refresh the layout hands
124
+ // down (`LayoutWrapper` passes `handleWorkspaceChanged`), so counting
125
+ // it is how this test tells the two refreshes apart.
126
+ onRefresh: () => {
127
+ refreshCalls.count += 1;
128
+ },
129
+ }),
130
+ }),
131
+ container,
132
+ );
133
+ });
134
+ await settle();
135
+ }
136
+
137
+ /** Deferred commit + provider load. Polls instead of a fixed 40ms sleep: the
138
+ * sleep made this suite order-dependent (the header was sometimes not drawn
139
+ * yet, failing "the strip draws no second close control" about once per two
140
+ * full runs). Waits for the row BOTH chromes draw. */
141
+ async function settle() {
142
+ const deadline = Date.now() + 2000;
143
+ while (Date.now() < deadline) {
144
+ await act(async () => {
145
+ await Bun.sleep(10);
146
+ });
147
+ if (container.querySelector('button[aria-label="Close sidebar"]')) return;
148
+ }
149
+ }
150
+
151
+ const stripChips = () =>
152
+ [...container.querySelectorAll('[role="tablist"] [role="tab"]')].map((chip) =>
153
+ chip.textContent?.trim(),
154
+ );
155
+
156
+ /**
157
+ * The dock's chip row, identified by what only it draws: a pressed chip that
158
+ * names a VIEW. The session list's own filter chips ("All", "Running",
159
+ * "Archived") are also `aria-pressed`, so a bare count would be measuring the
160
+ * list rather than the chrome.
161
+ */
162
+ const dockChips = () =>
163
+ [...container.querySelectorAll('[aria-pressed][aria-label]')].filter((chip) =>
164
+ ['Sessions', 'Files', 'GIT', 'Search', 'Terminal'].some((name) =>
165
+ chip.getAttribute('aria-label')?.startsWith(name),
166
+ ),
167
+ );
168
+
169
+ describe('the left drawer chrome follows the setting', () => {
170
+ test('classic draws the chip row and no tab strip', async () => {
171
+ await mount('classic');
172
+ expect(container.querySelector('[role="tablist"]')).toBeNull();
173
+ // The rail's own chip row: `Sessions` is always in it when the rail is on.
174
+ expect(dockChips().length).toBeGreaterThan(0);
175
+ });
176
+
177
+ test('tabs draws the strip and no chip row', async () => {
178
+ await mount('tabs');
179
+ expect(container.querySelector('[role="tablist"]')).not.toBeNull();
180
+ expect(dockChips().length).toBe(0);
181
+ });
182
+ });
183
+
184
+ /**
185
+ * The dead-end rule, and the reason this drawer is not a copy of the right one:
186
+ * the session list is pinned, so it can never be closed away.
187
+ */
188
+ describe('the session list is pinned under tabs', () => {
189
+ test('Sessions leads the strip', async () => {
190
+ await mount('tabs');
191
+ const chips = stripChips();
192
+ expect(chips[0]).toContain('Sessions');
193
+ });
194
+
195
+ test('the pinned chip has no close control, and a placed view does', async () => {
196
+ await mount('tabs');
197
+ const pinned = container.querySelector('[role="tab"]') as HTMLElement;
198
+ expect(pinned.textContent).toContain('Sessions');
199
+ expect(pinned.querySelector('[aria-label^="Tutup tab"]')).toBeNull();
200
+ });
201
+ });
202
+
203
+ /**
204
+ * The working set, not the catalog: opening a view from the home page puts ONE
205
+ * chip beside the pinned `Sessions` — which is what makes this the desktop's
206
+ * shape rather than a restyled chip row.
207
+ */
208
+ describe('the strip is a working set', () => {
209
+ /** Open the catalog from the strip's add control. */
210
+ async function showCatalog() {
211
+ const add = container.querySelector('[aria-label="Tambah tab"]') as HTMLElement | undefined;
212
+ expect(add).not.toBeNull();
213
+ await act(() => {
214
+ add?.click();
215
+ });
216
+ await settle();
217
+ }
218
+
219
+ test('the drawer opens on the pinned view, not on the catalog', async () => {
220
+ await mount('tabs');
221
+ // The pinned view IS a tab, so a fresh drawer has something on screen —
222
+ // the same reason the desktop column never opens on a blank body.
223
+ expect(stripChips().length).toBe(1);
224
+ expect(container.textContent).not.toContain('Klik kartu');
225
+ });
226
+
227
+ test('opening a view from the catalog adds its chip beside the pinned one', async () => {
228
+ await mount('tabs');
229
+ await showCatalog();
230
+ const card = [...container.querySelectorAll('[aria-label^="Buka "]')][0] as HTMLElement | undefined;
231
+ expect(card).toBeDefined();
232
+ await act(() => {
233
+ card?.click();
234
+ });
235
+ await settle();
236
+ expect(stripChips().length).toBe(2);
237
+ expect(stripChips()[0]).toContain('Sessions');
238
+ });
239
+
240
+ test('closing that view returns to the pinned one, never to a blank drawer', async () => {
241
+ await mount('tabs');
242
+ await showCatalog();
243
+ const card = [...container.querySelectorAll('[aria-label^="Buka "]')][0] as HTMLElement | undefined;
244
+ await act(() => {
245
+ card?.click();
246
+ });
247
+ await settle();
248
+ const closers = [...container.querySelectorAll('[aria-label^="Tutup tab"]')] as HTMLElement[];
249
+ // Exactly one close control: the pinned Sessions chip has none.
250
+ expect(closers.length).toBe(1);
251
+ await act(() => {
252
+ closers[0]?.click();
253
+ });
254
+ await settle();
255
+ expect(stripChips().length).toBe(1);
256
+ expect(stripChips()[0]).toContain('Sessions');
257
+ });
258
+ });
259
+
260
+ /**
261
+ * The drawer keeps its TITLE BAR and its FOOTER in both chromes.
262
+ *
263
+ * Both were lost when the tab style landed, and each for its own reason:
264
+ *
265
+ * - the header was dropped on the argument that the strip is the drawer's whole
266
+ * chrome — true of the RIGHT drawer, wrong here, because the left column's
267
+ * header carries the wordmark, the server chip and the close control, exactly
268
+ * as the desktop column draws a title row above its strip (40 + 38 + 40).
269
+ * Without it the only way back to the chat was the Android back gesture.
270
+ * - the footer fell off screen because `PanelTabsColumn` is `h-full`, and as a
271
+ * flex child of the drawer's column that 100% pushed the footer out of the
272
+ * box. The strip's wrapper must be `flex-1 min-h-0` so the footer keeps its
273
+ * own row.
274
+ */
275
+ describe('the drawer keeps its title bar and footer in both chromes', () => {
276
+ for (const style of ['classic', 'tabs'] as const) {
277
+ test(`${style} draws the wordmark header with its close control`, async () => {
278
+ await mount(style);
279
+ // The header is the drawer's own title bar, not the strip: it carries the
280
+ // wordmark and the labelled close control.
281
+ const close = container.querySelector('button[aria-label="Close sidebar"]');
282
+ expect(close).not.toBeNull();
283
+ expect(container.textContent).toContain('Kabmo');
284
+ });
285
+
286
+ test(`${style} draws the footer`, async () => {
287
+ await mount(style);
288
+ // The footer's own rows: Settings · Keys · About.
289
+ expect(container.textContent).toContain('Settings');
290
+ expect(container.textContent).toContain('Keys');
291
+ expect(container.textContent).toContain('About');
292
+ });
293
+ }
294
+
295
+ test('the strip column is a shrinking flex child, so the footer keeps its row', async () => {
296
+ await mount('tabs');
297
+ const strip = container.querySelector('[role="tablist"]') as HTMLElement;
298
+ const wrapper = strip.closest('.flex-1.min-h-0') as HTMLElement | null;
299
+ // `PanelTabsColumn` is `h-full`. As a flex child of the drawer's column,
300
+ // 100% resolved against the whole box and pushed the footer off screen —
301
+ // measured in Chromium before the wrapper: the drawer had exactly two rows
302
+ // (strip 56 + body 788) and no footer at all. happy-dom does not lay out,
303
+ // so the CONTRACT is what a DOM test can hold; the pixels are checked in a
304
+ // browser.
305
+ expect(wrapper).not.toBeNull();
306
+ expect(wrapper?.className).toContain('min-h-0');
307
+ });
308
+
309
+ /**
310
+ * The strip draws NO trailing action at all.
311
+ *
312
+ * A refresh there was tried and removed: the four views that read
313
+ * `refreshKey` (Files, GIT, Context, WIKI) each draw their own refresh in
314
+ * their own toolbar, beside the repo picker it re-reads, and the other five
315
+ * (Search, Terminal, Usage, Todos, Plan) ignore `refreshKey` entirely — so
316
+ * the button was redundant in one case and dead in the other. Measured on the
317
+ * running drawer with Files open: one click issued zero requests.
318
+ *
319
+ * The session list's own "Refresh sessions" lives in `MobileSessionToolbar`,
320
+ * which is why the DESKTOP column keeps a strip refresh and this drawer does
321
+ * not: the desktop's session list has no such control.
322
+ */
323
+ test('the strip draws no trailing action', async () => {
324
+ await mount('tabs');
325
+ const strip = container.querySelector('[role="tablist"]') as HTMLElement;
326
+ expect(strip.querySelector('[aria-label="Muat ulang view"]')).toBeNull();
327
+ // And nothing else took its place in the trailing slot.
328
+ expect(strip.querySelector('[aria-label="Tutup panel kiri"]')).toBeNull();
329
+ expect(refreshCalls.count).toBe(0);
330
+ });
331
+
332
+ test('the strip draws no second close control under the header', async () => {
333
+ await mount('tabs');
334
+ // Two close controls 56px apart doing the same thing was the defect; the
335
+ // header owns the only one.
336
+ expect(container.querySelectorAll('[aria-label="Close left sidebar"]').length).toBe(0);
337
+ expect(container.querySelector('[aria-label="Close sidebar"]')).not.toBeNull();
338
+ });
339
+ });
340
+
341
+ /**
342
+ * The rail switch is what the style hangs on, exactly as on the desktop: with
343
+ * no rail there is no strip, so a tab style has nothing to open a view from.
344
+ */
345
+ describe('the style is inert without the rail', () => {
346
+ test('tabs with the rail off draws no strip at all', async () => {
347
+ await mount('tabs', false);
348
+ expect(container.querySelector('[role="tablist"]')).toBeNull();
349
+ });
350
+ });
@@ -0,0 +1,194 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's two drawers as SCREENS.
8
+ *
9
+ * A drawer here is not a column: the right one unmounts when it closes and the
10
+ * left one's screen stays mounted, so "the drawer appeared" cannot tell a
11
+ * header REVEAL from a named open. The counters are that distinction, and these
12
+ * tests pin each way they move:
13
+ *
14
+ * - a header press bumps its own counter and picks its screen;
15
+ * - a named open writes the tab through the store and picks the screen the
16
+ * PLACEMENT resolves, not the panel's slot;
17
+ * - a named open of the RIGHT drawer clears its counter, so a fresh drawer opens
18
+ * on the stored tab instead of reading as a reveal;
19
+ * - an `editor`-slot takeover resolves to no drawer and changes nothing.
20
+ */
21
+
22
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
23
+ import { Window } from 'happy-dom';
24
+ import { h, render } from 'preact';
25
+ import { act } from 'preact/test-utils';
26
+ import { useState } from 'preact/hooks';
27
+ import {
28
+ useMobileDrawerReveals,
29
+ type MobileDrawerReveals,
30
+ type MobileScreen,
31
+ } from '@/client/components/mobile/mobile-drawer-reveals';
32
+ import { requestOpenPanel } from '@/shared/lib/workspace/panel-open';
33
+ import {
34
+ getSessionValue,
35
+ resetSessionStateStore,
36
+ } from '@/shared/lib/workspace/session-state/store';
37
+ import type { LeftDockHandle } from '@/client/hooks/workspace/left-dock';
38
+ import { silenceRealtime, restoreRealtime } from '@/test-support/silent-socket';
39
+
40
+ const DOM_GLOBALS = [
41
+ 'window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement',
42
+ 'Event', 'MouseEvent', 'KeyboardEvent', 'CustomEvent',
43
+ ] as const;
44
+ const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
45
+ const realFetch = globalThis.fetch;
46
+
47
+ const SESSION = 'session-drawer-reveals';
48
+ let win: Window;
49
+ let container: HTMLElement;
50
+ let drawers: MobileDrawerReveals;
51
+
52
+ /** The hook needs a real screen state: it must re-render when the drawer moves. */
53
+ function Probe({ dock }: { dock: LeftDockHandle }) {
54
+ const [screen, setScreen] = useState<MobileScreen>('main');
55
+ drawers = useMobileDrawerReveals({
56
+ dock,
57
+ sessionId: SESSION,
58
+ currentScreen: screen,
59
+ setCurrentScreen: setScreen,
60
+ });
61
+ return h('p', null, screen);
62
+ }
63
+
64
+ function dockWith(panels: string[], enabled = false): LeftDockHandle {
65
+ return {
66
+ enabled,
67
+ panels,
68
+ setEnabled: () => {},
69
+ setSide: () => {},
70
+ setOrder: () => {},
71
+ widthOf: () => 280,
72
+ commitWidth: () => {},
73
+ };
74
+ }
75
+
76
+ beforeAll(() => {
77
+ globalThis.fetch = (async () =>
78
+ new Response(JSON.stringify({ state: {} }), { status: 200 })) as unknown as typeof fetch;
79
+ win = new Window({ url: 'http://localhost' });
80
+ const target = globalThis as unknown as Record<string, unknown>;
81
+ for (const key of DOM_GLOBALS) {
82
+ if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
83
+ target[key] = (win as unknown as Record<string, unknown>)[key];
84
+ }
85
+ });
86
+
87
+ afterAll(() => {
88
+ globalThis.fetch = realFetch;
89
+ const target = globalThis as unknown as Record<string, unknown>;
90
+ for (const key of DOM_GLOBALS) {
91
+ const value = nativeGlobals[key];
92
+ if (value === undefined) delete target[key];
93
+ else target[key] = value;
94
+ }
95
+ });
96
+
97
+ beforeEach(() => {
98
+ silenceRealtime();
99
+ resetSessionStateStore();
100
+ container = document.createElement('div');
101
+ document.body.appendChild(container);
102
+ });
103
+
104
+ afterEach(async () => {
105
+ await act(() => {
106
+ render(null, container);
107
+ });
108
+ container.remove();
109
+ restoreRealtime();
110
+ });
111
+
112
+ async function mount(dock: LeftDockHandle) {
113
+ await act(async () => {
114
+ render(h(Probe, { dock }), container);
115
+ });
116
+ }
117
+
118
+ describe('header presses are reveals', () => {
119
+ test('the sessions control bumps only the left counter', async () => {
120
+ await mount(dockWith([]));
121
+ expect(drawers.left).toBe(0);
122
+ expect(drawers.right).toBe(0);
123
+
124
+ await act(async () => drawers.openSessionDrawer());
125
+
126
+ expect(drawers.left).toBe(1);
127
+ expect(drawers.right).toBe(0);
128
+ expect(container.textContent).toBe('session');
129
+ });
130
+
131
+ test('the right-panel control bumps the right counter and opens its screen', async () => {
132
+ await mount(dockWith([]));
133
+
134
+ await act(async () => drawers.openRightDrawer());
135
+
136
+ expect(drawers.right).toBe(1);
137
+ expect(drawers.left).toBe(0);
138
+ expect(container.textContent).toBe('right');
139
+ // A header press does not name a view: it must NOT write a stored tab.
140
+ expect(getSessionValue(SESSION, 'layout.mobileRightPanel')).toBeUndefined();
141
+ });
142
+ });
143
+
144
+ describe('a named open is not a reveal', () => {
145
+ test('a right-placed panel opens the right screen on its stored tab', async () => {
146
+ await mount(dockWith([]));
147
+
148
+ await act(async () => drawers.openNamedPanel('files'));
149
+
150
+ expect(container.textContent).toBe('right');
151
+ expect(getSessionValue(SESSION, 'layout.mobileRightPanel')).toBe('files');
152
+ });
153
+
154
+ test('it clears the right counter so the fresh drawer is not a reveal', async () => {
155
+ await mount(dockWith([]));
156
+ await act(async () => drawers.openRightDrawer());
157
+ expect(drawers.right).toBe(1);
158
+
159
+ await act(async () => drawers.openNamedPanel('files'));
160
+
161
+ expect(drawers.right).toBe(0);
162
+ expect(container.textContent).toBe('right');
163
+ });
164
+
165
+ test('a left-placed panel opens the session screen and leaves the left counter alone', async () => {
166
+ await mount(dockWith(['files'], true));
167
+
168
+ await act(async () => drawers.openNamedPanel('files'));
169
+
170
+ expect(container.textContent).toBe('session');
171
+ expect(getSessionValue(SESSION, 'layout.mobileLeftPanel')).toBe('files');
172
+ expect(drawers.left).toBe(0);
173
+ });
174
+
175
+ test('the window event resolves the same way as the direct call', async () => {
176
+ await mount(dockWith([]));
177
+
178
+ await act(async () => requestOpenPanel('files'));
179
+
180
+ expect(container.textContent).toBe('right');
181
+ expect(getSessionValue(SESSION, 'layout.mobileRightPanel')).toBe('files');
182
+ });
183
+
184
+ test('an editor-slot takeover opens nothing', async () => {
185
+ await mount(dockWith([]));
186
+
187
+ await act(async () => drawers.openNamedPanel('plugin:demo:panel'));
188
+
189
+ expect(container.textContent).toBe('main');
190
+ expect(drawers.right).toBe(0);
191
+ expect(drawers.left).toBe(0);
192
+ expect(getSessionValue(SESSION, 'layout.mobileRightPanel')).toBeUndefined();
193
+ });
194
+ });
@@ -0,0 +1,138 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone layout's two drawers, as SCREENS: which one a request opens, and
8
+ * whether that request was a REVEAL.
9
+ *
10
+ * Both facts used to live inline in `LayoutWrapper`, and they are one subject:
11
+ * a drawer is not a column. It has no persistent strip to watch — the right one
12
+ * unmounts when it closes, and the left one's screen stays mounted so its
13
+ * drawer has no mount edge at all — which is why a header press and a named
14
+ * request (`omp:open-panel` from the Stats readout) have to be told apart by
15
+ * something other than "the drawer appeared".
16
+ *
17
+ * `revealSignal` is that something: a counter bumped ONLY by the header control
18
+ * that asks for the drawer, which the drawer reads through `useRevealSignal` and
19
+ * turns into "leave the catalog and show a view" (`panel-tabs-reveal`). A named
20
+ * request CLEARS the right drawer's counter, because it already says which view
21
+ * it wants and the stored tab is the answer.
22
+ *
23
+ * Extracted for the file ceiling, and it earns the boundary: the reveal rule,
24
+ * the keyboard arming and the drawer/screen mapping are one decision a reader
25
+ * should be able to follow without the layout's editor, drop target and diff
26
+ * screens in the way.
27
+ */
28
+
29
+ import { useCallback, useState } from 'preact/hooks';
30
+ import { useKabmoEvent } from '@/client/hooks/ui/window-event';
31
+ import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
32
+ import { DEFAULT_RIGHT_PANEL_TYPE } from '@/shared/lib/workspace/right-panels';
33
+ import { armTerminalSoftKeyboard } from '@/client/components/workspace/terminal-panel/soft-keyboard';
34
+ import { OPEN_PANEL_EVENT, phoneDrawerForPanel, type OpenPanelDetail } from '@/shared/lib/workspace/panel-open';
35
+ import type { LeftDockHandle } from '@/client/hooks/workspace/left-dock';
36
+
37
+ /** The phone's three screens. The drawers ARE two of them. */
38
+ export type MobileScreen = 'main' | 'session' | 'right';
39
+
40
+ export interface MobileDrawerReveals {
41
+ /** The counter the right drawer compares against — see this module's doc. */
42
+ right: number;
43
+ /** The counter the left drawer compares against. */
44
+ left: number;
45
+ /** The header's "Open Sessions": a reveal of the left drawer. */
46
+ openSessionDrawer: () => void;
47
+ /** The header's "Open Right Panel": a reveal of the right drawer. */
48
+ openRightDrawer: () => void;
49
+ /** `omp:open-panel` from a plugin's navbar readout, resolved by placement. */
50
+ openNamedPanel: (panelKey: string) => void;
51
+ }
52
+
53
+ export interface MobileDrawerRevealInput {
54
+ dock: LeftDockHandle;
55
+ sessionId: string;
56
+ currentScreen: MobileScreen;
57
+ setCurrentScreen: (screen: MobileScreen) => void;
58
+ }
59
+
60
+ /**
61
+ * The reveal counters, and the three gestures that move them.
62
+ *
63
+ * A hook rather than a plain function because the counters are render state: a
64
+ * drawer that reads them must re-render when the header presses, and the
65
+ * `omp:open-panel` listener must see the CURRENT screen (a request while the
66
+ * drawer is already on screen does not re-arm the keyboard).
67
+ */
68
+ export function useMobileDrawerReveals({
69
+ dock,
70
+ sessionId,
71
+ currentScreen,
72
+ setCurrentScreen,
73
+ }: MobileDrawerRevealInput): MobileDrawerReveals {
74
+ const [right, setRight] = useState(0);
75
+ const [left, setLeft] = useState(0);
76
+
77
+ // The right drawer is a SCREEN: opening it is the tap that can summon the
78
+ // keyboard, but the terminal mounts after it. Arm it for the tab the drawer
79
+ // will open on; the drawer releases it if another view resolves.
80
+ const openRightDrawer = useCallback(() => {
81
+ const stored = getSessionValue<string>(sessionId, 'layout.mobileRightPanel') ?? DEFAULT_RIGHT_PANEL_TYPE;
82
+ armTerminalSoftKeyboard(stored);
83
+ setRight((count) => count + 1);
84
+ setCurrentScreen('right');
85
+ }, [sessionId, setCurrentScreen]);
86
+
87
+ // The session screen is mounted permanently (its status-ack effect must run
88
+ // while it is closed), so its drawer has no mount edge at all — the counter is
89
+ // the only thing that can say "the header asked for this". It only ever grows,
90
+ // so each press is one reveal and a press while the drawer is already open is
91
+ // not one (`useRevealSignal` compares against the last value it saw).
92
+ const openSessionDrawer = useCallback(() => {
93
+ setLeft((count) => count + 1);
94
+ setCurrentScreen('session');
95
+ }, [setCurrentScreen]);
96
+
97
+ /**
98
+ * A plugin's navbar readout asking for its own panel.
99
+ *
100
+ * A phone has no rail, so "show this panel" is two decisions — which DRAWER
101
+ * reaches it and which chip inside it — both answered by `phoneDrawerForPanel`
102
+ * from the PLACEMENT, never from the panel's slot. The tab is written through
103
+ * the store because the drawer mounts on this screen change and reads the
104
+ * stored tab; an `editor` takeover resolves to null and the click does nothing
105
+ * rather than opening a drawer that cannot show it.
106
+ */
107
+ const openNamedPanel = useCallback(
108
+ (panelKey: string) => {
109
+ const drawer = phoneDrawerForPanel(panelKey, dock);
110
+ if (!drawer) return;
111
+ // Same gesture rule as the header's button: arm the keyboard before the
112
+ // terminal mounts, but never for the view already on screen (it is
113
+ // focused).
114
+ const stored = getSessionValue<string>(sessionId, 'layout.mobileRightPanel');
115
+ if (drawer === 'right' && (currentScreen !== 'right' || stored !== panelKey)) {
116
+ armTerminalSoftKeyboard(panelKey);
117
+ }
118
+ // The phone's two drawers are SCREENS, not columns: the session screen
119
+ // draws the left dock and the right screen draws the panel drawer.
120
+ setSessionKey(sessionId, drawer === 'left' ? 'layout.mobileLeftPanel' : 'layout.mobileRightPanel', panelKey);
121
+ // This open NAMED its view, so it must not read as a header reveal: the
122
+ // right drawer mounts fresh and compares its counter against `0`, so a
123
+ // cleared counter is what says "nobody asked for a reveal here" — the
124
+ // stored tab is what the drawer opens on. The left drawer stays mounted
125
+ // and needs no reset: its counter only moves when the header asks.
126
+ if (drawer === 'right') setRight(0);
127
+ setCurrentScreen(drawer === 'left' ? 'session' : 'right');
128
+ },
129
+ [dock, sessionId, currentScreen, setCurrentScreen],
130
+ );
131
+
132
+ useKabmoEvent(OPEN_PANEL_EVENT, (event) => {
133
+ const panelKey = (event as CustomEvent<OpenPanelDetail>).detail?.panelKey;
134
+ if (panelKey) openNamedPanel(panelKey);
135
+ });
136
+
137
+ return { right, left, openSessionDrawer, openRightDrawer, openNamedPanel };
138
+ }