@kabmo-labs/kabmo 0.45.1 → 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-eqmctwyq.js → CsvGrid-br4j001k.js} +2 -2
  4. package/dist/client/static/js/{DocxView-rjrshmzf.js → DocxView-kmtkbmmw.js} +3 -3
  5. package/dist/client/static/js/{DrawioView-za569srw.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-2m78d4jz.js → PdfView-p5z7c7eg.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-54awmse0.js → SessionsView-t06h6zfx.js} +1 -1
  11. package/dist/client/static/js/{SheetView-xfvjdh24.js → SheetView-agw459v2.js} +19 -19
  12. package/dist/client/static/js/{SvgPreview-yfjrfb40.js → SvgPreview-b9rfy1h6.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-tmsa3b36.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-a5effrpz.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-3q2kf22c.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-mkw3jvf6.js → c4Diagram-YGBWAQC7-7h03146b.js} +3 -3
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fw9bs1za.js → classDiagram-v2-NBCMYWYE-m57e9kp1.js} +7 -7
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-eqjrpps4.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-4w61hq3e.js → cynefinDiagram-VND7K2PF-mjf6njey.js} +1 -1
  28. package/dist/client/static/js/{dagre-6A5THRUB-t52jdfr1.js → dagre-6A5THRUB-6yma9ch3.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-448hyxaz.js → diagram-22UHCM2B-1q4ce2gb.js} +18 -18
  30. package/dist/client/static/js/{diagram-3UASUU5V-350k213a.js → diagram-3UASUU5V-0ttps29p.js} +1 -1
  31. package/dist/client/static/js/{diagram-ATOU4E4O-9davjeyb.js → diagram-ATOU4E4O-1mzexgv1.js} +3 -3
  32. package/dist/client/static/js/{diagram-CDSNMT55-034wwghk.js → diagram-CDSNMT55-4ae89t23.js} +4 -4
  33. package/dist/client/static/js/{diagram-MLGK6HIB-kzzd4ecm.js → diagram-MLGK6HIB-057jaqvh.js} +2 -2
  34. package/dist/client/static/js/{diagram-MPIPVDR6-rsky4e3s.js → diagram-MPIPVDR6-p6yyq5sx.js} +2 -2
  35. package/dist/client/static/js/{dockerfile-68b0e6b6.js → dockerfile-00hqsk9c.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-7bm1e394.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-4xjp4rgh.js → elk-276RUBZZ-dsq91er5.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-v52qmcrv.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-1r1fn18p.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-zt5cwg83.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-x0kgnkv3.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-127se1a3.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-xgv501v0.js → index-5gf52a6d.js} +2 -2
  60. package/dist/client/static/js/{index-84vmdg3k.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-528x5x8c.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-tkfxnnr5.js → index-9d3n04vb.js} +2 -2
  67. package/dist/client/static/js/{index-ga6492qc.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-q36gq3yz.js → index-amys498v.js} +198 -198
  70. package/dist/client/static/js/{index-9zwtpazh.js → index-bafe7hmd.js} +2 -2
  71. package/dist/client/static/js/{index-mnh8nptt.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-2tmnqqzt.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-cza9mnxx.js → index-ex5dtdx2.js} +6 -6
  79. package/dist/client/static/js/{index-8ps5gdwz.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-bcpyxt97.js → index-j718pxb3.js} +2 -2
  86. package/dist/client/static/js/{index-0gmw2bt3.js → index-jkay7aw7.js} +2 -2
  87. package/dist/client/static/js/{index-ex3w7t7s.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-2zntn964.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-j50y0z44.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-snjtkfkq.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-m9s7r4z9.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-2gbfke1a.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-frqq7yen.js → index-x1fqhhpp.js} +64 -64
  103. package/dist/client/static/js/{index-mhnwyra0.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-zwx3vbf0.js → index-zedt16w7.js} +1 -1
  107. package/dist/client/static/js/{index-c7vbr57m.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-yd4zwrtv.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-7sjp09d4.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-qh9jk7qk.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-cjc8k0jk.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-vw0b7r0k.js → mermaid.core-hwhzw0wv.js} +7 -7
  122. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-jyhtpt1z.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-80ygdd29.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-6vgh7ntn.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-k5byajmm.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-qffrkk7g.js → railroadDiagram-XR7U4H2S-x188rcxf.js} +1 -1
  141. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-r80w7tdp.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-a9jcfy2e.js → rust-1v8xbxn9.js} +1 -1
  144. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-g9qdy74b.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-nywg1eq3.js → sequenceDiagram-PO4LG4MO-pp8s63rt.js} +19 -19
  148. package/dist/client/static/js/{sizeCapture-INFHLROL-m5pks027.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-xzzv780w.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-n4q5ad13.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-j9pde7sa.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-ehnc0600.js → usecaseDiagram-POWQR4AR-yq2y1b09.js} +44 -44
  160. package/dist/client/static/js/{vennDiagram-UO4OBE2U-cp4kj6kw.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-eegf1jpw.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-zkkqfyex.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-6ksvyzqv.js +0 -1
  307. package/dist/client/static/js/LayoutWrapper-px60417t.js +0 -2
  308. package/dist/client/static/js/Modal-yv1718s1.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-hekt0qsb.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-252br0k2.js +0 -1
  322. package/dist/client/static/js/index-6bm4pw90.css +0 -1
  323. package/dist/client/static/js/index-80qxk9hx.js +0 -1
  324. package/dist/client/static/js/index-9674dxb4.js +0 -1
  325. package/dist/client/static/js/index-9k4121z4.js +0 -4
  326. package/dist/client/static/js/index-b6454rme.js +0 -12
  327. package/dist/client/static/js/index-ck0fd3aj.js +0 -2
  328. package/dist/client/static/js/index-jdf1tks1.js +0 -2
  329. package/dist/client/static/js/index-q58e8x6j.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-axkq0m3s.js +0 -1
  339. package/dist/client/static/js/one-light-pncb08qd.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-253nz20y.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
@@ -29,11 +29,11 @@ import {
29
29
  currentPanelNav,
30
30
  } from '@/client/hooks/workspace/panel-nav';
31
31
  import {
32
- MOBILE_RIGHT_PANEL_NAV_CHANGED_EVENT,
33
- MOBILE_RIGHT_PANEL_NAV_SETTING_KEY,
34
- applyMobileRightPanelNav,
35
- currentMobileRightPanelNav,
36
- } from '@/client/hooks/workspace/mobile-right-panel-nav';
32
+ MOBILE_PANEL_NAV_CHANGED_EVENT,
33
+ MOBILE_PANEL_NAV_SETTING_KEY,
34
+ applyMobilePanelNav,
35
+ currentMobilePanelNav,
36
+ } from '@/client/hooks/workspace/mobile-panel-nav';
37
37
 
38
38
  /** The events dispatched while the current test ran; `detail` may be absent. */
39
39
  const dispatched: unknown[] = [];
@@ -110,31 +110,52 @@ describe('applyPanelNav', () => {
110
110
  describe('the phone drawer setting', () => {
111
111
  afterEach(() => dispatched.length = 0);
112
112
 
113
- test('reads its own key, so a desktop column cannot answer for it', () => {
114
- primeKabmoSettings({ leftPanelNav: 'tabs', rightPanelNav: 'tabs', mobileRightPanelNav: 'classic' });
115
- expect(currentMobileRightPanelNav()).toBe('classic');
113
+ test('reads each drawer from its own key, so neither can answer for the other', () => {
114
+ primeKabmoSettings({
115
+ leftPanelNav: 'tabs',
116
+ rightPanelNav: 'tabs',
117
+ mobileLeftPanelNav: 'classic',
118
+ mobileRightPanelNav: 'tabs',
119
+ });
120
+ expect(currentMobilePanelNav('left')).toBe('classic');
121
+ expect(currentMobilePanelNav('right')).toBe('tabs');
122
+ });
123
+
124
+ test('a desktop column cannot answer for a drawer', () => {
125
+ primeKabmoSettings({ leftPanelNav: 'tabs', rightPanelNav: 'tabs' });
126
+ expect(currentMobilePanelNav('left')).toBe('classic');
127
+ expect(currentMobilePanelNav('right')).toBe('classic');
116
128
  });
117
129
 
118
130
  test('an unset or unreadable value is the shipped default', () => {
119
- primeKabmoSettings({ mobileRightPanelNav: 'from-a-newer-build' });
120
- expect(currentMobileRightPanelNav()).toBe('classic');
131
+ primeKabmoSettings({ mobileLeftPanelNav: 'from-a-newer-build', mobileRightPanelNav: null });
132
+ expect(currentMobilePanelNav('left')).toBe('classic');
133
+ expect(currentMobilePanelNav('right')).toBe('classic');
134
+ });
135
+
136
+ test('the keys match the settings fields they persist under', () => {
137
+ expect(MOBILE_PANEL_NAV_SETTING_KEY.left).toBe('mobileLeftPanelNav');
138
+ expect(MOBILE_PANEL_NAV_SETTING_KEY.right).toBe('mobileRightPanelNav');
121
139
  });
122
140
 
123
- test('the key matches the settings field it persists under', () => {
124
- expect(MOBILE_RIGHT_PANEL_NAV_SETTING_KEY).toBe('mobileRightPanelNav');
141
+ test('it announces on its OWN event, carrying the side', () => {
142
+ applyMobilePanelNav('left', 'tabs');
143
+ expect(dispatched).toEqual([{ side: 'left', style: 'tabs' }]);
144
+ expect(MOBILE_PANEL_NAV_CHANGED_EVENT).toBe('omp:mobile-panel-nav-changed');
145
+ expect(MOBILE_PANEL_NAV_CHANGED_EVENT).not.toBe(PANEL_NAV_CHANGED_EVENT);
125
146
  });
126
147
 
127
- test('it announces on its OWN event, not the desktop one', () => {
128
- applyMobileRightPanelNav('tabs');
129
- // Its detail is the resolved STYLE, not `{side, style}`: the phone has one
130
- // drawer, so there is no side for the listener to compare.
131
- expect(dispatched).toEqual(['tabs']);
132
- expect(MOBILE_RIGHT_PANEL_NAV_CHANGED_EVENT).toBe('omp:mobile-right-panel-nav-changed');
133
- expect(MOBILE_RIGHT_PANEL_NAV_CHANGED_EVENT).not.toBe(PANEL_NAV_CHANGED_EVENT);
148
+ test('two changes addressed to different drawers stay separate events', () => {
149
+ applyMobilePanelNav('left', 'tabs');
150
+ applyMobilePanelNav('right', 'classic');
151
+ expect(dispatched).toEqual([
152
+ { side: 'left', style: 'tabs' },
153
+ { side: 'right', style: 'classic' },
154
+ ]);
134
155
  });
135
156
 
136
157
  test('an unreadable value is announced as the default, never as itself', () => {
137
- applyMobileRightPanelNav('whatever');
138
- expect(dispatched).toEqual(['classic']);
158
+ applyMobilePanelNav('right', 'whatever');
159
+ expect(dispatched).toEqual([{ side: 'right', style: 'classic' }]);
139
160
  });
140
161
  });
@@ -0,0 +1,283 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Revealing a tab-style column must show a VIEW, and only a reveal counts.
8
+ *
9
+ * The reported defect: with `rightPanelNav: tabs`, a fresh session put the side
10
+ * away and the navbar's toggle brought back the catalog card grid (`Panel
11
+ * kanan`) — while the Stats navbar readout, which names a panel, opened its
12
+ * view. Two clicks that both promise "show me the panel" gave two different
13
+ * answers, and the one the user pressed second looked broken.
14
+ *
15
+ * The cases below pin both halves of the rule: the EDGE (closed → open, on the
16
+ * home page, with a drawable view) and the four things that must NOT count — a
17
+ * column that mounts open, a column already showing a tab, a rail column, and a
18
+ * view this build cannot draw.
19
+ */
20
+
21
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
22
+ import { Window } from 'happy-dom';
23
+ import { h, render } from 'preact';
24
+ import { act } from 'preact/test-utils';
25
+ import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
26
+ import { usePanelTabs } from '@/client/hooks/workspace/panel-tabs';
27
+ import {
28
+ revealTabId,
29
+ useRevealEdge,
30
+ useRevealPanelTab,
31
+ useRevealSignal,
32
+ type RevealTabInput,
33
+ } from '@/client/hooks/workspace/panel-tabs-reveal';
34
+ import {
35
+ getSessionState,
36
+ getSessionValue,
37
+ hydrateSession,
38
+ resetSessionStateStore,
39
+ } from '@/shared/lib/workspace/session-state/store';
40
+
41
+ const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'Event', 'MouseEvent', 'KeyboardEvent'] as const;
42
+ const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
43
+ const nativeFetch = Bun.fetch;
44
+
45
+ let container: HTMLElement;
46
+
47
+ /** The column's props, driven from outside by the hook cases. */
48
+ let column = { open: false, view: 'files', enabled: true, known: new Set(['files', 'git', 'todo']) };
49
+ /** What the probe last rendered. */
50
+ let seen: { tabs: readonly string[]; active: string | null; home: boolean; chosenHome: boolean } | null = null;
51
+ /** The probe's writer, so a test can close a tab the way the strip does. */
52
+ let actions: { open: (id: string) => void; close: (id: string) => void } | null = null;
53
+
54
+ function Probe() {
55
+ const tabs = usePanelTabs('right', column.known, null);
56
+ useRevealPanelTab({
57
+ enabled: column.enabled,
58
+ revealed: useRevealEdge(column.open),
59
+ view: column.view,
60
+ home: tabs.home,
61
+ chosenHome: tabs.chosenHome,
62
+ openTab: tabs.open,
63
+ known: column.known,
64
+ });
65
+ seen = { tabs: tabs.tabs, active: tabs.active, home: tabs.home, chosenHome: tabs.chosenHome };
66
+ actions = { open: tabs.open, close: tabs.close };
67
+ return h('div', null, JSON.stringify(seen));
68
+ }
69
+
70
+ function mount(sessionId: string) {
71
+ container = document.createElement('div');
72
+ document.body.appendChild(container);
73
+ act(() => {
74
+ render(h(SessionStateProvider, { sessionId, children: h(Probe, null) }), container);
75
+ });
76
+ }
77
+
78
+ /** Apply a prop change the way the layout would, then let the effects land. */
79
+ async function rerender() {
80
+ await act(async () => {
81
+ render(h(SessionStateProvider, { sessionId: currentSession, children: h(Probe, null) }), container);
82
+ });
83
+ await act(async () => {});
84
+ }
85
+
86
+ let currentSession = '';
87
+
88
+ beforeAll(() => {
89
+ const win = new Window({ url: 'http://localhost' });
90
+ const target = globalThis as unknown as Record<string, unknown>;
91
+ for (const key of DOM_GLOBALS) {
92
+ if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
93
+ target[key] = (win as unknown as Record<string, unknown>)[key];
94
+ }
95
+ // The stub answers what was persisted, so a load landing mid-test cannot
96
+ // adopt an empty blob over the value `hydrateSession` seeded.
97
+ target.fetch = async (input: unknown, init?: { method?: string; body?: unknown }) => {
98
+ const method = init?.method ?? 'GET';
99
+ const sessionId = String(input).split('/sessions/')[1]?.split('/')[0] ?? 'x';
100
+ if (method === 'POST') return new Response(JSON.stringify({ success: true }), { status: 200 });
101
+ return new Response(JSON.stringify({ sessionId, state: { ...(getSessionState(sessionId) ?? {}) } }), { status: 200 });
102
+ };
103
+ });
104
+
105
+ afterAll(() => {
106
+ const target = globalThis as unknown as Record<string, unknown>;
107
+ for (const key of DOM_GLOBALS) {
108
+ if (nativeGlobals[key] === undefined) delete target[key];
109
+ else target[key] = nativeGlobals[key];
110
+ }
111
+ target.fetch = nativeFetch;
112
+ });
113
+
114
+ beforeEach(() => {
115
+ // The store is a module singleton: a tab left by one case would seed the next.
116
+ resetSessionStateStore();
117
+ column = { open: false, view: 'files', enabled: true, known: new Set(['files', 'git', 'todo']) };
118
+ });
119
+
120
+ afterEach(() => {
121
+ if (container) {
122
+ render(null, container);
123
+ container.remove();
124
+ }
125
+ seen = null;
126
+ actions = null;
127
+ });
128
+
129
+ /** The rule, as data: only the reveal edge on a home page with a drawable view. */
130
+ describe('revealTabId', () => {
131
+ const base: RevealTabInput = {
132
+ revealed: true,
133
+ home: true,
134
+ chosenHome: false,
135
+ view: 'files',
136
+ known: new Set(['files', 'git']),
137
+ enabled: true,
138
+ };
139
+
140
+ test('a reveal on the home page opens the stored view', () => {
141
+ expect(revealTabId(base)).toBe('files');
142
+ });
143
+
144
+ test('a home page the user closed a tab down to is not reopened', () => {
145
+ // The reported defect: closing the right panel's tab and then toggling the
146
+ // panel brought that tab back. A close is an answer; the reveal must not
147
+ // read the resulting catalog as "nothing was ever open".
148
+ expect(revealTabId({ ...base, chosenHome: true })).toBeNull();
149
+ });
150
+
151
+ test('a column that was already open is not a reveal', () => {
152
+ // The `+` control puts the column on its catalog ON PURPOSE; a rule keyed on
153
+ // "open and on the home page" would undo that on the next render.
154
+ expect(revealTabId({ ...base, revealed: false })).toBeNull();
155
+ });
156
+
157
+ test('a column already showing a tab needs nothing opened', () => {
158
+ expect(revealTabId({ ...base, home: false })).toBeNull();
159
+ });
160
+
161
+ test('a rail column has no home page to leave', () => {
162
+ expect(revealTabId({ ...base, enabled: false })).toBeNull();
163
+ });
164
+
165
+ test('a view this build cannot draw is not opened', () => {
166
+ // Opening it would write an id `visiblePanelTabs` filters back out — a write
167
+ // loop disguised as a sync.
168
+ expect(revealTabId({ ...base, view: 'ghost' })).toBeNull();
169
+ expect(revealTabId({ ...base, view: '' })).toBeNull();
170
+ });
171
+ });
172
+
173
+ /**
174
+ * A phone drawer unmounts on close, so its mount is also what a screen change for
175
+ * any other reason produces. The counter the header bumps is what tells it apart.
176
+ */
177
+ describe('useRevealSignal', () => {
178
+ test('the first value is not a reveal, a bump is', async () => {
179
+ const seen: boolean[] = [];
180
+ function ProbeSignal({ signal }: { signal: number }) {
181
+ seen.push(useRevealSignal(signal));
182
+ return null;
183
+ }
184
+ const host = document.createElement('div');
185
+ document.body.appendChild(host);
186
+ await act(async () => {
187
+ render(h(ProbeSignal, { signal: 0 }), host);
188
+ });
189
+ await act(async () => {
190
+ render(h(ProbeSignal, { signal: 1 }), host);
191
+ });
192
+ // A CLEARED counter is the layout saying "nobody asked for a reveal here" —
193
+ // the named open that clears it (the Stats readout) is what the drawer opens
194
+ // on, so the drop must not read as a gesture of its own.
195
+ await act(async () => {
196
+ render(h(ProbeSignal, { signal: 0 }), host);
197
+ });
198
+ render(null, host);
199
+ host.remove();
200
+ expect(seen).toEqual([false, true, false]);
201
+ });
202
+ });
203
+
204
+ describe('the column, mounted and toggled', () => {
205
+ test('a column that MOUNTS open stays on its home page', async () => {
206
+ // A restored selection is not a request (`useRightOpenRequest` owns that),
207
+ // and a fresh tab-style install must not open Files by itself.
208
+ currentSession = 'reveal-mount-open';
209
+ hydrateSession(currentSession, {});
210
+ column.open = true;
211
+ mount(currentSession);
212
+ expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: false });
213
+ });
214
+
215
+ test('putting the side away and bringing it back opens the stored view', async () => {
216
+ // A session that has NEVER held a tab: the empty strip is the default home
217
+ // page, not something the user chose, so the toggle brings its view back.
218
+ currentSession = 'reveal-edge';
219
+ hydrateSession(currentSession, {});
220
+ mount(currentSession);
221
+ expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: false });
222
+
223
+ column.open = true;
224
+ await rerender();
225
+
226
+ expect(seen?.tabs).toEqual(['files']);
227
+ expect(seen?.active).toBe('files');
228
+ expect(seen?.home).toBe(false);
229
+ // The write is the strip's own, so the persisted shape is a real tab.
230
+ const stored = getSessionValue<{ tabs: string[]; active: string; home: boolean }>(currentSession, 'layout.rightPanelTabs');
231
+ expect(stored).toEqual({ tabs: ['files'], active: 'files', home: false });
232
+ });
233
+
234
+ test('a tab closed by the user stays closed across a toggle', async () => {
235
+ // The reported defect: closing the right panel's last tab and toggling the
236
+ // panel back brought that tab out of the catalog, because the empty strip
237
+ // was read as "this session never opened one".
238
+ currentSession = 'reveal-closed';
239
+ hydrateSession(currentSession, {});
240
+ mount(currentSession);
241
+
242
+ column.open = true;
243
+ await rerender();
244
+ expect(seen?.tabs).toEqual(['files']);
245
+
246
+ act(() => actions!.close('files'));
247
+ expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: true });
248
+
249
+ column.open = false;
250
+ await rerender();
251
+ column.open = true;
252
+ await rerender();
253
+
254
+ expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: true });
255
+ });
256
+
257
+ test('a column that already had a tab is only revealed, never re-opened', async () => {
258
+ currentSession = 'reveal-existing';
259
+ hydrateSession(currentSession, { 'layout.rightPanelTabs': { tabs: ['git'], active: 'git', home: false } });
260
+ column.view = 'git';
261
+ mount(currentSession);
262
+ expect(seen?.tabs).toEqual(['git']);
263
+
264
+ column.open = true;
265
+ await rerender();
266
+
267
+ // Nothing appended, nothing selected differently: revealing a column that
268
+ // already shows a view is the whole of the click.
269
+ expect(seen).toEqual({ tabs: ['git'], active: 'git', home: false, chosenHome: false });
270
+ });
271
+
272
+ test('a rail column ignores the toggle entirely', async () => {
273
+ currentSession = 'reveal-rail';
274
+ hydrateSession(currentSession, {});
275
+ column.enabled = false;
276
+ mount(currentSession);
277
+
278
+ column.open = true;
279
+ await rerender();
280
+
281
+ expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: false });
282
+ });
283
+ });
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * A tab-style panel that is REVEALED shows a view, not its catalog.
8
+ *
9
+ * A panel can be put away whole — the navbar's right-side toggle, the sidebar's
10
+ * expand control, `⌥⌘J`, `⌘B`, and on a phone the same two header controls — and
11
+ * under the tab style the empty state is the HOME PAGE: a strip whose empty state
12
+ * is the catalog is a real answer, which is why a fresh session legitimately
13
+ * opens on `Panel kanan` with no tab. The same state is wrong for a control whose
14
+ * promise is "bring the panel back": measured in Chromium at 1440x900 on a fresh
15
+ * session with `rightPanelNav: tabs`, the toggle restored the card grid while the
16
+ * Stats navbar readout — which asks for a panel by name (`omp:open-panel`) —
17
+ * opened `Resources` as a tab. Two clicks that both say "show me the panel" gave
18
+ * two different answers, and the second one looked broken.
19
+ *
20
+ * So the rule is stated once, for every column and drawer, and it is a GESTURE,
21
+ * not a state:
22
+ *
23
+ * - **Only a reveal counts.** Keying it on "the panel is open and on its home
24
+ * page" would fight the `+` control: pressing it to browse the catalog would be
25
+ * undone on the next render.
26
+ * - **Only the home page is left.** A panel already showing a tab has nothing to
27
+ * open — revealing it is enough.
28
+ * - **A home page the user CHOSE is left alone.** Closing the last tab (or
29
+ * pressing `+`) is an answer, not an absence: reopening the closed tab on the
30
+ * next toggle is the defect this rule was extended for. Only a column that has
31
+ * never held a tab is brought back on its view.
32
+ * - **A view the panel cannot draw is not opened.** The stored selection can name
33
+ * a panel that is switched off, uninstalled, or whose bundle has not loaded;
34
+ * `open` would write an id `visiblePanelTabs` filters straight back out, which
35
+ * is a write loop disguised as a sync.
36
+ * - **A column that mounts open reveals nothing.** A restored selection is not a
37
+ * request (`useRightOpenRequest` owns that), and a fresh tab-style install must
38
+ * not open `Files` by itself. A phone DRAWER is the other case: it mounts on
39
+ * the very gesture that opens it, so it passes that gesture explicitly instead
40
+ * of relying on the mount (`useRevealSignal`).
41
+ *
42
+ * Deliberately NOT in `toggleRightSide` / the phone's screen state: those own
43
+ * visibility and know nothing about how a panel navigates itself, and the same
44
+ * reveal arrives from a chord, the palette and a header control.
45
+ */
46
+
47
+ import { useEffect, useRef } from 'preact/hooks';
48
+
49
+ export interface RevealTabInput {
50
+ /** A reveal gesture landed on this render. */
51
+ revealed: boolean;
52
+ /** The strip is showing the catalog instead of a view. */
53
+ home: boolean;
54
+ /**
55
+ * The catalog is up because the user ASKED for it — `+`, or closing the last
56
+ * tab. A reveal leaves that alone; only a column that never held a tab is
57
+ * brought back on its view.
58
+ */
59
+ chosenHome: boolean;
60
+ /** The view the panel would show — its stored selection. */
61
+ view: string;
62
+ /** Every id this panel could draw right now. */
63
+ known: ReadonlySet<string>;
64
+ /** Only the tab style has a home page to leave. */
65
+ enabled: boolean;
66
+ }
67
+
68
+ /** The id a reveal must open, or `null` when there is nothing to do. */
69
+ export function revealTabId({ revealed, home, chosenHome, view, known, enabled }: RevealTabInput): string | null {
70
+ if (!enabled || !revealed) return null;
71
+ if (!home) return null;
72
+ // Closing the last tab IS the answer. Reopening it on the next toggle is the
73
+ // reported defect: the tab came back after the user had closed it.
74
+ if (chosenHome) return null;
75
+ if (!view || !known.has(view)) return null;
76
+ return view;
77
+ }
78
+
79
+ /**
80
+ * The closed → open edge of a desktop panel column.
81
+ *
82
+ * Seeded with the CURRENT value: a column that mounts open is not a reveal, which
83
+ * is what keeps a fresh tab-style install off `Files`.
84
+ */
85
+ export function useRevealEdge(open: boolean): boolean {
86
+ const wasOpen = useRef(open);
87
+ const revealed = open && !wasOpen.current;
88
+ // Written in an EFFECT, not during render: `revealed` is already derived from
89
+ // the previous value above, and a render-time write is a side effect the next
90
+ // commit could observe out of order.
91
+ useEffect(() => {
92
+ wasOpen.current = open;
93
+ }, [open]);
94
+ return revealed;
95
+ }
96
+
97
+ /**
98
+ * A reveal asked for by name — a phone drawer's own open gesture.
99
+ *
100
+ * A drawer unmounts when it closes, so its mount IS the open, and it can mount
101
+ * AFTER the header bumped its counter — which is why the baseline is `0` rather
102
+ * than the value at mount: a drawer that mounts with a non-zero counter was
103
+ * asked for by the control that bumped it. A named open CLEARS the counter
104
+ * (`useMobileDrawerReveals`), because it already says which view it wants, so a
105
+ * drawer mounted that way reads no reveal and opens on the stored tab.
106
+ *
107
+ * The same hook serves the LEFT drawer, which stays mounted: there the counter
108
+ * moves while the hook is alive, and the comparison is an ordinary edge.
109
+ */
110
+ export function useRevealSignal(signal: number): boolean {
111
+ const seen = useRef(0);
112
+ // `0` is the layout's own "nothing asked for a reveal" — a named open clears
113
+ // the counter, and a drawer mounting on that clear must not read the drop from
114
+ // a previous press as a fresh gesture.
115
+ const revealed = signal !== 0 && signal !== seen.current;
116
+ // Written in an EFFECT, like `useRevealEdge`: the value above is this render's
117
+ // answer, and moving the baseline during render is a side effect the next
118
+ // commit could observe out of order.
119
+ useEffect(() => {
120
+ seen.current = signal;
121
+ }, [signal]);
122
+ return revealed;
123
+ }
124
+
125
+ export interface RevealPanelTabOptions {
126
+ /** Whether this panel navigates by a strip at all. */
127
+ enabled: boolean;
128
+ /** A reveal gesture landed on this render — see `useRevealEdge`. */
129
+ revealed: boolean;
130
+ /** The view to show when the strip has nothing on screen. */
131
+ view: string;
132
+ /** The panel's strip is showing its catalog. */
133
+ home: boolean;
134
+ /** The catalog was ASKED for (see `RevealTabInput.chosenHome`). */
135
+ chosenHome: boolean;
136
+ /**
137
+ * The strip's own `open`, so the reveal writes what a card would.
138
+ *
139
+ * `null` for a panel that has no strip right now (a phone drawer with the rail
140
+ * off owns no working set): the caller must still call this hook, because a
141
+ * hook cannot be conditional, and a `null` writer is how it says "nothing to
142
+ * open here" without a second flag to keep in sync.
143
+ */
144
+ openTab: ((id: string) => void) | null;
145
+ /** Every id this panel could draw right now. */
146
+ known: ReadonlySet<string>;
147
+ }
148
+
149
+ /**
150
+ * Leave the home page when the panel is revealed.
151
+ *
152
+ * Called unconditionally by every panel (hooks cannot be conditional); the
153
+ * `enabled` flag is what keeps rail panels out of it, where there is no home page
154
+ * and the stored selection is already on screen.
155
+ */
156
+ export function useRevealPanelTab({ enabled, revealed, view, home, chosenHome, openTab, known }: RevealPanelTabOptions): void {
157
+ useEffect(() => {
158
+ if (!openTab) return;
159
+ const id = revealTabId({ revealed, home, chosenHome, view, known, enabled });
160
+ if (id !== null) openTab(id);
161
+ }, [enabled, revealed, home, chosenHome, view, known, openTab]);
162
+ }
@@ -44,6 +44,15 @@ export interface PanelTabsHandle {
44
44
  active: string | null;
45
45
  /** The catalog is on screen. The strip and the selection stay behind it. */
46
46
  home: boolean;
47
+ /**
48
+ * The home page was ASKED for — `+`, or closing the last tab — as opposed to
49
+ * a column that has simply never held a tab.
50
+ *
51
+ * `home` cannot answer this: it is also true for an empty strip, which is how
52
+ * a fresh session starts. A reveal may leave the default home page, but it
53
+ * must never undo a close.
54
+ */
55
+ chosenHome: boolean;
47
56
  /** Open a view (or focus it when it is already open) and select it. */
48
57
  open: (id: string) => void;
49
58
  /** Select a tab that is already open; a no-op for an id that is not. */
@@ -89,7 +98,11 @@ function readStored(value: unknown): ColumnTabs {
89
98
  const tabs = Array.isArray(raw.tabs)
90
99
  ? raw.tabs.filter((id): id is string => typeof id === 'string')
91
100
  : [];
92
- if (tabs.length === 0) return EMPTY;
101
+ // `home` survives an EMPTY strip, and it must: closing the last tab writes
102
+ // `{ tabs: [], home: true }`, and collapsing that to `EMPTY` (which spells
103
+ // `home: false`) erased the one fact that says the user CHOSE the catalog.
104
+ // The reveal rule then read it as a fresh session and reopened the tab they
105
+ // had just closed. An empty list is not a corrupt blob; only a non-object is.
93
106
  const active = typeof raw.active === 'string' ? raw.active : null;
94
107
  return { tabs, active, home: raw.home === true };
95
108
  }
@@ -135,6 +148,10 @@ export function usePanelTabs(
135
148
  // pinned column that was closed down to its pinned tab only if the user asked
136
149
  // for it — which is the stored `home` flag, not a consequence.
137
150
  const home = stored.home || tabs.length === 0;
151
+ // The stored flag, WITHOUT the empty-strip fallback: a reveal must be able to
152
+ // tell "the user closed the last tab" (keep the catalog) from "this session
153
+ // has never opened one" (leaving the catalog for a view is the toggle's job).
154
+ const chosenHome = stored.home;
138
155
 
139
156
  const write = useCallback((next: ColumnTabs) => setStored(next), [setStored]);
140
157
 
@@ -190,5 +207,5 @@ export function usePanelTabs(
190
207
  [tabs, active, home, pinned, write],
191
208
  );
192
209
 
193
- return { tabs, active, home, open, select, close, setOrder, showHome };
210
+ return { tabs, active, home, chosenHome, open, select, close, setOrder, showHome };
194
211
  }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's chrome row is ONE fact.
8
+ *
9
+ * Six phone title bars stated their own height, notch and window insets, and
10
+ * they had already drifted: the chat header and both drawers were `3.5rem` while
11
+ * the editor and the diff were `3rem`, so opening a file moved the back control
12
+ * 8px and the row read as a different window. These cases pin the shared
13
+ * declarations, so a surface that goes back to writing its own loses the notch
14
+ * or the shell inset and fails here rather than in a screenshot.
15
+ */
16
+
17
+ import { describe, expect, test } from 'bun:test';
18
+ import { PHONE_ROW_HEIGHT, phoneFrameStyle, phoneRowStyle } from '@/client/lib/ui/phone-row';
19
+
20
+ describe('the phone row', () => {
21
+ test('the height carries the notch, and the padding reserves it too', () => {
22
+ // Height AND padding are both load-bearing with border-box: height alone
23
+ // pins the controls to y=0 (under the status bar), padding alone is eaten
24
+ // out of the row and squeezes them into a 16px content box.
25
+ expect(PHONE_ROW_HEIGHT).toBe('calc(3.5rem + env(safe-area-inset-top, 0px))');
26
+ const style = phoneRowStyle();
27
+ expect(style.height).toBe(PHONE_ROW_HEIGHT);
28
+ expect(style.paddingTop).toBe('env(safe-area-inset-top, 0px)');
29
+ });
30
+
31
+ test('both edges clear the safe area and the window controls', () => {
32
+ const style = phoneRowStyle();
33
+ expect(style.paddingLeft).toContain('env(safe-area-inset-left, 0px)');
34
+ expect(style.paddingLeft).toContain('env(titlebar-area-x, 0px)');
35
+ expect(style.paddingRight).toContain('env(safe-area-inset-right, 0px)');
36
+ expect(style.paddingRight).toContain('env(titlebar-area-width, 100vw)');
37
+ });
38
+
39
+ test('a full-screen frame takes the insets and NOT the height', () => {
40
+ // A `h-dvh` dialog is the viewport, not a row: the row height here would
41
+ // make the whole sheet 56px tall.
42
+ const style = phoneFrameStyle();
43
+ expect(style.height).toBeUndefined();
44
+ expect(style.paddingTop).toBe('env(safe-area-inset-top, 0px)');
45
+ expect(style.paddingLeft).toContain('env(titlebar-area-x, 0px)');
46
+ });
47
+
48
+ test('the caller can state its own horizontal base', () => {
49
+ expect(phoneRowStyle('1rem').paddingLeft).toContain('1rem');
50
+ expect(phoneFrameStyle('1rem').paddingLeft).toContain('1rem');
51
+ });
52
+ });