@kabmo-labs/kabmo 0.58.0 → 0.59.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 (431) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +520 -489
  3. package/dist/client/static/js/{Body-karkrzkc.js → Body-jqq4654r.js} +3 -3
  4. package/dist/client/static/js/{CsvGrid-j03knmbe.js → CsvGrid-avw0taqb.js} +2 -2
  5. package/dist/client/static/js/{DocxView-e8408vzs.js → DocxView-d221vr6g.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-fj4mfzch.js → DrawioView-gjsy7p01.js} +2 -2
  7. package/dist/client/static/js/{HtmlPreview-9g8xwzgw.js → HtmlPreview-949393v1.js} +1 -1
  8. package/dist/client/static/js/ImageView-pan9pqtm.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-p0qmghgt.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-swt467g7.js +1 -0
  11. package/dist/client/static/js/Modal-4spmcn44.js +60 -0
  12. package/dist/client/static/js/{PdfView-8jtdx5hd.js → PdfView-dzj2s6rj.js} +1 -1
  13. package/dist/client/static/js/SessionsView-b6szjdg5.js +1 -0
  14. package/dist/client/static/js/{SheetView-hwx8s864.js → SheetView-jpc178g5.js} +11 -11
  15. package/dist/client/static/js/{SvgPreview-ete36nzv.js → SvgPreview-94fap32p.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-7nsqzz6z.js → abnfDiagram-O67JEVCF-a6eyfzrj.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xvpkfq2f.js → architectureDiagram-NJMV4G6O-pgmyfncy.js} +3 -3
  19. package/dist/client/static/js/{astro-rsrqgjjx.js → astro-ryr2ajmg.js} +1 -1
  20. package/dist/client/static/js/bash-zknkkwkw.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-0saahcs6.js → blockDiagram-BEXU5L5S-rf51jyb2.js} +6 -6
  22. package/dist/client/static/js/c-0w02jkxb.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-ktpqnb4a.js → c4Diagram-YGBWAQC7-0faj48jp.js} +2 -2
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-x67cz3ms.js → classDiagram-v2-NBCMYWYE-bvzsws8x.js} +6 -6
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-9wzmhkz8.js → cose-bilkent-JH36ORCC-j1amnd3m.js} +1 -1
  26. package/dist/client/static/js/cpp-p5b4vean.js +1 -0
  27. package/dist/client/static/js/css-9jzbvdyz.js +1 -0
  28. package/dist/client/static/js/css-sn00sq6v.js +1 -0
  29. package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +1 -0
  30. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dmmgmv99.js → cynefinDiagram-VND7K2PF-f73w6zzz.js} +2 -2
  31. package/dist/client/static/js/{dagre-6A5THRUB-ygkkms1t.js → dagre-6A5THRUB-a5vgvjsg.js} +2 -2
  32. package/dist/client/static/js/{diagram-22UHCM2B-qxj0pqb4.js → diagram-22UHCM2B-6y9efamp.js} +12 -12
  33. package/dist/client/static/js/{diagram-3UASUU5V-77k8w5dt.js → diagram-3UASUU5V-2mycy7xm.js} +2 -2
  34. package/dist/client/static/js/{diagram-ATOU4E4O-m0h86vf4.js → diagram-ATOU4E4O-10zgjb66.js} +3 -3
  35. package/dist/client/static/js/{diagram-CDSNMT55-5v28kaeg.js → diagram-CDSNMT55-bewa52yf.js} +4 -4
  36. package/dist/client/static/js/{diagram-MLGK6HIB-zgcg9gaz.js → diagram-MLGK6HIB-mh3b7gd3.js} +1 -1
  37. package/dist/client/static/js/{diagram-MPIPVDR6-10c9s6e6.js → diagram-MPIPVDR6-gvdrbdm5.js} +2 -2
  38. package/dist/client/static/js/{dockerfile-dr9sdsqp.js → dockerfile-6bn19kg0.js} +1 -1
  39. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mz4022dz.js → ebnfDiagram-ZINNZB2B-2prre93c.js} +1 -1
  40. package/dist/client/static/js/{elixir-3dy25ex8.js → elixir-fyxw6d70.js} +1 -1
  41. package/dist/client/static/js/{elk-276RUBZZ-ccerbsag.js → elk-276RUBZZ-9t6t9kc6.js} +2 -2
  42. package/dist/client/static/js/{erDiagram-OPXOYQCR-a8vjyrrw.js → erDiagram-OPXOYQCR-etcggr5n.js} +6 -6
  43. package/dist/client/static/js/{erlang-v7344938.js → erlang-97ayje6m.js} +1 -1
  44. package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +1 -0
  45. package/dist/client/static/js/flowDiagram-KWPJA3E3-7c2ncsw7.js +1 -0
  46. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-sz1g29fp.js → ganttDiagram-FUAMR5RP-cdc4mwhs.js} +3 -3
  47. package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +1 -0
  48. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-efqk42q0.js → gitGraphDiagram-X574FWY7-55d0fa7x.js} +8 -8
  49. package/dist/client/static/js/graphql-xzykn0ba.js +1 -0
  50. package/dist/client/static/js/html-2zc3shky.js +1 -0
  51. package/dist/client/static/js/{index-mpyd7qxj.js → index-10vzyga1.js} +2 -2
  52. package/dist/client/static/js/{index-2f6psebk.js → index-27gwghmp.js} +2 -2
  53. package/dist/client/static/js/{index-t71k3b28.js → index-2f6afhze.js} +2 -2
  54. package/dist/client/static/js/{index-tnxp90ac.js → index-3akjcs82.js} +1 -1
  55. package/dist/client/static/js/{index-fhtnvqgf.js → index-3j2he86h.js} +2 -2
  56. package/dist/client/static/js/index-461ga40v.js +2 -0
  57. package/dist/client/static/js/{index-9qf2h9jb.js → index-51rbgeh9.js} +12 -12
  58. package/dist/client/static/js/{index-zh550byg.js → index-537m8a3x.js} +2 -2
  59. package/dist/client/static/js/{index-tdg7hz80.js → index-58z2hatp.js} +2 -2
  60. package/dist/client/static/js/{index-4tbdws4r.js → index-5e4e18tg.js} +2 -2
  61. package/dist/client/static/js/{index-xfyxmaj1.js → index-60cxxnpk.js} +62 -62
  62. package/dist/client/static/js/{index-th61y26d.js → index-69mnn71v.js} +2 -2
  63. package/dist/client/static/js/{index-8aqjj2x2.js → index-6bsez5n6.js} +1 -1
  64. package/dist/client/static/js/{index-gaa39w5q.js → index-8tzt0dek.js} +2 -2
  65. package/dist/client/static/js/{index-vb5a3g01.js → index-8z9aqgf3.js} +4 -4
  66. package/dist/client/static/js/{index-ewryzs4g.js → index-92h38pwg.js} +2 -2
  67. package/dist/client/static/js/{index-7ma44af3.js → index-9rvjegmy.js} +3 -3
  68. package/dist/client/static/js/{index-q0k1am0g.js → index-a3bpmw2r.js} +2 -2
  69. package/dist/client/static/js/{index-j863hg0d.js → index-a5ecn5yx.js} +6 -6
  70. package/dist/client/static/js/{index-6ey6y9em.js → index-ax8gaayq.js} +2 -2
  71. package/dist/client/static/js/{index-e42ys2q3.js → index-c253x7vt.js} +7 -7
  72. package/dist/client/static/js/{index-y0f3wbc3.js → index-d9sfavx1.js} +2 -2
  73. package/dist/client/static/js/{index-5tp3emtg.js → index-db6s66jr.js} +2 -2
  74. package/dist/client/static/js/index-eggbcdwx.js +481 -0
  75. package/dist/client/static/js/{index-ts8rhd06.js → index-f13ern5e.js} +1 -1
  76. package/dist/client/static/js/{index-ver116ed.js → index-f6t91mpp.js} +1 -1
  77. package/dist/client/static/js/{index-tc07gd33.js → index-fr91ghwb.js} +2 -2
  78. package/dist/client/static/js/{index-tq3t3qm4.js → index-fsa18ns9.js} +2 -2
  79. package/dist/client/static/js/{index-k56patms.js → index-fyt8m8ah.js} +2 -2
  80. package/dist/client/static/js/{index-gw4c5n3a.js → index-gcad7b6g.js} +2 -2
  81. package/dist/client/static/js/{index-rxt8sf9a.js → index-h1xbx74w.js} +2 -2
  82. package/dist/client/static/js/{index-q5q8a3qn.js → index-j1ksa4x2.js} +2 -2
  83. package/dist/client/static/js/{index-sxag9ptg.js → index-jct0jryd.js} +2 -2
  84. package/dist/client/static/js/{index-r1wrke3j.js → index-jpvng27a.js} +1 -1
  85. package/dist/client/static/js/{index-w5j1wgcz.js → index-me0b6wkw.js} +1 -1
  86. package/dist/client/static/js/{index-6x0kn8pb.js → index-mhrkjbjq.js} +2 -2
  87. package/dist/client/static/js/{index-nzq51nbb.js → index-mngpcca7.js} +5 -5
  88. package/dist/client/static/js/index-mttx9327.css +1 -0
  89. package/dist/client/static/js/{index-ssepzdaz.js → index-mx5y9vt9.js} +7 -7
  90. package/dist/client/static/js/{index-3ymw778n.js → index-ndqtff48.js} +2 -2
  91. package/dist/client/static/js/{index-wnk9k57k.js → index-nf4hq5tg.js} +55 -55
  92. package/dist/client/static/js/{index-f31c6jg8.js → index-njhrm5qa.js} +10 -10
  93. package/dist/client/static/js/index-nnwcbp2d.js +2 -0
  94. package/dist/client/static/js/{index-3p732mvs.js → index-np2rfq06.js} +2 -2
  95. package/dist/client/static/js/{index-kc5yt2cd.js → index-nwbr15b3.js} +2 -2
  96. package/dist/client/static/js/{index-2a0b9ya2.js → index-pa70qj4p.js} +1 -1
  97. package/dist/client/static/js/index-pe5f2gmn.js +1 -0
  98. package/dist/client/static/js/{index-qbqm3c91.js → index-pgy7ree5.js} +5 -5
  99. package/dist/client/static/js/index-pzwf6hwe.js +4 -0
  100. package/dist/client/static/js/{index-jnxmvxb8.js → index-q3k8r0ms.js} +11 -11
  101. package/dist/client/static/js/{index-qkcmspxq.js → index-rw84kefb.js} +2 -2
  102. package/dist/client/static/js/{index-gqsnyh8k.js → index-s9ts6qbj.js} +2 -2
  103. package/dist/client/static/js/{index-dqf0srrp.js → index-sg65xdey.js} +2 -2
  104. package/dist/client/static/js/{index-mkp3gwag.js → index-skvfxcd8.js} +1 -1
  105. package/dist/client/static/js/{index-6qqsy78z.js → index-sx2yz2wx.js} +1 -1
  106. package/dist/client/static/js/{index-6ac860yz.js → index-trq7bdvk.js} +2 -2
  107. package/dist/client/static/js/{index-v8xhgfeq.js → index-vs2y8gxr.js} +2 -2
  108. package/dist/client/static/js/index-wwyjzhgs.js +2 -0
  109. package/dist/client/static/js/{index-7s4dge1z.js → index-xe447cw3.js} +1 -1
  110. package/dist/client/static/js/index-y09de44h.js +2 -0
  111. package/dist/client/static/js/{index-jxsha63v.js → index-y4cx8cqf.js} +2 -2
  112. package/dist/client/static/js/{index-bkwax812.js → index-yg38s8t3.js} +1 -1
  113. package/dist/client/static/js/{index-dz18nn65.js → index-yh7gngsh.js} +2 -2
  114. package/dist/client/static/js/{index-3m1dksmy.js → index-yrwm437g.js} +2 -2
  115. package/dist/client/static/js/{index-7ynf3s2w.js → index-z82nd2bd.js} +2 -2
  116. package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +1 -0
  117. package/dist/client/static/js/{infoDiagram-VRGFBTTK-rykcacj5.js → infoDiagram-VRGFBTTK-9xph6cr5.js} +2 -2
  118. package/dist/client/static/js/ini-62r3vxaf.js +1 -0
  119. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rj752kd8.js → ishikawaDiagram-OU5B5YK6-3gshs3v8.js} +2 -2
  120. package/dist/client/static/js/java-kacycary.js +1 -0
  121. package/dist/client/static/js/javascript-zc1qnyyp.js +1 -0
  122. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mtetwn6f.js → journeyDiagram-ZHPQQLJL-fa8x56mf.js} +3 -3
  123. package/dist/client/static/js/json-yrwpn6bd.js +1 -0
  124. package/dist/client/static/js/jsx-b40ag8q1.js +1 -0
  125. package/dist/client/static/js/{julia-mxe3pnz3.js → julia-agc5kfvg.js} +1 -1
  126. package/dist/client/static/js/{kanban-definition-PNTS6WVX-4h5pw5mm.js → kanban-definition-PNTS6WVX-fybp2hh4.js} +5 -5
  127. package/dist/client/static/js/lua-bk961f37.js +1 -0
  128. package/dist/client/static/js/markdown-b7rgzgd6.js +1 -0
  129. package/dist/client/static/js/mermaid.core-jjh5ggp0.js +12 -0
  130. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-67s4xy7h.js → mindmap-definition-NLK3R4M7-gtfbg619.js} +5 -5
  131. package/dist/client/static/js/one-dark-pro-vht9rv39.js +1 -0
  132. package/dist/client/static/js/one-light-arxc5whh.js +1 -0
  133. package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +1 -0
  134. package/dist/client/static/js/{pegDiagram-GJSIUBJH-qykb6ssk.js → pegDiagram-GJSIUBJH-1a51sbqv.js} +1 -1
  135. package/dist/client/static/js/{perl-a8eeaqkn.js → perl-v5vbtzgf.js} +1 -1
  136. package/dist/client/static/js/{php-6gq92zt8.js → php-83qwy98t.js} +1 -1
  137. package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +1 -0
  138. package/dist/client/static/js/{pieDiagram-5QR66LMP-mymrrvck.js → pieDiagram-5QR66LMP-zd9svyyn.js} +3 -3
  139. package/dist/client/static/js/properties-k8gbzggp.js +1 -0
  140. package/dist/client/static/js/python-343tspad.js +1 -0
  141. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-6f8ahd40.js → quadrantDiagram-O4NWA36T-5gtw2m6s.js} +3 -3
  142. package/dist/client/static/js/r-ycdwmv8g.js +1 -0
  143. package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +1 -0
  144. package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +1 -0
  145. package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +1 -0
  146. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +1 -0
  147. package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +1 -0
  148. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-c3habpvw.js → railroadDiagram-XR7U4H2S-3ccwpfzz.js} +1 -1
  149. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-nysqy6te.js → requirementDiagram-PLB6GJNP-sasndrrp.js} +4 -4
  150. package/dist/client/static/js/{ruby-mc826p2e.js → ruby-994n5j6e.js} +1 -1
  151. package/dist/client/static/js/{rust-m4f4vpvn.js → rust-n9z2c9m3.js} +1 -1
  152. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s5dtfp3z.js → sankeyDiagram-IPEJSGJF-2ahb4sda.js} +3 -3
  153. package/dist/client/static/js/{sass-8bq5r2tz.js → sass-p6g7qdv2.js} +1 -1
  154. package/dist/client/static/js/{scss-9wz47c6t.js → scss-4j4t3r6y.js} +1 -1
  155. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bb3yp049.js → sequenceDiagram-PO4LG4MO-bfj90kz1.js} +7 -7
  156. package/dist/client/static/js/{sizeCapture-INFHLROL-0m2msee7.js → sizeCapture-INFHLROL-5tygxmtc.js} +1 -1
  157. package/dist/client/static/js/sql-kwpd5w07.js +1 -0
  158. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-cd0qgj6t.js → stateDiagram-v2-GCMORJYK-533xw76e.js} +3 -3
  159. package/dist/client/static/js/{svelte-5vrwkc13.js → svelte-bek3h1sz.js} +1 -1
  160. package/dist/client/static/js/{swimlanes-2SLR337P-rpb01f7p.js → swimlanes-2SLR337P-gd3d04pk.js} +1 -1
  161. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xxmvdyg4.js +8 -0
  162. package/dist/client/static/js/{timeline-definition-EJHVYXUP-tqw2e6y1.js → timeline-definition-EJHVYXUP-fvqvgqvg.js} +3 -3
  163. package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +1 -0
  164. package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +1 -0
  165. package/dist/client/static/js/tsx-gjxfjnbk.js +1 -0
  166. package/dist/client/static/js/typescript-4dchbnya.js +1 -0
  167. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-dhf4d5xg.js → usecaseDiagram-POWQR4AR-tm1f0m4x.js} +25 -25
  168. package/dist/client/static/js/{vennDiagram-UO4OBE2U-ztkk79dv.js → vennDiagram-UO4OBE2U-2vdvv1hd.js} +4 -4
  169. package/dist/client/static/js/{vue-gmjnxjm3.js → vue-y44m889c.js} +1 -1
  170. package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +1 -0
  171. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-ahre5tmv.js → wardleyDiagram-VNRHLVJA-7avcjznx.js} +4 -4
  172. package/dist/client/static/js/xml-xs6qz3ya.js +1 -0
  173. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-vak2c50n.js → xychartDiagram-PMCCYNJV-g39y526n.js} +4 -4
  174. package/dist/client/static/js/yaml-174nk5bn.js +1 -0
  175. package/package.json +7 -7
  176. package/src/client/borders.css +15 -3
  177. package/src/client/components/common/ComposerTextarea.test.tsx +13 -1
  178. package/src/client/components/common/ComposerTextarea.tsx +8 -2
  179. package/src/client/components/common/MarkdownRenderer.tsx +11 -2
  180. package/src/client/components/common/anchored-menu/index.tsx +11 -4
  181. package/src/client/components/common/harness-glyph/harness-glyph.test.ts +0 -4
  182. package/src/client/components/common/harness-glyph/index.tsx +4 -5
  183. package/src/client/components/common/markdown-inline-file.test.tsx +90 -15
  184. package/src/client/components/common/session-actions-menu/index.test.tsx +45 -0
  185. package/src/client/components/common/session-actions-menu/index.tsx +6 -1
  186. package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
  187. package/src/client/components/common/session-row/index.tsx +32 -16
  188. package/src/client/components/common/session-row/session-row.test.tsx +56 -18
  189. package/src/client/components/layout/desktop-layout/RightColumn.tsx +4 -1
  190. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +28 -35
  191. package/src/client/components/layout/desktop-layout/index.tsx +5 -3
  192. package/src/client/components/layout/desktop-layout/resizer/index.tsx +13 -3
  193. package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +41 -0
  194. package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +21 -1
  195. package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +1 -0
  196. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -2
  197. package/src/client/components/layout/session-sidebar/ClassicView.tsx +2 -0
  198. package/src/client/components/layout/session-sidebar/SessionList.tsx +4 -0
  199. package/src/client/components/layout/session-sidebar/SessionsView.tsx +22 -1
  200. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +46 -8
  201. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +9 -3
  202. package/src/client/components/layout/session-sidebar/modern/index.tsx +2 -0
  203. package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +36 -0
  204. package/src/client/components/layout/session-sidebar/search-results.test.tsx +29 -16
  205. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +1 -0
  206. package/src/client/components/layout/session-sidebar/variant-props.ts +2 -0
  207. package/src/client/components/mobile/LayoutWrapper.tsx +9 -0
  208. package/src/client/components/mobile/SessionSidebar.tsx +4 -0
  209. package/src/client/components/mobile/left-drawer-nav.test.tsx +1 -1
  210. package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +4 -0
  211. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +3 -0
  212. package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +85 -0
  213. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +30 -14
  214. package/src/client/components/mobile/mobile-session-sidebar/List.tsx +4 -0
  215. package/src/client/components/settings/apply-side-effects.test.ts +31 -0
  216. package/src/client/components/settings/apply-side-effects.ts +7 -0
  217. package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +3 -2
  218. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.test.tsx +95 -0
  219. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +35 -0
  220. package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +1 -0
  221. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +1 -0
  222. package/src/client/components/workspace/chat-timeline/MessageItem.gutter.test.ts +26 -0
  223. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +6 -3
  224. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +5 -0
  225. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +81 -162
  226. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +7 -3
  227. package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +17 -0
  228. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +21 -7
  229. package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -0
  230. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +24 -6
  231. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +17 -4
  232. package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +16 -0
  233. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +104 -11
  234. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +120 -43
  235. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +28 -21
  236. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.wait.test.tsx +48 -0
  237. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +47 -22
  238. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +24 -0
  239. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +44 -18
  240. package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +2 -1
  241. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +35 -0
  242. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +33 -12
  243. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +26 -2
  244. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +67 -37
  245. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +86 -1
  246. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +90 -135
  247. package/src/client/components/workspace/chat-timeline/chat-input/VoiceButton.tsx +58 -0
  248. package/src/client/components/workspace/chat-timeline/chat-input/access-capability.test.tsx +151 -0
  249. package/src/client/components/workspace/chat-timeline/chat-input/action-base.ts +42 -0
  250. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -0
  251. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.test.ts +108 -0
  252. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.tsx +122 -0
  253. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
  254. package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +78 -20
  255. package/src/client/components/workspace/chat-timeline/chat-input/styles/index.tsx +11 -5
  256. package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +19 -0
  257. package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
  258. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +1 -1
  259. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  260. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +21 -5
  261. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +100 -71
  262. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -9
  263. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +83 -66
  264. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.test.tsx +3 -3
  265. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +36 -15
  266. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.test.tsx +125 -0
  267. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +84 -27
  268. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +18 -0
  269. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +14 -5
  270. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -3
  271. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +10 -2
  272. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -2
  273. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +11 -6
  274. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +2 -2
  275. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +2 -2
  276. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +5 -3
  277. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +19 -12
  278. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +50 -2
  279. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/props.ts +2 -0
  280. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +31 -10
  281. package/src/client/components/workspace/model-dropdown/Header.tsx +13 -5
  282. package/src/client/components/workspace/model-dropdown/Panel.tsx +18 -0
  283. package/src/client/components/workspace/model-dropdown/ThinkingLevels.tsx +51 -0
  284. package/src/client/components/workspace/model-dropdown/Trigger.tsx +99 -0
  285. package/src/client/components/workspace/model-dropdown/bands.ts +51 -0
  286. package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +21 -5
  287. package/src/client/components/workspace/model-dropdown/index.tsx +20 -47
  288. package/src/client/components/workspace/model-dropdown/thinking-levels.test.tsx +108 -0
  289. package/src/client/components/workspace/model-dropdown/trigger.test.ts +54 -8
  290. package/src/client/hooks/chat/composer/attachments.test.ts +12 -0
  291. package/src/client/hooks/chat/composer/attachments.ts +16 -4
  292. package/src/client/hooks/chat/composer/pipeline.test.ts +14 -0
  293. package/src/client/hooks/chat/composer/pipeline.ts +15 -6
  294. package/src/client/hooks/chat/omp/session-list.activity.test.ts +20 -0
  295. package/src/client/hooks/chat/omp/session-merges.ts +18 -6
  296. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -0
  297. package/src/client/hooks/chat/timeline/access-ladder-wiring.test.ts +111 -0
  298. package/src/client/hooks/chat/timeline/access-ladder.test.ts +66 -0
  299. package/src/client/hooks/chat/timeline/access-ladder.ts +72 -0
  300. package/src/client/hooks/chat/timeline/access-mode.ts +11 -1
  301. package/src/client/hooks/chat/timeline/index.ts +4 -5
  302. package/src/client/hooks/chat/timeline/modes-contract.ts +10 -1
  303. package/src/client/hooks/chat/timeline/modes.ts +10 -2
  304. package/src/client/hooks/chat/timeline/scope.test.ts +17 -0
  305. package/src/client/hooks/chat/timeline/scope.ts +6 -1
  306. package/src/client/hooks/chat/timeline/send-refusal.test.ts +19 -0
  307. package/src/client/hooks/chat/timeline/send-steer.test.ts +17 -0
  308. package/src/client/hooks/chat/timeline/send.ts +17 -0
  309. package/src/client/hooks/editor/quick-open.ts +41 -0
  310. package/src/client/hooks/ui/border-style.test.ts +13 -0
  311. package/src/client/hooks/ui/markdown-render.ts +11 -6
  312. package/src/client/hooks/ui/open-inline-file.test.ts +16 -0
  313. package/src/client/hooks/ui/open-inline-file.ts +4 -2
  314. package/src/client/hooks/ui/show-more.ts +11 -1
  315. package/src/client/hooks/ui/ui-feedback.test.ts +11 -0
  316. package/src/client/hooks/ui/verified-inline-files.test.tsx +143 -0
  317. package/src/client/hooks/ui/verified-inline-files.ts +165 -0
  318. package/src/client/hooks/workspace/mobile-workspace-panels.test.tsx +116 -0
  319. package/src/client/hooks/workspace/mobile-workspace-panels.ts +73 -0
  320. package/src/client/hooks/workspace/panel-resize.test.ts +127 -0
  321. package/src/client/hooks/workspace/panel-resize.ts +81 -0
  322. package/src/client/hooks/workspace/session-list-limit.test.ts +80 -0
  323. package/src/client/hooks/workspace/session-list-limit.ts +69 -0
  324. package/src/client/hooks/workspace/session-pin.ts +58 -0
  325. package/src/client/hooks/workspace/workspace-panels-mode.test.tsx +87 -0
  326. package/src/client/hooks/workspace/workspace-panels-mode.ts +76 -0
  327. package/src/client/lib/router/branch-params.test.ts +17 -1
  328. package/src/client/lib/router/branch-params.ts +18 -0
  329. package/src/client/lib/ui/pressed.ts +15 -0
  330. package/src/client/tailwind.css +30 -10
  331. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +25 -9
  332. package/src/server/lib/db/schema.test.ts +1 -1
  333. package/src/server/lib/db/schema.ts +17 -0
  334. package/src/server/lib/harness/activity.server.test.ts +81 -0
  335. package/src/server/lib/harness/activity.server.ts +55 -0
  336. package/src/server/lib/harness/spawn.server.ts +9 -0
  337. package/src/server/lib/omp/session/delete.server.ts +4 -2
  338. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +24 -2
  339. package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +14 -0
  340. package/src/server/lib/realtime/topics/session-data.server.ts +6 -5
  341. package/src/server/lib/realtime/topics/session-data.test.ts +35 -0
  342. package/src/server/lib/sessions/last-opened.server.test.ts +17 -0
  343. package/src/server/lib/sessions/last-opened.server.ts +18 -1
  344. package/src/server/routes/sessions/index.ts +3 -2
  345. package/src/server/routes/sessions/routes.test.ts +29 -46
  346. package/src/server/routes/sessions/session.ts +40 -62
  347. package/src/server/routes/sessions/state.test.ts +89 -0
  348. package/src/server/routes/sessions/state.ts +86 -0
  349. package/src/shared/lib/chat/attachment-budget.test.ts +74 -0
  350. package/src/shared/lib/chat/attachment-budget.ts +111 -0
  351. package/src/shared/lib/chat/attachments.test.ts +0 -17
  352. package/src/shared/lib/chat/attachments.ts +0 -53
  353. package/src/shared/lib/chat/orchestration/outcome-markdown.test.ts +57 -0
  354. package/src/shared/lib/chat/orchestration/outcome-markdown.ts +74 -0
  355. package/src/shared/lib/chat/timeline/block-chrome.test.ts +35 -0
  356. package/src/shared/lib/chat/timeline/block-chrome.ts +21 -0
  357. package/src/shared/lib/markdown/degenerate-emphasis.test.ts +64 -0
  358. package/src/shared/lib/markdown/degenerate-emphasis.ts +90 -0
  359. package/src/shared/lib/markdown/inline-file.test.ts +79 -22
  360. package/src/shared/lib/markdown/inline-file.ts +57 -25
  361. package/src/shared/lib/markdown/marked.ts +5 -1
  362. package/src/shared/lib/settings/defaults.ts +2 -0
  363. package/src/shared/lib/theme/border-style.ts +1 -1
  364. package/src/shared/lib/workspace/active-project.test.ts +17 -1
  365. package/src/shared/lib/workspace/active-project.ts +9 -0
  366. package/src/shared/lib/workspace/project-settings-delete.test.ts +97 -0
  367. package/src/shared/lib/workspace/project-settings.test.ts +2 -34
  368. package/src/shared/lib/workspace/project-settings.ts +6 -0
  369. package/src/shared/lib/workspace/session-list-limit.test.ts +31 -0
  370. package/src/shared/lib/workspace/session-list-limit.ts +32 -0
  371. package/src/shared/lib/workspace/sidebar-sort.test.ts +21 -0
  372. package/src/shared/lib/workspace/workspace-panel-widths.ts +1 -1
  373. package/src/shared/lib/workspace/workspace-session.test.ts +34 -0
  374. package/src/shared/lib/workspace/workspace-session.ts +40 -0
  375. package/src/shared/types/settings/state.ts +10 -0
  376. package/dist/client/static/js/ImageView-sz4fzz9k.js +0 -1
  377. package/dist/client/static/js/LayoutWrapper-q6q4h04a.js +0 -2
  378. package/dist/client/static/js/MergeDiffView-b8f013ws.js +0 -1
  379. package/dist/client/static/js/Modal-ahecatp5.js +0 -60
  380. package/dist/client/static/js/SessionsView-jwp8xvw5.js +0 -1
  381. package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +0 -1
  382. package/dist/client/static/js/bash-n5d0esqg.js +0 -1
  383. package/dist/client/static/js/c-pk766wx0.js +0 -1
  384. package/dist/client/static/js/cpp-3pt91jvm.js +0 -1
  385. package/dist/client/static/js/css-9gak6bze.js +0 -1
  386. package/dist/client/static/js/css-sp1cgdbr.js +0 -1
  387. package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +0 -1
  388. package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +0 -1
  389. package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +0 -1
  390. package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +0 -1
  391. package/dist/client/static/js/graphql-2ntm7jyh.js +0 -1
  392. package/dist/client/static/js/html-mt2yb43b.js +0 -1
  393. package/dist/client/static/js/index-6h46r2de.js +0 -1
  394. package/dist/client/static/js/index-f44k9k8d.css +0 -1
  395. package/dist/client/static/js/index-k1576e2m.js +0 -2
  396. package/dist/client/static/js/index-k4qshngy.js +0 -4
  397. package/dist/client/static/js/index-rr79n77k.js +0 -470
  398. package/dist/client/static/js/index-vf01q99d.js +0 -2
  399. package/dist/client/static/js/index-x7h04xzf.js +0 -2
  400. package/dist/client/static/js/index-xygk0v3e.js +0 -2
  401. package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +0 -1
  402. package/dist/client/static/js/ini-bdk46a3d.js +0 -1
  403. package/dist/client/static/js/java-3g3925cf.js +0 -1
  404. package/dist/client/static/js/javascript-0mqgcvps.js +0 -1
  405. package/dist/client/static/js/json-hdyzmffz.js +0 -1
  406. package/dist/client/static/js/jsx-y8r9mrdq.js +0 -1
  407. package/dist/client/static/js/lua-wf5k6p3r.js +0 -1
  408. package/dist/client/static/js/markdown-9bf16dx7.js +0 -1
  409. package/dist/client/static/js/mermaid.core-bs542jma.js +0 -12
  410. package/dist/client/static/js/one-dark-pro-541ed4b7.js +0 -1
  411. package/dist/client/static/js/one-light-nr79mykt.js +0 -1
  412. package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +0 -1
  413. package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +0 -1
  414. package/dist/client/static/js/properties-xk4dn00p.js +0 -1
  415. package/dist/client/static/js/python-7sgz05n4.js +0 -1
  416. package/dist/client/static/js/r-w4qxm0pv.js +0 -1
  417. package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +0 -1
  418. package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +0 -1
  419. package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +0 -1
  420. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +0 -1
  421. package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +0 -1
  422. package/dist/client/static/js/sql-sd00wgem.js +0 -1
  423. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-zx36y2c8.js +0 -8
  424. package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +0 -1
  425. package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +0 -1
  426. package/dist/client/static/js/tsx-h5yzg80q.js +0 -1
  427. package/dist/client/static/js/typescript-qy1sbhea.js +0 -1
  428. package/dist/client/static/js/wardley-WFR3VGLG-vy6rp5gp.js +0 -1
  429. package/dist/client/static/js/xml-mrk4xakv.js +0 -1
  430. package/dist/client/static/js/yaml-xaza6dra.js +0 -1
  431. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +0 -67
@@ -152,6 +152,19 @@ describe('borders.css', () => {
152
152
  expect(rule).toContain('.border-dashed');
153
153
  });
154
154
 
155
+ test('the chat transcript is the one subtree the clearing rules skip', async () => {
156
+ const all = selectors(await declarations());
157
+ // Both clearing rules — the rung border and the row divider — must exclude
158
+ // the timeline, or a borderless install flattens every thinking block and
159
+ // tool card into one text wall (the reported "border ikut hilang").
160
+ const guarded = all.filter((selector) => selector.includes(':not([data-chat-timeline]'));
161
+ expect(guarded.length).toBe(2);
162
+ for (const selector of guarded) {
163
+ expect({ selector, subtree: selector.includes('[data-chat-timeline] *') })
164
+ .toEqual({ selector, subtree: true });
165
+ }
166
+ });
167
+
155
168
  test('a dialog keeps an edge via outline, never by replacing its shadow', async () => {
156
169
  const css = await declarations();
157
170
  const start = css.indexOf(':is(.glass-overlay, .glass-popover)');
@@ -29,12 +29,18 @@ import { rewriteWikiReferences } from '@/shared/lib/wiki/document-urls';
29
29
  import { expandGollumLinks } from '@/shared/lib/wiki/pages';
30
30
  import { MATH_PENDING_CLASS, preloadKatex } from '@/shared/lib/markdown/katex';
31
31
  import { sanitizeHtml } from '@/shared/lib/markdown/sanitize';
32
- import { markInlineFilePaths } from '@/shared/lib/markdown/inline-file';
32
+ import { inlineFileCandidates, type InlineFileReference as MarkdownFileReference } from '@/shared/lib/markdown/inline-file';
33
33
  import { localizeFileImageSources, markLocalImageSources } from '@/shared/lib/chat/timeline/local-image';
34
34
 
35
35
  export interface RenderedMarkdown {
36
36
  html: string;
37
37
  blocks: MdBlock[];
38
+ /**
39
+ * The inline file references the HTML names, for the caller to verify
40
+ * against the workspace before marking any of them clickable. Document and
41
+ * wiki renders resolve their own references and leave this empty.
42
+ */
43
+ references: MarkdownFileReference[];
38
44
  }
39
45
 
40
46
  /** Everything the render depends on, as PRIMITIVES. A new object per render is
@@ -73,7 +79,7 @@ export function useRenderedMarkdown(options: MarkdownRenderOptions): RenderedMar
73
79
  } = options;
74
80
 
75
81
  return useMemo(() => {
76
- if (!content) return { html: '', blocks: [] as MdBlock[] };
82
+ if (!content) return { html: '', blocks: [] as MdBlock[], references: [] as MarkdownFileReference[] };
77
83
  // Gollum's `[[Page]]` is invisible to a markdown parser, so it is expanded
78
84
  // before parsing rather than patched afterwards.
79
85
  const source = wikiPath ? expandGollumLinks(content) : content;
@@ -97,13 +103,12 @@ export function useRenderedMarkdown(options: MarkdownRenderOptions): RenderedMar
97
103
  // Agent output is the one place an inline `` `path` `` is a file the reader
98
104
  // can open. A document preview and a wiki page resolve their OWN references
99
105
  // through the scope above, so marking them here would be a second rule for
100
- // the same job. The marker runs after sanitization: the attributes never
101
- // need a DOMPurify allow-list entry (same contract as local images).
106
+ // the same job. The caller marks only the ones the workspace confirms.
102
107
  const agentOutput = !isDocument && !isWiki;
103
- const withFiles = agentOutput ? markInlineFilePaths(sanitized) : sanitized;
104
108
  return {
105
- html: chat ? markLocalImageSources(withFiles) : withFiles,
109
+ html: chat ? markLocalImageSources(sanitized) : sanitized,
106
110
  blocks: mapped?.blocks ?? [],
111
+ references: agentOutput ? inlineFileCandidates(sanitized) : [],
107
112
  };
108
113
  // Primitive deps: the caller may build `scope`/`wikiScope` inline, and a
109
114
  // new object identity would re-parse the whole document every render.
@@ -15,6 +15,7 @@
15
15
  import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
16
16
  import { Window } from 'happy-dom';
17
17
  import { closePalette, paletteState } from '@/client/lib/commands/overlays';
18
+ import { forgetQuickOpenIndex, loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
18
19
  import { setPluginContext } from '@/client/lib/plugins/context';
19
20
  import { getLineReveal, setLineReveal } from '@/client/lib/line-reveal';
20
21
  import {
@@ -62,6 +63,7 @@ afterEach(() => {
62
63
  closePalette();
63
64
  setLineReveal(null);
64
65
  setPluginContext(null, null);
66
+ forgetQuickOpenIndex();
65
67
  files = [];
66
68
  fetchCalls = [];
67
69
  opened = [];
@@ -90,6 +92,20 @@ describe('openInlineFileReference', () => {
90
92
  expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
91
93
  });
92
94
 
95
+ test('a click reuses the index the chip verification already fetched', async () => {
96
+ setPluginContext(null, ROOT);
97
+ files = [{ path: 'src/client/App.tsx' }, { path: 'src/server/read.ts' }];
98
+ // The verification pass for the chip, before any click.
99
+ await loadQuickOpenIndex(ROOT);
100
+ fetchCalls = [];
101
+
102
+ await openInlineFileReference({ path: 'App.tsx', line: 3 });
103
+
104
+ expect(fetchCalls).toEqual([]);
105
+ expect(getLineReveal()).toEqual({ path: 'src/client/App.tsx', line: 3 });
106
+ expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
107
+ });
108
+
93
109
  test('a bare filename with several matches opens the picker on the name', async () => {
94
110
  setPluginContext(null, ROOT);
95
111
  files = [{ path: 'src/a/index.ts' }, { path: 'src/b/index.ts' }];
@@ -21,7 +21,7 @@
21
21
  * jump that was already served).
22
22
  */
23
23
 
24
- import { fetchQuickOpenIndex } from '@/client/hooks/editor/quick-open';
24
+ import { loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
25
25
  import { openFileInEditor } from '@/client/hooks/ui/open-file';
26
26
  import { openPalette } from '@/client/lib/commands/overlays';
27
27
  import { setLineReveal } from '@/client/lib/line-reveal';
@@ -45,7 +45,9 @@ export async function openInlineFileReference(reference: InlineFileTarget): Prom
45
45
  const root = pluginContext().workspacePath ?? undefined;
46
46
 
47
47
  if (root && !reference.path.includes('/')) {
48
- const entries = await fetchQuickOpenIndex(root);
48
+ // The same loader the chip verification used, so a click does not repeat
49
+ // the walk the chip already paid for.
50
+ const entries = await loadQuickOpenIndex(root);
49
51
  const target = chooseFileTarget(reference, entries);
50
52
  if (target.kind === 'pick') {
51
53
  openPalette('files', { query: target.query });
@@ -17,7 +17,7 @@
17
17
  * keep going AND to start over.
18
18
  */
19
19
 
20
- import { useCallback, useState } from 'preact/hooks';
20
+ import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
21
21
 
22
22
  export interface ShowMore {
23
23
  visibleCount: number;
@@ -29,6 +29,16 @@ export interface ShowMore {
29
29
 
30
30
  export function useShowMore(initial = 5, step = 7): ShowMore {
31
31
  const [visibleCount, setVisibleCount] = useState(initial);
32
+ const previousInitial = useRef(initial);
33
+ // A page size that comes from a setting can change while the list is mounted
34
+ // (Settings is drawn over the open sidebar). Reset to the new window rather
35
+ // than keep a count the user never chose — but not on mount, where the state
36
+ // already starts at `initial` and a late effect would overwrite a click.
37
+ useEffect(() => {
38
+ if (previousInitial.current === initial) return;
39
+ previousInitial.current = initial;
40
+ setVisibleCount(initial);
41
+ }, [initial]);
32
42
  const showMore = useCallback(() => setVisibleCount((c) => c + step), [step]);
33
43
  const showLess = useCallback(() => setVisibleCount(initial), [initial]);
34
44
  return { visibleCount, showMore, showLess, canShowLess: visibleCount > initial };
@@ -180,6 +180,17 @@ describe('useShowMore', () => {
180
180
  expect(seen.current!.visibleCount).toBe(13);
181
181
  });
182
182
 
183
+ test('a new initial resets the window, so a saved page size applies immediately', () => {
184
+ const seen: { current: ShowMore | null } = { current: null };
185
+ mount(h(ShowMoreProbe, { initial: 5, seen }));
186
+ act(() => seen.current!.showMore());
187
+ expect(seen.current!.visibleCount).toBe(12);
188
+
189
+ mount(h(ShowMoreProbe, { initial: 10, seen }));
190
+ expect(seen.current!.visibleCount).toBe(10);
191
+ expect(seen.current!.canShowLess).toBe(false);
192
+ });
193
+
183
194
  test('canShowLess is false until the window grows, and showLess collapses to the initial size', () => {
184
195
  const seen: { current: ShowMore | null } = { current: null };
185
196
  mount(h(ShowMoreProbe, { seen }));
@@ -0,0 +1,143 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Which references the timeline is allowed to make clickable.
8
+ *
9
+ * The integration suite (`markdown-inline-file.test.tsx`) pins the chip; this
10
+ * pins the answers the hook gives the marker — a directory path is stat'ed, a
11
+ * bare name goes through the index, and an unanswerable probe (refusal, no
12
+ * workspace) verifies NOTHING, because a clickable chip that opens a missing
13
+ * file is the bug.
14
+ */
15
+
16
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
17
+ import { Window } from 'happy-dom';
18
+ import { render } from 'preact';
19
+ import { act } from 'preact/test-utils';
20
+ import { forgetQuickOpenIndex } from '@/client/hooks/editor/quick-open';
21
+ import {
22
+ forgetInlineFileVerdicts,
23
+ probeInlineFileExists,
24
+ useVerifiedInlineFiles,
25
+ } from '@/client/hooks/ui/verified-inline-files';
26
+ import { setPluginContext } from '@/client/lib/plugins/context';
27
+ import type { InlineFileReference } from '@/shared/lib/markdown/inline-file';
28
+
29
+ const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement'] as const;
30
+ const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
31
+ const nativeFetch = globalThis.fetch;
32
+
33
+ let container: HTMLElement;
34
+ let requests: string[] = [];
35
+ let existing = new Set<string>();
36
+ let listed: string[] = [];
37
+ let failFetch = false;
38
+
39
+ function jsonResponse(body: unknown, status = 200): Response {
40
+ return { ok: status >= 200 && status < 300, status, json: async () => body } as unknown as Response;
41
+ }
42
+
43
+ function Harness({ references }: { references: readonly InlineFileReference[] }) {
44
+ const verified = useVerifiedInlineFiles(references);
45
+ return <span id="verified">{[...verified].sort().join(',')}</span>;
46
+ }
47
+
48
+ async function settle(): Promise<void> {
49
+ await act(async () => {
50
+ const { promise, resolve } = Promise.withResolvers<void>();
51
+ setTimeout(resolve, 0);
52
+ await promise;
53
+ });
54
+ }
55
+
56
+ async function mount(references: InlineFileReference[], root: string | null): Promise<string> {
57
+ container = document.createElement('div');
58
+ document.body.appendChild(container);
59
+ setPluginContext(null, root);
60
+ act(() => render(<Harness references={references} />, container));
61
+ await settle();
62
+ return container.querySelector('#verified')?.textContent ?? '';
63
+ }
64
+
65
+ beforeAll(() => {
66
+ const win = new Window({ url: 'http://localhost' });
67
+ const target = globalThis as unknown as Record<string, unknown>;
68
+ for (const key of DOM_GLOBALS) {
69
+ nativeGlobals[key] = target[key];
70
+ target[key] = (win as unknown as Record<string, unknown>)[key];
71
+ }
72
+ globalThis.fetch = (async (input: string | URL | Request) => {
73
+ const url = new URL(String(input), 'http://localhost');
74
+ requests.push(`${url.pathname}?${url.searchParams.toString()}`);
75
+ if (failFetch) throw new Error('offline');
76
+ if (url.pathname === '/api/fs/exists') {
77
+ return jsonResponse({ exists: existing.has(url.searchParams.get('path') ?? ''), mtimeMs: null });
78
+ }
79
+ if (url.pathname === '/api/fs/list') {
80
+ return jsonResponse({ files: listed.map((path) => ({ path })), truncated: false });
81
+ }
82
+ return jsonResponse({}, 404);
83
+ }) as unknown as typeof globalThis.fetch;
84
+ });
85
+
86
+ afterAll(() => {
87
+ const target = globalThis as unknown as Record<string, unknown>;
88
+ for (const key of DOM_GLOBALS) {
89
+ if (nativeGlobals[key] === undefined) delete target[key];
90
+ else target[key] = nativeGlobals[key];
91
+ }
92
+ globalThis.fetch = nativeFetch;
93
+ });
94
+
95
+ afterEach(() => {
96
+ render(null, container);
97
+ container.remove();
98
+ setPluginContext(null, null);
99
+ forgetQuickOpenIndex();
100
+ forgetInlineFileVerdicts();
101
+ requests = [];
102
+ existing = new Set();
103
+ listed = [];
104
+ failFetch = false;
105
+ });
106
+
107
+ describe('useVerifiedInlineFiles', () => {
108
+ test('a directory path is verified by the exists route, a bare name by the index', async () => {
109
+ existing = new Set(['src/a.ts']);
110
+ listed = ['src/client/App.tsx'];
111
+ const text = await mount([{ path: 'src/a.ts' }, { path: 'App.tsx' }], '/repo');
112
+ expect(text).toBe('App.tsx,src/a.ts');
113
+ });
114
+
115
+ test('a path the workspace does not have is not verified', async () => {
116
+ existing = new Set(['src/a.ts']);
117
+ expect(await mount([{ path: 'src/gone.ts' }], '/repo')).toBe('');
118
+ });
119
+
120
+ test('the same path is asked about once', async () => {
121
+ existing = new Set(['src/a.ts']);
122
+ await mount([{ path: 'src/a.ts' }, { path: 'src/a.ts', line: 9 }], '/repo');
123
+ expect(requests.filter((url) => url.startsWith('/api/fs/exists'))).toHaveLength(1);
124
+ });
125
+
126
+ test('a settled verdict is reused instead of stat-ing again', async () => {
127
+ existing = new Set(['src/a.ts']);
128
+ expect(await probeInlineFileExists('/repo', 'src/a.ts')).toBe(true);
129
+ expect(await probeInlineFileExists('/repo', 'src/a.ts')).toBe(true);
130
+ expect(requests.filter((url) => url.startsWith('/api/fs/exists'))).toHaveLength(1);
131
+ });
132
+
133
+ test('a failed probe verifies nothing', async () => {
134
+ failFetch = true;
135
+ expect(await mount([{ path: 'src/a.ts' }, { path: 'App.tsx' }], '/repo')).toBe('');
136
+ });
137
+
138
+ test('without a workspace nothing is asked and nothing is verified', async () => {
139
+ existing = new Set(['src/a.ts']);
140
+ expect(await mount([{ path: 'src/a.ts' }], null)).toBe('');
141
+ expect(requests).toEqual([]);
142
+ });
143
+ });
@@ -0,0 +1,165 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Which inline file references a chat message wrote actually name a file.
8
+ *
9
+ * The detector (`inline-file.ts`) accepts anything that LOOKS like a path, and
10
+ * the agent does not always write one that resolves: a partial name, a path
11
+ * from another checkout, a file it never created. Marking all of them made the
12
+ * chip a promise the click could not keep — the tab opened empty and the editor
13
+ * said the file was missing.
14
+ *
15
+ * So the marker is gated on this hook. A reference WITH a directory is a
16
+ * workspace-relative location, which `/api/fs/exists` stats exactly. A BARE
17
+ * name has no location, so it is resolved through the quick-open index the
18
+ * click itself uses (`chooseFileTarget`): an exact entry, or a basename match,
19
+ * is a file that can be opened; nothing is not.
20
+ *
21
+ * Only a POSITIVE answer marks a chip. A failed probe, an absent workspace and
22
+ * an unreadable index all leave it plain text — an inert chip is honest, a
23
+ * clickable one that opens a missing tab is the bug this exists to prevent.
24
+ */
25
+
26
+ import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
27
+ import { loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
28
+ import { pluginContext } from '@/client/lib/plugins/context';
29
+ import { chooseFileTarget } from '@/shared/lib/fs/open-reference';
30
+ import type { InlineFileReference } from '@/shared/lib/markdown/inline-file';
31
+
32
+ /** Probes for the same scope and path share one request. */
33
+ const inFlightProbes = new Map<string, Promise<boolean>>();
34
+
35
+ /**
36
+ * A settled verdict is reused for this long, so ten messages that mention the
37
+ * same file cost one `stat`, not ten. Short on purpose: a file created after a
38
+ * stale "missing" must become clickable soon.
39
+ */
40
+ const VERDICT_REUSE_MS = 5_000;
41
+
42
+ interface CachedVerdict {
43
+ settledAt: number;
44
+ exists: boolean;
45
+ }
46
+
47
+ const verdictCache = new Map<string, CachedVerdict>();
48
+
49
+ /**
50
+ * Whether `path` names a file under `root`.
51
+ *
52
+ * The route is the same one `useMissingFiles` asks, so "a chip is clickable"
53
+ * and "a tab is not missing" cannot disagree about what exists. A refusal is
54
+ * NOT an answer: only an explicit `exists: true` verifies.
55
+ */
56
+ export function probeInlineFileExists(root: string, path: string): Promise<boolean> {
57
+ const key = `${root}\u0000${path}`;
58
+ const cached = verdictCache.get(key);
59
+ if (cached && Date.now() - cached.settledAt < VERDICT_REUSE_MS) {
60
+ return Promise.resolve(cached.exists);
61
+ }
62
+ const pending = inFlightProbes.get(key);
63
+ if (pending) return pending;
64
+ const params = new URLSearchParams({ path, root });
65
+ const probe = (async () => {
66
+ try {
67
+ const res = await fetch(`/api/fs/exists?${params.toString()}`);
68
+ const data = (await res.json().catch(() => null)) as { exists?: unknown } | null;
69
+ return res.ok && data?.exists === true;
70
+ } catch {
71
+ return false;
72
+ }
73
+ })().then((exists) => {
74
+ verdictCache.set(key, { settledAt: Date.now(), exists });
75
+ return exists;
76
+ }).finally(() => inFlightProbes.delete(key));
77
+ inFlightProbes.set(key, probe);
78
+ return probe;
79
+ }
80
+
81
+ /** Drop the shared verdicts. Tests that change a scope's files call this. */
82
+ export function forgetInlineFileVerdicts(): void {
83
+ verdictCache.clear();
84
+ inFlightProbes.clear();
85
+ }
86
+
87
+ interface Verdicts {
88
+ /** The workspace the verdicts belong to; a different root starts over. */
89
+ root: string | null;
90
+ byPath: Map<string, boolean>;
91
+ }
92
+
93
+ /**
94
+ * The reference paths that exist, for the current message and workspace.
95
+ *
96
+ * Verdicts live in a ref so a streaming re-render does not re-ask about spans
97
+ * that are already settled; `revision` is the only thing that repaints. A path
98
+ * that appears later (the agent finished writing the sentence) is probed once.
99
+ */
100
+ export function useVerifiedInlineFiles(references: readonly InlineFileReference[]): ReadonlySet<string> {
101
+ const root = pluginContext().workspacePath;
102
+ const verdicts = useRef<Verdicts>({ root, byPath: new Map() });
103
+ const inFlight = useRef(new Set<string>());
104
+ const alive = useRef(true);
105
+ const [revision, setRevision] = useState(0);
106
+
107
+ useEffect(() => {
108
+ alive.current = true;
109
+ return () => {
110
+ alive.current = false;
111
+ };
112
+ }, []);
113
+
114
+ const paths = useMemo(() => {
115
+ const unique = new Set<string>();
116
+ for (const reference of references) unique.add(reference.path);
117
+ return [...unique];
118
+ }, [references]);
119
+ // A string dep keeps the effect stable while the parse produces a new array
120
+ // with the same content (every streaming tick does).
121
+ const pathKey = paths.join('\n');
122
+
123
+ useEffect(() => {
124
+ if (verdicts.current.root !== root) {
125
+ verdicts.current = { root, byPath: new Map() };
126
+ inFlight.current = new Set();
127
+ }
128
+ if (!root) return;
129
+ const current = verdicts.current.byPath;
130
+ const unknown = paths.filter((path) => !current.has(path) && !inFlight.current.has(path));
131
+ if (unknown.length === 0) return;
132
+ for (const path of unknown) inFlight.current.add(path);
133
+ const scope = root;
134
+
135
+ void (async () => {
136
+ const needsIndex = unknown.some((path) => !path.includes('/'));
137
+ const entries = needsIndex ? await loadQuickOpenIndex(scope) : [];
138
+ const answers = await Promise.all(
139
+ unknown.map(async (path): Promise<[string, boolean]> => [
140
+ path,
141
+ path.includes('/')
142
+ ? await probeInlineFileExists(scope, path)
143
+ : chooseFileTarget({ path }, entries).kind !== 'literal',
144
+ ]),
145
+ );
146
+ // The component may have unmounted, or the workspace switched, while the
147
+ // requests were in flight; a verdict for the wrong scope is not stored.
148
+ if (verdicts.current.root !== scope) return;
149
+ for (const [path, exists] of answers) {
150
+ inFlight.current.delete(path);
151
+ verdicts.current.byPath.set(path, exists);
152
+ }
153
+ if (alive.current) setRevision((value) => value + 1);
154
+ })();
155
+ }, [pathKey, root]);
156
+
157
+ return useMemo(() => {
158
+ const verified = new Set<string>();
159
+ if (verdicts.current.root === root) {
160
+ for (const [path, exists] of verdicts.current.byPath) if (exists) verified.add(path);
161
+ }
162
+ return verified;
163
+ // `revision` is the repaint signal for the mutable verdict map.
164
+ }, [revision, root, pathKey]);
165
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's folder workspace entry: a press writes the folder's synthetic id
8
+ * and opens the panel drawer, and a settled workspace id reopens the drawer
9
+ * after a reload. A real session must do neither.
10
+ */
11
+
12
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
13
+ import { Window } from 'happy-dom';
14
+ import { h, render } from 'preact';
15
+ import { act } from 'preact/test-utils';
16
+
17
+ import {
18
+ useMobileWorkspacePanels,
19
+ type MobileWorkspacePanelsOptions,
20
+ } from '@/client/hooks/workspace/mobile-workspace-panels';
21
+ import type { MobileDrawerReveals } from '@/client/components/mobile/mobile-drawer-reveals';
22
+ import { resetSessionStateStore } from '@/shared/lib/workspace/session-state/store';
23
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
24
+
25
+ let container: HTMLElement | undefined;
26
+ let open: ((folderId: number) => void) | null = null;
27
+
28
+ function drawers(count: { opened: number }): MobileDrawerReveals {
29
+ return {
30
+ right: 0,
31
+ left: 0,
32
+ openSessionDrawer: () => {},
33
+ openRightDrawer: () => { count.opened += 1; },
34
+ openNamedPanel: () => {},
35
+ };
36
+ }
37
+
38
+ function Probe(props: MobileWorkspacePanelsOptions) {
39
+ open = useMobileWorkspacePanels(props);
40
+ return null;
41
+ }
42
+
43
+ async function mount(options: MobileWorkspacePanelsOptions) {
44
+ container = document.body.appendChild(document.createElement('div'));
45
+ await act(async () => { render(h(Probe, options), container as HTMLElement); });
46
+ await act(async () => {});
47
+ }
48
+
49
+ beforeAll(() => {
50
+ installDomGlobals(new Window({ url: 'http://localhost' }));
51
+ });
52
+
53
+ beforeEach(() => {
54
+ resetSessionStateStore();
55
+ open = null;
56
+ });
57
+
58
+ afterAll(() => {
59
+ restoreDomGlobals();
60
+ });
61
+
62
+ afterEach(() => {
63
+ if (container) render(null, container);
64
+ container?.remove();
65
+ container = undefined;
66
+ });
67
+
68
+ describe('useMobileWorkspacePanels', () => {
69
+ test('a press writes the workspace id and opens the panel drawer', async () => {
70
+ const count = { opened: 0 };
71
+ let screen = 'main';
72
+ let search = '';
73
+ await mount({
74
+ stateSessionId: 'real-1',
75
+ drawers: drawers(count),
76
+ setSearchParams: (next) => {
77
+ const value = typeof next === 'function' ? next(new URLSearchParams()) : next;
78
+ search = String(value);
79
+ },
80
+ setCurrentScreen: (next) => { screen = next; },
81
+ });
82
+
83
+ await act(async () => { open?.(7); });
84
+
85
+ expect(search).toContain('sessionId=workspace-7');
86
+ expect(search).toContain('folderId=7');
87
+ expect(screen).toBe('right');
88
+ expect(count.opened).toBe(0);
89
+ });
90
+
91
+ test('a repeat press on an already-settled workspace reveals the drawer', async () => {
92
+ const count = { opened: 0 };
93
+ await mount({
94
+ stateSessionId: 'workspace-7',
95
+ drawers: drawers(count),
96
+ setSearchParams: () => {},
97
+ setCurrentScreen: () => {},
98
+ });
99
+ // The mount effect is the reload/cold-restore path.
100
+ expect(count.opened).toBe(1);
101
+
102
+ await act(async () => { open?.(7); });
103
+ expect(count.opened).toBe(2);
104
+ });
105
+
106
+ test('a real session opens nothing on mount', async () => {
107
+ const count = { opened: 0 };
108
+ await mount({
109
+ stateSessionId: 'real-1',
110
+ drawers: drawers(count),
111
+ setSearchParams: () => {},
112
+ setCurrentScreen: () => {},
113
+ });
114
+ expect(count.opened).toBe(0);
115
+ });
116
+ });
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone's folder-workspace button: write the folder's synthetic session id
8
+ * and bring its panel drawer forward.
9
+ *
10
+ * The drawer is a SCREEN, so the URL write alone is not enough. Two paths open
11
+ * it: the button press (which may be a repeat on the current folder) and a
12
+ * settled session id after a reload or a cold restore. Both seed Files when the
13
+ * folder has never picked a drawer view, because under `tabs` navigation the
14
+ * fallback alone lands on the catalog.
15
+ */
16
+
17
+ import { useCallback, useEffect, useRef } from 'preact/hooks';
18
+ import type { SetSearchParams } from '@/client/lib/router/search-params';
19
+ import { workspaceSessionParams } from '@/client/lib/router/branch-params';
20
+ import type { MobileDrawerReveals, MobileScreen } from '@/client/components/mobile/mobile-drawer-reveals';
21
+ import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
22
+ import { DEFAULT_RIGHT_PANEL_TYPE } from '@/shared/lib/workspace/right-panels';
23
+ import {
24
+ isWorkspaceSessionId,
25
+ workspaceSessionId,
26
+ } from '@/shared/lib/workspace/workspace-session';
27
+
28
+ export interface MobileWorkspacePanelsOptions {
29
+ /** The settled session id from `SessionStateProvider`. */
30
+ stateSessionId: string;
31
+ drawers: MobileDrawerReveals;
32
+ setSearchParams: SetSearchParams;
33
+ setCurrentScreen: (screen: MobileScreen) => void;
34
+ }
35
+
36
+ export function useMobileWorkspacePanels({
37
+ stateSessionId,
38
+ drawers,
39
+ setSearchParams,
40
+ setCurrentScreen,
41
+ }: MobileWorkspacePanelsOptions): (folderId: number) => void {
42
+ const handleOpenWorkspacePanels = useCallback(
43
+ (folderId: number) => {
44
+ const workspaceId = workspaceSessionId(folderId);
45
+ if (getSessionValue(workspaceId, 'layout.mobileRightPanel') === undefined) {
46
+ setSessionKey(workspaceId, 'layout.mobileRightPanel', DEFAULT_RIGHT_PANEL_TYPE);
47
+ }
48
+ setSearchParams(prev => workspaceSessionParams(prev, folderId), { replace: true });
49
+ if (stateSessionId === workspaceId) drawers.openRightDrawer();
50
+ else setCurrentScreen('right');
51
+ },
52
+ [stateSessionId, drawers, setSearchParams, setCurrentScreen],
53
+ );
54
+
55
+ // A workspace session opens on its panels, from a reload or a cold restore:
56
+ // in `tabs` mode the drawer otherwise lands on its catalog. Keyed by the
57
+ // SETTLED session id, not the just-written URL param.
58
+ const revealedRef = useRef<string | null>(null);
59
+ useEffect(() => {
60
+ if (!isWorkspaceSessionId(stateSessionId)) {
61
+ revealedRef.current = null;
62
+ return;
63
+ }
64
+ if (revealedRef.current === stateSessionId) return;
65
+ revealedRef.current = stateSessionId;
66
+ if (getSessionValue(stateSessionId, 'layout.mobileRightPanel') === undefined) {
67
+ setSessionKey(stateSessionId, 'layout.mobileRightPanel', DEFAULT_RIGHT_PANEL_TYPE);
68
+ }
69
+ drawers.openRightDrawer();
70
+ }, [stateSessionId, drawers]);
71
+
72
+ return handleOpenWorkspacePanels;
73
+ }