@kabmo-labs/kabmo 0.46.0 → 0.47.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 (301) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +439 -435
  3. package/dist/client/static/js/{CsvGrid-br4j001k.js → CsvGrid-vfgttmym.js} +2 -2
  4. package/dist/client/static/js/{DocxView-kmtkbmmw.js → DocxView-dc41t6rp.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-3df0g3jr.js → DrawioView-wpwr38d9.js} +2 -2
  6. package/dist/client/static/js/HtmlPreview-23n7t5cs.js +1 -0
  7. package/dist/client/static/js/ImageView-mvjb3qh1.js +1 -0
  8. package/dist/client/static/js/LayoutWrapper-eenx0hp2.js +2 -0
  9. package/dist/client/static/js/{Modal-tmxhxd6q.js → Modal-dsqhas10.js} +13 -13
  10. package/dist/client/static/js/{PdfView-p5z7c7eg.js → PdfView-cpvsbfk0.js} +1 -1
  11. package/dist/client/static/js/{SessionsView-t06h6zfx.js → SessionsView-s0crtcm8.js} +1 -1
  12. package/dist/client/static/js/{SheetView-agw459v2.js → SheetView-n6mst0hq.js} +13 -13
  13. package/dist/client/static/js/{SvgPreview-b9rfy1h6.js → SvgPreview-g2aqq812.js} +1 -1
  14. package/dist/client/static/js/{abnfDiagram-O67JEVCF-wbnhzcnj.js → abnfDiagram-O67JEVCF-3vac8sq4.js} +1 -1
  15. package/dist/client/static/js/architecture-7GRP2DOG-b5w9mnn5.js +1 -0
  16. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-t2sgevea.js → architectureDiagram-NJMV4G6O-1nh4htz2.js} +3 -3
  17. package/dist/client/static/js/{astro-hyj5wege.js → astro-63zcysj7.js} +1 -1
  18. package/dist/client/static/js/bash-hv3167gh.js +1 -0
  19. package/dist/client/static/js/{blockDiagram-BEXU5L5S-v2nzp54a.js → blockDiagram-BEXU5L5S-62z6kaar.js} +2 -2
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-7h03146b.js → c4Diagram-YGBWAQC7-rts5zgx4.js} +3 -3
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-m57e9kp1.js → classDiagram-v2-NBCMYWYE-tnpww186.js} +1 -1
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-c4tnh4mg.js → cose-bilkent-JH36ORCC-8vsjbzwa.js} +1 -1
  23. package/dist/client/static/js/cpp-v2mqp8j7.js +1 -0
  24. package/dist/client/static/js/css-x7gyc3ta.js +1 -0
  25. package/dist/client/static/js/cynefin-OW5HDTMX-kdj8rjc1.js +1 -0
  26. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-mjf6njey.js → cynefinDiagram-VND7K2PF-005gc8km.js} +1 -1
  27. package/dist/client/static/js/{dagre-6A5THRUB-6yma9ch3.js → dagre-6A5THRUB-41zsteyd.js} +2 -2
  28. package/dist/client/static/js/{diagram-22UHCM2B-1q4ce2gb.js → diagram-22UHCM2B-prsm18a1.js} +3 -3
  29. package/dist/client/static/js/{diagram-3UASUU5V-0ttps29p.js → diagram-3UASUU5V-5nx9wf04.js} +1 -1
  30. package/dist/client/static/js/{diagram-ATOU4E4O-1mzexgv1.js → diagram-ATOU4E4O-k3d4z3aq.js} +3 -3
  31. package/dist/client/static/js/{diagram-CDSNMT55-4ae89t23.js → diagram-CDSNMT55-x2c5x5j2.js} +2 -2
  32. package/dist/client/static/js/{diagram-MLGK6HIB-057jaqvh.js → diagram-MLGK6HIB-nvr76jqh.js} +1 -1
  33. package/dist/client/static/js/{diagram-MPIPVDR6-p6yyq5sx.js → diagram-MPIPVDR6-v1jpzp9p.js} +1 -1
  34. package/dist/client/static/js/{dockerfile-00hqsk9c.js → dockerfile-vz6va73h.js} +1 -1
  35. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-bsk7dvm4.js → ebnfDiagram-ZINNZB2B-0v4tqr9v.js} +1 -1
  36. package/dist/client/static/js/{elk-276RUBZZ-dsq91er5.js → elk-276RUBZZ-qfn4r7xj.js} +1 -1
  37. package/dist/client/static/js/{erDiagram-OPXOYQCR-p7p13mbh.js → erDiagram-OPXOYQCR-cd667n9f.js} +4 -4
  38. package/dist/client/static/js/{erlang-814e8qy5.js → erlang-vk66vt7q.js} +1 -1
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-m57b7ytw.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-fasj2gxy.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-bwgnttyk.js → ganttDiagram-FUAMR5RP-ps0h3drm.js} +1 -1
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-wvzsc4ph.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ca0gj5am.js → gitGraphDiagram-X574FWY7-fts23jer.js} +2 -2
  44. package/dist/client/static/js/graphql-a4gbqpj9.js +1 -0
  45. package/dist/client/static/js/{index-y2z8nsvw.js → index-0dkc6z8e.js} +2 -2
  46. package/dist/client/static/js/{index-eqhjs1yv.js → index-1d8bxjsz.js} +4 -4
  47. package/dist/client/static/js/{index-kty4ncsr.js → index-1whzs9kb.js} +2 -2
  48. package/dist/client/static/js/{index-qfxn7yh5.js → index-396r53n0.js} +2 -2
  49. package/dist/client/static/js/{index-qn200x1b.js → index-39d8zbkx.js} +6 -6
  50. package/dist/client/static/js/{index-dn7hg4em.js → index-3nsrnyqr.js} +2 -2
  51. package/dist/client/static/js/{index-jkay7aw7.js → index-4jzsr1ky.js} +2 -2
  52. package/dist/client/static/js/{index-064vdkrs.js → index-4wnzs76g.js} +1 -1
  53. package/dist/client/static/js/{index-16sd19f0.js → index-4x9p7hf9.js} +2 -2
  54. package/dist/client/static/js/{index-zq0qxb17.js → index-52nd4hgm.js} +1 -1
  55. package/dist/client/static/js/{index-8pksqzwq.js → index-54mkp2r2.js} +1 -1
  56. package/dist/client/static/js/{index-abs635a1.js → index-56rtb871.js} +25 -25
  57. package/dist/client/static/js/{index-dxvtjn6a.js → index-5f4b44ay.js} +2 -2
  58. package/dist/client/static/js/{index-95kese1h.js → index-6009v8jf.js} +1 -1
  59. package/dist/client/static/js/{index-29npynva.js → index-62jgcgfd.js} +5 -5
  60. package/dist/client/static/js/{index-nw5mvcaj.js → index-64p1dncg.js} +2 -2
  61. package/dist/client/static/js/{index-fj5rsp5v.js → index-6d6hxwb5.js} +2 -2
  62. package/dist/client/static/js/{index-19x11s5w.js → index-70g527sb.js} +2 -2
  63. package/dist/client/static/js/{index-9d3n04vb.js → index-7zeah164.js} +2 -2
  64. package/dist/client/static/js/{index-5h8y54t6.js → index-7zedprz3.js} +1 -1
  65. package/dist/client/static/js/{index-g7s0wsag.js → index-9ab6xaxd.js} +2 -2
  66. package/dist/client/static/js/index-9vqkyj58.js +3 -0
  67. package/dist/client/static/js/{index-x1fqhhpp.js → index-9xsf8162.js} +35 -35
  68. package/dist/client/static/js/{index-j718pxb3.js → index-a4h5np9r.js} +2 -2
  69. package/dist/client/static/js/{index-bjv5ga2e.js → index-an2wv33f.js} +2 -2
  70. package/dist/client/static/js/{index-64sqfr4a.js → index-c5hjht5e.js} +2 -2
  71. package/dist/client/static/js/{index-aagt3382.js → index-c63qyysm.js} +1 -1
  72. package/dist/client/static/js/{index-red856x6.js → index-ccgzzydx.js} +1 -1
  73. package/dist/client/static/js/{index-ex5dtdx2.js → index-cra9mgkq.js} +4 -4
  74. package/dist/client/static/js/index-cvyqp8nz.css +1 -0
  75. package/dist/client/static/js/index-d2xtbabt.js +2 -0
  76. package/dist/client/static/js/{index-7055hdx1.js → index-dxkefysk.js} +1 -1
  77. package/dist/client/static/js/index-dxp2yvy7.js +2 -0
  78. package/dist/client/static/js/{index-vjmg7kn5.js → index-dyc886cc.js} +1 -1
  79. package/dist/client/static/js/{index-5wz0y88c.js → index-dzeyd153.js} +2 -2
  80. package/dist/client/static/js/{index-qf3y3ahx.js → index-e5j5gc4h.js} +2 -2
  81. package/dist/client/static/js/{index-2ks0m8ss.js → index-evmcc5qh.js} +2 -2
  82. package/dist/client/static/js/{index-f7te27n5.js → index-f2ahkev0.js} +5 -5
  83. package/dist/client/static/js/{index-5gf52a6d.js → index-fjex1y0t.js} +2 -2
  84. package/dist/client/static/js/{index-bafe7hmd.js → index-fxd8dfj4.js} +2 -2
  85. package/dist/client/static/js/{index-trvqvb1v.js → index-g4kkapka.js} +2 -2
  86. package/dist/client/static/js/{index-561gkvve.js → index-gzkzwgzv.js} +2 -2
  87. package/dist/client/static/js/{index-twsbv1yn.js → index-n1yr4khe.js} +1 -1
  88. package/dist/client/static/js/{index-d23eacf2.js → index-nkahe229.js} +2 -2
  89. package/dist/client/static/js/{index-3bf7r7z4.js → index-p6s3fz6b.js} +11 -11
  90. package/dist/client/static/js/{index-hnb66d3s.js → index-q4ke39rh.js} +2 -2
  91. package/dist/client/static/js/index-qtd0e38d.js +1 -0
  92. package/dist/client/static/js/{index-ncpwteyt.js → index-tqgj7rd9.js} +2 -2
  93. package/dist/client/static/js/{index-wbws16ag.js → index-x0xspam4.js} +2 -2
  94. package/dist/client/static/js/{index-amys498v.js → index-x2v1zmth.js} +186 -186
  95. package/dist/client/static/js/{index-pwe6chtp.js → index-x9hfvbz6.js} +1 -1
  96. package/dist/client/static/js/{index-dr5hca5b.js → index-xk1cqjkn.js} +3 -3
  97. package/dist/client/static/js/{index-k5zfzgez.js → index-y6ke70e6.js} +2 -2
  98. package/dist/client/static/js/{index-zedt16w7.js → index-zhjjpvcc.js} +1 -1
  99. package/dist/client/static/js/info-A6RAGUB7-ym2xevn8.js +1 -0
  100. package/dist/client/static/js/{infoDiagram-VRGFBTTK-7q58qdf1.js → infoDiagram-VRGFBTTK-88qbtpq5.js} +1 -1
  101. package/dist/client/static/js/ini-80p6sp79.js +1 -0
  102. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-9jmeszag.js → ishikawaDiagram-OU5B5YK6-s8bagk00.js} +1 -1
  103. package/dist/client/static/js/java-mm2b3s9b.js +1 -0
  104. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-0d7xe845.js → journeyDiagram-ZHPQQLJL-hz8z0b9x.js} +2 -2
  105. package/dist/client/static/js/json-fzy76fkw.js +1 -0
  106. package/dist/client/static/js/jsx-c7v2f8s7.js +1 -0
  107. package/dist/client/static/js/{julia-yv2j8qd0.js → julia-dm0j9apa.js} +1 -1
  108. package/dist/client/static/js/{kanban-definition-PNTS6WVX-7p83rwdn.js → kanban-definition-PNTS6WVX-sjjnjb51.js} +1 -1
  109. package/dist/client/static/js/lua-ppfdxrmv.js +1 -0
  110. package/dist/client/static/js/markdown-xed7y3ds.js +1 -0
  111. package/dist/client/static/js/{mermaid.core-hwhzw0wv.js → mermaid.core-zvwygxbh.js} +7 -7
  112. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-hy0rtr7t.js → mindmap-definition-NLK3R4M7-kgj8enan.js} +2 -2
  113. package/dist/client/static/js/one-dark-pro-mq6sn6a2.js +1 -0
  114. package/dist/client/static/js/one-light-pt6t6vax.js +1 -0
  115. package/dist/client/static/js/packet-AYTQ26CC-01vcsy6x.js +1 -0
  116. package/dist/client/static/js/{pegDiagram-GJSIUBJH-kd8t53tx.js → pegDiagram-GJSIUBJH-gxzw1qwa.js} +1 -1
  117. package/dist/client/static/js/{perl-917pjq5a.js → perl-4jcm2jxv.js} +1 -1
  118. package/dist/client/static/js/{php-hwz75qzt.js → php-q32mec74.js} +1 -1
  119. package/dist/client/static/js/pie-WAS4IAKB-053gzkmh.js +1 -0
  120. package/dist/client/static/js/{pieDiagram-5QR66LMP-h3x03f80.js → pieDiagram-5QR66LMP-pdqwyqcm.js} +1 -1
  121. package/dist/client/static/js/properties-8ysbq2n2.js +1 -0
  122. package/dist/client/static/js/python-4ysexc8s.js +1 -0
  123. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-y2b1ncbg.js → quadrantDiagram-O4NWA36T-yx2t364p.js} +1 -1
  124. package/dist/client/static/js/r-hrsw5arc.js +1 -0
  125. package/dist/client/static/js/radar-RG4KPBEZ-bkpby8am.js +1 -0
  126. package/dist/client/static/js/railroad-74A4TZTK-67bxrjgw.js +1 -0
  127. package/dist/client/static/js/railroad-abnf-HS5TGJTU-xj9ymacg.js +1 -0
  128. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2xxpbnf6.js +1 -0
  129. package/dist/client/static/js/railroad-peg-WCYAUIDC-78w88znz.js +1 -0
  130. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-x188rcxf.js → railroadDiagram-XR7U4H2S-800fdzkr.js} +1 -1
  131. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g5e9fk17.js → requirementDiagram-PLB6GJNP-vc5rpgtm.js} +1 -1
  132. package/dist/client/static/js/{ruby-er7ayhte.js → ruby-npmpb290.js} +1 -1
  133. package/dist/client/static/js/{rust-1v8xbxn9.js → rust-waks43wh.js} +1 -1
  134. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-y9ht91gf.js → sankeyDiagram-IPEJSGJF-ccjk8zgn.js} +2 -2
  135. package/dist/client/static/js/{sass-n47tt136.js → sass-502a4r7y.js} +1 -1
  136. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-pp8s63rt.js → sequenceDiagram-PO4LG4MO-c0tk7gfn.js} +6 -6
  137. package/dist/client/static/js/{sizeCapture-INFHLROL-k6dhfxex.js → sizeCapture-INFHLROL-fma9p1vy.js} +1 -1
  138. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-y3akpsm4.js → stateDiagram-v2-GCMORJYK-d8f24b7j.js} +2 -2
  139. package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-c15d0421.js} +1 -1
  140. package/dist/client/static/js/{swimlanes-2SLR337P-89081dr3.js → swimlanes-2SLR337P-sdt7qy36.js} +1 -1
  141. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-rz309qrx.js +8 -0
  142. package/dist/client/static/js/{timeline-definition-EJHVYXUP-tz6r8g3q.js → timeline-definition-EJHVYXUP-rv8qyr8b.js} +2 -2
  143. package/dist/client/static/js/treeView-Q6P3EWNA-g2bkjr4z.js +1 -0
  144. package/dist/client/static/js/treemap-WGGIJYW6-pj7yw9rw.js +1 -0
  145. package/dist/client/static/js/tsx-xjp2ds8g.js +1 -0
  146. package/dist/client/static/js/typescript-yg97da8h.js +1 -0
  147. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yq2y1b09.js → usecaseDiagram-POWQR4AR-w6ew1red.js} +2 -2
  148. package/dist/client/static/js/{vennDiagram-UO4OBE2U-qdmjf6x3.js → vennDiagram-UO4OBE2U-p9axw7ch.js} +1 -1
  149. package/dist/client/static/js/{vue-d5gpjfgn.js → vue-xpemy62d.js} +1 -1
  150. package/dist/client/static/js/wardley-WFR3VGLG-c7ekf8r2.js +1 -0
  151. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-3n2sm7rj.js → wardleyDiagram-VNRHLVJA-5ewc8s4p.js} +1 -1
  152. package/dist/client/static/js/xml-nrb23phz.js +1 -0
  153. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-d7n2av2t.js → xychartDiagram-PMCCYNJV-7n4gn7k6.js} +2 -2
  154. package/dist/client/static/js/yaml-sqs6pjpx.js +1 -0
  155. package/marketplace/marketplace.json +34 -7
  156. package/marketplace/plugins/kanban/README.md +143 -0
  157. package/marketplace/plugins/kanban/icon.svg +5 -0
  158. package/marketplace/plugins/kanban/package.json +30 -0
  159. package/marketplace/plugins/kanban/src/app.tsx +34 -0
  160. package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
  161. package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
  162. package/marketplace/plugins/kanban/src/mcp.ts +148 -0
  163. package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
  164. package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
  165. package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
  166. package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
  167. package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
  168. package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
  169. package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
  170. package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
  171. package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
  172. package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
  173. package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
  174. package/marketplace/plugins/kanban/src/protocol.ts +180 -0
  175. package/marketplace/plugins/kanban/src/server.test.ts +113 -0
  176. package/marketplace/plugins/kanban/src/server.ts +227 -0
  177. package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
  178. package/marketplace/plugins/kanban/src/store/board.ts +147 -0
  179. package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
  180. package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
  181. package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
  182. package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
  183. package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
  184. package/marketplace/plugins/kanban/tsconfig.json +26 -0
  185. package/package.json +2 -2
  186. package/src/client/components/common/file-icon/index.tsx +1 -1
  187. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +14 -4
  188. package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +204 -0
  189. package/src/client/components/layout/desktop-layout/RightColumn.tsx +37 -16
  190. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
  191. package/src/client/components/layout/desktop-layout/index.tsx +17 -22
  192. package/src/client/components/mobile/RightSidebar.tsx +10 -8
  193. package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
  194. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
  195. package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +2 -1
  196. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
  197. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
  198. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
  199. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
  200. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +11 -0
  201. package/src/client/components/workspace/chat-timeline/MessageList.tsx +29 -21
  202. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
  203. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
  204. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
  205. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
  206. package/src/client/components/workspace/editor/FilePane.tsx +4 -2
  207. package/src/client/components/workspace/editor/Tabs.tsx +7 -1
  208. package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
  209. package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
  210. package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
  211. package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
  212. package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
  213. package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
  214. package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
  215. package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
  216. package/src/client/components/workspace/panel-header/index.tsx +6 -4
  217. package/src/client/hooks/chat/timeline/row-measure.ts +75 -0
  218. package/src/client/hooks/chat/timeline/row-window.test.ts +41 -21
  219. package/src/client/hooks/chat/timeline/row-window.ts +6 -24
  220. package/src/client/hooks/editor/resolve-viewer.ts +1 -1
  221. package/src/client/hooks/editor/use-editor-drop.ts +14 -0
  222. package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
  223. package/src/client/hooks/ui/media-query.ts +27 -0
  224. package/src/client/hooks/workspace/file-tabs.ts +10 -0
  225. package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +20 -17
  226. package/src/client/hooks/workspace/panel-tabs-reveal.ts +29 -17
  227. package/src/client/hooks/workspace/panel-tabs.ts +3 -2
  228. package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
  229. package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
  230. package/src/client/hooks/workspace/session-state/index.test.tsx +145 -0
  231. package/src/client/hooks/workspace/session-state/index.ts +28 -16
  232. package/src/client/lib/router/search-params.test.ts +83 -0
  233. package/src/client/lib/router/search-params.ts +14 -3
  234. package/src/server/lib/mcp/session-mcp.test.ts +64 -1
  235. package/src/server/lib/mcp/session-overlay.server.ts +7 -4
  236. package/src/server/lib/omp/rpc/constants.test.ts +31 -0
  237. package/src/server/lib/omp/rpc/constants.ts +19 -0
  238. package/src/server/lib/omp/rpc/session-new.ts +78 -0
  239. package/src/server/lib/omp/rpc/session-registry.ts +22 -49
  240. package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
  241. package/src/server/lib/omp/session/blobs.server.ts +2 -1
  242. package/src/server/lib/plugins/e2e.test.ts +71 -2
  243. package/src/server/lib/plugins/loader.server.ts +20 -1
  244. package/src/server/lib/plugins/module-import.server.ts +45 -0
  245. package/src/server/routes/agent/new-prompt.test.ts +81 -0
  246. package/src/server/routes/agent/new.ts +78 -4
  247. package/src/server/routes/fs/raw.test.ts +12 -0
  248. package/src/server/routes/fs/raw.ts +2 -6
  249. package/src/server/routes/wiki/asset.ts +1 -1
  250. package/src/shared/lib/fs/document-kind.test.ts +39 -2
  251. package/src/shared/lib/fs/document-kind.ts +49 -1
  252. package/src/shared/lib/fs/file-kind.test.ts +30 -3
  253. package/src/shared/lib/fs/file-kind.ts +7 -104
  254. package/src/shared/lib/fs/mime.ts +159 -0
  255. package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
  256. package/src/shared/lib/workspace/sidebar-width.ts +33 -0
  257. package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
  258. package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
  259. package/dist/client/static/js/ImageView-2r8p5z3y.js +0 -1
  260. package/dist/client/static/js/LayoutWrapper-rq3d2a4e.js +0 -2
  261. package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
  262. package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
  263. package/dist/client/static/js/cpp-620mvjkk.js +0 -1
  264. package/dist/client/static/js/css-bt76kxbq.js +0 -1
  265. package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
  266. package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
  267. package/dist/client/static/js/flowDiagram-KWPJA3E3-7b4w6phx.js +0 -1
  268. package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
  269. package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
  270. package/dist/client/static/js/index-3qnjdjg2.js +0 -1
  271. package/dist/client/static/js/index-4bqssvt6.js +0 -2
  272. package/dist/client/static/js/index-dpy3ewrn.css +0 -1
  273. package/dist/client/static/js/index-gq5w5w8x.js +0 -2
  274. package/dist/client/static/js/index-ta6gpcpw.js +0 -3
  275. package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
  276. package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
  277. package/dist/client/static/js/java-jj41mty3.js +0 -1
  278. package/dist/client/static/js/json-rnh2h17x.js +0 -1
  279. package/dist/client/static/js/jsx-4gecrt29.js +0 -1
  280. package/dist/client/static/js/lua-zszaw2f7.js +0 -1
  281. package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
  282. package/dist/client/static/js/one-dark-pro-4b8er03c.js +0 -1
  283. package/dist/client/static/js/one-light-e6r3vsz4.js +0 -1
  284. package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
  285. package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
  286. package/dist/client/static/js/properties-rkptax7r.js +0 -1
  287. package/dist/client/static/js/python-qf1se1mj.js +0 -1
  288. package/dist/client/static/js/r-ms0cygq2.js +0 -1
  289. package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
  290. package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
  291. package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
  292. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
  293. package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
  294. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3q2a15wc.js +0 -8
  295. package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
  296. package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
  297. package/dist/client/static/js/tsx-gx7td06z.js +0 -1
  298. package/dist/client/static/js/typescript-1a808spn.js +0 -1
  299. package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
  300. package/dist/client/static/js/xml-3117mxd9.js +0 -1
  301. package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
@@ -61,7 +61,8 @@ import { useUpdates } from '@/client/hooks/ui/updates';
61
61
  import { UPDATE_REQUEST_EVENT } from '@/shared/lib/updates/popup-state';
62
62
  import { useUpdateCheckRequest } from '@/client/hooks/ui/updates/check-request';
63
63
  import { openKeyBindingHelp } from '@/client/lib/commands/overlays';
64
- import { MAX_LEFT_PANEL_WIDTH } from '@/shared/lib/workspace/sidebar-width';
64
+ import { MAX_LEFT_PANEL_WIDTH, sidebarWidthForViewport } from '@/shared/lib/workspace/sidebar-width';
65
+ import { useViewportWidth } from '@/client/hooks/ui/media-query';
65
66
  import { updateOutcomeTone } from '@/shared/lib/ui/toast-duration';
66
67
  import type { AgentStreamStatus } from '@/shared/lib/chat/omp/status';
67
68
 
@@ -158,7 +159,8 @@ export function LeftColumn({
158
159
  useRevealPanelTab({
159
160
  enabled: tabsMode,
160
161
  revealed,
161
- view,
162
+ // The left column pins the session list, so it always has a view to reveal.
163
+ storedView: view,
162
164
  home: tabsState.home,
163
165
  chosenHome: tabsState.chosenHome,
164
166
  openTab: tabsState.open,
@@ -212,14 +214,22 @@ export function LeftColumn({
212
214
  // not.
213
215
  useUpdateCheckRequest(updates, pushToast);
214
216
 
217
+ // The stored width is a CHOICE, the rendered one is a choice that fits THIS
218
+ // window: a 414px column on a 768px window leaves the chat 148px (measured),
219
+ // so the column gives way as a share of the viewport and the chosen width
220
+ // comes back on a wider window (`sidebarWidthForViewport`). The separator's
221
+ // ceiling follows, or a drag would push straight back past the cap.
222
+ const viewportWidth = useViewportWidth();
223
+ const renderedWidth = sidebarWidthForViewport(width, viewportWidth);
224
+
215
225
  return (
216
226
  <>
217
227
  <Panel
218
228
  panelRef={panelRef}
219
229
  id="left-panel"
220
- defaultSize={width}
230
+ defaultSize={renderedWidth}
221
231
  minSize={minWidth}
222
- maxSize={MAX_LEFT_PANEL_WIDTH}
232
+ maxSize={Math.max(minWidth, sidebarWidthForViewport(MAX_LEFT_PANEL_WIDTH, viewportWidth))}
223
233
  collapsed={!open}
224
234
  >
225
235
  {/* The column is three ROWS, and the order is what makes it read as one
@@ -0,0 +1,204 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * An explicit "open this view" wins over the strip's mirror in BOTH directions.
8
+ *
9
+ * The reported defect: on a session whose right strip already held `Files`, the
10
+ * Stats navbar readout added a `Resources` tab but left `Files` selected and
11
+ * drawn; the tab only appeared to work after switching chats and coming back.
12
+ * The cause was a second writer: a request writes `layout.activeRightPanel`
13
+ * before its tab is opened, so for one commit the stored view names `Resources`
14
+ * while the strip still says `Files`. The mirror effect read that as a strip
15
+ * choice and requested `Files` back, and the next commit repeated the exchange
16
+ * in the other direction — an open/pending request that also re-applied after a
17
+ * session switch, which is how the tab landed in the next chat too.
18
+ *
19
+ * The claim is the PAIR: after a request settles, the stored selection and the
20
+ * strip's active tab name the SAME view, and no request is left pending.
21
+ */
22
+
23
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
24
+ import { h, render } from 'preact';
25
+ import { act } from 'preact/test-utils';
26
+ import { Window } from 'happy-dom';
27
+ import { Group } from '@/client/components/layout/desktop-layout/resizer';
28
+ import { RightColumn } from '@/client/components/layout/desktop-layout/RightColumn';
29
+ import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
30
+ import { useSessionState } from '@/client/hooks/workspace/session-state';
31
+ import { useRightOpenRequest, type RightOpenRequest } from '@/client/hooks/workspace/right-open-request';
32
+ import type { ResolvedPanel } from '@/client/components/workspace/plugin-panel/catalog';
33
+ import {
34
+ getSessionState,
35
+ getSessionValue,
36
+ hydrateSession,
37
+ resetSessionStateStore,
38
+ } from '@/shared/lib/workspace/session-state/store';
39
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
40
+
41
+ const FILES = 'files';
42
+ const STATS = 'plugin:stats:rightPanel';
43
+
44
+ let container: HTMLElement;
45
+ let requestPanel: ((panelKey: string) => void) | null = null;
46
+ let request: RightOpenRequest | null = null;
47
+
48
+ function panel(id: string, label: string, builtin: boolean): ResolvedPanel {
49
+ return {
50
+ id,
51
+ side: 'right',
52
+ title: `${label} — title`,
53
+ label,
54
+ name: builtin ? '' : 'Stats',
55
+ builtin,
56
+ requiresWorkspace: false,
57
+ liveWhileHidden: false,
58
+ minWidth: 200,
59
+ defaultWidth: 420,
60
+ defaultFraction: 0.3,
61
+ render: () => h('div', { 'data-body': id }, `${label} body`),
62
+ };
63
+ }
64
+
65
+ const CATALOG = [panel(FILES, 'Files', true), panel(STATS, 'Resources', false)];
66
+
67
+ /**
68
+ * The desktop layout's own wiring, reduced to what the two effects read: the
69
+ * restored selection, its request handle, and the rail's toggle-on-select rule.
70
+ */
71
+ function Harness() {
72
+ const [activeRightPanel, setActiveRightPanel] = useSessionState<string>('layout.activeRightPanel', FILES);
73
+ const [showRightPanel, setShowRightPanel] = useSessionState<boolean>('layout.showRightPanel', true);
74
+ const handle = useRightOpenRequest(setActiveRightPanel);
75
+ requestPanel = handle.requestPanel;
76
+ request = handle.request;
77
+
78
+ const onSelectPanel = (id: string) => {
79
+ if (activeRightPanel === id && showRightPanel) {
80
+ setShowRightPanel(false);
81
+ return;
82
+ }
83
+ setShowRightPanel(true);
84
+ handle.requestPanel(id);
85
+ };
86
+
87
+ return h(
88
+ Group,
89
+ { orientation: 'horizontal', children: h(RightColumn, {
90
+ panelRef: { current: null },
91
+ open: showRightPanel,
92
+ width: 420,
93
+ minWidth: 200,
94
+ maxWidth: undefined,
95
+ catalog: CATALOG,
96
+ shownPanel: activeRightPanel,
97
+ selectedPanel: activeRightPanel,
98
+ activePanelFound: true,
99
+ hasActiveContext: false,
100
+ refreshKey: 0,
101
+ onRefresh: () => {},
102
+ onOpenFile: () => {},
103
+ onClose: () => {},
104
+ navStyle: 'tabs',
105
+ onSelectPanel,
106
+ openRequest: handle.request,
107
+ }) },
108
+ );
109
+ }
110
+
111
+ /** Render the provider on a session id and drain the load's promise chain. */
112
+ async function show(sessionId: string): Promise<void> {
113
+ await act(async () => {
114
+ render(h(SessionStateProvider, { sessionId, children: h(Harness, null) }), container);
115
+ });
116
+ await drain();
117
+ }
118
+
119
+ async function drain(): Promise<void> {
120
+ for (let i = 0; i < 20; i += 1) await act(async () => {});
121
+ }
122
+
123
+ function activeTab(): string | null {
124
+ return container.querySelector('[role="tab"][aria-selected="true"]')?.getAttribute('data-panel-tab') ?? null;
125
+ }
126
+
127
+ beforeAll(() => {
128
+ installDomGlobals(new Window({ url: 'http://localhost' }));
129
+ const target = globalThis as unknown as Record<string, unknown>;
130
+ target.fetch = async (input: unknown, init?: { method?: string }) => {
131
+ const method = init?.method ?? 'GET';
132
+ const sessionId = String(input).split('/sessions/')[1]?.split('/')[0] ?? 'x';
133
+ if (method === 'POST') return new Response(JSON.stringify({ success: true }), { status: 200 });
134
+ return new Response(
135
+ JSON.stringify({ sessionId, state: { ...(getSessionState(sessionId) ?? {}) } }),
136
+ { status: 200 },
137
+ );
138
+ };
139
+ });
140
+
141
+ afterAll(() => {
142
+ restoreDomGlobals();
143
+ });
144
+
145
+ beforeEach(() => {
146
+ resetSessionStateStore();
147
+ requestPanel = null;
148
+ request = null;
149
+ container = document.createElement('div');
150
+ document.body.appendChild(container);
151
+ hydrateSession('s-a', {
152
+ 'layout.rightPanelTabs': { tabs: [FILES], active: FILES, home: false },
153
+ 'layout.activeRightPanel': FILES,
154
+ 'layout.showRightPanel': true,
155
+ });
156
+ hydrateSession('s-b', {});
157
+ });
158
+
159
+ afterEach(() => {
160
+ render(null, container);
161
+ container.remove();
162
+ });
163
+
164
+ describe('an explicit open request beside the strip mirror', () => {
165
+ test('the requested view is the one stored AND the one drawn, and nothing stays pending', async () => {
166
+ await show('s-a');
167
+ expect(activeTab()).toBe(FILES);
168
+
169
+ await act(async () => {
170
+ requestPanel?.(STATS);
171
+ });
172
+ await drain();
173
+
174
+ // The race this test exists for: on the buggy code the two writers keep
175
+ // swapping, so the stored selection and the drawn tab disagree in every
176
+ // commit — whichever parity the drains happen to land on.
177
+ expect(getSessionValue<{ active: string }>('s-a', 'layout.rightPanelTabs')?.active).toBe(STATS);
178
+ expect(activeTab()).toBe(STATS);
179
+ expect(getSessionValue<string>('s-a', 'layout.activeRightPanel')).toBe(STATS);
180
+ expect(container.textContent).toContain('Resources body');
181
+
182
+ // A pending request would be re-applied by the next commit (and by the next
183
+ // session). Settled means the nonce stops moving.
184
+ const settled = request?.nonce;
185
+ await drain();
186
+ expect(request?.nonce).toBe(settled);
187
+ });
188
+
189
+ test('a request that settled under one session is not replayed in the next', async () => {
190
+ await show('s-a');
191
+ await act(async () => {
192
+ requestPanel?.(STATS);
193
+ });
194
+ await drain();
195
+
196
+ await show('s-b');
197
+
198
+ // A still-pending nonce would open `Resources` here on the switch commit —
199
+ // the reported tab in every chat. A fresh session owns no tab and no pick.
200
+ expect(container.querySelectorAll('[role="tab"]').length).toBe(0);
201
+ expect(getSessionValue('s-b', 'layout.rightPanelTabs')).toBeUndefined();
202
+ expect(getSessionValue('s-b', 'layout.activeRightPanel')).toBeUndefined();
203
+ });
204
+ });
@@ -43,6 +43,7 @@ import { useLeftDock } from '@/client/hooks/workspace/left-dock';
43
43
  import { usePanelTabs } from '@/client/hooks/workspace/panel-tabs';
44
44
  import { useRevealEdge, useRevealPanelTab } from '@/client/hooks/workspace/panel-tabs-reveal';
45
45
  import { useSessionStateContext } from '@/client/hooks/workspace/session-state/context';
46
+ import { getSessionValue } from '@/shared/lib/workspace/session-state/store';
46
47
  import { resolvePanelNav, type PanelNavStyle } from '@/shared/lib/workspace/panel-nav';
47
48
 
48
49
  export interface RightColumnProps {
@@ -126,10 +127,14 @@ export function RightColumn({
126
127
  // for. The Stats readout, which names a panel, already opened one — this is
127
128
  // the same answer for the click that names no view. See `panel-tabs-reveal`.
128
129
  const revealed = useRevealEdge(open);
130
+ // The view this session PICKED, not the fallback `files`: a fresh chat has
131
+ // never stored one, and treating the fallback as a pick is what opened the
132
+ // file explorer in every new session.
133
+ const storedView = getSessionValue<string>(sessionId, 'layout.activeRightPanel') ?? null;
129
134
  useRevealPanelTab({
130
135
  enabled: tabsMode,
131
136
  revealed,
132
- view: shownPanel,
137
+ storedView,
133
138
  home: tabsState.home,
134
139
  chosenHome: tabsState.chosenHome,
135
140
  openTab: tabsState.open,
@@ -146,21 +151,6 @@ export function RightColumn({
146
151
  // would mark a view active behind the catalog, and a view that re-reads on
147
152
  // activation would fetch for a page nobody is looking at.
148
153
  const effectivePanel = tabsMode ? (tabsState.home ? null : tabsState.active) : shownPanel;
149
- // Opening a tab from the home page happens through the strip, which writes the
150
- // hook; the effect above then mirrors it into the stored selection. `pinned`
151
- // is null here, so `active` is the user's own choice and may be `null`.
152
- useEffect(() => {
153
- if (!tabsMode || tabsState.home || tabsState.active === null) return;
154
- if (tabsState.active !== shownPanel) onSelectPanel?.(tabsState.active);
155
- }, [tabsMode, tabsState.home, tabsState.active, shownPanel, onSelectPanel]);
156
-
157
- /**
158
- * The OTHER direction, and it listens to a REQUEST rather than to
159
- * `shownPanel` — see `openRequest`. A restored selection is not an opening:
160
- * this column's default is the home page, so the only thing that may add a
161
- * tab without the user pressing something in the strip is a caller that
162
- * asked for a view by name.
163
- */
164
154
  const { open: openTab } = tabsState;
165
155
  /**
166
156
  * Each request is applied ONCE, tracked by its nonce.
@@ -174,6 +164,37 @@ export function RightColumn({
174
164
  const appliedRequest = useRef<number | null>(null);
175
165
  const requestKey = openRequest?.panelKey;
176
166
  const requestNonce = openRequest?.nonce;
167
+ /**
168
+ * A request that has not been applied yet is AHEAD of the strip: it writes
169
+ * `layout.activeRightPanel` in its event handler, while the tab it names is
170
+ * only opened by the effect below. For that commit `shownPanel` names the
171
+ * requested view and `tabsState.active` names the one the user is leaving —
172
+ * the mirror effect would read that as a strip choice and request the OLD
173
+ * view right back. The two then alternate every commit: measured on a session
174
+ * whose strip held `Files`, clicking the Stats readout added `Resources` but
175
+ * left `Files` selected and drawn, and the still-pending request re-applied
176
+ * after a session switch — the tab appeared in the next chat too.
177
+ */
178
+ const requestPending = requestNonce !== undefined && appliedRequest.current !== requestNonce;
179
+ // Opening a tab from the home page happens through the strip, which writes the
180
+ // hook; the effect above then mirrors it into the stored selection. `pinned`
181
+ // is null here, so `active` is the user's own choice and may be `null`.
182
+ useEffect(() => {
183
+ if (!tabsMode || tabsState.home || tabsState.active === null) return;
184
+ if (tabsState.active === shownPanel) return;
185
+ // The divergence a pending request creates is not a strip choice; only the
186
+ // request may answer it, and it does so in the effect below.
187
+ if (requestPending) return;
188
+ onSelectPanel?.(tabsState.active);
189
+ }, [tabsMode, tabsState.home, tabsState.active, shownPanel, onSelectPanel, requestPending]);
190
+
191
+ /**
192
+ * The OTHER direction, and it listens to a REQUEST rather than to
193
+ * `shownPanel` — see `openRequest`. A restored selection is not an opening:
194
+ * this column's default is the home page, so the only thing that may add a
195
+ * tab without the user pressing something in the strip is a caller that
196
+ * asked for a view by name.
197
+ */
177
198
  useEffect(() => {
178
199
  if (!tabsMode || requestKey === undefined || requestNonce === undefined) return;
179
200
  if (appliedRequest.current === requestNonce) return;
@@ -1,4 +1,4 @@
1
- import { useRef } from 'preact/hooks';
1
+ import { useEffect, useRef } from 'preact/hooks';
2
2
  import { lazy } from 'preact/compat';
3
3
  import type { RefObject } from 'preact/compat';
4
4
  import { Group, Panel, type PanelImperativeHandle } from '@/client/components/layout/desktop-layout/resizer';
@@ -20,7 +20,7 @@ import {
20
20
  type EditorWidthMode,
21
21
  type PanelWidths,
22
22
  } from '@/shared/lib/workspace/panel-widths';
23
- import { resolveWorkspacePanelWidths } from '@/shared/lib/workspace/workspace-panel-widths';
23
+ import { railShown, resolveWorkspacePanelWidths } from '@/shared/lib/workspace/workspace-panel-widths';
24
24
 
25
25
  const Editor = lazy(() => import('@/client/components/workspace/editor/index').then((m) => ({ default: m.Editor })));
26
26
 
@@ -85,6 +85,14 @@ interface WorkspacePanelsProps {
85
85
  onHideEditor: () => void;
86
86
  onSessionTitle: (title: string | null) => void;
87
87
  onPanelWidths: (patch: PanelWidths) => void;
88
+ /**
89
+ * The right panel is asked for but the group has no room for it.
90
+ *
91
+ * Reported upward because the CONTROL that asked lives in the navbar: a
92
+ * toggle that flips a flag this layout ignores reads as a dead button, so the
93
+ * owner of the flag is the one that has to explain the refusal.
94
+ */
95
+ onRightPanelSuppressed?: (suppressed: boolean | null) => void;
88
96
  }
89
97
 
90
98
  export function WorkspacePanels(props: WorkspacePanelsProps) {
@@ -123,6 +131,7 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
123
131
  onHideEditor,
124
132
  onSessionTitle,
125
133
  onPanelWidths,
134
+ onRightPanelSuppressed,
126
135
  } = props;
127
136
 
128
137
  /**
@@ -174,6 +183,8 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
174
183
  const {
175
184
  editor: editorWidth,
176
185
  right: rightWidth,
186
+ rightShown: rightPanelShown,
187
+ rightSuppressed,
177
188
  editorMax: editorMaxSize,
178
189
  rightMax: rightMaxSize,
179
190
  rightMin: rightPanelMin,
@@ -189,6 +200,16 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
189
200
  chatHidden,
190
201
  });
191
202
 
203
+ // The owner of the flag is the navbar's toggle, so the refusal travels up:
204
+ // a click that changes nothing visible is the defect this exists to prevent.
205
+ // `null` before the group is measured, so the first suppression of a load can
206
+ // be told apart from a panel being taken away.
207
+ useEffect(() => {
208
+ // `0` is the pre-measurement area as much as `null` is: the observer reports
209
+ // it on the first frame, and the resolver answers "fits" for both.
210
+ onRightPanelSuppressed?.(available == null || available <= 0 ? null : rightSuppressed);
211
+ }, [available, rightSuppressed, onRightPanelSuppressed]);
212
+
192
213
  /**
193
214
  * Widths of the fixed panels as they are right now, keyed by slot: the
194
215
  * editor (source or diff, whichever is showing) and the right panel under
@@ -243,7 +264,7 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
243
264
  available,
244
265
  reservedPx:
245
266
  (showEditor ? editorWidth : 0) +
246
- (showRightPanel ? rightWidth : 0) +
267
+ (rightPanelShown ? rightWidth : 0) +
247
268
  handleCount * HANDLE_WIDTH,
248
269
  })}
249
270
  >
@@ -289,10 +310,10 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
289
310
  </div>
290
311
  </Panel>
291
312
 
292
- {showRightPanel && <ResizeHandle />}
313
+ {rightPanelShown && <ResizeHandle />}
293
314
  <RightColumn
294
315
  panelRef={rightPanelRef}
295
- open={showRightPanel}
316
+ open={rightPanelShown}
296
317
  width={rightWidth}
297
318
  minWidth={rightPanelMin}
298
319
  maxWidth={rightMaxSize}
@@ -312,8 +333,14 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
312
333
  />
313
334
  </Group>
314
335
 
315
- {showRightSide && rightNav === 'rail' && (
316
- <ActivityBar side="right" activePanel={shownRightPanel} onChangePanel={onChangeRightPanel} isPanelOpen={showRightPanel} hasActiveContext={hasActiveContext} activeProjectPath={activeProjectPath} />
336
+ {/* The rail is how a view is CHOSEN, so it goes only where choosing one
337
+ can still put something on screen: a rail beside a SUPPRESSED panel is
338
+ a column of marks that switches nothing (and 44px the chat cannot
339
+ spare). A panel closed by its own control is not suppressed — the rail
340
+ is then the way back, and hiding it with the column left the column
341
+ unreachable except through the navbar's chord. */}
342
+ {railShown({ sideShown: showRightSide, nav: rightNav, rightSuppressed }) && (
343
+ <ActivityBar side="right" activePanel={shownRightPanel} onChangePanel={onChangeRightPanel} isPanelOpen={rightPanelShown} hasActiveContext={hasActiveContext} activeProjectPath={activeProjectPath} />
317
344
  )}
318
345
  </div>
319
346
  );
@@ -1,4 +1,4 @@
1
- import { useCallback, useMemo, useRef, useState } from 'preact/hooks';
1
+ import { useCallback, useRef, useState } from 'preact/hooks';
2
2
  import { Group, Panel, type PanelImperativeHandle } from '@/client/components/layout/desktop-layout/resizer';
3
3
  import { LeftColumn } from '@/client/components/layout/desktop-layout/LeftColumn';
4
4
  import { DesktopOverlays } from '@/client/components/layout/desktop-layout/DesktopOverlays';
@@ -21,16 +21,16 @@ import { useRightOpenRequest } from '@/client/hooks/workspace/right-open-request
21
21
  import { useLeftDock, useLeftDockWidth } from '@/client/hooks/workspace/left-dock';
22
22
  import { useEditorViewLayout } from '@/client/hooks/workspace/editor-view';
23
23
  import { useLeftDockView } from '@/client/components/workspace/plugin-panel/catalog';
24
- import type { EditorWidthMode } from '@/shared/lib/workspace/panel-widths';
25
24
  import { useSettingsModal } from '@/client/hooks/ui/settings-modal';
26
25
  import { useWorkspaceCommands } from '@/client/hooks/workspace/commands';
27
26
  import { PluginBootstrap } from '@/client/lib/plugins/bootstrap';
28
27
  import { useToasts } from '@/client/hooks/ui/toasts';
29
- import type { EditorDropResult } from '@/client/hooks/editor/use-editor-drop';
28
+ import { useDropOutcomeToast } from '@/client/hooks/editor/use-editor-drop';
30
29
  import { useNavbarSessionActions } from '@/client/hooks/workspace/navbar-session-actions';
31
30
  import { useCopyTabPath } from '@/client/hooks/workspace/copy-tab-path';
32
31
  import { useRightSideLayout, type RightSideLayout } from '@/client/hooks/workspace/right-side';
33
32
  import { useActiveWorkspaceProject } from '@/client/hooks/workspace/active-project';
33
+ import { useRightPanelPresence } from '@/client/hooks/workspace/right-panel-presence';
34
34
 
35
35
  interface DesktopLayoutProps {
36
36
  sessionId: string | null;
@@ -90,6 +90,7 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
90
90
  const {
91
91
  openedFiles,
92
92
  activeFileId,
93
+ widthMode: editorWidthMode,
93
94
  setActiveFileId,
94
95
  handleOpenFile,
95
96
  handleCloseFile,
@@ -130,13 +131,6 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
130
131
  // while the rail draws another.
131
132
  const rightSideShown = !rightSide.hidden;
132
133
 
133
- // A diff wants room a source file does not, so the editor panel keeps a
134
- // separate remembered width per tab kind.
135
- const editorWidthMode: EditorWidthMode = useMemo(
136
- () => (openedFiles.find(f => String(f.id) === String(activeFileId))?.isDiff ? 'diff' : 'editor'),
137
- [openedFiles, activeFileId],
138
- );
139
-
140
134
  /**
141
135
  * The editor's WIDTH mode (`compact` / `full`), entered from either toolbar.
142
136
  *
@@ -163,17 +157,17 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
163
157
 
164
158
  const { pushToast } = useToasts();
165
159
 
166
- /**
167
- * A refused drop names its reason ("outside every workspace", "not text") —
168
- * a silent no-op reads as a broken target. The TARGET is `WorkspacePanels`':
169
- * a layout-wide one would accept a drop over the sidebar and right panel too.
170
- */
171
- const handleDropResult = useCallback(
172
- (result: EditorDropResult) => pushToast(result.message, result.ok ? 'success' : 'error'),
173
- [pushToast],
174
- );
160
+ const handleDropResult = useDropOutcomeToast(pushToast);
175
161
  const { menu: sessionActions, sessionDelete } = useNavbarSessionActions(folders, sessionId, pushToast);
176
162
 
163
+ // The side's presence and its refusal, one owner: `useRightPanelPresence`.
164
+ const rightPanel = useRightPanelPresence({
165
+ pushToast,
166
+ showEditor,
167
+ sideShown: rightSideShown,
168
+ toggleSide: rightSide.toggleRightSide,
169
+ });
170
+
177
171
  /**
178
172
  * Ask for the sidebar (or put it away).
179
173
  *
@@ -199,7 +193,7 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
199
193
  toggleEditor: rightSide.toggleEditor,
200
194
  // The side's own switch, so the other chord and the navbar's button cannot
201
195
  // disagree about what "the right side" means.
202
- toggleRightPanel: rightSide.toggleRightSide,
196
+ toggleRightPanel: rightPanel.toggle,
203
197
  openSettings: () => (settings.isOpen ? settings.close() : settings.open()),
204
198
  });
205
199
 
@@ -292,9 +286,9 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
292
286
  sessionTitle={sessionTitle}
293
287
  sessionId={sessionId}
294
288
  showLeftPanel={sidebarOpen}
295
- showRightSide={rightSideShown}
289
+ showRightSide={rightSideShown && rightPanel.sideVisible}
296
290
  streamStatus={streamStatus}
297
- onToggleRightSide={rightSide.toggleRightSide}
291
+ onToggleRightSide={rightPanel.toggle}
298
292
  onToggleLeftPanel={() => handleToggleLeftPanel(!sidebarOpen)}
299
293
  sessionActions={sessionActions}
300
294
  />
@@ -338,6 +332,7 @@ export function DesktopLayout({ sessionId, onMobileToggle, appSettings = {} }: D
338
332
  onHideEditor={rightSide.hideEditor}
339
333
  onSessionTitle={setSessionTitle}
340
334
  onPanelWidths={commitWidths}
335
+ onRightPanelSuppressed={rightPanel.report}
341
336
  />
342
337
  </main>
343
338
  </Panel>
@@ -99,23 +99,25 @@ export function MobileRightSidebar({
99
99
  const tabsMode = navStyle === 'tabs';
100
100
  const known = useMemo(() => new Set(catalog.map((panel) => panel.id)), [catalog]);
101
101
  const tabsState = usePanelTabs('right', known, null);
102
- // The header's "Open Right Panel" is a reveal, so it must show a VIEW rather
103
- // than the catalog — the same rule the desktop column follows, and the same
104
- // one the Stats readout already satisfies by naming a panel.
102
+ // Whether the session's blob actually holds a right-drawer view. Read through
103
+ // the store (not the hook's fallback), because "unset" and "set to the
104
+ // default" are different facts here — and only the former is a session the
105
+ // header's reveal may open a view for.
106
+ const hasStoredTab = getSessionValue<string>(sessionId, 'layout.mobileRightPanel') !== undefined;
107
+ // The header's "Open Right Panel" is a reveal, so it shows the view this
108
+ // session PICKED. A fresh chat never picked one (`activeTab` is the `files`
109
+ // fallback), so it keeps its catalog — the reported defect was a new chat
110
+ // opening a `Files` tab every time the drawer was revealed.
105
111
  useRevealPanelTab({
106
112
  enabled: tabsMode,
107
113
  revealed: useRevealSignal(revealSignal),
108
- view: activeTab,
114
+ storedView: hasStoredTab ? activeTab : null,
109
115
  home: tabsState.home,
110
116
  chosenHome: tabsState.chosenHome,
111
117
  openTab: tabsState.open,
112
118
  known,
113
119
  });
114
120
  const { open: openTab, tabs: openTabIds } = tabsState;
115
- // Whether the session's blob actually holds a right-drawer view. Read through
116
- // the store (not the hook's fallback), because "unset" and "set to the
117
- // default" are different facts here.
118
- const hasStoredTab = getSessionValue<string>(sessionId, 'layout.mobileRightPanel') !== undefined;
119
121
 
120
122
  /**
121
123
  * Every gesture that CHANGES the view must arm the soft keyboard before the
@@ -123,6 +123,8 @@ export function MobileEditorSurface({
123
123
  name={file.name}
124
124
  source={editor.byteSource}
125
125
  content={editor.content}
126
+ root={file.root}
127
+ repo={file.repo}
126
128
  revision={editor.revision}
127
129
  onContentChange={editor.onChange}
128
130
  onSaveBytes={editor.deviceBacked ? undefined : saveBytes}
@@ -29,7 +29,13 @@ import { indentUnitFor, useEditorIndent } from '@/client/hooks/editor/indent-set
29
29
  import { useEditorTyping } from '@/client/hooks/editor/typing-settings';
30
30
  import { useFileReviewMode } from '@/client/hooks/editor/use-file-review-mode';
31
31
  import { MOBILE_SCROLL_POSITIONS_KEY } from '@/shared/lib/workspace/scroll-positions';
32
- import { BINARY_VIEWERS, RENDERED_VIEWERS, VIEWER_LABELS, viewerKindFor } from '@/shared/lib/fs/document-kind';
32
+ import {
33
+ BINARY_VIEWERS,
34
+ RENDERED_VIEWERS,
35
+ VIEWER_LABELS,
36
+ opensInPreview,
37
+ viewerKindFor,
38
+ } from '@/shared/lib/fs/document-kind';
33
39
  import type { MobileFullEditorProps } from '@/client/components/mobile/mobile-right-sidebar/editor-props';
34
40
 
35
41
  export function MobileFullEditor({ file, missing = false, onClose, onFileSaved, onDropResult }: MobileFullEditorProps) {
@@ -57,8 +63,10 @@ export function MobileFullEditor({ file, missing = false, onClose, onFileSaved,
57
63
  const hasPreview = RENDERED_VIEWERS[viewerKind] === true;
58
64
  const fileKey = file.path ?? file.name;
59
65
  // The picture/grid/prose is what the file was opened to read, so a rendered
60
- // kind defaults to its preview and only a user's own toggle moves it.
61
- const isPreview = previewOverrides[fileKey] ?? hasPreview;
66
+ // kind defaults to its preview and only a user's own toggle moves it. An HTML
67
+ // page is the exception: it opens its SOURCE, which is why the default is its
68
+ // own table rather than "has a preview at all".
69
+ const isPreview = previewOverrides[fileKey] ?? opensInPreview(viewerKind);
62
70
  // Review mode is the same per-tab toggle the desktop pane uses (one key, one
63
71
  // rule), and it exists only where a rendered markdown document is on screen —
64
72
  // a CSV grid and an SVG picture have no markdown blocks to judge.
@@ -46,7 +46,8 @@ export function useMobileDrawerTabs(dock: MobileDockState, revealSignal: number)
46
46
  useRevealPanelTab({
47
47
  enabled: dock.tabsMode,
48
48
  revealed: useRevealSignal(revealSignal),
49
- view: dock.activeView,
49
+ // The left drawer pins the session list, so it always has a view to reveal.
50
+ storedView: dock.activeView,
50
51
  home: tabs?.home ?? false,
51
52
  chosenHome: tabs?.chosenHome ?? false,
52
53
  openTab: tabs?.open ?? null,
@@ -164,4 +164,25 @@ describe('editor theme picker', () => {
164
164
  // Auto is a choice, not a light/dark theme, so a variant filter keeps it.
165
165
  expect(labels.some((label) => label.startsWith('Auto'))).toBe(true);
166
166
  });
167
+
168
+ /**
169
+ * The grid's density is a fact about the PANE, not the window.
170
+ *
171
+ * `sm:grid-cols-2 lg:grid-cols-3` read the VIEWPORT: at a 768px window the
172
+ * settings modal is 720 wide and this pane gets 174px, where two 83px cards
173
+ * were drawn and the selected card's check measured 6px outside the dialog
174
+ * (which is `overflow-hidden`, so it was clipped). A DOM test cannot measure
175
+ * Tailwind, so this pins the contract the markup must keep: the section is
176
+ * the container and the grid's breakpoints are container queries.
177
+ */
178
+ test('the card grid asks its PANE, never the viewport', async () => {
179
+ const root = await mount(EDITOR_AUTO_THEME_ID);
180
+ const grid = root.querySelector('.grid');
181
+ expect(grid).not.toBeNull();
182
+ const classes = grid?.className ?? '';
183
+ expect(classes).toContain('grid-cols-1');
184
+ expect(classes).toContain('@[320px]:grid-cols-2');
185
+ expect(classes).not.toMatch(/(^|\s)(sm|md|lg|xl):/);
186
+ expect(root.querySelector('section')?.className).toContain('@container');
187
+ });
167
188
  });