@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
@@ -85,7 +85,9 @@ export function EditorThemeSection({ settings, onUpdate }: EditorThemeSectionPro
85
85
  );
86
86
 
87
87
  return (
88
- <section className="space-y-3">
88
+ // `@container`, for the reason `ThemeGrid` states: the card grid's density
89
+ // follows the PANE, and the pane is 174px wide at a 768px window.
90
+ <section className="@container space-y-3">
89
91
  <div>
90
92
  <h4 className="flex items-center gap-2 text-sm font-semibold text-ink">
91
93
  <Palette size={15} className="text-ink/60" />
@@ -98,7 +100,9 @@ export function EditorThemeSection({ settings, onUpdate }: EditorThemeSectionPro
98
100
  </p>
99
101
  </div>
100
102
 
101
- <div className="flex items-center gap-1.5">
103
+ {/* Same row, same wrap as the palette grid's: the pane is 174px wide at
104
+ a 768px window, where three filters plus the count overflow it. */}
105
+ <div className="flex flex-wrap items-center gap-1.5">
102
106
  {FILTERS.map((option) => (
103
107
  <button
104
108
  key={option.id}
@@ -115,12 +119,12 @@ export function EditorThemeSection({ settings, onUpdate }: EditorThemeSectionPro
115
119
  {option.label}
116
120
  </button>
117
121
  ))}
118
- <span className="ml-auto font-mono text-[11px] text-ink/50">
122
+ <span className="ml-auto min-w-0 font-mono text-[11px] text-ink/50 whitespace-nowrap">
119
123
  {filter === 'all' ? `${themes.length} themes` : `${themes.length} shown`}
120
124
  </span>
121
125
  </div>
122
126
 
123
- <div className="grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3">
127
+ <div className="grid grid-cols-1 gap-2 @[320px]:grid-cols-2 @[560px]:grid-cols-3">
124
128
  {/* `Auto` is a card rather than a checkbox: it is one of the choices,
125
129
  and a checkbox beside a grid makes the default look like an
126
130
  override of the thing it is a peer of. It is drawn under EVERY
@@ -36,8 +36,14 @@ export function ThemeCard({ theme, selected, onSelect }: ThemeCardProps) {
36
36
  : 'border-ink/20 bg-paper hover:border-ink/40 hover:bg-ink/5'
37
37
  }`}
38
38
  >
39
- <div className="flex items-center gap-2">
40
- <span className="truncate font-semibold text-ink" title={theme.name}>
39
+ {/* `min-w-0` on the name and the badge as a group: a flex item's default
40
+ `min-width: auto` is its min-content width, so the name refused to
41
+ shrink and the selected card's check was painted past the pane's own
42
+ edge — measured at a 768px window, where this card is 83px wide and
43
+ the check landed 6px outside the dialog (which is `overflow-hidden`,
44
+ so it was clipped rather than scrolled). */}
45
+ <div className="flex min-w-0 items-center gap-2">
46
+ <span className="min-w-0 truncate font-semibold text-ink" title={theme.name}>
41
47
  {theme.name}
42
48
  </span>
43
49
  <span className="shrink-0 rounded-full border border-ink/15 px-1.5 py-px text-[10px] font-semibold uppercase tracking-wider text-ink/50">
@@ -44,8 +44,19 @@ export function ThemeGrid({ selectedId, onSelect }: ThemeGridProps) {
44
44
  const themes = useMemo(() => filterThemes(filter), [filter]);
45
45
 
46
46
  return (
47
- <div className="space-y-3 pb-6">
48
- <div className="flex items-center gap-1.5">
47
+ // `@container` on the section: the grid's density is a fact about THIS
48
+ // pane, not about the window. At a 768px window the settings modal is 720
49
+ // wide and the palette pane gets 174px, where `sm:grid-cols-2` (a VIEWPORT
50
+ // query) drew two 83px cards and pushed the selected card's check past the
51
+ // dialog's clipped edge.
52
+ <div className="@container space-y-3 pb-6">
53
+ {/* `flex-wrap` + a `min-w-0` count: at a 768px window the settings modal
54
+ is 720 wide and this pane gets 174px, where the three filters and the
55
+ count measured 138 client against 191 scroll — the count painted 30px
56
+ past the dialog's own edge and was clipped, since the modal is
57
+ `overflow-hidden`. Wrapping costs one row on a narrow pane and nothing
58
+ on a wide one. */}
59
+ <div className="flex flex-wrap items-center gap-1.5">
49
60
  {FILTERS.map((option) => (
50
61
  <button
51
62
  key={option.id}
@@ -62,10 +73,10 @@ export function ThemeGrid({ selectedId, onSelect }: ThemeGridProps) {
62
73
  {option.label}
63
74
  </button>
64
75
  ))}
65
- <span className="ml-auto font-mono text-[11px] text-ink/50">{themes.length} themes</span>
76
+ <span className="ml-auto min-w-0 font-mono text-[11px] text-ink/50 whitespace-nowrap">{themes.length} themes</span>
66
77
  </div>
67
78
 
68
- <div className="grid grid-cols-1 gap-2.5 sm:grid-cols-2 lg:grid-cols-3">
79
+ <div className="grid grid-cols-1 gap-2.5 @[320px]:grid-cols-2 @[560px]:grid-cols-3">
69
80
  {themes.map((theme) => (
70
81
  <ThemeCard
71
82
  key={theme.id}
@@ -186,6 +186,17 @@ describe('MessageList mounted window', () => {
186
186
  expect(footers(el)).toBe(1);
187
187
  });
188
188
 
189
+ test('the trailing footer marks the row whose measured slot it fills', async () => {
190
+ // The footer is a sibling of the row group, outside the row's rect, so the
191
+ // row window learns its height from this marker only. Without it the
192
+ // content height changes when the row at the window's edge mounts — the
193
+ // up/down flicker at the end of a stream (pinned by `row-window.test.ts`).
194
+ const messages = [user('u1'), ai('a1'), user('u2'), ai('a2')];
195
+ const el = await mountWindowed(messages, window(0, 2, 0, 500));
196
+ const marker = el.querySelector('[data-row-footer-for]');
197
+ expect(marker?.getAttribute('data-row-footer-for')).toBe('a1');
198
+ });
199
+
189
200
  test('an errored answer renders the failure instead of an empty bubble', async () => {
190
201
  const el = await mount([
191
202
  user('u1'),
@@ -150,7 +150,8 @@ export const MessageList = memo(function MessageList({
150
150
  // The run footer belongs to the run but NOT to its trace: it is a model
151
151
  // and duration stamp, not a step. Left inside the rail container it drew
152
152
  // the line 58px past the last node (measured), so it renders after the
153
- // grouped rows instead.
153
+ // grouped rows instead — outside its row's rect, which is why the
154
+ // sibling below marks which row's measured slot it fills.
154
155
  const lastIdx = group.rows[group.rows.length - 1];
155
156
  const trailingFooter = footers[lastIdx];
156
157
  return (
@@ -215,26 +216,33 @@ export const MessageList = memo(function MessageList({
215
216
  })}
216
217
  </div>
217
218
  {trailingFooter && (
218
- <RunFooter
219
- msg={trailingFooter.msg}
220
- provider={provider}
221
- providerNames={providerNames}
222
- modelName={modelName}
223
- modelNames={modelNames}
224
- thinkingLevel={thinkingLevel}
225
- {...(harness ? { harness } : {})}
226
- durationMs={trailingFooter.durationMs}
227
- answerText={trailingFooter.answerText}
228
- retryTargetId={trailingFooter.runUserId}
229
- onRetry={onRetry}
230
- onNewChat={onNewChat}
231
- onFork={onFork}
232
- isMobile={isMobile}
233
- showActions={userActions}
234
- changedFiles={changedFilesByOwner.get(trailingFooter.ownerIndex)}
235
- sessionId={sessionId}
236
- runWindow={runWindows.get(trailingFooter.ownerIndex)}
237
- />
219
+ // `data-row-footer-for` is a measurement contract, not decoration:
220
+ // the footer is a SIBLING of the row above (the rail must not run
221
+ // through it), so it sits outside that row's rect — the row window
222
+ // attributes it back by this marker. `flow-root` so the footer's own
223
+ // `mt-2` is inside the rect the window measures.
224
+ <div data-row-footer-for={messages[lastIdx].id} style={{ display: 'flow-root' }}>
225
+ <RunFooter
226
+ msg={trailingFooter.msg}
227
+ provider={provider}
228
+ providerNames={providerNames}
229
+ modelName={modelName}
230
+ modelNames={modelNames}
231
+ thinkingLevel={thinkingLevel}
232
+ {...(harness ? { harness } : {})}
233
+ durationMs={trailingFooter.durationMs}
234
+ answerText={trailingFooter.answerText}
235
+ retryTargetId={trailingFooter.runUserId}
236
+ onRetry={onRetry}
237
+ onNewChat={onNewChat}
238
+ onFork={onFork}
239
+ isMobile={isMobile}
240
+ showActions={userActions}
241
+ changedFiles={changedFilesByOwner.get(trailingFooter.ownerIndex)}
242
+ sessionId={sessionId}
243
+ runWindow={runWindows.get(trailingFooter.ownerIndex)}
244
+ />
245
+ </div>
238
246
  )}
239
247
  </Fragment>
240
248
  );
@@ -44,6 +44,27 @@ async function open(harness?: string): Promise<HTMLElement> {
44
44
  return container;
45
45
  }
46
46
 
47
+ describe('AccessDropdown label', () => {
48
+ /**
49
+ * The chip's label is hidden by the COMPOSER's width, not the window's.
50
+ *
51
+ * `hidden lg:inline` read the viewport, so a 1440px window kept the label on
52
+ * inside a 366px card (the chat column beside the editor and the right panel)
53
+ * and wrapped the chip to two lines — measured, `Always ask` at h=40 against
54
+ * the row's 24px controls. `Toolbar`'s row is the `@container`, so the class
55
+ * has to be a container query.
56
+ */
57
+ test('the label folds on the COMPOSER width, never a viewport breakpoint', async () => {
58
+ const el = await open('omp-rpc');
59
+ const label = [...el.querySelectorAll('span')].find((span) => span.textContent === 'Always ask');
60
+ expect(label).toBeDefined();
61
+ const classes = label?.className ?? '';
62
+ expect(classes).toContain('hidden');
63
+ expect(classes).toContain('@[420px]:inline');
64
+ expect(classes).not.toMatch(/(^|\s)(sm|md|lg|xl):/);
65
+ });
66
+ });
67
+
47
68
  describe('AccessDropdown copy', () => {
48
69
  test('omp keeps the restricted-folder promise', async () => {
49
70
  const el = await open('omp-rpc');
@@ -36,7 +36,13 @@ export function AccessDropdown({ value, onSelect, harness }: AccessDropdownProps
36
36
  className="tap-chip flex items-center space-x-1 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-muted"
37
37
  >
38
38
  <LockKeyhole size={12} className="text-ink/60" />
39
- <span className="hidden lg:inline">{copy.labels[value]}</span>
39
+ {/* A CONTAINER query, not `lg:`: the composer lives in a chat column
40
+ that can be 320px on a 1440px window (measured: 400px chat beside
41
+ the editor and the right panel), and `lg:` read the WINDOW, so the
42
+ label stayed on and wrapped the chip to two lines inside a 366px
43
+ card. `Toolbar`'s row is the `@container`; `ModeToggles` states the
44
+ same 420px. */}
45
+ <span className="hidden @[420px]:inline whitespace-nowrap">{copy.labels[value]}</span>
40
46
  </button>
41
47
  {showAccess && (
42
48
  <div className={`glass-popover absolute bottom-full left-0 mb-1 ${copy.note ? 'w-56' : 'w-40'} bg-paper border border-ink/20 rounded-md shadow-lg z-50 py-1 text-xs`}>
@@ -27,7 +27,9 @@ export function ThinkingLevelDropdown({ thinkingLevels, currentThinking, onSelec
27
27
  title={thinkingLevels.length === 0 ? 'This model exposes no thinking levels' : `Thinking Level: ${currentThinking}`}
28
28
  >
29
29
  <Brain size={12} className="text-ink/60" />
30
- <span className="hidden lg:inline">{currentThinking}</span>
30
+ {/* Same axis as `AccessDropdown` and `ModeToggles`: the chip's room is
31
+ the COMPOSER's width, not the window's. */}
32
+ <span className="hidden @[420px]:inline whitespace-nowrap">{currentThinking}</span>
31
33
  </button>
32
34
  {showThinking && thinkingLevels.length > 0 && (
33
35
  <div className="glass-popover absolute bottom-full left-0 mb-1 w-40 bg-paper border border-ink/20 rounded-md shadow-lg z-50 py-1 text-xs">
@@ -3,7 +3,7 @@ import { FileCode, FileImage, FolderOpen, Info, Loader2 } from 'lucide-preact';
3
3
  import { getLanguageFromPath } from '@/shared/lib/code/language';
4
4
  import { useDeferredHighlightLines } from '@/client/hooks/code/deferred-highlight';
5
5
  import { parseDirListing, parseNumberedCode } from '@/shared/lib/code/parser';
6
- import { getPaintableImageMimeType, SVG_MIME } from '@/shared/lib/fs/file-kind';
6
+ import { getPaintableImageMimeType, SVG_MIME } from '@/shared/lib/fs/mime';
7
7
  import { buildFsRawUrl, isVirtualPath, stripReadSelector } from '@/shared/lib/fs/paths';
8
8
  import { toolImageSrc } from '@/shared/lib/omp/session/tool-images';
9
9
  import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
@@ -12,7 +12,7 @@ import type { UseFileEditorResult } from '@/client/hooks/editor/use-file-editor'
12
12
  import type { EditorFindState } from '@/client/hooks/editor/use-editor-find';
13
13
  import type { EditorCommand } from '@/shared/lib/code/editor/keymap';
14
14
  import { EDITOR_MAX_FONT_SIZE, EDITOR_MIN_FONT_SIZE } from '@/shared/lib/code/editor/typography';
15
- import { RENDERED_VIEWERS, type ViewerKind } from '@/shared/lib/fs/document-kind';
15
+ import { BINARY_VIEWERS, RENDERED_VIEWERS, type ViewerKind } from '@/shared/lib/fs/document-kind';
16
16
  import type { OpenedFile } from '@/shared/types/fs';
17
17
  import { isProbeableTab } from '@/client/hooks/workspace/missing-files';
18
18
  import { saveFileBytes } from '@/client/hooks/editor/save-bytes';
@@ -98,7 +98,7 @@ export function FilePane({
98
98
  }: FilePaneProps) {
99
99
  // A byte viewer owns the whole surface and has no buffer, so Save, find,
100
100
  // wrap and font zoom are all hidden — the toolbar reads this same flag.
101
- const byteViewer = viewerKind === 'image' || viewerKind === 'pdf' || viewerKind === 'docx' || viewerKind === 'spreadsheet';
101
+ const byteViewer = BINARY_VIEWERS[viewerKind] === true;
102
102
  // The rendered text views are the ones the eye toggle switches.
103
103
  const hasPreview = RENDERED_VIEWERS[viewerKind] === true;
104
104
 
@@ -294,6 +294,8 @@ export function FilePane({
294
294
  name={activeFile.name}
295
295
  source={editor.byteSource}
296
296
  content={editor.content}
297
+ root={activeFile.root ?? rootPath}
298
+ repo={activeFile.repo ?? repoPath}
297
299
  revision={editor.revision}
298
300
  onContentChange={editor.onChange}
299
301
  onSaveBytes={editor.deviceBacked ? undefined : saveBytes}
@@ -8,6 +8,7 @@ import { splitCandidate } from '@/shared/lib/workspace/split-editor';
8
8
  import { PanelRight } from 'lucide-preact';
9
9
  import { EditorHideButton } from '@/client/components/workspace/editor/EditorHideButton';
10
10
  import { useOnClickOutside } from '@/client/hooks/ui/on-click-outside';
11
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
11
12
  import { getGitStatusInfo } from '@/shared/lib/fs/git-status';
12
13
  import type { OpenedFile } from '@/shared/types/fs';
13
14
 
@@ -111,7 +112,12 @@ export function EditorTabs({
111
112
  }
112
113
 
113
114
  return (
114
- <div className="flex bg-ink/10 w-full relative border-b border-ink/10" ref={tabsContainerRef}>
115
+ // The strip is the column's CHROME ROW: `CONTROL_ROW_HEIGHT.desktop`, the
116
+ // same 40px as the right column's strip and its `PanelHeader` beneath it.
117
+ // Sized from its own chips (`py-1.5` + `border-t-2`) it measured 31px, so
118
+ // the two columns' separators landed on different lines (measured in
119
+ // Chromium at 1365x768: 71 against 80).
120
+ <div className={`${CONTROL_ROW_HEIGHT.desktop} flex bg-ink/10 w-full relative border-b border-ink/10`} ref={tabsContainerRef}>
115
121
  <div className="flex overflow-hidden">
116
122
  {visibleTabs.map(file => {
117
123
  const isActive = file.id === activeFileId;
@@ -11,6 +11,7 @@ import { buildEditorClusters } from '@/client/components/workspace/editor/toolba
11
11
  import { ACTION_CLASS } from '@/client/components/workspace/editor/toolbar-toggle';
12
12
  import { writeKabmoSettings } from '@/shared/lib/settings/client';
13
13
  import { EDITOR_BLAME_CHANGED_EVENT, currentEditorBlame, useEditorBlame } from '@/client/hooks/editor/blame-settings';
14
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
14
15
 
15
16
  export type EditorSaveStatus = 'idle' | 'saving' | 'saved' | 'error' | 'needs-permission';
16
17
 
@@ -244,7 +245,12 @@ export function EditorToolbar({
244
245
  // viewport. At the editor panel's 320px floor the path would be a truncated
245
246
  // fragment of a filename — not information, and the tab above already
246
247
  // carries it.
247
- <div className="@container flex items-center justify-between gap-2 px-3 py-2 border-b border-ink/10 bg-paper flex-shrink-0">
248
+ //
249
+ // The row is the shared chrome row (`CONTROL_ROW_HEIGHT.desktop`, not
250
+ // `py-2` around 27px of controls) because it is the peer of the right
251
+ // column's `PanelHeader`: two columns' second chrome rows have to end on the
252
+ // same line or the panels look staggered.
253
+ <div className={`@container ${CONTROL_ROW_HEIGHT.desktop} flex items-center justify-between gap-2 px-3 border-b border-ink/10 bg-paper flex-shrink-0`}>
248
254
  {/* Left status */}
249
255
  <div className="hidden @[420px]:flex items-center space-x-2 text-xs font-mono text-ink/40 min-w-0">
250
256
  <span className="truncate max-w-[300px]" title={path}>{path}</span>
@@ -0,0 +1,126 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The editor column's two chrome rows and the right column's header are ONE
8
+ * height.
9
+ *
10
+ * Measured in Chromium at 1365x768 before this test existed: the editor strip
11
+ * sized itself from its own chips (`py-1.5` + `border-t-2` = 31px) and its
12
+ * toolbar from `py-2` around 27px of controls (43px), against the right
13
+ * column's 40px strip and 40px header. The first separator landed at y=71 in
14
+ * one column and y=80 in the other, and the document began at 114 against 120 —
15
+ * which reads as two panels that are not on the same grid.
16
+ *
17
+ * happy-dom lays nothing out, so the assertion is the CLASS the rows carry: all
18
+ * three read `CONTROL_ROW_HEIGHT.desktop`, and that constant is 40px. A row that
19
+ * invents its own padding again fails here.
20
+ */
21
+
22
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
23
+ import { Window } from 'happy-dom';
24
+ import { h, render } from 'preact';
25
+ import type { ComponentChildren } from 'preact';
26
+ import { act } from 'preact/test-utils';
27
+
28
+ import { SessionStateContext } from '@/client/hooks/workspace/session-state/context';
29
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
30
+ import { PanelHeader } from '@/client/components/workspace/panel-header';
31
+ import { EditorTabs } from '@/client/components/workspace/editor/Tabs';
32
+ import { EditorToolbar } from '@/client/components/workspace/editor/Toolbar';
33
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
34
+ import type { OpenedFile } from '@/shared/types/fs';
35
+
36
+ const FILES: OpenedFile[] = [{ id: 1, name: 'keep.ts', path: 'src/keep.ts' }];
37
+
38
+ let container: HTMLElement;
39
+
40
+ beforeAll(() => {
41
+ installDomGlobals(new Window({ url: 'http://localhost' }));
42
+ });
43
+
44
+ afterAll(() => {
45
+ restoreDomGlobals();
46
+ });
47
+
48
+ afterEach(() => {
49
+ if (!container) return;
50
+ render(null, container);
51
+ container.remove();
52
+ });
53
+
54
+ async function mount(children: ComponentChildren): Promise<HTMLElement> {
55
+ container = document.createElement('div');
56
+ document.body.appendChild(container);
57
+ await act(async () => {
58
+ render(
59
+ h(
60
+ SessionStateContext.Provider,
61
+ { value: { sessionId: 'chrome-rows', ready: false } },
62
+ children,
63
+ ),
64
+ container,
65
+ );
66
+ });
67
+ return container;
68
+ }
69
+
70
+ function toolbar() {
71
+ return h(EditorToolbar, {
72
+ path: 'src/keep.ts',
73
+ saveStatus: 'idle',
74
+ wordWrap: false,
75
+ hasPreview: false,
76
+ isPreview: false,
77
+ hasReview: false,
78
+ isReviewing: false,
79
+ copied: false,
80
+ canReload: true,
81
+ reloadDiscardsEdits: false,
82
+ onToggleFind: () => {},
83
+ onSave: () => {},
84
+ onTogglePreview: () => {},
85
+ onToggleReview: () => {},
86
+ onToggleWordWrap: () => {},
87
+ onZoomIn: () => {},
88
+ onZoomOut: () => {},
89
+ onCopy: () => {},
90
+ onDownload: () => {},
91
+ onReload: () => {},
92
+ onSaveAs: () => {},
93
+ onToggleMaximize: () => {},
94
+ });
95
+ }
96
+
97
+ describe('editor chrome rows', () => {
98
+ test('the shared row height is the 40px chrome row', () => {
99
+ expect(CONTROL_ROW_HEIGHT.desktop).toBe('h-10');
100
+ });
101
+
102
+ test('the tab strip is that row', async () => {
103
+ const el = await mount(
104
+ h(EditorTabs, {
105
+ openedFiles: FILES,
106
+ activeFileId: 1,
107
+ onSelectFile: () => {},
108
+ onCloseFile: () => {},
109
+ }),
110
+ );
111
+ const strip = el.firstElementChild as HTMLElement;
112
+ expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
113
+ });
114
+
115
+ test('the toolbar is that row, so it ends on the right panel header line', async () => {
116
+ const el = await mount(toolbar());
117
+ const row = el.firstElementChild as HTMLElement;
118
+ expect(row.className).toContain(CONTROL_ROW_HEIGHT.desktop);
119
+ });
120
+
121
+ test('the right panel header is that row', async () => {
122
+ const el = await mount(h(PanelHeader, { left: h('span', null, 'picker') }));
123
+ const strip = el.firstElementChild as HTMLElement;
124
+ expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
125
+ });
126
+ });
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The HTML preview's two load-bearing claims.
8
+ *
9
+ * A preview that drops the sandbox is a script from the opened file running in
10
+ * this app's origin, and a preview that ignores the file's folder fetches every
11
+ * relative `src` from the console's own root — both fail silently, because the
12
+ * frame still paints something.
13
+ */
14
+
15
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
16
+ import { Window } from 'happy-dom';
17
+ import { h, render } from 'preact';
18
+ import { act } from 'preact/test-utils';
19
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
20
+ import { HtmlPreview } from '@/client/components/workspace/editor/viewers/HtmlPreview';
21
+
22
+ let container: HTMLElement;
23
+
24
+ beforeAll(() => {
25
+ const win = new Window({ url: 'http://localhost' });
26
+ installDomGlobals(win);
27
+ });
28
+
29
+ afterAll(() => restoreDomGlobals());
30
+
31
+ afterEach(() => {
32
+ if (container) render(null, container);
33
+ container?.remove();
34
+ });
35
+
36
+ async function mount(node: unknown): Promise<void> {
37
+ container = document.createElement('div');
38
+ document.body.appendChild(container);
39
+ await act(async () => {
40
+ render(node as never, container);
41
+ });
42
+ }
43
+
44
+ function frame(): HTMLIFrameElement {
45
+ const element = container.querySelector('iframe');
46
+ if (!element) throw new Error('no iframe mounted');
47
+ return element as HTMLIFrameElement;
48
+ }
49
+
50
+ describe('HtmlPreview', () => {
51
+ test('renders the page in a frame that scripts cannot use to reach this app', async () => {
52
+ await mount(
53
+ h(HtmlPreview, {
54
+ content: '<!doctype html><style>body{background:red}</style><h1>Hi</h1>',
55
+ name: 'page.html',
56
+ path: 'page.html',
57
+ }),
58
+ );
59
+
60
+ expect(frame().getAttribute('srcdoc')).toContain('<h1>Hi</h1>');
61
+ const sandbox = frame().getAttribute('sandbox') ?? '';
62
+ expect(sandbox).toContain('allow-scripts');
63
+ expect(sandbox).not.toContain('allow-same-origin');
64
+ });
65
+
66
+ test('resolves a relative reference against the file folder, not the app root', async () => {
67
+ await mount(
68
+ h(HtmlPreview, {
69
+ content: '<link rel="stylesheet" href="./app.css"><img src="logo.png">',
70
+ name: 'index.html',
71
+ path: 'site/pages/index.html',
72
+ root: '/workspace',
73
+ }),
74
+ );
75
+
76
+ const html = frame().getAttribute('srcdoc') ?? '';
77
+ // `&` is an entity inside an attribute value; the browser reads it back as
78
+ // the separator.
79
+ expect(html).toContain('/api/fs/raw?path=site%2Fpages%2Fapp.css&amp;root=%2Fworkspace');
80
+ expect(html).toContain('/api/fs/raw?path=site%2Fpages%2Flogo.png&amp;root=%2Fworkspace');
81
+ });
82
+
83
+ test('leaves the markup alone when the file has no server-reachable scope', async () => {
84
+ await mount(
85
+ h(HtmlPreview, {
86
+ content: '<img src="logo.png">',
87
+ name: 'dropped.html',
88
+ path: 'dropped.html',
89
+ }),
90
+ );
91
+
92
+ expect(frame().getAttribute('srcdoc')).toContain('src="logo.png"');
93
+ });
94
+ });
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * An HTML file, drawn as the page it is.
8
+ *
9
+ * Built on the TEXT buffer like `SvgPreview`, so an edit in the source updates
10
+ * the page without a second fetch. The document is handed to a sandboxed
11
+ * `<iframe>` through `srcdoc` rather than injected as `innerHTML`: a page
12
+ * carries its own `<style>`, `<script>` and `<body>` semantics, and putting
13
+ * those in the app's document would let the file restyle — or script — the
14
+ * console around it.
15
+ *
16
+ * `allow-same-origin` is deliberately ABSENT. With it, a script in the file
17
+ * could reach `parent` and this app's storage, which is the isolation the
18
+ * sandbox exists for; without it the frame is an opaque origin. Scripts still
19
+ * run (`allow-scripts`) because a page that builds its own DOM is exactly what
20
+ * the preview is for.
21
+ *
22
+ * Relative references are resolved against the FILE's folder through the same
23
+ * `rewriteDocumentReferences` the markdown preview uses. An `srcdoc` document
24
+ * inherits the PARENT page's base URL, so `./style.css` would otherwise be
25
+ * fetched from the console's own root instead of the file's directory. The
26
+ * rewrite covers `src`/`href` attributes; a CSS `url()` or a script that
27
+ * fetches a relative path is out of its reach, which is a limit of previewing
28
+ * a file that was written to be served by a web server.
29
+ */
30
+
31
+ import { useMemo } from 'preact/hooks';
32
+ import { rewriteDocumentReferences } from '@/shared/lib/markdown/document-urls';
33
+
34
+ interface HtmlPreviewProps {
35
+ content: string;
36
+ name: string;
37
+ /** The file's path inside its scope, for resolving relative references. */
38
+ path: string;
39
+ root?: string | null;
40
+ repo?: string | null;
41
+ }
42
+
43
+ /**
44
+ * What the page may do. No `allow-same-origin`, so the frame cannot touch this
45
+ * app; `allow-popups` and `allow-downloads` keep an ordinary page's links and
46
+ * downloads working.
47
+ */
48
+ const SANDBOX = 'allow-scripts allow-forms allow-modals allow-popups allow-downloads';
49
+
50
+ export function HtmlPreview({ content, name, path, root = null, repo = null }: HtmlPreviewProps) {
51
+ const html = useMemo(
52
+ () =>
53
+ // A handle-backed or device file has no server-reachable path, so a raw
54
+ // URL built from its display name would fetch an unrelated file. Its
55
+ // markup is shown as written.
56
+ root || repo
57
+ ? rewriteDocumentReferences(content, { path, root: root ?? undefined, repo: repo ?? undefined })
58
+ : content,
59
+ [content, path, root, repo],
60
+ );
61
+
62
+ return (
63
+ <iframe
64
+ title={name}
65
+ srcDoc={html}
66
+ sandbox={SANDBOX}
67
+ referrerPolicy="no-referrer"
68
+ className="h-full w-full flex-1 border-0 bg-white"
69
+ />
70
+ );
71
+ }
@@ -31,7 +31,7 @@
31
31
 
32
32
  import { deviceFileFor } from '@/client/lib/launch/device-files';
33
33
  import { fileHandleFor } from '@/client/lib/launch/file-handlers';
34
- import { getRawContentType } from '@/shared/lib/fs/file-kind';
34
+ import { getRawContentType } from '@/shared/lib/fs/mime';
35
35
 
36
36
  export interface ByteSource {
37
37
  /** Stable identity of the file these bytes come from. */