@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
@@ -45,6 +45,9 @@ const ImageView = lazy(() =>
45
45
  const DrawioView = lazy(() =>
46
46
  import('@/client/components/workspace/editor/viewers/DrawioView').then((m) => ({ default: m.DrawioView })),
47
47
  );
48
+ const HtmlPreview = lazy(() =>
49
+ import('@/client/components/workspace/editor/viewers/HtmlPreview').then((m) => ({ default: m.HtmlPreview })),
50
+ );
48
51
 
49
52
  /** What a viewer is handed: the file's identity, its bytes and its text. */
50
53
  export interface ViewerProps {
@@ -54,8 +57,11 @@ export interface ViewerProps {
54
57
  name: string;
55
58
  /** Byte source for the byte-drawing viewers. */
56
59
  source: ByteSource;
57
- /** Text buffer, for the viewers that read it (CSV, SVG). */
60
+ /** Text buffer, for the viewers that read it (CSV, SVG, HTML). */
58
61
  content: string;
62
+ /** The file's workspace scope, so a rendered document resolves its relatives. */
63
+ root?: string | null;
64
+ repo?: string | null;
59
65
  /** Bumped to force a re-parse (a workspace refresh). */
60
66
  revision: number;
61
67
  /** Write an edited TEXT buffer back (the CSV grid's cells are text). */
@@ -75,7 +81,8 @@ export function hasViewerSurface(kind: ViewerKind): boolean {
75
81
  kind === 'spreadsheet' ||
76
82
  kind === 'csv' ||
77
83
  kind === 'svg' ||
78
- kind === 'drawio'
84
+ kind === 'drawio' ||
85
+ kind === 'html'
79
86
  );
80
87
  }
81
88
 
@@ -98,6 +105,8 @@ export function ViewerSurface({
98
105
  name,
99
106
  source,
100
107
  content,
108
+ root = null,
109
+ repo = null,
101
110
  revision,
102
111
  onContentChange,
103
112
  onSaveBytes,
@@ -159,5 +168,12 @@ export function ViewerSurface({
159
168
  </Suspense>
160
169
  );
161
170
  }
171
+ if (kind === 'html') {
172
+ return (
173
+ <Suspense fallback={<Loading />}>
174
+ <HtmlPreview content={content} name={name} path={path} root={root} repo={repo} />
175
+ </Suspense>
176
+ );
177
+ }
162
178
  return null;
163
179
  }
@@ -52,6 +52,10 @@ beforeAll(async () => {
52
52
  ({ DocxView } = await import('@/client/components/workspace/editor/viewers/DocxView'));
53
53
  ({ SheetView } = await import('@/client/components/workspace/editor/viewers/SheetView'));
54
54
  ({ DrawioView } = await import('@/client/components/workspace/editor/viewers/DrawioView'));
55
+ // Evaluated here for the same reason every viewer above is: the module binds
56
+ // DOM globals at load time, which `installDomGlobals` only just installed.
57
+ // Importing it also lets the lazy branch in `dispatch` resolve immediately.
58
+ await import('@/client/components/workspace/editor/viewers/HtmlPreview');
55
59
  ({ ViewerSurface, hasViewerSurface } = await import('@/client/components/workspace/editor/viewers/dispatch'));
56
60
  });
57
61
 
@@ -228,7 +232,7 @@ describe('DocxView', () => {
228
232
 
229
233
  describe('hasViewerSurface', () => {
230
234
  test('the drawn kinds have a surface; text kinds do not', () => {
231
- for (const kind of ['image', 'pdf', 'docx', 'spreadsheet', 'csv', 'svg', 'drawio'] as const) {
235
+ for (const kind of ['image', 'pdf', 'docx', 'spreadsheet', 'csv', 'svg', 'drawio', 'html'] as const) {
232
236
  expect(hasViewerSurface(kind)).toBe(true);
233
237
  }
234
238
  for (const kind of ['code', 'markdown'] as const) {
@@ -266,6 +270,15 @@ describe('ViewerSurface routing', () => {
266
270
  expect(container.querySelector('.drawio-preview svg')).not.toBeNull();
267
271
  });
268
272
 
273
+ // An HTML page reads the TEXT buffer and paints in a sandboxed frame, so the
274
+ // dispatch must reach HtmlPreview with no byte source at all.
275
+ test('an html kind draws the page in a frame from the text buffer', async () => {
276
+ await mount(
277
+ h(ViewerSurface, { kind: 'html', path: 'page.html', name: 'page.html', source: noSource, content: '<h1>Hi</h1>', revision: 0 }),
278
+ );
279
+ expect(container.querySelector('iframe')?.getAttribute('srcdoc')).toContain('<h1>Hi</h1>');
280
+ });
281
+
269
282
  test('a kind with no surface here renders nothing', async () => {
270
283
  await mount(h(ViewerSurface, { kind: 'code', path: 'a.ts', name: 'a.ts', source: noSource, content: 'x', revision: 0 }));
271
284
  expect(container.textContent).toBe('');
@@ -20,6 +20,7 @@ import type { ComponentChildren } from 'preact';
20
20
  import { act } from 'preact/test-utils';
21
21
 
22
22
  import { PanelHeader } from '@/client/components/workspace/panel-header';
23
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
23
24
 
24
25
  const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'Event'] as const;
25
26
  const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
@@ -75,6 +76,6 @@ describe('PanelHeader', () => {
75
76
  const el = await mount(h('span', null, 'picker'), undefined, 'border-b-0');
76
77
  const strip = el.firstElementChild as HTMLElement;
77
78
  expect(strip.className).toContain('border-b-0');
78
- expect(strip.className).toContain('h-10');
79
+ expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
79
80
  });
80
81
  });
@@ -9,9 +9,10 @@
9
9
  * Every right-panel view drew its own header, and each picked its own height
10
10
  * and padding: `p-3` on three of them, `p-4` on Context, `px-3.5 py-2.5` on
11
11
  * Usage and Todos, `py-1.5` on the wiki. The repo picker is the same control in
12
- * all of them, so the row around it is one fact: a 40px strip whose centre is
13
- * the activity rail's first mark. Stating it once is what keeps the picker on
14
- * the same line as the rail when a view is switched.
12
+ * all of them, so the row around it is one fact: a 40px strip
13
+ * (`CONTROL_ROW_HEIGHT.desktop`, the same constant the panel tab strips read)
14
+ * whose centre is the activity rail's first mark. Stating it once is what keeps
15
+ * the picker on the same line as the rail when a view is switched.
15
16
  *
16
17
  * The icon controls in `right` are `HeaderButton`/`RefreshButton` from
17
18
  * `common/header-button`, so the reload glyph is the same box in a settings
@@ -24,6 +25,7 @@
24
25
  */
25
26
 
26
27
  import type { ReactNode } from 'preact/compat';
28
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
27
29
 
28
30
  interface PanelHeaderProps {
29
31
  /** The picker and the view's own leading content. */
@@ -37,7 +39,7 @@ interface PanelHeaderProps {
37
39
  export function PanelHeader({ left, right, className = '' }: PanelHeaderProps) {
38
40
  return (
39
41
  <div
40
- className={`h-10 flex-shrink-0 px-3 border-b border-ink/10 bg-paper flex items-center justify-between gap-2 select-none ${className}`}
42
+ className={`${CONTROL_ROW_HEIGHT.desktop} flex-shrink-0 px-3 border-b border-ink/10 bg-paper flex items-center justify-between gap-2 select-none ${className}`}
41
43
  >
42
44
  <div className="flex items-center gap-2 min-w-0">{left}</div>
43
45
  {right ? <div className="flex items-center gap-1 flex-shrink-0">{right}</div> : null}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Measuring the mounted window into the layout's height map.
8
+ *
9
+ * Split out of `row-window.ts` so that hook stays under the repo's per-file
10
+ * ceiling; the arithmetic is self-contained (DOM in, slot map out) and the
11
+ * subtlety it encodes is worth its own module.
12
+ *
13
+ * A row's SLOT is its wrapper PLUS the run footer that closes it. The footer is
14
+ * a sibling of the row GROUP — it is a model/duration stamp, not a step of the
15
+ * trace rail, so it cannot live inside the rail's container — which puts it
16
+ * outside the row's own rect. Left out of the layout, the rendered content
17
+ * height depended on which rows were mounted: the row at the window's edge
18
+ * pulled its footer in with it, the total grew by the footer's height, the tail
19
+ * pin followed, and the next frame's window started one row later and dropped
20
+ * it again — measured in Chromium at a run's settle as scrollTop 1938 → 1968 →
21
+ * 1938 with scrollHeight 2236 → 2266 → 2236, i.e. the reported up/down flicker
22
+ * at the end of a stream. The marker (`data-row-footer-for`) is set by
23
+ * `MessageList`; the pad then carries the footer for a row that is unmounted,
24
+ * exactly as it carries the row.
25
+ */
26
+
27
+ /** A measurement is only adopted when it differs by more than this. */
28
+ const MEASURE_EPSILON_PX = 0.5;
29
+
30
+ export interface RowMeasurement {
31
+ /** At least one slot changed by more than the epsilon. */
32
+ changed: boolean;
33
+ /** A measured row sits at or above the viewport's top, so the content ABOVE
34
+ * the reader moved. */
35
+ above: boolean;
36
+ }
37
+
38
+ /** Read the mounted rows (and their footers) into `measured`, keyed by row id.
39
+ *
40
+ * A height survives the row being unmounted and remounted, which is what keeps
41
+ * the scrollbar steady — so this only ever ADDS or REFRESHES entries. */
42
+ export function measureRows(el: HTMLElement, measured: Map<string, number>): RowMeasurement {
43
+ let above = false;
44
+ const slots = new Map<string, number>();
45
+ for (const node of el.querySelectorAll<HTMLElement>('[data-row-id]')) {
46
+ const id = node.dataset.rowId;
47
+ if (!id) continue;
48
+ const rect = node.getBoundingClientRect();
49
+ const height = rect.height;
50
+ // A row measured while hidden reports 0; averaging it in would drag every
51
+ // unmeasured row toward nothing.
52
+ if (height <= 0) continue;
53
+ slots.set(id, height);
54
+ // A row at or above the viewport's top moves the content ABOVE the reader;
55
+ // the tail pin must not follow it (see `skipTailPinRef`).
56
+ if (rect.bottom <= 0) above = true;
57
+ }
58
+ for (const node of el.querySelectorAll<HTMLElement>('[data-row-footer-for]')) {
59
+ const id = node.dataset.rowFooterFor;
60
+ if (!id) continue;
61
+ // Only a mounted row has its footer on screen; an unmounted one takes the
62
+ // slot height recorded when it last was.
63
+ const height = slots.get(id);
64
+ if (height === undefined) continue;
65
+ slots.set(id, height + node.getBoundingClientRect().height);
66
+ }
67
+ let changed = false;
68
+ for (const [id, height] of slots) {
69
+ const previous = measured.get(id);
70
+ if (previous !== undefined && Math.abs(previous - height) <= MEASURE_EPSILON_PX) continue;
71
+ measured.set(id, height);
72
+ changed = true;
73
+ }
74
+ return { changed, above };
75
+ }
@@ -84,6 +84,16 @@ function installScroller(top: number): HTMLDivElement {
84
84
  return el;
85
85
  }
86
86
 
87
+ /** Mount `ROWS` stubbed row nodes, each reporting the rect `rectFor` returns. */
88
+ function installRows(scroller: HTMLDivElement, rectFor: (index: number, id: string) => DOMRect): void {
89
+ for (let i = 0; i < ROWS; i += 1) {
90
+ const node = document.createElement('div');
91
+ node.dataset.rowId = `r-${i}`;
92
+ node.getBoundingClientRect = () => rectFor(i, node.dataset.rowId!);
93
+ scroller.appendChild(node);
94
+ }
95
+ }
96
+
87
97
  interface JumpStub {
88
98
  active: { current: boolean };
89
99
  behavior: { current: ScrollBehavior };
@@ -236,12 +246,7 @@ describe('useTimelineRowWindow', () => {
236
246
  // is what lands the open in the commit that measured the rows instead of
237
247
  // one rAF later (measured in the browser: one painted frame 2 044 px short).
238
248
  const scroller = installScroller(20_000);
239
- for (let i = 0; i < ROWS; i += 1) {
240
- const node = document.createElement('div');
241
- node.dataset.rowId = `r-${i}`;
242
- node.getBoundingClientRect = () => ({ height: ROW_HEIGHT }) as DOMRect;
243
- scroller.appendChild(node);
244
- }
249
+ installRows(scroller, () => ({ height: ROW_HEIGHT }) as DOMRect);
245
250
  const tail = ROWS * ROW_HEIGHT - VIEWPORT;
246
251
  await mount(scroller, { active: { current: true }, behavior: { current: 'instant' } });
247
252
  await act(async () => {});
@@ -266,12 +271,7 @@ describe('useTimelineRowWindow', () => {
266
271
  // snapping shut).
267
272
  const scroller = installScroller(20_000);
268
273
  const heights = new Map<string, number>();
269
- for (let i = 0; i < ROWS; i += 1) {
270
- const node = document.createElement('div');
271
- node.dataset.rowId = `r-${i}`;
272
- node.getBoundingClientRect = () => ({ height: heights.get(node.dataset.rowId!) ?? ROW_HEIGHT }) as DOMRect;
273
- scroller.appendChild(node);
274
- }
274
+ installRows(scroller, (_i, id) => ({ height: heights.get(id) ?? ROW_HEIGHT }) as DOMRect);
275
275
  await mount(scroller);
276
276
  await act(async () => {});
277
277
  const opened = rowWindow!.start;
@@ -298,15 +298,10 @@ describe('useTimelineRowWindow', () => {
298
298
  // must win, and the geometry pin must stand down for that delivery.
299
299
  const scroller = installScroller(ROWS * ROW_HEIGHT - VIEWPORT);
300
300
  const heights = new Map<string, number>();
301
- for (let i = 0; i < ROWS; i += 1) {
302
- const node = document.createElement('div');
303
- node.dataset.rowId = `r-${i}`;
304
- node.getBoundingClientRect = () => {
305
- const height = heights.get(node.dataset.rowId!) ?? ROW_HEIGHT;
306
- return { height, bottom: i * ROW_HEIGHT + height - scroller.scrollTop } as DOMRect;
307
- };
308
- scroller.appendChild(node);
309
- }
301
+ installRows(scroller, (i, id) => {
302
+ const height = heights.get(id) ?? ROW_HEIGHT;
303
+ return { height, bottom: i * ROW_HEIGHT + height - scroller.scrollTop } as DOMRect;
304
+ });
310
305
  const skip = { current: false };
311
306
  const jump = { active: { current: true }, behavior: { current: 'instant' as ScrollBehavior } };
312
307
  await mount(scroller, jump, skip);
@@ -324,4 +319,29 @@ describe('useTimelineRowWindow', () => {
324
319
  expect(scroller.scrollTop).toBe(before + 1_000);
325
320
  expect(skip.current).toBe(true);
326
321
  });
322
+
323
+ test('a run footer is measured into the slot of the row it closes', async () => {
324
+ // The reported up/down flicker at the end of a stream: the footer is a
325
+ // SIBLING of the row group (the rail must not run through it), so its
326
+ // height is outside the row's rect. Left out of the layout, the content
327
+ // height depended on the mounted window — the row at its edge pulled the
328
+ // footer in with it, the total grew by the footer's height, the tail pin
329
+ // followed, and the next frame's window started one row later and dropped
330
+ // it again (measured in Chromium: scrollTop 1938 → 1968 → 1938 with
331
+ // scrollHeight 2236 → 2266 → 2236). The spacer must carry it instead.
332
+ const scroller = installScroller(20_000);
333
+ installRows(scroller, () => ({ height: ROW_HEIGHT }) as DOMRect);
334
+ const footer = document.createElement('div');
335
+ footer.dataset.rowFooterFor = 'r-150';
336
+ footer.getBoundingClientRect = () => ({ height: 30 }) as DOMRect;
337
+ scroller.appendChild(footer);
338
+
339
+ await mount(scroller);
340
+ await act(async () => {});
341
+
342
+ // `r-150` is above the mounted window, so its slot (row + footer) is
343
+ // inside `padTop`: the spacer describes the session, not the window.
344
+ expect(rowWindow!.start).toBeGreaterThan(150);
345
+ expect(rowWindow!.padTop).toBe(rowWindow!.start * ROW_HEIGHT + 30);
346
+ });
327
347
  });
@@ -33,9 +33,7 @@ import type { RefObject } from 'preact/compat';
33
33
  import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'preact/hooks';
34
34
  import { layoutTimelineRows, rowIndex, timelineWindow } from '@/shared/lib/chat/timeline/row-window';
35
35
  import { createRevealRow, writeScrollTop } from '@/client/hooks/chat/timeline/row-window-reveal';
36
-
37
- /** A measurement is only adopted when it differs by more than this. */
38
- const MEASURE_EPSILON_PX = 0.5;
36
+ import { measureRows } from '@/client/hooks/chat/timeline/row-measure';
39
37
 
40
38
  /** Distance from the bottom, in px, that makes a reader "at the tail". Mirrors
41
39
  * `FOLLOW_BOTTOM_THRESHOLD_PX` in `scroll.ts`: below it, follow mode is on. */
@@ -206,30 +204,14 @@ export function useTimelineRowWindow({
206
204
  // row every frame, an accordion expands, an image decodes — and a stale height
207
205
  // there is a scrollbar that describes a session shorter than it is, which is
208
206
  // what makes a jump land short. `range` is a dependency because a new window
209
- // means a new set of nodes to observe.
207
+ // means a new set of nodes to observe. The run footers are observed for the
208
+ // same reason: `changedFiles` lands in one a second after the turn, and its
209
+ // growth belongs to the row's slot (see `row-measure.ts`).
210
210
  useLayoutEffect(() => {
211
211
  if (!enabled) return;
212
212
  const el = element;
213
213
  if (!el) return;
214
- const measure = (): { changed: boolean; above: boolean } => {
215
- let changed = false;
216
- let above = false;
217
- for (const node of el.querySelectorAll<HTMLElement>('[data-row-id]')) {
218
- const id = node.dataset.rowId;
219
- if (!id) continue;
220
- const rect = node.getBoundingClientRect();
221
- const height = rect.height;
222
- if (height <= 0) continue;
223
- const previous = measuredRef.current.get(id);
224
- if (previous !== undefined && Math.abs(previous - height) <= MEASURE_EPSILON_PX) continue;
225
- measuredRef.current.set(id, height);
226
- // A row at or above the viewport's top moves the content ABOVE the
227
- // reader; the tail pin must not follow it (see `skipTailPinRef`).
228
- if (rect.bottom <= 0) above = true;
229
- changed = true;
230
- }
231
- return { changed, above };
232
- };
214
+ const measure = () => measureRows(el, measuredRef.current);
233
215
  const adopt = (above: boolean): void => {
234
216
  // Which row the reader is looking at, under the geometry they are still
235
217
  // seeing: `el.scrollTop` has not moved yet (a browser does not adjust it
@@ -309,7 +291,7 @@ export function useTimelineRowWindow({
309
291
  if (result.changed) adopt(result.above);
310
292
  });
311
293
  });
312
- for (const node of el.querySelectorAll('[data-row-id]')) observer.observe(node);
294
+ for (const node of el.querySelectorAll('[data-row-id], [data-row-footer-for]')) observer.observe(node);
313
295
  return () => {
314
296
  observer.disconnect();
315
297
  if (frame !== null) cancelAnimationFrame(frame);
@@ -21,7 +21,7 @@
21
21
  * object.
22
22
  */
23
23
 
24
- import { getImageMimeType } from '@/shared/lib/fs/file-kind';
24
+ import { getImageMimeType } from '@/shared/lib/fs/mime';
25
25
  import { BINARY_VIEWERS, viewerKindFor, type ViewerKind } from '@/shared/lib/fs/document-kind';
26
26
  import { buildFsRawUrl } from '@/shared/lib/fs/paths';
27
27
  import { byteSourceFor, type ByteSource } from '@/client/components/workspace/editor/viewers/bytes';
@@ -55,6 +55,20 @@ export interface EditorDropResult {
55
55
  message: string;
56
56
  }
57
57
 
58
+ /**
59
+ * The toast a drop outcome earns.
60
+ *
61
+ * A refused drop names its reason ("outside every workspace", "not text") — a
62
+ * silent no-op reads as a broken target, which is the one thing a drop zone
63
+ * cannot afford. The TARGET that produced the result is `WorkspacePanels`, so
64
+ * the layout only relays what it reported.
65
+ */
66
+ export function useDropOutcomeToast(
67
+ pushToast: (message: string, tone?: 'success' | 'error' | 'warning') => void,
68
+ ): (result: EditorDropResult) => void {
69
+ return useCallback((result: EditorDropResult) => pushToast(result.message, result.ok ? 'success' : 'error'), [pushToast]);
70
+ }
71
+
58
72
  export interface UseEditorDropOptions {
59
73
  /** False when the column has no workspace to resolve against. */
60
74
  enabled?: boolean;
@@ -22,7 +22,7 @@
22
22
 
23
23
  import { useEffect } from 'preact/hooks';
24
24
 
25
- import { RENDERED_VIEWERS, viewerKindFor } from '@/shared/lib/fs/document-kind';
25
+ import { opensInPreview, viewerKindFor } from '@/shared/lib/fs/document-kind';
26
26
  import { getSessionValue } from '@/shared/lib/workspace/session-state/store';
27
27
  import { setDirtyTabs } from '@/client/lib/editor-dirty-tabs';
28
28
  import type { OpenedFile } from '@/shared/types/fs';
@@ -57,9 +57,10 @@ export function useEditorTabState({
57
57
  if (!previewReady) return;
58
58
  const id = activeFile?.id;
59
59
  if (!activeFile || id === undefined || id === null) return;
60
- // Only a file with a RENDERED view has a default worth setting; a code file has
61
- // no preview to open.
62
- if (!RENDERED_VIEWERS[viewerKindFor(activeFile.name)]) return;
60
+ // Only a file that OPENS rendered has a default worth setting; a code file
61
+ // has no preview to open, and an HTML page defaults to its source even
62
+ // though it has one.
63
+ if (!opensInPreview(viewerKindFor(activeFile.name))) return;
63
64
  const stored = getSessionValue<Record<string | number, boolean>>(sessionId, 'editor.previewMode');
64
65
  if (stored && stored[id] !== undefined) return;
65
66
  setPreviewMode((previous) => (previous[id] === undefined ? { ...previous, [id]: true } : previous));
@@ -21,6 +21,33 @@
21
21
 
22
22
  import { useEffect, useState } from 'preact/hooks';
23
23
 
24
+ /**
25
+ * The window's current width, subscribed.
26
+ *
27
+ * `useViewportAtLeast` answers a yes/no question, which is all a control that
28
+ * folds or not needs. The desktop sidebar asks a different one — how many
29
+ * pixels the window has, so its own width can be capped as a SHARE of them
30
+ * (`sidebarWidthForViewport`) — and a boolean cannot answer that.
31
+ */
32
+ export function useViewportWidth(): number {
33
+ const [width, setWidth] = useState(() => (typeof window === 'undefined' ? 0 : window.innerWidth));
34
+
35
+ useEffect(() => {
36
+ const update = () => setWidth(window.innerWidth);
37
+ // Read once on the way in: a window resized between the first render and
38
+ // this effect would otherwise keep the stale value until the next resize.
39
+ update();
40
+ window.addEventListener('resize', update);
41
+ window.addEventListener('orientationchange', update);
42
+ return () => {
43
+ window.removeEventListener('resize', update);
44
+ window.removeEventListener('orientationchange', update);
45
+ };
46
+ }, []);
47
+
48
+ return width;
49
+ }
50
+
24
51
  export function useViewportAtLeast(px: number): boolean {
25
52
  const query = `(min-width: ${px}px)`;
26
53
  const [matches, setMatches] = useState(() =>
@@ -1,3 +1,4 @@
1
+ import type { EditorWidthMode } from '@/shared/lib/workspace/panel-widths';
1
2
  import { useCallback, useEffect, useRef } from 'preact/hooks';
2
3
  import { useSessionState } from '@/client/hooks/workspace/session-state';
3
4
  import { useSessionStateContext } from '@/client/hooks/workspace/session-state/context';
@@ -303,9 +304,18 @@ export function useFileTabs(
303
304
  handleOpenDiff(customEvent.detail);
304
305
  });
305
306
 
307
+ // A diff wants room a source file does not, so the editor panel keeps a
308
+ // separate remembered width per tab kind. Derived HERE because it is a
309
+ // property of the tab list: the layout was recomputing it from the same two
310
+ // values on every render.
311
+ const widthMode: EditorWidthMode = openedFiles.find((f) => String(f.id) === String(activeFileId))?.isDiff
312
+ ? 'diff'
313
+ : 'editor';
314
+
306
315
  return {
307
316
  openedFiles,
308
317
  activeFileId,
318
+ widthMode,
309
319
  setActiveFileId,
310
320
  handleOpenFile,
311
321
  handleOpenDiff,
@@ -45,7 +45,7 @@ const nativeFetch = Bun.fetch;
45
45
  let container: HTMLElement;
46
46
 
47
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']) };
48
+ let column = { open: false, storedView: 'files' as string | null, enabled: true, known: new Set(['files', 'git', 'todo']) };
49
49
  /** What the probe last rendered. */
50
50
  let seen: { tabs: readonly string[]; active: string | null; home: boolean; chosenHome: boolean } | null = null;
51
51
  /** The probe's writer, so a test can close a tab the way the strip does. */
@@ -56,7 +56,7 @@ function Probe() {
56
56
  useRevealPanelTab({
57
57
  enabled: column.enabled,
58
58
  revealed: useRevealEdge(column.open),
59
- view: column.view,
59
+ storedView: column.storedView,
60
60
  home: tabs.home,
61
61
  chosenHome: tabs.chosenHome,
62
62
  openTab: tabs.open,
@@ -114,7 +114,7 @@ afterAll(() => {
114
114
  beforeEach(() => {
115
115
  // The store is a module singleton: a tab left by one case would seed the next.
116
116
  resetSessionStateStore();
117
- column = { open: false, view: 'files', enabled: true, known: new Set(['files', 'git', 'todo']) };
117
+ column = { open: false, storedView: 'files', enabled: true, known: new Set(['files', 'git', 'todo']) };
118
118
  });
119
119
 
120
120
  afterEach(() => {
@@ -126,13 +126,13 @@ afterEach(() => {
126
126
  actions = null;
127
127
  });
128
128
 
129
- /** The rule, as data: only the reveal edge on a home page with a drawable view. */
129
+ /** The rule, as data: only the reveal edge on a home page with a view the session picked. */
130
130
  describe('revealTabId', () => {
131
131
  const base: RevealTabInput = {
132
132
  revealed: true,
133
133
  home: true,
134
134
  chosenHome: false,
135
- view: 'files',
135
+ storedView: 'files',
136
136
  known: new Set(['files', 'git']),
137
137
  enabled: true,
138
138
  };
@@ -165,8 +165,13 @@ describe('revealTabId', () => {
165
165
  test('a view this build cannot draw is not opened', () => {
166
166
  // Opening it would write an id `visiblePanelTabs` filters back out — a write
167
167
  // loop disguised as a sync.
168
- expect(revealTabId({ ...base, view: 'ghost' })).toBeNull();
169
- expect(revealTabId({ ...base, view: '' })).toBeNull();
168
+ expect(revealTabId({ ...base, storedView: 'ghost' })).toBeNull();
169
+ });
170
+
171
+ test('a session that never picked a view keeps its catalog', () => {
172
+ // The reported defect: a new chat's right drawer showed a `Files` tab on
173
+ // both layouts. The resolved fallback is not a pick.
174
+ expect(revealTabId({ ...base, storedView: null })).toBeNull();
170
175
  });
171
176
  });
172
177
 
@@ -212,23 +217,21 @@ describe('the column, mounted and toggled', () => {
212
217
  expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: false });
213
218
  });
214
219
 
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.
220
+ test('a session that never picked a view stays on its catalog', async () => {
221
+ // A fresh chat: the empty strip is its home page. Revealing the panel must
222
+ // not turn the `files` fallback into a tab — the reported defect on both
223
+ // layouts.
218
224
  currentSession = 'reveal-edge';
219
225
  hydrateSession(currentSession, {});
226
+ column.storedView = null;
220
227
  mount(currentSession);
221
228
  expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: false });
222
229
 
223
230
  column.open = true;
224
231
  await rerender();
225
232
 
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 });
233
+ expect(seen).toEqual({ tabs: [], active: null, home: true, chosenHome: false });
234
+ expect(getSessionValue(currentSession, 'layout.rightPanelTabs')).toBeUndefined();
232
235
  });
233
236
 
234
237
  test('a tab closed by the user stays closed across a toggle', async () => {
@@ -257,7 +260,7 @@ describe('the column, mounted and toggled', () => {
257
260
  test('a column that already had a tab is only revealed, never re-opened', async () => {
258
261
  currentSession = 'reveal-existing';
259
262
  hydrateSession(currentSession, { 'layout.rightPanelTabs': { tabs: ['git'], active: 'git', home: false } });
260
- column.view = 'git';
263
+ column.storedView = 'git';
261
264
  mount(currentSession);
262
265
  expect(seen?.tabs).toEqual(['git']);
263
266