@dylanpiercey/work 0.0.66 → 0.0.67

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 (249) hide show
  1. package/bin/work.mjs +17 -1
  2. package/dist/{_CLt6aKrh.js → _B9UH2f9c.js} +20 -15
  3. package/dist/_C8-SYmgW.js +2 -0
  4. package/dist/{_prItJCwP.js → _D78MdEM0.js} +1174 -973
  5. package/dist/{_Dp9_KYvx.js → _mSrLyFdO.js} +9 -1
  6. package/dist/index.mjs +867 -658
  7. package/dist/public/assets/{_Bz51lZqR.js → _3k9q7qTZ.js} +1 -1
  8. package/dist/public/assets/_3k9q7qTZ.js.br +0 -0
  9. package/dist/public/assets/{_B05o73WT2.js → _6Uv2mA8-2.js} +1 -1
  10. package/dist/public/assets/_6Uv2mA8-2.js.br +0 -0
  11. package/dist/public/assets/{_B8G3NoPj.js → _AMWZA0be.js} +1 -1
  12. package/dist/public/assets/_AMWZA0be.js.br +0 -0
  13. package/dist/public/assets/{_DNEFW33V.js → _B1ZCEYOD.js} +1 -1
  14. package/dist/public/assets/_B1ZCEYOD.js.br +0 -0
  15. package/dist/public/assets/{_Cdheecpj.js → _B1vmwnMa.js} +1 -1
  16. package/dist/public/assets/_B1vmwnMa.js.br +0 -0
  17. package/dist/public/assets/{_kh47s6nR.js → _B5iCC67h.js} +1 -1
  18. package/dist/public/assets/_B5iCC67h.js.br +0 -0
  19. package/dist/public/assets/{_C9OXLFHE.js → _BL7XgPZ_.js} +1 -1
  20. package/dist/public/assets/_BL7XgPZ_.js.br +0 -0
  21. package/dist/public/assets/{_DYzEbPN62.js → _BSNS3UMH2.js} +1 -1
  22. package/dist/public/assets/_BSNS3UMH2.js.br +0 -0
  23. package/dist/public/assets/{_BHfYUVf92.js → _BV3Xd3ki2.js} +1 -1
  24. package/dist/public/assets/{_opBVTnU5.js → _BW1UpUrT.js} +1 -1
  25. package/dist/public/assets/_BW1UpUrT.js.br +0 -0
  26. package/dist/public/assets/{_PuhXJ75Y2.js → _BW81rf1H2.js} +1 -1
  27. package/dist/public/assets/_BW81rf1H2.js.br +0 -0
  28. package/dist/public/assets/{_CVsVJtsx2.js → _BXCZuUQA2.js} +1 -1
  29. package/dist/public/assets/_BXCZuUQA2.js.br +0 -0
  30. package/dist/public/assets/{_CaqW-zk5.js → _B_cZqSdw.js} +1 -1
  31. package/dist/public/assets/_B_cZqSdw.js.br +0 -0
  32. package/dist/public/assets/{_BrmwzOnI.js → _BaoSUC_i.js} +1 -1
  33. package/dist/public/assets/_BaoSUC_i.js.br +0 -0
  34. package/dist/public/assets/{_BskoQ_9N.js → _BkgwhUlf.js} +1 -1
  35. package/dist/public/assets/_BkgwhUlf.js.br +0 -0
  36. package/dist/public/assets/{_dh9Nkmu2.js → _Bs3zDe42.js} +1 -1
  37. package/dist/public/assets/_Bs3zDe42.js.br +0 -0
  38. package/dist/public/assets/{_DDlrIXcy.js → _BtsudbJn.js} +1 -1
  39. package/dist/public/assets/_BtsudbJn.js.br +0 -0
  40. package/dist/public/assets/{_bN6AHjz72.js → _BwQNx6NX2.js} +1 -1
  41. package/dist/public/assets/_BwQNx6NX2.js.br +0 -0
  42. package/dist/public/assets/{_D9saMO33.js → _Bx58LnKm.js} +1 -1
  43. package/dist/public/assets/_Bx58LnKm.js.br +0 -0
  44. package/dist/public/assets/{_DoPHUocN2.js → _BzP13oLI2.js} +1 -1
  45. package/dist/public/assets/_BzP13oLI2.js.br +0 -0
  46. package/dist/public/assets/{_mcTiUg5Q.js → _C13mV9Vy.js} +1 -1
  47. package/dist/public/assets/_C13mV9Vy.js.br +0 -0
  48. package/dist/public/assets/{_CuKBxxEj.js → _C7_gIQ1W.js} +1 -1
  49. package/dist/public/assets/_C7_gIQ1W.js.br +0 -0
  50. package/dist/public/assets/{_DmiiHlMw.js → _C8IzwQRq.js} +1 -1
  51. package/dist/public/assets/_C8IzwQRq.js.br +0 -0
  52. package/dist/public/assets/{_B1mF3byy.js → _C9ETD15k.js} +1 -1
  53. package/dist/public/assets/_C9ETD15k.js.br +0 -0
  54. package/dist/public/assets/{_WP2Lc15n2.js → _CBo0xAjA2.js} +1 -1
  55. package/dist/public/assets/{_D816eq_5.js → _CCbKzznD.js} +1 -1
  56. package/dist/public/assets/_CCbKzznD.js.br +0 -0
  57. package/dist/public/assets/{_DNX2C5WJ2.js → _CHxLUwRe2.js} +1 -1
  58. package/dist/public/assets/_CHxLUwRe2.js.br +0 -0
  59. package/dist/public/assets/{_B0k7NugC2.js → _CPi3B_vr2.js} +1 -1
  60. package/dist/public/assets/_CPi3B_vr2.js.br +0 -0
  61. package/dist/public/assets/{_C49UpI2x.js → _CS_y_5bW.js} +1 -1
  62. package/dist/public/assets/_CS_y_5bW.js.br +0 -0
  63. package/dist/public/assets/{_CxfdAeEw2.js → _CYMzncSB2.js} +1 -1
  64. package/dist/public/assets/_CYMzncSB2.js.br +0 -0
  65. package/dist/public/assets/{_rZXmOaG32.js → _CZyTbXSO2.js} +1 -1
  66. package/dist/public/assets/_CZyTbXSO2.js.br +0 -0
  67. package/dist/public/assets/{_DcprnWO8.js → _Cc8KMyAp.js} +1 -1
  68. package/dist/public/assets/_Cc8KMyAp.js.br +0 -0
  69. package/dist/public/assets/{_CbWbEVg6.js → _CcdwqB39.js} +1 -1
  70. package/dist/public/assets/_CcdwqB39.js.br +0 -0
  71. package/dist/public/assets/{_vRoufqCj.js → _CduHXYfC.js} +45 -45
  72. package/dist/public/assets/_CduHXYfC.js.br +0 -0
  73. package/dist/public/assets/{_B5xui1fA.js → _CgMtsYIH.js} +1 -1
  74. package/dist/public/assets/_CgMtsYIH.js.br +0 -0
  75. package/dist/public/assets/{_CHvHhxWd2.js → _CgdPOrhX2.js} +1 -1
  76. package/dist/public/assets/_CgdPOrhX2.js.br +0 -0
  77. package/dist/public/assets/{_B1EEc4qP.js → _Chsu042s.js} +1 -1
  78. package/dist/public/assets/_Chsu042s.js.br +0 -0
  79. package/dist/public/assets/{_BQx2yI4L2.js → _CjxTlEOw2.js} +1 -1
  80. package/dist/public/assets/_CjxTlEOw2.js.br +0 -0
  81. package/dist/public/assets/{_CusaLcB32.js → _ClECf4L52.js} +1 -1
  82. package/dist/public/assets/_ClECf4L52.js.br +0 -0
  83. package/dist/public/assets/{_DTKF7fNw.js → _CnQdBazT.js} +1 -1
  84. package/dist/public/assets/_CnQdBazT.js.br +0 -0
  85. package/dist/public/assets/{_ByLRpoD8.js → _CsVHdEro.js} +1 -1
  86. package/dist/public/assets/{_e-tg77rn.js → _CsdnwX6C.js} +1 -1
  87. package/dist/public/assets/_CsdnwX6C.js.br +0 -0
  88. package/dist/public/assets/{_DgRqz5gW.js → _CsuFzJmI.js} +1 -1
  89. package/dist/public/assets/_CsuFzJmI.js.br +0 -0
  90. package/dist/public/assets/{_d0SVuxND.js → _CuUYX7O6.js} +1 -1
  91. package/dist/public/assets/_CuUYX7O6.js.br +0 -0
  92. package/dist/public/assets/{_r0Ipkhml2.js → _Cvm7LApl2.js} +1 -1
  93. package/dist/public/assets/_Cvm7LApl2.js.br +0 -0
  94. package/dist/public/assets/{_CnuCerLV.js → _CzJu_xMs.js} +1 -1
  95. package/dist/public/assets/_CzJu_xMs.js.br +0 -0
  96. package/dist/public/assets/{_Bu3F-JoI.js → _D3ardbW_.js} +1 -1
  97. package/dist/public/assets/_D3ardbW_.js.br +0 -0
  98. package/dist/public/assets/{_CPFyUv8c.js → _D6UgA7_X.js} +1 -1
  99. package/dist/public/assets/_D6UgA7_X.js.br +0 -0
  100. package/dist/public/assets/{_DQUq9TzX2.js → _D6hi7ua72.js} +1 -1
  101. package/dist/public/assets/_D6hi7ua72.js.br +0 -0
  102. package/dist/public/assets/{_CPY9iUML.js → _D9eCCnFe.js} +1 -1
  103. package/dist/public/assets/_D9eCCnFe.js.br +0 -0
  104. package/dist/public/assets/{_Uj1o8NRL.js → _DHLcQgxi.js} +1 -1
  105. package/dist/public/assets/_DHLcQgxi.js.br +0 -0
  106. package/dist/public/assets/{_BzqAPgV-.js → _DLfp1TG-.js} +1 -1
  107. package/dist/public/assets/_DLfp1TG-.js.br +0 -0
  108. package/dist/public/assets/{_D7CRrNvF.js → _DRbnn8C_.js} +1 -1
  109. package/dist/public/assets/_DRbnn8C_.js.br +0 -0
  110. package/dist/public/assets/{_CXUgu159.js → _DTD1tZCR.js} +1 -1
  111. package/dist/public/assets/_DTD1tZCR.js.br +0 -0
  112. package/dist/public/assets/{_BS0vA9WC.js → _DX5zvNmD.js} +1 -1
  113. package/dist/public/assets/_DX5zvNmD.js.br +0 -0
  114. package/dist/public/assets/{_CqVqqLWQ.js → _DbEBleKv.js} +1 -1
  115. package/dist/public/assets/_DbEBleKv.js.br +0 -0
  116. package/dist/public/assets/{_CMW5tN5O2.js → _DeKPlPsD2.js} +1 -1
  117. package/dist/public/assets/_DeKPlPsD2.js.br +0 -0
  118. package/dist/public/assets/{_TGf7nf1b.js → _DfBlfnwv.js} +1 -1
  119. package/dist/public/assets/_DfBlfnwv.js.br +0 -0
  120. package/dist/public/assets/{_BsO1b3gk.js → _DiAj-Esd.js} +1 -1
  121. package/dist/public/assets/_DiAj-Esd.js.br +0 -0
  122. package/dist/public/assets/{_jR8RP1Ko2.js → _DlpIObWk2.js} +1 -1
  123. package/dist/public/assets/_DlpIObWk2.js.br +0 -0
  124. package/dist/public/assets/{_wN6_cR73.js → _Dlrc6R2N.js} +4 -4
  125. package/dist/public/assets/_Dlrc6R2N.js.br +0 -0
  126. package/dist/public/assets/{_6zkzF93t.js → _Ds1l_cNr.js} +1 -1
  127. package/dist/public/assets/_Ds1l_cNr.js.br +0 -0
  128. package/dist/public/assets/{_DuRPosDU2.js → _Dzm4iymN2.js} +1 -1
  129. package/dist/public/assets/_Dzm4iymN2.js.br +0 -0
  130. package/dist/public/assets/{_BD4oLAJs.js → _NElrm0bu.js} +1 -1
  131. package/dist/public/assets/_NElrm0bu.js.br +0 -0
  132. package/dist/public/assets/{_HzkUNjYF.js → _QqRd5Qfx.js} +1 -1
  133. package/dist/public/assets/_QqRd5Qfx.js.br +0 -0
  134. package/dist/public/assets/{_BWVJscSb.js → _VuWoXkq_.js} +1 -1
  135. package/dist/public/assets/_VuWoXkq_.js.br +0 -0
  136. package/dist/public/assets/{_DuYhjVLw.js → _W9tsjAUN.js} +1 -1
  137. package/dist/public/assets/_W9tsjAUN.js.br +0 -0
  138. package/dist/public/assets/{_w1EhXX_8.js → _g4l6Vz4T.js} +1 -1
  139. package/dist/public/assets/_g4l6Vz4T.js.br +0 -0
  140. package/dist/public/assets/{_CCthH_iX.js → _iFcqMrGB.js} +1 -1
  141. package/dist/public/assets/_iFcqMrGB.js.br +0 -0
  142. package/dist/public/assets/{_DaJqwjNP2.js → _m3dEhGTX2.js} +1 -1
  143. package/dist/public/assets/_m3dEhGTX2.js.br +0 -0
  144. package/dist/public/assets/{_CCtam4vN2.js → _pfnxgR1W2.js} +1 -1
  145. package/dist/public/assets/_pfnxgR1W2.js.br +0 -0
  146. package/dist/public/assets/{_C4-16Peb2.js → _sNxRRogh2.js} +1 -1
  147. package/dist/public/assets/_sNxRRogh2.js.br +0 -0
  148. package/dist/public/assets/{_jOq05NWI.js → _uDnfyVmG.js} +1 -1
  149. package/dist/public/assets/_uDnfyVmG.js.br +0 -0
  150. package/dist/public/assets/{_D-NX3TNd.js → _u_iVn6qP.js} +1 -1
  151. package/dist/public/assets/_u_iVn6qP.js.br +0 -0
  152. package/dist/public/assets/{_DV7j4cO7.js → _y4Ul_ohO.js} +1 -1
  153. package/dist/public/assets/_y4Ul_ohO.js.br +0 -0
  154. package/dist/public/assets/{_ILiR5QWb2.js → _ypxye8UD2.js} +1 -1
  155. package/dist/public/assets/_ypxye8UD2.js.br +0 -0
  156. package/dist/public/assets/{app-page-DASXpmZa.css → app-page-DZhaOCYJ.css} +1 -1
  157. package/dist/public/assets/app-page-DZhaOCYJ.css.br +0 -0
  158. package/dist/public/assets/diff-view-QQN-PSAx.css +1 -0
  159. package/dist/public/assets/diff-view-QQN-PSAx.css.br +0 -0
  160. package/dist/public/assets/new-Cia2P5u6.js +1 -0
  161. package/dist/public/assets/settings-Cia2P5u6.js +1 -0
  162. package/dist/public/assets/w-Cia2P5u6.js +1 -0
  163. package/dist/public/assets/w._-BwIlYQ_7.js +1 -0
  164. package/dist/public/assets/w._-Cia2P5u6.js +1 -0
  165. package/lib/review/markdown.d.mts +37 -0
  166. package/lib/review/markdown.mjs +117 -0
  167. package/package.json +1 -1
  168. package/dist/_CTJQVrRJ.js +0 -2
  169. package/dist/public/assets/_6zkzF93t.js.br +0 -0
  170. package/dist/public/assets/_B05o73WT2.js.br +0 -0
  171. package/dist/public/assets/_B0k7NugC2.js.br +0 -0
  172. package/dist/public/assets/_B1EEc4qP.js.br +0 -0
  173. package/dist/public/assets/_B1mF3byy.js.br +0 -0
  174. package/dist/public/assets/_B5xui1fA.js.br +0 -0
  175. package/dist/public/assets/_B8G3NoPj.js.br +0 -0
  176. package/dist/public/assets/_BD4oLAJs.js.br +0 -0
  177. package/dist/public/assets/_BQx2yI4L2.js.br +0 -0
  178. package/dist/public/assets/_BS0vA9WC.js.br +0 -0
  179. package/dist/public/assets/_BWVJscSb.js.br +0 -0
  180. package/dist/public/assets/_BrmwzOnI.js.br +0 -0
  181. package/dist/public/assets/_BsO1b3gk.js.br +0 -0
  182. package/dist/public/assets/_BskoQ_9N.js.br +0 -0
  183. package/dist/public/assets/_Bu3F-JoI.js.br +0 -0
  184. package/dist/public/assets/_Bz51lZqR.js.br +0 -0
  185. package/dist/public/assets/_BzqAPgV-.js.br +0 -0
  186. package/dist/public/assets/_C4-16Peb2.js.br +0 -0
  187. package/dist/public/assets/_C49UpI2x.js.br +0 -0
  188. package/dist/public/assets/_C9OXLFHE.js.br +0 -0
  189. package/dist/public/assets/_CCtam4vN2.js.br +0 -0
  190. package/dist/public/assets/_CCthH_iX.js.br +0 -0
  191. package/dist/public/assets/_CHvHhxWd2.js.br +0 -0
  192. package/dist/public/assets/_CMW5tN5O2.js.br +0 -0
  193. package/dist/public/assets/_CPFyUv8c.js.br +0 -0
  194. package/dist/public/assets/_CPY9iUML.js.br +0 -0
  195. package/dist/public/assets/_CVsVJtsx2.js.br +0 -0
  196. package/dist/public/assets/_CXUgu159.js.br +0 -0
  197. package/dist/public/assets/_CaqW-zk5.js.br +0 -0
  198. package/dist/public/assets/_CbWbEVg6.js.br +0 -0
  199. package/dist/public/assets/_Cdheecpj.js.br +0 -0
  200. package/dist/public/assets/_CnuCerLV.js.br +0 -0
  201. package/dist/public/assets/_CqVqqLWQ.js.br +0 -0
  202. package/dist/public/assets/_CuKBxxEj.js.br +0 -0
  203. package/dist/public/assets/_CusaLcB32.js.br +0 -0
  204. package/dist/public/assets/_CxfdAeEw2.js.br +0 -0
  205. package/dist/public/assets/_D-NX3TNd.js.br +0 -0
  206. package/dist/public/assets/_D7CRrNvF.js.br +0 -0
  207. package/dist/public/assets/_D816eq_5.js.br +0 -0
  208. package/dist/public/assets/_D9saMO33.js.br +0 -0
  209. package/dist/public/assets/_DDlrIXcy.js.br +0 -0
  210. package/dist/public/assets/_DNEFW33V.js.br +0 -0
  211. package/dist/public/assets/_DNX2C5WJ2.js.br +0 -0
  212. package/dist/public/assets/_DQUq9TzX2.js.br +0 -0
  213. package/dist/public/assets/_DTKF7fNw.js.br +0 -0
  214. package/dist/public/assets/_DV7j4cO7.js.br +0 -0
  215. package/dist/public/assets/_DYzEbPN62.js.br +0 -0
  216. package/dist/public/assets/_DaJqwjNP2.js.br +0 -0
  217. package/dist/public/assets/_DcprnWO8.js.br +0 -0
  218. package/dist/public/assets/_DgRqz5gW.js.br +0 -0
  219. package/dist/public/assets/_DmiiHlMw.js.br +0 -0
  220. package/dist/public/assets/_DoPHUocN2.js.br +0 -0
  221. package/dist/public/assets/_DuRPosDU2.js.br +0 -0
  222. package/dist/public/assets/_DuYhjVLw.js.br +0 -0
  223. package/dist/public/assets/_HzkUNjYF.js.br +0 -0
  224. package/dist/public/assets/_ILiR5QWb2.js.br +0 -0
  225. package/dist/public/assets/_PuhXJ75Y2.js.br +0 -0
  226. package/dist/public/assets/_TGf7nf1b.js.br +0 -0
  227. package/dist/public/assets/_Uj1o8NRL.js.br +0 -0
  228. package/dist/public/assets/_bN6AHjz72.js.br +0 -0
  229. package/dist/public/assets/_d0SVuxND.js.br +0 -0
  230. package/dist/public/assets/_dh9Nkmu2.js.br +0 -0
  231. package/dist/public/assets/_e-tg77rn.js.br +0 -0
  232. package/dist/public/assets/_jOq05NWI.js.br +0 -0
  233. package/dist/public/assets/_jR8RP1Ko2.js.br +0 -0
  234. package/dist/public/assets/_kh47s6nR.js.br +0 -0
  235. package/dist/public/assets/_mcTiUg5Q.js.br +0 -0
  236. package/dist/public/assets/_opBVTnU5.js.br +0 -0
  237. package/dist/public/assets/_r0Ipkhml2.js.br +0 -0
  238. package/dist/public/assets/_rZXmOaG32.js.br +0 -0
  239. package/dist/public/assets/_vRoufqCj.js.br +0 -0
  240. package/dist/public/assets/_w1EhXX_8.js.br +0 -0
  241. package/dist/public/assets/_wN6_cR73.js.br +0 -0
  242. package/dist/public/assets/app-page-DASXpmZa.css.br +0 -0
  243. package/dist/public/assets/diff-view-DsPD6PLr.css +0 -1
  244. package/dist/public/assets/diff-view-DsPD6PLr.css.br +0 -0
  245. package/dist/public/assets/new-DYa0KZD7.js +0 -1
  246. package/dist/public/assets/settings-DYa0KZD7.js +0 -1
  247. package/dist/public/assets/w-DYa0KZD7.js +0 -1
  248. package/dist/public/assets/w._-CN7l1nb6.js +0 -1
  249. package/dist/public/assets/w._-DYa0KZD7.js +0 -1
@@ -1,4 +1,22 @@
1
- import { $ as _for_of, B as _attr_style, E as iconBtnRow, Et as writeScope, F as _attr_details_or_dialog_open, G as _content_resume, I as _attr_input_value, J as _el_read_error, L as _attr_option_value, N as _attr, P as _attr_class, T as iconBtnLg, X as _escape, Y as _el_resume, Z as _existing_scope, _ as toast_default, _t as _show_start, a as diffUncommitted, at as _peek_scope_id, b as repoLabel, ct as _scope_id, d as icon_search_default, dt as _script, f as icon_back_default, ft as _sep, gt as _show_end, ht as _set_serialize_reason, i as diffTreeOpen, it as _if, j as tone, l as fuzzy, lt as _scope_reason, mt as _serialize_if, n as findInput, nt as _html, ot as _resume, p as icon_refresh_default, pt as _serialize_guard, q as _el, r as icon_sidebar_default, st as _resume_branch, t as findIconBtn, ut as _scope_with_id, v as icon_xmark_default, vt as _subscribe, wt as attrTag, yt as _template, z as _attr_select_value } from "./_CLt6aKrh.js";
1
+ import { B as _attr_select_value, D as iconBtnRow, Dt as writeScope, E as iconBtnLg, F as _attr_class, I as _attr_details_or_dialog_open, J as _el, K as _content_resume, L as _attr_input_value, M as tone, P as _attr, Q as _existing_scope, R as _attr_option_value, V as _attr_style, X as _el_resume, Y as _el_read_error, Z as _escape, _t as _show_end, a as diffTreeOpen, at as _if, bt as _template, ct as _resume_branch, dt as _scope_with_id, et as _for_of, f as icon_search_default, ft as _script, gt as _set_serialize_reason, ht as _serialize_if, i as diffScope, lt as _scope_id, m as icon_refresh_default, mt as _serialize_guard, n as findInput, o as setDiffScope, ot as _peek_scope_id, p as icon_back_default, pt as _sep, r as icon_sidebar_default, rt as _html, st as _resume, t as findIconBtn, u as fuzzy, ut as _scope_reason, v as toast_default, vt as _show_start, x as repoLabel, y as icon_xmark_default, yt as _subscribe } from "./_B9UH2f9c.js";
2
+ //#region src/client/router.ts
3
+ function urlFor(r) {
4
+ if (r.view === "settings") return "/settings";
5
+ if (r.view === "new") return "/new";
6
+ if (!r.workspaceId) return "/";
7
+ const base = `/w/${encodeURIComponent(r.workspaceId)}`;
8
+ if (r.view === "diff") {
9
+ const q = new URLSearchParams();
10
+ if (r.pr) q.set("pr", r.pr);
11
+ if (r.scope && r.scope !== "committed") q.set("scope", r.scope);
12
+ if (r.file) q.set("file", r.file);
13
+ const qs = q.toString();
14
+ return `${base}/review${qs ? `?${qs}` : ""}`;
15
+ }
16
+ if (r.view === "manage") return `${base}/manage`;
17
+ return `${base}${r.sessionId ? `?s=${encodeURIComponent(r.sessionId)}` : ""}`;
18
+ }
19
+ //#endregion
2
20
  //#region src/client/clipboard.ts
3
21
  /** Copy text to the clipboard. `navigator.clipboard` needs a secure
4
22
  * context — absent over plain-http LAN origins — so fall back to a hidden
@@ -73,72 +91,24 @@ function termMatcher(term) {
73
91
  }
74
92
  }
75
93
  //#endregion
76
- //#region src/client/branch-label.ts
77
- /** Fallback label for a workspace branch when the workspace name is not to
78
- * hand: `dpiercey-ws-work-4f1hei` → `dpiercey-ws-work`.
79
- *
80
- * Deliberately only drops the trailing id. The branch is
81
- * `{user}-{host}-{slug}-{id}` (server/config.ts `branchPrefix`), and both
82
- * user and host are arbitrary — the host is this machine's hostname, so the
83
- * `ws-` that used to be matched here was one developer's laptop leaking into
84
- * a parser. Callers that know the workspace name should pass it instead. */
85
- function shortWorkspaceName(wsBranch) {
86
- const name = wsBranch.replace(/^origin\//, "");
87
- return dropRandomId(name.includes("/") ? name.slice(name.lastIndexOf("/") + 1) : name);
88
- }
89
- /** Strip a trailing `-<id>` segment (workspaces.ts:
90
- * `Math.random().toString(36).slice(2, 8)`), keeping the input when that
91
- * would leave nothing. */
92
- function dropRandomId(slug) {
93
- return slug.replace(/-[a-z0-9]{1,6}$/i, "") || slug;
94
- }
95
- /** Topic suffix when `head` is a `-topic` lane under the workspace branch. */
96
- function topicLane(head, wsBranch) {
97
- if (!wsBranch) return "";
98
- const h = head.replace(/^origin\//, "");
99
- const ws = wsBranch.replace(/^origin\//, "");
100
- if (h.startsWith(`${ws}-`)) return h.slice(ws.length + 1);
101
- return "";
102
- }
103
- function shortHeadFallback(head) {
104
- const short = dropRandomId(head);
105
- if (short.length <= 20) return short;
106
- const parts = short.split("-");
107
- return parts.length > 1 ? parts[parts.length - 1] : short;
108
- }
94
+ //#region lib/review/markdown.mjs
95
+ var CONTEXT = 3;
109
96
  /**
110
- * Review compare parts: render as `main` `work` `[topic]`, not one chip.
97
+ * @typedef {{ worktree: string, path: string, side: "additions"|"deletions",
98
+ * line_start: number, line_end: number, text: string,
99
+ * head?: string|null, snippet?: string|null }} Comment
100
+ * @typedef {{ worktree: string, head?: string, baseSha?: string, base?: string,
101
+ * branch?: string, pr?: { number: number, headRefName: string } | null,
102
+ * files?: { path: string, old: string|null, new: string|null }[] }} Repo
103
+ */
104
+ /**
105
+ * Per-repo base/head so the agent can see if it has moved on, plus ±3
106
+ * numbered lines of context so the snippet is still locatable after a small
107
+ * edit. A comment's stored `snippet` (what the reviewer actually saw) wins
108
+ * over re-reading the file, which may have changed since.
109
+ * @param {Comment[]} comments
110
+ * @param {Repo[] | null | undefined} repos
111
111
  */
112
- function reviewCompareLabel(base, head, wsBranch = "", wsName = "") {
113
- const baseName = (base || "base").replace(/^origin\//, "");
114
- const headName = (head || "HEAD").replace(/^origin\//, "");
115
- const ws = (wsBranch || "").replace(/^origin\//, "");
116
- const onWs = !!ws && (headName === ws || headName.startsWith(`${ws}-`));
117
- return {
118
- base: baseName,
119
- head: onWs ? wsName || shortWorkspaceName(ws) : shortHeadFallback(headName),
120
- topic: onWs ? topicLane(headName, ws) : "",
121
- title: headName === baseName ? baseName : `${headName} vs ${baseName}`
122
- };
123
- }
124
- /** Short label for "local …" chips (workspace name, plus [topic] if any). */
125
- function shortBranch(name, wsBranch = "", wsName = "") {
126
- const head = name.replace(/^origin\//, "");
127
- if (!head || head === "HEAD") return head || "HEAD";
128
- const ws = wsBranch.replace(/^origin\//, "");
129
- if (ws && (head === ws || head.startsWith(`${ws}-`))) {
130
- const work = wsName || shortWorkspaceName(ws);
131
- const topic = topicLane(head, ws);
132
- return topic ? `${work} [${topic}]` : work;
133
- }
134
- return shortHeadFallback(head);
135
- }
136
- //#endregion
137
- //#region src/client/review.ts
138
- var CONTEXT = 3;
139
- /** Render review comments as markdown: per-repo base/head so the agent
140
- * can see if it has moved on, plus ±3 lines of numbered patch context
141
- * so the snippet is still locatable after a small edit. */
142
112
  function commentMarkdown(comments, repos) {
143
113
  const byRepo = /* @__PURE__ */ new Map();
144
114
  for (const c of comments) byRepo.set(c.worktree, [...byRepo.get(c.worktree) || [], c]);
@@ -147,17 +117,15 @@ function commentMarkdown(comments, repos) {
147
117
  for (const [worktree, list] of byRepo) {
148
118
  const repo = (repos || []).find((r) => r.worktree === worktree);
149
119
  chunks.push("");
150
- chunks.push(repoHeader(worktree, repo));
120
+ chunks.push(repoHeader(worktree, repo, list));
151
121
  for (const c of list) {
152
122
  n++;
153
- const file = repo?.files.find((f) => f.path === c.path);
154
- const source = c.side === "deletions" ? file?.old : file?.new;
155
123
  const side = c.side === "deletions" ? "Old" : "New";
156
124
  const range = c.line_start === c.line_end ? `line ${c.line_start}` : `lines ${c.line_start}-${c.line_end}`;
157
125
  chunks.push("");
158
126
  chunks.push(`${n}. **${c.path}** (${side} ${range})`);
159
- if (source != null) {
160
- const snippet = quoteRange(source, c.line_start, c.line_end, c.side);
127
+ const snippet = c.snippet ?? currentSnippet(repo, c);
128
+ if (snippet != null) {
161
129
  const fence = markdownFence(snippet);
162
130
  chunks.push("");
163
131
  chunks.push(indent(`${fence}diff\n${snippet}\n${fence}`));
@@ -168,18 +136,33 @@ function commentMarkdown(comments, repos) {
168
136
  }
169
137
  return chunks.join("\n");
170
138
  }
171
- function repoHeader(worktree, repo) {
172
- if (!repo?.head) return `${worktree}/`;
173
- const head = shortSha(repo.head);
174
- const base = shortSha(repo.baseSha);
175
- const branch = repo.pr?.headRefName || repo.branch || "HEAD";
176
- return `${worktree}/${repo.pr ? ` #${repo.pr.number}` : ""}: \`${branch}\` ${head} vs \`${repo.base}\` ${base}`;
139
+ /** @param {Repo | undefined} repo @param {Comment} c */
140
+ function currentSnippet(repo, c) {
141
+ const file = repo?.files?.find((f) => f.path === c.path);
142
+ const source = c.side === "deletions" ? file?.old : file?.new;
143
+ return source == null ? null : quoteRange(source, c.line_start, c.line_end, c.side);
144
+ }
145
+ /** @param {string} worktree @param {Repo | undefined} repo @param {Comment[]} list */
146
+ function repoHeader(worktree, repo, list) {
147
+ if (repo?.head) {
148
+ const head = shortSha(repo.head);
149
+ const base = repo.baseSha ? shortSha(repo.baseSha) : "";
150
+ const branch = repo.pr?.headRefName || repo.branch || "HEAD";
151
+ return `${worktree}/${repo.pr ? ` #${repo.pr.number}` : ""}: \`${branch}\` ${head}${repo.base ? ` vs \`${repo.base}\` ${base}` : ""}`;
152
+ }
153
+ const heads = [...new Set(list.map((c) => c.head).filter(Boolean))];
154
+ return heads.length ? `${worktree}/: ${heads.map((h) => shortSha(h)).join(", ")}` : `${worktree}/`;
177
155
  }
156
+ /** @param {string} sha */
178
157
  function shortSha(sha, n = 12) {
179
158
  return sha.slice(0, n);
180
159
  }
181
- /** ±CONTEXT rows around the commented range, with +/- prefixes and
182
- * line numbers same shape as codiff's review payload. */
160
+ /**
161
+ * ±CONTEXT rows around the commented range, with +/- prefixes and line
162
+ * numbers — same shape as codiff's review payload.
163
+ * @param {string} source @param {number} start @param {number} end
164
+ * @param {"additions"|"deletions"} side
165
+ */
183
166
  function quoteRange(source, start, end, side) {
184
167
  const lines = source.split("\n");
185
168
  const from = Math.max(1, start - CONTEXT);
@@ -192,6 +175,7 @@ function quoteRange(source, start, end, side) {
192
175
  }
193
176
  return rows.join("\n");
194
177
  }
178
+ /** @param {string} body */
195
179
  function markdownFence(body) {
196
180
  let ticks = 3;
197
181
  const re = /`+/g;
@@ -199,9 +183,12 @@ function markdownFence(body) {
199
183
  while (m = re.exec(body)) ticks = Math.max(ticks, m[0].length + 1);
200
184
  return "`".repeat(ticks);
201
185
  }
186
+ /** @param {string} text */
202
187
  function indent(text) {
203
188
  return text.split("\n").map((line) => line ? ` ${line}` : line).join("\n");
204
189
  }
190
+ //#endregion
191
+ //#region src/client/review.ts
205
192
  /** Build hierarchical rows from a sorted file list: a path trie with
206
193
  * single-child directory chains compressed into one label (GitHub-style
207
194
  * "src/util" segments), each level indented by depth — labels stay short
@@ -261,55 +248,6 @@ function treeRows(files) {
261
248
  return rows;
262
249
  }
263
250
  var treeToggle = "_ea _X _g";
264
- var repoWorktree = "_eD _u";
265
- var repoTitle = "_eF _t";
266
- var fileFilter = "_fg _i";
267
- //#endregion
268
- //#region src/tags/file-filter.marko
269
- var file_filter_default = _template("k", (input) => {
270
- const $scope0_reason = _scope_reason();
271
- const $scope0_id = _scope_id();
272
- let value = input.value;
273
- let pending = null;
274
- const draft = (pending ?? value) || "";
275
- const box = { timer: 0 };
276
- const flush = _resume(() => {
277
- if (box.timer) {
278
- clearTimeout(box.timer);
279
- box.timer = 0;
280
- }
281
- const next = pending !== null ? pending : value || "";
282
- pending = null;
283
- value = next;
284
- }, "k1", $scope0_id);
285
- const type = _resume((v) => {
286
- if (box.timer) clearTimeout(box.timer);
287
- if (!v) {
288
- box.timer = 0;
289
- pending = null;
290
- value = "";
291
- return;
292
- }
293
- pending = v;
294
- box.timer = setTimeout(flush, 150);
295
- }, "k2", $scope0_id);
296
- _html(`<div${_attr_class("_ff")}><input${_attr_input_value($scope0_id, "b", draft, _resume(function(v) {
297
- type(v);
298
- }, "k0", $scope0_id))}${_attr_class(fileFilter)} type=search placeholder="Filter files…" aria-label="Filter files">${_el_resume($scope0_id, "b")}</div>`);
299
- _script($scope0_id, "k3");
300
- writeScope($scope0_id, {
301
- e: _serialize_if($scope0_reason, 1) && input.value,
302
- f: _serialize_if($scope0_reason, 0) && input.valueChange,
303
- h: value,
304
- j: pending,
305
- l: draft,
306
- n: box.timer,
307
- p: flush,
308
- r: type,
309
- i: input.valueChange || void 0
310
- });
311
- _resume_branch($scope0_id);
312
- });
313
251
  //#endregion
314
252
  //#region src/tags/diff-send.marko
315
253
  var diff_send_default = _template("h", (input) => {
@@ -319,7 +257,7 @@ var diff_send_default = _template("h", (input) => {
319
257
  let sendTarget = null;
320
258
  const sessions = input.sessions || [];
321
259
  const sendPick = sessions.some((s) => s.id === sendTarget) ? sendTarget : sessions[0]?.id ?? null;
322
- _html(`<span${_attr_class("_fh")}><button type=button${_attr_class("_l")} title="Copy comments as markdown">Copy${_el_resume($scope0_id, "c")}</button>${_el_resume($scope0_id, "b")}`);
260
+ _html(`<span${_attr_class("_eA")}><button type=button${_attr_class("_l")} title="Copy comments as markdown">Copy${_el_resume($scope0_id, "c")}</button>${_el_resume($scope0_id, "b")}`);
323
261
  _if(() => {
324
262
  if (sessions.length === 1) {
325
263
  const $scope1_id = _scope_id();
@@ -329,11 +267,11 @@ var diff_send_default = _template("h", (input) => {
329
267
  return 0;
330
268
  } else if (sessions.length) {
331
269
  const $scope2_id = _scope_id();
332
- _html(`<span${_attr_class("_fi")}><button type=button${_attr_class(["_m", "_fj"])}${_attr("disabled", sending)}>Send to${_el_resume($scope2_id, "c")}</button>${_el_resume($scope2_id, "b")}`);
270
+ _html(`<span${_attr_class("_eB")}><button type=button${_attr_class(["_m", "_eC"])}${_attr("disabled", sending)}>Send to${_el_resume($scope2_id, "c")}</button>${_el_resume($scope2_id, "b")}`);
333
271
  _attr_select_value($scope2_id, "d", sendTarget, _resume((_new_sendTarget) => {
334
272
  sendTarget = _new_sendTarget;
335
273
  }, "h0", $scope2_id), () => {
336
- _html(`<select${_attr_class("_fk")} aria-label="Send comments to session"${_attr("disabled", sending)}>`);
274
+ _html(`<select${_attr_class("_eD")} aria-label="Send comments to session"${_attr("disabled", sending)}>`);
337
275
  _for_of(sessions, (s) => {
338
276
  const $scope3_id = _scope_id();
339
277
  _html(`<option${_attr_option_value(s.id)}>${_escape(s.title || s.agent)}${_el_resume($scope3_id, "b", $sg__input_sessions)}</option>${_el_resume($scope3_id, "a", $sg__input_sessions)}`);
@@ -1869,9 +1807,9 @@ var diff_find_default = _template("g", (input) => {
1869
1807
  el.select();
1870
1808
  }, 0);
1871
1809
  }, "g5", $scope0_id);
1872
- _html(`<div${_attr_class(["_e2", !open && "_e1"])} aria-hidden=${open ? "false" : "true"}><input${_attr_input_value($scope0_id, "b", query || "", _resume(function(v) {
1810
+ _html(`<div${_attr_class(["_eI", !open && "_eH"])} aria-hidden=${open ? "false" : "true"}><input${_attr_input_value($scope0_id, "b", query || "", _resume(function(v) {
1873
1811
  type(v);
1874
- }, "g0", $scope0_id))}${_attr_class(findInput)} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in review" aria-label="Find in review">${_el_resume($scope0_id, "b")}<span${_attr_class("_e5")}>${open && (query || "").trim() ? hits.length ? `${_escape(`${at + 1}`)}/${_escape(`${hits.length}`)}` : "0/0" : ""}${_el_resume($scope0_id, "d")}</span><button type=button${_attr_class(findIconBtn)} title="Previous match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class(findIconBtn)} title="Next match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "f")}<button type=button${_attr_class(findIconBtn)} title="Close find" tabindex=${open ? "0" : "-1"}>`);
1812
+ }, "g0", $scope0_id))}${_attr_class(findInput)} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in review" aria-label="Find in review">${_el_resume($scope0_id, "b")}<span${_attr_class("_eL")}>${open && (query || "").trim() ? hits.length ? `${_escape(`${at + 1}`)}/${_escape(`${hits.length}`)}` : "0/0" : ""}${_el_resume($scope0_id, "d")}</span><button type=button${_attr_class(findIconBtn)} title="Previous match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class(findIconBtn)} title="Next match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "f")}<button type=button${_attr_class(findIconBtn)} title="Close find" tabindex=${open ? "0" : "-1"}>`);
1875
1813
  icon_xmark_default({ size: 14 });
1876
1814
  _html(`</button>${_el_resume($scope0_id, "g")}</div>${_el_resume($scope0_id, "a")}`);
1877
1815
  _script($scope0_id, "g6");
@@ -1907,11 +1845,75 @@ var diff_find_default = _template("g", (input) => {
1907
1845
  });
1908
1846
  _resume_branch($scope0_id);
1909
1847
  });
1848
+ //#endregion
1849
+ //#region src/client/branch-label.ts
1850
+ /** Fallback label for a workspace branch when the workspace name is not to
1851
+ * hand: `dpiercey-ws-work-4f1hei` → `dpiercey-ws-work`.
1852
+ *
1853
+ * Deliberately only drops the trailing id. The branch is
1854
+ * `{user}-{host}-{slug}-{id}` (server/config.ts `branchPrefix`), and both
1855
+ * user and host are arbitrary — the host is this machine's hostname, so the
1856
+ * `ws-` that used to be matched here was one developer's laptop leaking into
1857
+ * a parser. Callers that know the workspace name should pass it instead. */
1858
+ function shortWorkspaceName(wsBranch) {
1859
+ const name = wsBranch.replace(/^origin\//, "");
1860
+ return dropRandomId(name.includes("/") ? name.slice(name.lastIndexOf("/") + 1) : name);
1861
+ }
1862
+ /** Strip a trailing `-<id>` segment (workspaces.ts:
1863
+ * `Math.random().toString(36).slice(2, 8)`), keeping the input when that
1864
+ * would leave nothing. */
1865
+ function dropRandomId(slug) {
1866
+ return slug.replace(/-[a-z0-9]{1,6}$/i, "") || slug;
1867
+ }
1868
+ /** Topic suffix when `head` is a `-topic` lane under the workspace branch. */
1869
+ function topicLane(head, wsBranch) {
1870
+ if (!wsBranch) return "";
1871
+ const h = head.replace(/^origin\//, "");
1872
+ const ws = wsBranch.replace(/^origin\//, "");
1873
+ if (h.startsWith(`${ws}-`)) return h.slice(ws.length + 1);
1874
+ return "";
1875
+ }
1876
+ function shortHeadFallback(head) {
1877
+ const short = dropRandomId(head);
1878
+ if (short.length <= 20) return short;
1879
+ const parts = short.split("-");
1880
+ return parts.length > 1 ? parts[parts.length - 1] : short;
1881
+ }
1882
+ /**
1883
+ * Review compare parts: render as `main` → `work` `[topic]`, not one chip.
1884
+ */
1885
+ function reviewCompareLabel(base, head, wsBranch = "", wsName = "") {
1886
+ const baseName = (base || "base").replace(/^origin\//, "");
1887
+ const headName = (head || "HEAD").replace(/^origin\//, "");
1888
+ const ws = (wsBranch || "").replace(/^origin\//, "");
1889
+ const onWs = !!ws && (headName === ws || headName.startsWith(`${ws}-`));
1890
+ return {
1891
+ base: baseName,
1892
+ head: onWs ? wsName || shortWorkspaceName(ws) : shortHeadFallback(headName),
1893
+ topic: onWs ? topicLane(headName, ws) : "",
1894
+ title: headName === baseName ? baseName : `${headName} vs ${baseName}`
1895
+ };
1896
+ }
1897
+ /** Short label for "local …" chips (workspace name, plus [topic] if any). */
1898
+ function shortBranch(name, wsBranch = "", wsName = "") {
1899
+ const head = name.replace(/^origin\//, "");
1900
+ if (!head || head === "HEAD") return head || "HEAD";
1901
+ const ws = wsBranch.replace(/^origin\//, "");
1902
+ if (ws && (head === ws || head.startsWith(`${ws}-`))) {
1903
+ const work = wsName || shortWorkspaceName(ws);
1904
+ const topic = topicLane(head, ws);
1905
+ return topic ? `${work} [${topic}]` : work;
1906
+ }
1907
+ return shortHeadFallback(head);
1908
+ }
1909
+ var repoWorktree = "_fU _u";
1910
+ var repoTitle = "_f0 _t";
1911
+ tone.warn;
1910
1912
  var diff_file_default = _template("f", (input) => {
1911
1913
  _scope_reason();
1912
1914
  const $scope0_id = _scope_id();
1913
1915
  _el($scope0_id, "f0");
1914
- _html(`<div${_attr_class(["_fl", input.class])}></div>${_el_resume($scope0_id, "a")}`);
1916
+ _html(`<div${_attr_class(["_gw", input.class])}></div>${_el_resume($scope0_id, "a")}`);
1915
1917
  _script($scope0_id, "f1");
1916
1918
  writeScope($scope0_id, {
1917
1919
  e: input.file,
@@ -1929,65 +1931,471 @@ var diff_file_default = _template("f", (input) => {
1929
1931
  _resume_branch($scope0_id);
1930
1932
  });
1931
1933
  //#endregion
1932
- //#region src/tags/diff-tree.marko
1933
- var diff_tree_default = _template("i", (input) => {
1934
- const $scope0_reason = _scope_reason(), $sg__input_sections = _serialize_guard($scope0_reason, 7), $sg__input_commentKeys__OR__input_sections = _serialize_guard($scope0_reason, 0), $si__input_sections = _serialize_if($scope0_reason, 7), $si__input_commentKeys = _serialize_if($scope0_reason, 6);
1934
+ //#region src/tags/review-section.marko
1935
+ var review_section_default = _template("r", (input) => {
1936
+ const $scope0_reason = _scope_reason(), $sg__input_repo = _serialize_guard($scope0_reason, 30), $si__input_repo = _serialize_if($scope0_reason, 30), $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened = _serialize_guard($scope0_reason, 27), $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName = _serialize_guard($scope0_reason, 12), $sg__input_repo__OR__input_files_length = _serialize_guard($scope0_reason, 0), $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName = _serialize_if($scope0_reason, 12), $sg__input_files__OR__input_shownKeys = _serialize_guard($scope0_reason, 3), $sg__input_files__OR__input_onlyNew = _serialize_guard($scope0_reason, 4), $sg__input_files = _serialize_guard($scope0_reason, 31), $sg__input_files__OR__input_commentsByFile = _serialize_guard($scope0_reason, 5), $si__input_files = _serialize_if($scope0_reason, 31), $si__input_files__OR__input_commentsByFile = _serialize_if($scope0_reason, 5), $si__input_findHit_key = _serialize_if($scope0_reason, 38), $sg__input_collapsible__OR__input_collapsed = _serialize_guard($scope0_reason, 8), $si__input_repo__OR__input_files__OR__input_shownKeys = _serialize_if($scope0_reason, 10), $si__input_collapsible__OR__input_collapsed = _serialize_if($scope0_reason, 8), $si__input_files__OR__input_collapsible__OR__input_collapsed__OR__input_opened = _serialize_if($scope0_reason, 21), $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_localDiffers = _serialize_if($scope0_reason, 20), $si__input_files__OR__input_shownKeys = _serialize_if($scope0_reason, 3), $si__input_files__OR__input_onlyNew = _serialize_if($scope0_reason, 4), $si__input = _serialize_if($scope0_reason, 29), $si__input_draft = _serialize_if($scope0_reason, 40), $si__input_sessions = _serialize_if($scope0_reason, 41), $si__input_onSelect = _serialize_if($scope0_reason, 42), $si__input_onSaveComment = _serialize_if($scope0_reason, 43), $si__input_onSendDraft = _serialize_if($scope0_reason, 44), $si__input_onCancelDraft = _serialize_if($scope0_reason, 45), $si__input_onDeleteComment = _serialize_if($scope0_reason, 46), $si__input_onSendComment = _serialize_if($scope0_reason, 47), $si__input_onError = _serialize_if($scope0_reason, 48), $si__input_shownKeys = _serialize_if($scope0_reason, 32), $si__input_commentsByFile = _serialize_if($scope0_reason, 37), $si__input_findHit_line = _serialize_if($scope0_reason, 39);
1935
1937
  const $scope0_id = _scope_id();
1936
- const $collapsedDirs__closures = /* @__PURE__ */ new Set();
1937
- const $commentKeys__closures = /* @__PURE__ */ new Set();
1938
- const $collapsedRepos__closures = /* @__PURE__ */ new Set();
1939
- let collapsedRepos = input.collapsedRepos;
1940
- let openedRepos = input.openedRepos;
1941
- let collapsedDirs = /* @__PURE__ */ new Set();
1942
- const commentKeys = input.commentKeys || /* @__PURE__ */ new Set();
1943
- _html(`<aside${_attr_class(["_fx", { ["_fw"]: input.open === false }])}>`);
1944
- _for_of(input.sections, (section) => {
1945
- const $scope1_id = _scope_id();
1946
- _html(`<div${_attr_class("_fy")}><button type=button${_attr_class(["_fz", { ["_fw"]: collapsedRepos.has(section.id) }])}><span${_attr_class("_fE")}>${collapsedRepos.has(section.id) ? "▸" : "▾"}${_el_resume($scope1_id, "d")}</span>${_sep($sg__input_sections)}${_escape(section.label)}${_el_resume($scope1_id, "e", $sg__input_sections)}</button>${_el_resume($scope1_id, "b")}`);
1947
- _if(() => {
1948
- if (!collapsedRepos.has(section.id) || openedRepos.has(section.id)) {
1949
- const $scope2_id = _scope_id();
1950
- const $if_content__dirKey__closures = /* @__PURE__ */ new Set();
1951
- const $show = !collapsedRepos.has(section.id);
1952
- _show_start($show, 1);
1953
- const repoRows = treeRows(section.files);
1954
- const dirKey = _resume((path) => `${section.id}/${path}`, "i0", $scope2_id);
1955
- const rowDir = _resume((row) => row.kind === "dir" ? row.path : row.file.path.includes("/") ? row.file.path.slice(0, row.file.path.lastIndexOf("/")) : "", "i1");
1956
- const hiddenByCollapse = _resume((row) => {
1957
- const dir = rowDir(row);
1958
- for (const collapsed of collapsedDirs) {
1959
- const slash = collapsed.indexOf("/");
1960
- const wt = collapsed.slice(0, slash);
1961
- const path = collapsed.slice(slash + 1);
1962
- if (wt !== section.id) continue;
1963
- if (row.kind === "dir" && row.path === path) continue;
1964
- if (dir === path || dir.startsWith(`${path}/`)) return true;
1938
+ const $input__closures = /* @__PURE__ */ new Set();
1939
+ const $input_draft__closures = /* @__PURE__ */ new Set();
1940
+ const $input_sessions__closures = /* @__PURE__ */ new Set();
1941
+ const $input_onSelect__closures = /* @__PURE__ */ new Set();
1942
+ const $input_onSaveComment__closures = /* @__PURE__ */ new Set();
1943
+ const $input_onSendDraft__closures = /* @__PURE__ */ new Set();
1944
+ const $input_onCancelDraft__closures = /* @__PURE__ */ new Set();
1945
+ const $input_onDeleteComment__closures = /* @__PURE__ */ new Set();
1946
+ const $input_onSendComment__closures = /* @__PURE__ */ new Set();
1947
+ const $input_onError__closures = /* @__PURE__ */ new Set();
1948
+ const $input_findHit_key__closures = /* @__PURE__ */ new Set();
1949
+ const $input_shownKeys__closures = /* @__PURE__ */ new Set();
1950
+ const $input_commentsByFile__closures = /* @__PURE__ */ new Set();
1951
+ const $input_findHit_line__closures = /* @__PURE__ */ new Set();
1952
+ const repo = input.repo;
1953
+ const shownFiles = input.files.filter((f) => input.shownKeys.has(f.key));
1954
+ const shownCount = shownFiles.length;
1955
+ const countLabel = shownCount || input.files.length;
1956
+ const stats = (() => {
1957
+ let additions = 0;
1958
+ let deletions = 0;
1959
+ for (const f of shownFiles) {
1960
+ additions += f.additions || 0;
1961
+ deletions += f.deletions || 0;
1962
+ }
1963
+ return {
1964
+ additions,
1965
+ deletions
1966
+ };
1967
+ })();
1968
+ const newCount = input.files.filter((f) => f.changedSince).length;
1969
+ const compare$1 = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch, input.workspaceName);
1970
+ const prTitle = repo.pr ? `${repo.pr.title}: ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}` : "";
1971
+ _html(`<section${_attr_class("_fQ")}${repo.pr ? _attr("data-pr", `${repo.worktree}/${repo.pr.number}`) : ""}${_attr("hidden", !shownCount && !repo.pr && input.findHit?.repo !== repo.id)}><div${_attr_class(["_fR", { ["_fS"]: input.collapsible && input.collapsed }])}>`);
1972
+ _if(() => {
1973
+ if (input.collapsible) {
1974
+ const $scope1_id = _scope_id();
1975
+ _html(`<button type=button${_attr_class("_fT")} aria-expanded=${!input.collapsed ? "true" : "false"} aria-busy=${input.expanding ? "true" : "false"}${input.collapsed ? _attr("title", `Show ${countLabel} files`) : " title=\"Hide files\""}><span${_attr_class([
1976
+ "_gc",
1977
+ !input.collapsed && "_gd",
1978
+ input.expanding && "_ge"
1979
+ ])} aria-hidden=true>${input.collapsed ? "▸" : "▾"}${_el_resume($scope1_id, "c", _serialize_guard($scope0_reason, 35))}</span>${_el_resume($scope1_id, "b", _serialize_guard($scope0_reason, 9))}<span${_attr_class(repoWorktree)}>${_escape(repo.worktree)}${_el_resume($scope1_id, "e", $sg__input_repo)}</span></button>${_el_resume($scope1_id, "a")}`);
1980
+ _script($scope1_id, "r7");
1981
+ writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
1982
+ return 0;
1983
+ } else {
1984
+ const $scope10_id = _scope_id();
1985
+ _html(`<span${_attr_class(repoWorktree)}>${_escape(repo.worktree)}${_el_resume($scope10_id, "b", $sg__input_repo)}</span>`);
1986
+ _serialize_if($scope0_reason, 1) && writeScope($scope10_id, { _: $si__input_repo && _scope_with_id($scope0_id) });
1987
+ return 1;
1988
+ }
1989
+ }, $scope0_id, "c", _serialize_guard($scope0_reason, 1) || _serialize_guard($scope0_reason, 25), _serialize_guard($scope0_reason, 34), $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened, 0, 1);
1990
+ _if(() => {
1991
+ if (repo.pr) {
1992
+ const $scope11_id = _scope_id();
1993
+ _html(`<a${_attr_class(["_p", "_r"])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", prTitle)}>#${_sep($sg__input_repo)}${_escape(repo.pr.number)}${_el_resume($scope11_id, "b", $sg__input_repo)}</a>${_el_resume($scope11_id, "a", $sg__input_repo)}<span${_attr_class(repoTitle)}>${_escape(repo.pr.title)}${_el_resume($scope11_id, "d", $sg__input_repo)}</span>`);
1994
+ $si__input_repo && writeScope($scope11_id, { _: _scope_with_id($scope0_id) });
1995
+ return 0;
1996
+ } else {
1997
+ const $scope12_id = _scope_id();
1998
+ _html(`<span${_attr_class(repoTitle)}>${_escape(repoLabel(repo.full_name))}${_el_resume($scope12_id, "b", $sg__input_repo)}</span>`);
1999
+ $si__input_repo && writeScope($scope12_id, { _: _scope_with_id($scope0_id) });
2000
+ return 1;
2001
+ }
2002
+ }, $scope0_id, "d", $sg__input_repo, $sg__input_repo, $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened);
2003
+ _html(`<span${_attr_class("_f1")}${_attr("title", `${compare$1.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class(["_F", "_f2"])}>${_escape(compare$1.base)}${_el_resume($scope0_id, "g", $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName)}</span><span${_attr_class(["_H", "_f4"])} aria-hidden=true>vs</span><span${_attr_class(["_F", "_f3"])}>${_escape(compare$1.head)}${_el_resume($scope0_id, "j", $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName)}</span>`);
2004
+ _if(() => {
2005
+ if (compare$1.topic) {
2006
+ const $scope15_id = _scope_id();
2007
+ _html(`<span${_attr_class([
2008
+ "_F",
2009
+ tone.accent,
2010
+ "_f5"
2011
+ ])}>${_escape(compare$1.topic)}${_el_resume($scope15_id, "b", $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName)}</span>`);
2012
+ $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName && writeScope($scope15_id, { _: _scope_with_id($scope0_id) });
2013
+ return 0;
2014
+ }
2015
+ }, $scope0_id, "k", $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName, $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName, $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened, 0, 1);
2016
+ _html(`</span>${_el_resume($scope0_id, "e", $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName)}`);
2017
+ _if(() => {
2018
+ if (repo.githubDrift) {
2019
+ const $scope2_id = _scope_id();
2020
+ _html(`<button type=button${_attr_class([
2021
+ "_F",
2022
+ tone.warn,
2023
+ "_f6"
2024
+ ])}${_attr("title", `origin/${repo.pr.headRefName} ${repo.head} · GitHub ${repo.pr.headRefOid}. Reload to re-ask GitHub`)}${_attr("disabled", input.loading)}>behind GitHub ${_sep($sg__input_repo)}${_escape(shortSha(repo.head, 7))}${_el_resume($scope2_id, "b", $sg__input_repo)} → ${_sep($sg__input_repo)}${_escape(shortSha(repo.pr.headRefOid, 7))}${_el_resume($scope2_id, "c", $sg__input_repo)}</button>${_el_resume($scope2_id, "a")}`);
2025
+ _script($scope2_id, "r8");
2026
+ writeScope($scope2_id, { _: _scope_with_id($scope0_id) });
2027
+ return 0;
2028
+ }
2029
+ }, $scope0_id, "l", _serialize_guard($scope0_reason, 2), $sg__input_repo, $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened, 0, 1);
2030
+ _if(() => {
2031
+ if (repo.contained && input.files.length) {
2032
+ const $scope13_id = _scope_id();
2033
+ _html(`<span${_attr_class(["_F", "_f6"])}${_attr("title", `${repo.pr ? `#${repo.pr.number}` : repo.branch} is already in ${repo.base}; showing the working tree only`)}>already in ${_sep($sg__input_repo)}${_escape(repo.base)}${_el_resume($scope13_id, "b", $sg__input_repo)}</span>${_el_resume($scope13_id, "a", $sg__input_repo)}`);
2034
+ _serialize_if($scope0_reason, 0) && writeScope($scope13_id, { _: $si__input_repo && _scope_with_id($scope0_id) });
2035
+ return 0;
2036
+ }
2037
+ }, $scope0_id, "m", $sg__input_repo__OR__input_files_length, $sg__input_repo__OR__input_files_length, $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened, 0, 1);
2038
+ _if(() => {
2039
+ if (input.localDiffers) {
2040
+ const $scope3_id = _scope_id();
2041
+ _html(`<span${_attr_class(["_F", "_f6"])}${_attr("title", `This view is ${shortSha(repo.head)} (${repo.pr.headRefName}); checked out is ${shortSha(repo.localHead)} (${repo.branch})`)}>local ${_sep($sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName)}${_escape(shortBranch(repo.branch, input.workspaceBranch, input.workspaceName))}${_el_resume($scope3_id, "b", $sg__input_repo__OR__input_workspaceBranch__OR__input_workspaceName)} ${_sep($sg__input_repo)}${_escape(shortSha(repo.localHead, 7))}${_el_resume($scope3_id, "c", $sg__input_repo)}</span>${_el_resume($scope3_id, "a", $sg__input_repo)}`);
2042
+ $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_localDiffers && writeScope($scope3_id, { _: $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName && _scope_with_id($scope0_id) });
2043
+ return 0;
2044
+ }
2045
+ }, $scope0_id, "n", _serialize_guard($scope0_reason, 20), _serialize_guard($scope0_reason, 36), $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened, 0, 1);
2046
+ _html(`<span${_attr_class("_fV")}><span>${_escape(countLabel)}${_el_resume($scope0_id, "p", $sg__input_files__OR__input_shownKeys)} file${_sep($sg__input_files__OR__input_shownKeys)}${countLabel === 1 ? "" : "s"}${_el_resume($scope0_id, "q", $sg__input_files__OR__input_shownKeys)}</span>`);
2047
+ _if(() => {
2048
+ if (stats.additions || stats.deletions) {
2049
+ const $scope14_id = _scope_id();
2050
+ _html(`<span${_attr_class("_fW")}>+${_sep($sg__input_files__OR__input_shownKeys)}${_escape(stats.additions)}${_el_resume($scope14_id, "b", $sg__input_files__OR__input_shownKeys)}</span><span${_attr_class("_fX")}>−${_sep($sg__input_files__OR__input_shownKeys)}${_escape(stats.deletions)}${_el_resume($scope14_id, "d", $sg__input_files__OR__input_shownKeys)}</span>`);
2051
+ $si__input_files__OR__input_shownKeys && writeScope($scope14_id, { _: _scope_with_id($scope0_id) });
2052
+ return 0;
2053
+ }
2054
+ }, $scope0_id, "r", $sg__input_files__OR__input_shownKeys, $sg__input_files__OR__input_shownKeys, $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened);
2055
+ _if(() => {
2056
+ if (newCount || input.onlyNew) {
2057
+ const $scope4_id = _scope_id();
2058
+ _html(`<button type=button${_attr_class(["_fZ", { ["_fY"]: input.onlyNew }])} aria-pressed=${input.onlyNew ? "true" : "false"} title=${input.onlyNew ? "\"Show every file\"" : "\"Show only files changed since your last visit\""}>${_escape(newCount)}${_el_resume($scope4_id, "b", $sg__input_files)} new</button>${_el_resume($scope4_id, "a")}`);
2059
+ _script($scope4_id, "r9");
2060
+ writeScope($scope4_id, { _: _scope_with_id($scope0_id) });
2061
+ return 0;
2062
+ }
2063
+ }, $scope0_id, "s", $sg__input_files__OR__input_onlyNew, $sg__input_files__OR__input_onlyNew, $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened, 0, 1);
2064
+ _html(`</span></div>${_el_resume($scope0_id, "b", $sg__input_collapsible__OR__input_collapsed)}`);
2065
+ _if(() => {
2066
+ if (!input.collapsible || !input.collapsed || input.opened) {
2067
+ const $scope5_id = _scope_id();
2068
+ const $show = !input.collapsible || !input.collapsed;
2069
+ _show_start($show);
2070
+ _html(`<div${_attr_class("_f8")}>`);
2071
+ _for_of(input.files, (file$1) => {
2072
+ const $scope6_id = _scope_id();
2073
+ const $for_content__file__closures = /* @__PURE__ */ new Set();
2074
+ const $for_content__file_key__closures = /* @__PURE__ */ new Set();
2075
+ const $for_content__fileComments__closures = /* @__PURE__ */ new Set();
2076
+ const fileComments = input.commentsByFile.get(file$1.key) || [];
2077
+ let expanded = true;
2078
+ _html(`<details${_attr_details_or_dialog_open($scope6_id, "a", expanded)}${_attr_class(["_f9", input.findHit?.key === file$1.key && "_fO"])}${_attr("data-key", file$1.key)}${_attr("hidden", !input.shownKeys.has(file$1.key))}><summary${_attr_class("_ga")}><span${_attr_class("_gf")}${_attr("data-status", file$1.status)}>${_escape(file$1.status)}${_el_resume($scope6_id, "d", $sg__input_files)}</span>${_el_resume($scope6_id, "c", $sg__input_files)}<span${_attr_class(["_gg", input.findHit?.key === file$1.key && input.findHit.line < 1 && "_fP"])}${_attr("title", file$1.path)}><bdi>${_escape(file$1.path)}${_el_resume($scope6_id, "f", $sg__input_files)}</bdi></span>${_el_resume($scope6_id, "e", _serialize_guard($scope0_reason, 16))}`);
2079
+ _if(() => {
2080
+ if (file$1.changedSince) {
2081
+ const $scope17_id = _scope_id();
2082
+ _html(`<span${_attr_class(["_w", "_f7"])} title="Changed since your last visit"></span>`);
2083
+ $si__input_files && writeScope($scope17_id, {});
2084
+ return 0;
1965
2085
  }
1966
- return false;
1967
- }, "i2", $scope2_id);
1968
- _for_of(repoRows, (row) => {
1969
- const $scope3_id = _scope_id();
2086
+ }, $scope6_id, "g", $sg__input_files, $sg__input_files, 1, 0, 1);
2087
+ _if(() => {
2088
+ if (fileComments.length) {
2089
+ const $scope16_id = _scope_id();
2090
+ _html(`<span${_attr_class("_p")}>💬 ${_sep($sg__input_files__OR__input_commentsByFile)}${_escape(fileComments.length)}${_el_resume($scope16_id, "b", $sg__input_files__OR__input_commentsByFile)}</span>`);
2091
+ $si__input_files__OR__input_commentsByFile && writeScope($scope16_id, { _: _scope_with_id($scope6_id) });
2092
+ return 0;
2093
+ }
2094
+ }, $scope6_id, "h", $sg__input_files__OR__input_commentsByFile, $sg__input_files__OR__input_commentsByFile, 1, 0, 1);
2095
+ _html("</summary>");
2096
+ _if(() => {
2097
+ if (file$1.binary) {
2098
+ const $scope18_id = _scope_id();
2099
+ _html(`<p${_attr_class(["_gh", "_f_"])}>binary file</p>`);
2100
+ writeScope($scope18_id, {});
2101
+ return 0;
2102
+ } else if (file$1.tooLarge) {
2103
+ const $scope19_id = _scope_id();
2104
+ _html(`<p${_attr_class(["_gh", "_f_"])}>file too large to display</p>`);
2105
+ writeScope($scope19_id, {});
2106
+ return 1;
2107
+ } else if (file$1.old == null && file$1.new == null) {
2108
+ const $scope20_id = _scope_id();
2109
+ _html(`<p${_attr_class(["_gh", "_f_"])}>file could not be read</p>`);
2110
+ writeScope($scope20_id, {});
2111
+ return 2;
2112
+ } else {
2113
+ const $scope7_id = _scope_id();
2114
+ let near = false;
2115
+ const forceNear = input.findHit?.key === file$1.key;
2116
+ _if(() => {
2117
+ if (!forceNear) {
2118
+ const $scope8_id = _scope_id();
2119
+ _html(`<div${_attr_class(["_gb", "_f_"])}></div>${_el_resume($scope8_id, "a")}`);
2120
+ _script($scope8_id, "r10");
2121
+ _subscribe($si__input && $input__closures, writeScope($scope8_id, {}));
2122
+ return 0;
2123
+ } else {
2124
+ const $scope9_id = _scope_id();
2125
+ const $childScope = _peek_scope_id();
2126
+ diff_file_default({
2127
+ class: "_f_",
2128
+ file: file$1,
2129
+ comments: fileComments,
2130
+ draft: input.draft && input.draft.key === file$1.key ? input.draft : null,
2131
+ sessions: input.sessions,
2132
+ onSelect: _resume(function(range) {
2133
+ input.onSelect(file$1, range);
2134
+ }, "r0", $scope9_id),
2135
+ onSaveComment: _resume(function(text) {
2136
+ input.onSaveComment(file$1, text);
2137
+ }, "r1", $scope9_id),
2138
+ onSendDraft: _resume(function(text, sessionId) {
2139
+ input.onSendDraft(file$1, text, sessionId);
2140
+ }, "r2", $scope9_id),
2141
+ onCancelDraft: _resume(function() {
2142
+ input.onCancelDraft();
2143
+ }, "r3", $scope9_id),
2144
+ onDeleteComment: _resume(function(id) {
2145
+ input.onDeleteComment(id);
2146
+ }, "r4", $scope9_id),
2147
+ onSendComment: _resume(function(id, sessionId) {
2148
+ input.onSendComment(id, sessionId);
2149
+ }, "r5", $scope9_id),
2150
+ onError: _resume(function(message) {
2151
+ input.onError(message);
2152
+ }, "r6", $scope9_id)
2153
+ });
2154
+ _subscribe($si__input_files__OR__input_commentsByFile && $for_content__fileComments__closures, _subscribe($si__input_files && $for_content__file_key__closures, _subscribe($si__input_files && $for_content__file__closures, _subscribe($si__input_onError && $input_onError__closures, _subscribe($si__input_onSendComment && $input_onSendComment__closures, _subscribe($si__input_onDeleteComment && $input_onDeleteComment__closures, _subscribe($si__input_onCancelDraft && $input_onCancelDraft__closures, _subscribe($si__input_onSendDraft && $input_onSendDraft__closures, _subscribe($si__input_onSaveComment && $input_onSaveComment__closures, _subscribe($si__input_onSelect && $input_onSelect__closures, _subscribe($si__input_sessions && $input_sessions__closures, _subscribe($si__input_draft && $input_draft__closures, writeScope($scope9_id, { a: _serialize_if($scope0_reason, 28) && _existing_scope($childScope) })))))))))))));
2155
+ return 1;
2156
+ }
2157
+ }, $scope7_id, "a", 1, 1, 1, 0, 1);
2158
+ _subscribe($si__input_findHit_key && $input_findHit_key__closures, writeScope($scope7_id, {
2159
+ b: _serialize_if($scope0_reason, 6) && near,
2160
+ c: forceNear,
2161
+ Cc7: $si__input_findHit_key && 1
2162
+ }));
2163
+ return 3;
2164
+ }
2165
+ }, $scope6_id, "i");
2166
+ _html(`</details>${_el_resume($scope6_id, "a")}`);
2167
+ _script($scope6_id, "r11");
2168
+ _subscribe($si__input_findHit_line && $input_findHit_line__closures, _subscribe($si__input_findHit_key && $input_findHit_key__closures, _subscribe($si__input_commentsByFile && $input_commentsByFile__closures, _subscribe($si__input_shownKeys && $input_shownKeys__closures, writeScope($scope6_id, {
2169
+ k: file$1,
2170
+ l: file$1?.key,
2171
+ t: file$1?.binary,
2172
+ u: file$1?.tooLarge,
2173
+ v: file$1?.old,
2174
+ w: file$1?.new,
2175
+ x: fileComments,
2176
+ y: $si__input_files__OR__input_commentsByFile && fileComments.length,
2177
+ z: $si__input_files && expanded,
2178
+ _: _scope_with_id($scope5_id),
2179
+ a1: $si__input_files && $for_content__file__closures,
2180
+ a2: $si__input_files && $for_content__file_key__closures,
2181
+ a3: $si__input_files__OR__input_commentsByFile && $for_content__fileComments__closures
2182
+ })))));
2183
+ }, "key", $scope5_id, "b", $sg__input_files, $sg__input_files, $sg__input_files, "</div>", 1);
2184
+ _show_end($scope5_id, "c", $show, $sg__input_collapsible__OR__input_collapsed, $sg__input_collapsible__OR__input_collapsed, 0, 1);
2185
+ writeScope($scope5_id, { _: _scope_with_id($scope0_id) });
2186
+ return 0;
2187
+ }
2188
+ }, $scope0_id, "t", _serialize_guard($scope0_reason, 21), _serialize_guard($scope0_reason, 17), $sg__input_repo__OR__input_files__OR__input_shownKeys__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_collapsible__OR__input_collapsed__OR__input_localDiffers__OR__input_onlyNew__OR__input_opened);
2189
+ _html(`</section>${_el_resume($scope0_id, "a", _serialize_guard($scope0_reason, 18))}`);
2190
+ writeScope($scope0_id, {
2191
+ v: input,
2192
+ x: _serialize_if($scope0_reason, 22) && input.files,
2193
+ y: $si__input_files__OR__input_collapsible__OR__input_collapsed__OR__input_opened && input.shownKeys,
2194
+ a0: $si__input_repo__OR__input_files__OR__input_shownKeys && input.files?.length,
2195
+ a1: _serialize_if($scope0_reason, 14) && input.workspaceBranch,
2196
+ a2: _serialize_if($scope0_reason, 13) && input.workspaceName,
2197
+ a4: $si__input_repo__OR__input_files__OR__input_shownKeys && input.findHit?.repo,
2198
+ a5: _serialize_if($scope0_reason, 17) && input.collapsible,
2199
+ a6: _serialize_if($scope0_reason, 26) && input.collapsed,
2200
+ a8: $si__input_collapsible__OR__input_collapsed && input.expanding,
2201
+ a9: input.onToggle,
2202
+ aa: $si__input_repo && input.loading,
2203
+ ab: input.onReload,
2204
+ ad: $si__input_files__OR__input_onlyNew && input.onlyNew,
2205
+ ae: input.onToggleNew,
2206
+ af: $si__input_collapsible__OR__input_collapsed && input.opened,
2207
+ ah: $si__input_files__OR__input_collapsible__OR__input_collapsed__OR__input_opened && input.commentsByFile,
2208
+ ai: input.findHit?.key,
2209
+ aj: _serialize_if($scope0_reason, 24) && input.findHit?.line,
2210
+ ak: input.draft,
2211
+ al: input.sessions,
2212
+ am: input.onSelect,
2213
+ an: input.onSaveComment,
2214
+ ao: input.onSendDraft,
2215
+ ap: input.onCancelDraft,
2216
+ aq: input.onDeleteComment,
2217
+ ar: input.onSendComment,
2218
+ as: input.onError,
2219
+ au: _serialize_if($scope0_reason, 18) && repo?.pr,
2220
+ av: _serialize_if($scope0_reason, 7) && repo?.pr?.baseRefName,
2221
+ aw: _serialize_if($scope0_reason, 19) && repo?.base,
2222
+ ax: $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_localDiffers && repo?.pr?.headRefName,
2223
+ ay: _serialize_if($scope0_reason, 23) && repo?.branch,
2224
+ b0: $si__input_repo && repo?.pr?.title,
2225
+ b1: $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName__OR__input_localDiffers && repo?.head,
2226
+ b2: $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName && repo?.baseSha,
2227
+ b3: _serialize_if($scope0_reason, 34) && repo?.worktree,
2228
+ b4: $si__input_repo && repo?.pr?.number,
2229
+ b5: _serialize_if($scope0_reason, 15) && repo?.id,
2230
+ b6: $si__input_repo && repo?.pr?.url,
2231
+ b7: $si__input_repo && repo?.full_name,
2232
+ b9: $si__input_repo && repo?.pr?.headRefOid,
2233
+ ba: _serialize_if($scope0_reason, 33) && repo?.contained,
2234
+ bc: _serialize_if($scope0_reason, 36) && repo?.localHead,
2235
+ bf: _serialize_if($scope0_reason, 11) && shownCount,
2236
+ bi: $si__input_collapsible__OR__input_collapsed && countLabel,
2237
+ bk: $si__input_files__OR__input_shownKeys && stats?.additions,
2238
+ bl: $si__input_files__OR__input_shownKeys && stats?.deletions,
2239
+ bn: $si__input_files__OR__input_onlyNew && newCount,
2240
+ bu: $si__input_repo__OR__input_workspaceBranch__OR__input_workspaceName && compare$1?.topic,
2241
+ bv: $si__input_repo && prTitle,
2242
+ bw: $si__input && $input__closures,
2243
+ c9: $si__input_draft && $input_draft__closures,
2244
+ ca: $si__input_sessions && $input_sessions__closures,
2245
+ cb: $si__input_onSelect && $input_onSelect__closures,
2246
+ cc: $si__input_onSaveComment && $input_onSaveComment__closures,
2247
+ cd: $si__input_onSendDraft && $input_onSendDraft__closures,
2248
+ ce: $si__input_onCancelDraft && $input_onCancelDraft__closures,
2249
+ cf: $si__input_onDeleteComment && $input_onDeleteComment__closures,
2250
+ cg: $si__input_onSendComment && $input_onSendComment__closures,
2251
+ ch: $si__input_onError && $input_onError__closures,
2252
+ c7: $si__input_findHit_key && $input_findHit_key__closures,
2253
+ by: $si__input_shownKeys && $input_shownKeys__closures,
2254
+ c6: $si__input_commentsByFile && $input_commentsByFile__closures,
2255
+ c8: $si__input_findHit_line && $input_findHit_line__closures
2256
+ });
2257
+ });
2258
+ var fileFilter = "_gj _i";
2259
+ //#endregion
2260
+ //#region src/tags/file-filter.marko
2261
+ var file_filter_default = _template("k", (input) => {
2262
+ const $scope0_reason = _scope_reason();
2263
+ const $scope0_id = _scope_id();
2264
+ let value = input.value;
2265
+ let pending = null;
2266
+ const draft = (pending ?? value) || "";
2267
+ const box = { timer: 0 };
2268
+ const flush = _resume(() => {
2269
+ if (box.timer) {
2270
+ clearTimeout(box.timer);
2271
+ box.timer = 0;
2272
+ }
2273
+ const next = pending !== null ? pending : value || "";
2274
+ pending = null;
2275
+ value = next;
2276
+ }, "k1", $scope0_id);
2277
+ const type = _resume((v) => {
2278
+ if (box.timer) clearTimeout(box.timer);
2279
+ if (!v) {
2280
+ box.timer = 0;
2281
+ pending = null;
2282
+ value = "";
2283
+ return;
2284
+ }
2285
+ pending = v;
2286
+ box.timer = setTimeout(flush, 150);
2287
+ }, "k2", $scope0_id);
2288
+ _html(`<div${_attr_class("_gi")}><input${_attr_input_value($scope0_id, "b", draft, _resume(function(v) {
2289
+ type(v);
2290
+ }, "k0", $scope0_id))}${_attr_class(fileFilter)} type=search placeholder="Filter files…" aria-label="Filter files">${_el_resume($scope0_id, "b")}</div>`);
2291
+ _script($scope0_id, "k3");
2292
+ writeScope($scope0_id, {
2293
+ e: _serialize_if($scope0_reason, 1) && input.value,
2294
+ f: _serialize_if($scope0_reason, 0) && input.valueChange,
2295
+ h: value,
2296
+ j: pending,
2297
+ l: draft,
2298
+ n: box.timer,
2299
+ p: flush,
2300
+ r: type,
2301
+ i: input.valueChange || void 0
2302
+ });
2303
+ _resume_branch($scope0_id);
2304
+ });
2305
+ //#endregion
2306
+ //#region src/tags/diff-tree.marko
2307
+ var diff_tree_default = _template("i", (input) => {
2308
+ const $scope0_reason = _scope_reason(), $sg__input_sections = _serialize_guard($scope0_reason, 14), $sg__input_newKeys__OR__input_sections = _serialize_guard($scope0_reason, 1), $sg__input_commentKeys__OR__input_newKeys__OR__input_sections = _serialize_guard($scope0_reason, 3), $sg__input_commentKeys__OR__input_sections = _serialize_guard($scope0_reason, 0), $si__input_sections = _serialize_if($scope0_reason, 14), $si__input_commentKeys = _serialize_if($scope0_reason, 11), $si__input_newKeys = _serialize_if($scope0_reason, 12), $si__input_workspaceId__OR__input_scope = _serialize_if($scope0_reason, 2);
2309
+ const $scope0_id = _scope_id();
2310
+ const $collapsedDirs__closures = /* @__PURE__ */ new Set();
2311
+ const $commentKeys__closures = /* @__PURE__ */ new Set();
2312
+ const $newKeys__closures = /* @__PURE__ */ new Set();
2313
+ const $hrefFor2__closures = /* @__PURE__ */ new Set();
2314
+ const $collapsedRepos__closures = /* @__PURE__ */ new Set();
2315
+ let collapsedRepos = input.collapsedRepos;
2316
+ let openedRepos = input.openedRepos;
2317
+ let filter = input.filter;
2318
+ let collapsedDirs = /* @__PURE__ */ new Set();
2319
+ const commentKeys = input.commentKeys || /* @__PURE__ */ new Set();
2320
+ const newKeys = input.newKeys || /* @__PURE__ */ new Set();
2321
+ const hrefFor = _resume((key) => urlFor({
2322
+ workspaceId: input.workspaceId,
2323
+ view: "diff",
2324
+ scope: input.scope ?? null,
2325
+ file: key
2326
+ }), "i0", $scope0_id);
2327
+ _html(`<aside${_attr_class(["_fn", { ["_fm"]: input.open === false }])}><div${_attr_class("_fo")}>`);
2328
+ _set_serialize_reason(2);
2329
+ const $childScope = _peek_scope_id();
2330
+ file_filter_default({
2331
+ value: filter,
2332
+ valueChange: _resume((_new_filter) => {
2333
+ filter = _new_filter;
2334
+ }, "i1", $scope0_id)
2335
+ });
2336
+ _html("</div>");
2337
+ _if(() => {
2338
+ if (!input.sections.length && filter) {
2339
+ const $scope6_id = _scope_id();
2340
+ _html(`<p${_attr_class("_fp")}>No files match.</p>`);
2341
+ writeScope($scope6_id, {});
2342
+ return 0;
2343
+ }
2344
+ }, $scope0_id, "d", 1, 1, 1, 0, 1);
2345
+ _for_of(input.sections, (section) => {
2346
+ const $scope1_id = _scope_id();
2347
+ _html(`<div${_attr_class("_fq")}><button type=button${_attr_class(["_fr", { ["_fm"]: collapsedRepos.has(section.id) }])}><span${_attr_class("_fx")}>${collapsedRepos.has(section.id) ? "▸" : "▾"}${_el_resume($scope1_id, "d")}</span>${_sep($sg__input_sections)}${_escape(section.label)}${_el_resume($scope1_id, "e", $sg__input_sections)}</button>${_el_resume($scope1_id, "b")}`);
2348
+ _if(() => {
2349
+ if (!collapsedRepos.has(section.id) || openedRepos.has(section.id)) {
2350
+ const $scope2_id = _scope_id();
2351
+ const $if_content__dirKey__closures = /* @__PURE__ */ new Set();
2352
+ const $show = !collapsedRepos.has(section.id);
2353
+ _show_start($show, 1);
2354
+ const repoRows = treeRows(section.files);
2355
+ const dirKey = _resume((path) => `${section.id}/${path}`, "i2", $scope2_id);
2356
+ const rowDir = _resume((row) => row.kind === "dir" ? row.path : row.file.path.includes("/") ? row.file.path.slice(0, row.file.path.lastIndexOf("/")) : "", "i3");
2357
+ const hiddenByCollapse = _resume((row) => {
2358
+ const dir = rowDir(row);
2359
+ for (const collapsed of collapsedDirs) {
2360
+ const slash = collapsed.indexOf("/");
2361
+ const wt = collapsed.slice(0, slash);
2362
+ const path = collapsed.slice(slash + 1);
2363
+ if (wt !== section.id) continue;
2364
+ if (row.kind === "dir" && row.path === path) continue;
2365
+ if (dir === path || dir.startsWith(`${path}/`)) return true;
2366
+ }
2367
+ return false;
2368
+ }, "i4", $scope2_id);
2369
+ _for_of(repoRows, (row) => {
2370
+ const $scope3_id = _scope_id();
1970
2371
  _if(() => {
1971
2372
  if (!hiddenByCollapse(row) && row.kind === "dir") {
1972
- const $scope5_id = _scope_id();
1973
- _html(`<button type=button${_attr_class(["_fA", { ["_fw"]: collapsedDirs.has(dirKey(row.path)) }])}${_attr("title", row.path)}${_attr_style(`padding-left:${.35 + row.depth * .75}rem`)}><span${_attr_class("_fE")}>${collapsedDirs.has(dirKey(row.path)) ? "▸" : "▾"}${_el_resume($scope5_id, "c")}</span>${_escape(row.label)}${_el_resume($scope5_id, "d", $sg__input_sections)}/</button>${_el_resume($scope5_id, "a")}`);
1974
- _script($scope5_id, "i3");
1975
- _subscribe($si__input_sections && $if_content__dirKey__closures, _subscribe($collapsedDirs__closures, writeScope($scope5_id, { Cv: 1 })));
2373
+ const $scope4_id = _scope_id();
2374
+ _html(`<button type=button${_attr_class(["_fs", { ["_fm"]: collapsedDirs.has(dirKey(row.path)) }])}${_attr("title", row.path)}${_attr_style(`padding-left:${.35 + row.depth * .75}rem`)}><span${_attr_class("_fx")}>${collapsedDirs.has(dirKey(row.path)) ? "▸" : "▾"}${_el_resume($scope4_id, "c")}</span>${_escape(row.label)}${_el_resume($scope4_id, "d", $sg__input_sections)}/</button>${_el_resume($scope4_id, "a")}`);
2375
+ _script($scope4_id, "i5");
2376
+ _subscribe($si__input_sections && $if_content__dirKey__closures, _subscribe($collapsedDirs__closures, writeScope($scope4_id, { Cab: 1 })));
1976
2377
  return 0;
1977
2378
  } else if (!hiddenByCollapse(row) && row.kind !== "dir") {
1978
- const $scope4_id = _scope_id();
1979
- _html(`<button type=button${_attr_class("_fB")}${_attr("title", row.file.path)}${_attr_style(`padding-left:${.5 + row.depth * .75}rem`)}><span${_attr_class("_fF")}${_attr("data-status", row.file.status)}>${_escape(row.file.status)}${_el_resume($scope4_id, "c", $sg__input_sections)}</span>${_el_resume($scope4_id, "b", $sg__input_sections)}<span${_attr_class("_fC")}>${_escape(row.name)}${_el_resume($scope4_id, "e", $sg__input_sections)}</span>`);
2379
+ const $scope5_id = _scope_id();
2380
+ _html(`<a${_attr("href", hrefFor(row.file.key))}${_attr_class("_ft")}${_attr("title", row.file.path)}${_attr_style(`padding-left:${.5 + row.depth * .75}rem`)}><span${_attr_class("_fy")}${_attr("data-status", row.file.status)}>${_escape(row.file.status)}${_el_resume($scope5_id, "c", $sg__input_sections)}</span>${_el_resume($scope5_id, "b", $sg__input_sections)}<span${_attr_class("_fu")}>${_escape(row.name)}${_el_resume($scope5_id, "e", $sg__input_sections)}</span>`);
2381
+ _if(() => {
2382
+ if (newKeys.has(row.file.key)) {
2383
+ const $scope7_id = _scope_id();
2384
+ _html(`<span${_attr_class(["_w", "_fv"])} title="Changed since your last visit"></span>`);
2385
+ _serialize_if($scope0_reason, 1) && writeScope($scope7_id, {});
2386
+ return 0;
2387
+ }
2388
+ }, $scope5_id, "f", $sg__input_newKeys__OR__input_sections, $sg__input_newKeys__OR__input_sections, $sg__input_commentKeys__OR__input_newKeys__OR__input_sections, 0, 1);
1980
2389
  _if(() => {
1981
2390
  if (commentKeys.has(row.file.key)) {
1982
- const $scope6_id = _scope_id();
1983
- _html(`<span${_attr_class("_fD")}>💬</span>`);
1984
- _serialize_if($scope0_reason, 0) && writeScope($scope6_id, {});
2391
+ const $scope8_id = _scope_id();
2392
+ _html(`<span${_attr_class("_fw")}>💬</span>`);
2393
+ _serialize_if($scope0_reason, 0) && writeScope($scope8_id, {});
1985
2394
  return 0;
1986
2395
  }
1987
- }, $scope4_id, "f", $sg__input_commentKeys__OR__input_sections, $sg__input_commentKeys__OR__input_sections, $sg__input_commentKeys__OR__input_sections, 0, 1);
1988
- _html(`</button>${_el_resume($scope4_id, "a")}`);
1989
- _script($scope4_id, "i4");
1990
- _subscribe($si__input_commentKeys && $commentKeys__closures, writeScope($scope4_id, {}));
2396
+ }, $scope5_id, "g", $sg__input_commentKeys__OR__input_sections, $sg__input_commentKeys__OR__input_sections, $sg__input_commentKeys__OR__input_newKeys__OR__input_sections, 0, 1);
2397
+ _html(`</a>${_el_resume($scope5_id, "a", _serialize_guard($scope0_reason, 4))}`);
2398
+ _subscribe($si__input_workspaceId__OR__input_scope && $hrefFor2__closures, _subscribe($si__input_newKeys && $newKeys__closures, _subscribe($si__input_commentKeys && $commentKeys__closures, writeScope($scope5_id, {}))));
1991
2399
  return 1;
1992
2400
  }
1993
2401
  }, $scope3_id, "a", 1, 1, 1, 0, 1);
@@ -1996,8 +2404,8 @@ var diff_tree_default = _template("i", (input) => {
1996
2404
  e: row?.path,
1997
2405
  f: row?.depth,
1998
2406
  g: row?.label,
1999
- i: row?.file?.path,
2000
- j: row?.file?.key,
2407
+ i: row?.file?.key,
2408
+ j: row?.file?.path,
2001
2409
  k: row?.file?.status,
2002
2410
  l: row?.name,
2003
2411
  _: _scope_with_id($scope2_id)
@@ -2014,81 +2422,159 @@ var diff_tree_default = _template("i", (input) => {
2014
2422
  }
2015
2423
  }, $scope1_id, "f");
2016
2424
  _html("</div>");
2017
- _script($scope1_id, "i5");
2425
+ _script($scope1_id, "i6");
2018
2426
  writeScope($scope1_id, {
2019
2427
  i: section?.id,
2020
2428
  m: section?.files,
2021
2429
  _: _scope_with_id($scope0_id)
2022
2430
  });
2023
- }, "id", $scope0_id, "a", 1, _serialize_guard($scope0_reason, 1), $sg__input_sections, "</aside>", 1);
2431
+ }, "id", $scope0_id, "e", 1, $sg__input_sections, $sg__input_sections, 0, 1);
2432
+ _html(`</aside>${_el_resume($scope0_id, "a", _serialize_guard($scope0_reason, 13))}`);
2024
2433
  writeScope($scope0_id, {
2025
- d: _serialize_if($scope0_reason, 3) && input.collapsedRepos,
2026
- e: _serialize_if($scope0_reason, 2) && input.collapsedReposChange,
2027
- g: _serialize_if($scope0_reason, 5) && input.openedRepos,
2028
- h: _serialize_if($scope0_reason, 4) && input.openedReposChange,
2029
- m: input.onJump,
2030
- n: collapsedRepos,
2031
- p: openedRepos,
2032
- r: collapsedDirs,
2033
- s: commentKeys,
2034
- o: input.collapsedReposChange || void 0,
2035
- q: input.openedReposChange || void 0,
2036
- v: $collapsedDirs__closures,
2037
- w: $si__input_commentKeys && $commentKeys__closures,
2038
- t: $collapsedRepos__closures
2434
+ h: _serialize_if($scope0_reason, 6) && input.collapsedRepos,
2435
+ i: _serialize_if($scope0_reason, 5) && input.collapsedReposChange,
2436
+ k: _serialize_if($scope0_reason, 8) && input.openedRepos,
2437
+ l: _serialize_if($scope0_reason, 7) && input.openedReposChange,
2438
+ n: _serialize_if($scope0_reason, 10) && input.filter,
2439
+ o: _serialize_if($scope0_reason, 9) && input.filterChange,
2440
+ s: input.workspaceId,
2441
+ t: input.scope,
2442
+ x: input.sections?.length,
2443
+ y: collapsedRepos,
2444
+ a0: openedRepos,
2445
+ a2: _serialize_if($scope0_reason, 15) && filter,
2446
+ a5: collapsedDirs,
2447
+ a6: commentKeys,
2448
+ a7: newKeys,
2449
+ a8: hrefFor,
2450
+ z: input.collapsedReposChange || void 0,
2451
+ a1: input.openedReposChange || void 0,
2452
+ a3: input.filterChange || void 0,
2453
+ c: _existing_scope($childScope),
2454
+ ab: $collapsedDirs__closures,
2455
+ ac: $si__input_commentKeys && $commentKeys__closures,
2456
+ ad: $si__input_newKeys && $newKeys__closures,
2457
+ ae: $si__input_workspaceId__OR__input_scope && $hrefFor2__closures,
2458
+ a9: $collapsedRepos__closures
2039
2459
  });
2040
2460
  _resume_branch($scope0_id);
2041
2461
  });
2042
2462
  //#endregion
2043
2463
  //#region src/tags/diff-file-sheet.marko
2044
2464
  var diff_file_sheet_default = _template("e", (input) => {
2045
- const $scope0_reason = _scope_reason(), $sg__input_total__OR__input_files_length = _serialize_guard($scope0_reason, 1), $sg__input_files = _serialize_guard($scope0_reason, 5), $sg__input_commentKeys__OR__input_files = _serialize_guard($scope0_reason, 0), $si__input_commentKeys = _serialize_if($scope0_reason, 4);
2465
+ const $scope0_reason = _scope_reason(), $sg__input_total__OR__input_files_length = _serialize_guard($scope0_reason, 2), $sg__input_files = _serialize_guard($scope0_reason, 12), $sg__input_commentKeys__OR__input_newKeys__OR__input_files = _serialize_guard($scope0_reason, 4), $sg__input_newKeys__OR__input_files = _serialize_guard($scope0_reason, 1), $sg__input_commentKeys__OR__input_files = _serialize_guard($scope0_reason, 0), $si__input_files = _serialize_if($scope0_reason, 12), $sg__input_files_length = _serialize_guard($scope0_reason, 13), $si__input_files_length = _serialize_if($scope0_reason, 13), $si__input_commentKeys = _serialize_if($scope0_reason, 10), $si__input_newKeys = _serialize_if($scope0_reason, 11), $si__input_workspaceId__OR__input_scope = _serialize_if($scope0_reason, 3);
2046
2466
  const $scope0_id = _scope_id();
2047
2467
  const $commentKeys__closures = /* @__PURE__ */ new Set();
2468
+ const $newKeys__closures = /* @__PURE__ */ new Set();
2469
+ const $hrefFor2__closures = /* @__PURE__ */ new Set();
2048
2470
  let open = input.open;
2471
+ let filter = input.filter;
2049
2472
  const commentKeys = input.commentKeys || /* @__PURE__ */ new Set();
2473
+ const newKeys = input.newKeys || /* @__PURE__ */ new Set();
2050
2474
  const total = input.total ?? input.files.length;
2475
+ const hrefFor = _resume((key) => urlFor({
2476
+ workspaceId: input.workspaceId,
2477
+ view: "diff",
2478
+ scope: input.scope ?? null,
2479
+ file: key
2480
+ }), "e0", $scope0_id);
2481
+ const splitKey = _resume((key) => {
2482
+ const slash = key.lastIndexOf("/");
2483
+ return slash < 0 ? {
2484
+ dir: "",
2485
+ name: key
2486
+ } : {
2487
+ dir: key.slice(0, slash),
2488
+ name: key.slice(slash + 1)
2489
+ };
2490
+ }, "e1");
2051
2491
  _if(() => {
2052
2492
  if (open) {
2053
2493
  const $scope1_id = _scope_id();
2054
- _html(`<div${_attr_class("_fo")}></div>${_el_resume($scope1_id, "a")}<div${_attr_class("_fp")} role=dialog aria-label="Jump to file"><div${_attr_class("_fq")}><strong${_attr_class("_fn")}>Files</strong><span${_attr_class("_fr")}>${_escape(input.files.length)}${_el_resume($scope1_id, "f", _serialize_guard($scope0_reason, 6))}${_sep($sg__input_total__OR__input_files_length)}${input.files.length !== total ? ` / ${_escape(`${total}`)}` : ""}${_el_resume($scope1_id, "g", $sg__input_total__OR__input_files_length)}</span><button type=button${_attr_class([iconBtnLg, "_fm"])} title=Close aria-label=Close>`);
2494
+ _html(`<div${_attr_class("_fB")}></div>${_el_resume($scope1_id, "a")}<div${_attr_class("_fC")} role=dialog aria-label="Jump to file"><div${_attr_class("_fD")}><strong${_attr_class("_fA")}>Files</strong><span${_attr_class("_fE")}>${_escape(input.files.length)}${_el_resume($scope1_id, "f", $sg__input_files_length)}${_sep($sg__input_total__OR__input_files_length)}${input.files.length !== total ? ` / ${_escape(`${total}`)}` : ""}${_el_resume($scope1_id, "g", $sg__input_total__OR__input_files_length)}</span><button type=button${_attr_class([iconBtnLg, "_fz"])} title=Close aria-label=Close>`);
2055
2495
  icon_xmark_default({ size: 16 });
2056
- _html(`</button>${_el_resume($scope1_id, "h")}</div><div${_attr_class("_fs")}>`);
2496
+ _html(`</button>${_el_resume($scope1_id, "h")}</div><div${_attr_class("_fK")}>`);
2497
+ _set_serialize_reason(2);
2498
+ const $childScope = _peek_scope_id();
2499
+ file_filter_default({
2500
+ value: filter,
2501
+ valueChange: _resume((_new_filter) => {
2502
+ filter = _new_filter;
2503
+ }, "e2", $scope1_id)
2504
+ });
2505
+ _html(`</div><div${_attr_class("_fF")}>`);
2057
2506
  _for_of(input.files, (file) => {
2058
2507
  const $scope2_id = _scope_id();
2059
- _html(`<button type=button${_attr_class(["_ft", "_u"])}><span${_attr_class("_fv")}${_attr("data-status", file.status)}>${_escape(file.status)}${_el_resume($scope2_id, "c", $sg__input_files)}</span>${_el_resume($scope2_id, "b", $sg__input_files)}<span${_attr_class("_fu")}${_attr("title", file.key)}><bdi>${_escape(file.key)}${_el_resume($scope2_id, "e", $sg__input_files)}</bdi></span>${_el_resume($scope2_id, "d", $sg__input_files)}`);
2508
+ const parts = splitKey(file.key);
2509
+ _html(`<a${_attr("href", hrefFor(file.key))}${_attr_class(["_fG", "_u"])}><span${_attr_class("_fN")}${_attr("data-status", file.status)}>${_escape(file.status)}${_el_resume($scope2_id, "c", $sg__input_files)}</span>${_el_resume($scope2_id, "b", $sg__input_files)}<span${_attr_class("_fH")}>`);
2060
2510
  _if(() => {
2061
- if (commentKeys.has(file.key)) {
2511
+ if (parts.dir) {
2062
2512
  const $scope3_id = _scope_id();
2513
+ _html(`<span${_attr_class("_fI")}><bdi>${_escape(parts.dir)}${_el_resume($scope3_id, "b", $sg__input_files)}/</bdi></span>`);
2514
+ $si__input_files && writeScope($scope3_id, { _: _scope_with_id($scope2_id) });
2515
+ return 0;
2516
+ }
2517
+ }, $scope2_id, "e", $sg__input_files, $sg__input_files, $sg__input_commentKeys__OR__input_newKeys__OR__input_files, 0, 1);
2518
+ _html(`<span${_attr_class("_fJ")}><bdi>${_escape(parts.name)}${_el_resume($scope2_id, "g", $sg__input_files)}</bdi></span></span>`);
2519
+ _if(() => {
2520
+ if (newKeys.has(file.key)) {
2521
+ const $scope4_id = _scope_id();
2522
+ _html(`<span${_attr_class(["_w", "_fM"])} title="Changed since your last visit"></span>`);
2523
+ _serialize_if($scope0_reason, 1) && writeScope($scope4_id, {});
2524
+ return 0;
2525
+ }
2526
+ }, $scope2_id, "h", $sg__input_newKeys__OR__input_files, $sg__input_newKeys__OR__input_files, $sg__input_commentKeys__OR__input_newKeys__OR__input_files, 0, 1);
2527
+ _if(() => {
2528
+ if (commentKeys.has(file.key)) {
2529
+ const $scope5_id = _scope_id();
2063
2530
  _html("<span>💬</span>");
2064
- _serialize_if($scope0_reason, 0) && writeScope($scope3_id, {});
2531
+ _serialize_if($scope0_reason, 0) && writeScope($scope5_id, {});
2065
2532
  return 0;
2066
2533
  }
2067
- }, $scope2_id, "f", $sg__input_commentKeys__OR__input_files, $sg__input_commentKeys__OR__input_files, $sg__input_commentKeys__OR__input_files, 0, 1);
2068
- _html(`</button>${_el_resume($scope2_id, "a")}`);
2069
- _script($scope2_id, "e0");
2070
- _subscribe($si__input_commentKeys && $commentKeys__closures, writeScope($scope2_id, {
2071
- i: file?.key,
2534
+ }, $scope2_id, "i", $sg__input_commentKeys__OR__input_files, $sg__input_commentKeys__OR__input_files, $sg__input_commentKeys__OR__input_newKeys__OR__input_files, 0, 1);
2535
+ _html(`</a>${_el_resume($scope2_id, "a")}`);
2536
+ _script($scope2_id, "e3");
2537
+ _subscribe($si__input_workspaceId__OR__input_scope && $hrefFor2__closures, _subscribe($si__input_newKeys && $newKeys__closures, _subscribe($si__input_commentKeys && $commentKeys__closures, writeScope($scope2_id, {
2538
+ l: _serialize_if($scope0_reason, 5) && file?.key,
2539
+ s: $si__input_files && parts?.dir,
2072
2540
  _: _scope_with_id($scope1_id)
2073
- }));
2074
- }, "key", $scope1_id, "j", $sg__input_files, $sg__input_files, $sg__input_files, "</div>", 1);
2075
- _html("</div>");
2076
- _script($scope1_id, "e1");
2077
- writeScope($scope1_id, {});
2541
+ }))));
2542
+ }, "key", $scope1_id, "m", $sg__input_files, $sg__input_files, $sg__input_files, 0, 1);
2543
+ _if(() => {
2544
+ if (!input.files.length) {
2545
+ const $scope6_id = _scope_id();
2546
+ _html(`<p${_attr_class("_fL")}>No files match.</p>`);
2547
+ $si__input_files_length && writeScope($scope6_id, {});
2548
+ return 0;
2549
+ }
2550
+ }, $scope1_id, "n", $sg__input_files_length, $sg__input_files_length, $sg__input_files_length, 0, 1);
2551
+ _html("</div></div>");
2552
+ _script($scope1_id, "e4");
2553
+ writeScope($scope1_id, { k: _existing_scope($childScope) });
2078
2554
  return 0;
2079
2555
  }
2080
2556
  }, $scope0_id, "a");
2081
2557
  writeScope($scope0_id, {
2082
- d: _serialize_if($scope0_reason, 3) && input.open,
2083
- e: _serialize_if($scope0_reason, 2) && input.openChange,
2084
- h: _serialize_if($scope0_reason, 6) && input.total,
2085
- i: input.files,
2086
- j: input.files?.length,
2087
- l: input.onJump,
2088
- o: commentKeys,
2089
- p: total,
2090
- n: input.openChange || void 0,
2091
- s: $si__input_commentKeys && $commentKeys__closures
2558
+ d: _serialize_if($scope0_reason, 7) && input.open,
2559
+ e: _serialize_if($scope0_reason, 6) && input.openChange,
2560
+ g: _serialize_if($scope0_reason, 9) && input.filter,
2561
+ h: _serialize_if($scope0_reason, 8) && input.filterChange,
2562
+ l: $si__input_files_length && input.total,
2563
+ m: input.files,
2564
+ n: input.files?.length,
2565
+ p: input.workspaceId,
2566
+ q: input.scope,
2567
+ u: filter,
2568
+ w: commentKeys,
2569
+ x: newKeys,
2570
+ y: total,
2571
+ z: hrefFor,
2572
+ a0: splitKey,
2573
+ t: input.openChange || void 0,
2574
+ v: input.filterChange || void 0,
2575
+ a4: $si__input_commentKeys && $commentKeys__closures,
2576
+ a5: $si__input_newKeys && $newKeys__closures,
2577
+ a7: $si__input_workspaceId__OR__input_scope && $hrefFor2__closures
2092
2578
  });
2093
2579
  _resume_branch($scope0_id);
2094
2580
  });
@@ -2099,42 +2585,46 @@ var getTermDims;
2099
2585
  var revealSearchHit;
2100
2586
  var setSearchPaint;
2101
2587
  var diff_view_default = _template("j", (input) => {
2102
- const $scope0_reason = _scope_reason(), $si__input_workspaceBranch = _serialize_if($scope0_reason, 6), $si__input_workspaceName = _serialize_if($scope0_reason, 7), $si__input_sessions = _serialize_if($scope0_reason, 5);
2588
+ const $scope0_reason = _scope_reason(), $si__input_sessions = _serialize_if($scope0_reason, 5), $si__input_workspaceBranch = _serialize_if($scope0_reason, 6), $si__input_workspaceName = _serialize_if($scope0_reason, 7);
2103
2589
  const $scope0_id = _scope_id();
2104
2590
  const $error__closures = /* @__PURE__ */ new Set();
2105
- const $uncommitted__closures = /* @__PURE__ */ new Set();
2106
- const $loading__closures = /* @__PURE__ */ new Set();
2107
- const $driftRepos__closures = /* @__PURE__ */ new Set();
2591
+ const $scope__closures = /* @__PURE__ */ new Set();
2592
+ const $input_sessions__closures = /* @__PURE__ */ new Set();
2108
2593
  const $input_workspaceBranch__closures = /* @__PURE__ */ new Set();
2109
2594
  const $input_workspaceName__closures = /* @__PURE__ */ new Set();
2595
+ const $draft__closures = /* @__PURE__ */ new Set();
2596
+ const $loading__closures = /* @__PURE__ */ new Set();
2597
+ const $onlyNew__closures = /* @__PURE__ */ new Set();
2598
+ const $findState_hit__closures = /* @__PURE__ */ new Set();
2110
2599
  const $collapsedRepos__closures = /* @__PURE__ */ new Set();
2600
+ const $openedRepos__closures = /* @__PURE__ */ new Set();
2111
2601
  const $expandingRepos__closures = /* @__PURE__ */ new Set();
2602
+ const $reload2__closures = /* @__PURE__ */ new Set();
2603
+ const $repoList_length__closures = /* @__PURE__ */ new Set();
2604
+ const $shownKeySet__closures = /* @__PURE__ */ new Set();
2605
+ const $commentsByFile__closures = /* @__PURE__ */ new Set();
2112
2606
  const $localDifferIds__closures = /* @__PURE__ */ new Set();
2113
- const $input_sessions__closures = /* @__PURE__ */ new Set();
2114
- const $draft__closures = /* @__PURE__ */ new Set();
2115
2607
  const $saveComment2__closures = /* @__PURE__ */ new Set();
2116
2608
  const $removeComment2__closures = /* @__PURE__ */ new Set();
2117
- const $sendDraftComment2__closures = /* @__PURE__ */ new Set();
2118
2609
  const $sendOneComment2__closures = /* @__PURE__ */ new Set();
2119
- const $findState_hit_key__closures = /* @__PURE__ */ new Set();
2120
- const $findState_hit_line__closures = /* @__PURE__ */ new Set();
2121
- const $shownKeySet__closures = /* @__PURE__ */ new Set();
2122
- const $commentsByFile__closures = /* @__PURE__ */ new Set();
2123
- const $repoList_length__closures = /* @__PURE__ */ new Set();
2124
- const $findState_hit_repo__closures = /* @__PURE__ */ new Set();
2125
- const $openedRepos__closures = /* @__PURE__ */ new Set();
2610
+ const $sendDraftComment2__closures = /* @__PURE__ */ new Set();
2611
+ const $toggleSection2__closures = /* @__PURE__ */ new Set();
2126
2612
  let repos = null;
2127
2613
  let comments = [];
2128
2614
  let draft = null;
2129
2615
  let error = null;
2130
2616
  let loading = false;
2131
2617
  let fileFilter = "";
2132
- let uncommitted = diffUncommitted();
2618
+ const $filterChange = _resume((_new_fileFilter) => {
2619
+ fileFilter = _new_fileFilter;
2620
+ }, "j1", $scope0_id);
2621
+ let onlyNew = false;
2622
+ let scope$1 = input.scope ?? diffScope();
2133
2623
  let treeOpen = diffTreeOpen();
2134
2624
  let fileSheet = false;
2135
2625
  let findOpen = input.findOpen;
2136
2626
  let findTick = input.findTick || 0;
2137
- const findFocusRef = input.findFocusRef || { focus: _resume(function() {}, "j0") };
2627
+ const findFocusRef = input.findFocusRef || { focus: _resume(function() {}, "j2") };
2138
2628
  let findState = {
2139
2629
  query: "",
2140
2630
  hit: null,
@@ -2143,7 +2633,6 @@ var diff_view_default = _template("j", (input) => {
2143
2633
  let collapsedRepos = /* @__PURE__ */ new Set();
2144
2634
  let openedRepos = /* @__PURE__ */ new Set();
2145
2635
  let expandingRepos = /* @__PURE__ */ new Set();
2146
- let dismissedDrift = /* @__PURE__ */ new Set();
2147
2636
  const nearBox = {
2148
2637
  io: null,
2149
2638
  root: null,
@@ -2182,7 +2671,16 @@ var diff_view_default = _template("j", (input) => {
2182
2671
  cb();
2183
2672
  }
2184
2673
  });
2185
- }, "j1", $scope0_id);
2674
+ }, "j3", $scope0_id);
2675
+ const pinToTop = _resume((el) => {
2676
+ const root = ((scrollEl) => scrollEl())(_el_read_error);
2677
+ if (!root) {
2678
+ el.scrollIntoView({ block: "start" });
2679
+ return;
2680
+ }
2681
+ const top = el.getBoundingClientRect().top - root.getBoundingClientRect().top + root.scrollTop;
2682
+ root.scrollTo({ top: Math.max(0, top - 8) });
2683
+ }, "j4", $scope0_id);
2186
2684
  const focusPrSection = _resume((pr) => {
2187
2685
  if (!pr) return;
2188
2686
  const list = repos || [];
@@ -2203,23 +2701,40 @@ var diff_view_default = _template("j", (input) => {
2203
2701
  if (Date.now() - started < 2500) requestAnimationFrame(tryScroll);
2204
2702
  return;
2205
2703
  }
2206
- const top = el.getBoundingClientRect().top - root.getBoundingClientRect().top + root.scrollTop;
2207
- root.scrollTo({ top: Math.max(0, top - 8) });
2704
+ pinToTop(el);
2208
2705
  };
2209
2706
  requestAnimationFrame(tryScroll);
2210
- }, "j2", $scope0_id);
2707
+ }, "j5", $scope0_id);
2708
+ const openFile = _resume((key) => {
2709
+ const el = ((scrollEl) => scrollEl())(_el_read_error)?.querySelector(`details[data-key="${CSS.escape(key)}"]`);
2710
+ if (el) el.open = true;
2711
+ return el;
2712
+ }, "j6", $scope0_id);
2713
+ const jumpTo = _resume((key) => {
2714
+ input.onFileChange?.(key);
2715
+ const started = Date.now();
2716
+ const tryJump = () => {
2717
+ const el = openFile(key);
2718
+ if (el) {
2719
+ pinToTop(el);
2720
+ return;
2721
+ }
2722
+ if (Date.now() - started < 2500) requestAnimationFrame(tryJump);
2723
+ };
2724
+ tryJump();
2725
+ }, "j7", $scope0_id);
2211
2726
  const headBox = {
2212
2727
  sig: "",
2213
2728
  timer: 0
2214
2729
  };
2215
2730
  const loadBox = { seq: 0 };
2216
- const load = _resume(async (dirty = uncommitted, refresh = false) => {
2731
+ const load = _resume(async (which = scope$1, refresh = false) => {
2217
2732
  const seq = ++loadBox.seq;
2218
2733
  loading = true;
2219
2734
  error = null;
2220
2735
  try {
2221
2736
  const q = new URLSearchParams();
2222
- if (dirty) q.set("uncommitted", "1");
2737
+ if (which !== "committed") q.set("scope", which);
2223
2738
  if (refresh) q.set("refresh", "1");
2224
2739
  const qs = q.size ? `?${q}` : "";
2225
2740
  const [diffData, reviewData] = await Promise.all([api(`/api/workspaces/${input.workspaceId}/diff${qs}`), api(`/api/workspaces/${input.workspaceId}/review`)]);
@@ -2228,13 +2743,21 @@ var diff_view_default = _template("j", (input) => {
2228
2743
  comments = reviewData.comments || [];
2229
2744
  headBox.sig = prHeadSigFromDiff(diffData);
2230
2745
  if (input.focusPr) focusPrSection(input.focusPr);
2746
+ else if (input.focusFile) jumpTo(input.focusFile);
2231
2747
  } catch (err) {
2232
2748
  if (seq !== loadBox.seq) return;
2233
2749
  error = String(err.message || err);
2234
2750
  } finally {
2235
2751
  if (seq === loadBox.seq) loading = false;
2236
2752
  }
2237
- }, "j3", $scope0_id);
2753
+ }, "j8", $scope0_id);
2754
+ const setScope = _resume((next, persist = true) => {
2755
+ if (next === scope$1) return;
2756
+ scope$1 = next;
2757
+ if (persist) setDiffScope(next);
2758
+ input.onScopeChange?.(next);
2759
+ load(next);
2760
+ }, "j9", $scope0_id);
2238
2761
  const sendGate = { busy: 0 };
2239
2762
  const loadReview = _resume(async () => {
2240
2763
  if (sendGate.busy) return;
@@ -2243,43 +2766,49 @@ var diff_view_default = _template("j", (input) => {
2243
2766
  if (sendGate.busy) return;
2244
2767
  comments = reviewData.comments || [];
2245
2768
  } catch {}
2246
- }, "j4", $scope0_id);
2247
- const reload = _resume(() => {
2248
- dismissedDrift = /* @__PURE__ */ new Set();
2249
- return load(uncommitted, true);
2250
- }, "j5", $scope0_id);
2769
+ }, "j10", $scope0_id);
2770
+ const reload = _resume(() => load(scope$1, true), "j11", $scope0_id);
2251
2771
  const reloadSoon = _resume(() => {
2252
2772
  if (headBox.timer) clearTimeout(headBox.timer);
2253
2773
  headBox.timer = setTimeout(() => {
2254
2774
  headBox.timer = 0;
2255
2775
  reload();
2256
2776
  }, 250);
2257
- }, "j6", $scope0_id);
2777
+ }, "j12", $scope0_id);
2778
+ const markSeen = _resume(() => {
2779
+ if (!repos) return;
2780
+ const heads = {};
2781
+ const dirty = {};
2782
+ for (const r of repos) {
2783
+ if (!heads[r.worktree] || !r.pr) heads[r.worktree] = r.head;
2784
+ for (const f of r.files) if (f.hash) dirty[`${r.worktree}/${f.path}`] = f.hash;
2785
+ }
2786
+ fetch(`/api/workspaces/${input.workspaceId}/review`, {
2787
+ method: "POST",
2788
+ headers: { "content-type": "application/json" },
2789
+ body: JSON.stringify({
2790
+ action: "seen",
2791
+ heads,
2792
+ dirty
2793
+ }),
2794
+ keepalive: true
2795
+ }).catch(() => {});
2796
+ }, "j13", $scope0_id);
2258
2797
  const repoList = repos || [];
2259
2798
  const allFiles = repoList.flatMap((r) => r.files.map((f) => ({
2260
2799
  ...f,
2261
2800
  repo: r.id,
2262
2801
  key: `${r.worktree}/${f.path}`
2263
2802
  })));
2803
+ allFiles.filter((f) => f.changedSince).length;
2264
2804
  const fileFiltered = (() => {
2265
2805
  const match = makeFileFilter(fileFilter);
2266
- return allFiles.filter((f) => match(f.key));
2267
- })();
2268
- const lineStats = (() => {
2269
- let additions = 0;
2270
- let deletions = 0;
2271
- for (const f of fileFiltered) {
2272
- additions += f.additions || 0;
2273
- deletions += f.deletions || 0;
2274
- }
2275
- return {
2276
- additions,
2277
- deletions
2278
- };
2806
+ return allFiles.filter((f) => match(f.key) && (!onlyNew || f.changedSince));
2279
2807
  })();
2280
2808
  const findKeys = findState.query.trim() ? new Set(findState.keys) : null;
2281
2809
  const shownFiles = findKeys ? fileFiltered.filter((f) => findKeys.has(f.key) || f.key === findState.hit?.key) : fileFiltered;
2282
2810
  const shownKeySet = new Set(shownFiles.map((f) => f.key));
2811
+ const newKeys = new Set(allFiles.filter((f) => f.changedSince).map((f) => f.key));
2283
2812
  const filesByRepo = new Map(repoList.map((r) => [r.id, allFiles.filter((f) => f.repo === r.id)]));
2284
2813
  const shownByRepo = new Map(repoList.map((r) => [r.id, shownFiles.filter((f) => f.repo === r.id)]));
2285
2814
  const commentsByFile = (() => {
@@ -2296,16 +2825,21 @@ var diff_view_default = _template("j", (input) => {
2296
2825
  label: r.pr ? `${r.worktree} #${r.pr.number}` : r.worktree,
2297
2826
  files: shownByRepo.get(r.id) || []
2298
2827
  }));
2299
- const localDifferList = repoList.filter((repo) => !!repo.pr && !!repo.localHead && (repo.localHead !== repo.head || repo.branch !== repo.pr.headRefName));
2300
- const localDifferIds = new Set(localDifferList.map((r) => r.id));
2301
- const driftRepos = repoList.filter((r) => r.githubDrift && !dismissedDrift.has(r.id));
2302
- const dismissDrift = _resume(() => {
2303
- dismissedDrift = /* @__PURE__ */ new Set([...dismissedDrift, ...driftRepos.map((r) => r.id)]);
2304
- }, "j7", $scope0_id);
2305
- const fileWorktree = _resume((repo) => repo.includes("#") ? repo.split("#")[0] : repo, "j8");
2828
+ const localDifferIds = new Set(repoList.filter((repo) => !!repo.pr && !!repo.localHead && (repo.localHead !== repo.head || repo.branch !== repo.pr.headRefName)).map((r) => r.id));
2829
+ const hasFiles = !repos || allFiles.length > 0;
2830
+ const fileWorktree = _resume((repo) => repo.includes("#") ? repo.split("#")[0] : repo, "j14");
2831
+ const anchorFor = _resume((file, range) => {
2832
+ const section = repoList.find((r) => r.id === file.repo);
2833
+ const source = range.side === "deletions" ? file.old : file.new;
2834
+ return {
2835
+ head: section?.head,
2836
+ snippet: source == null ? void 0 : quoteRange(source, range.start, range.end, range.side === "deletions" ? "deletions" : "additions")
2837
+ };
2838
+ }, "j15", $scope0_id);
2306
2839
  const saveComment = _resume(async (file, text) => {
2307
2840
  const range = draft;
2308
2841
  draft = null;
2842
+ if (!range) return;
2309
2843
  try {
2310
2844
  const comment = await api(`/api/workspaces/${input.workspaceId}/review`, {
2311
2845
  method: "POST",
@@ -2317,70 +2851,70 @@ var diff_view_default = _template("j", (input) => {
2317
2851
  side: range.side,
2318
2852
  line_start: range.start,
2319
2853
  line_end: range.end,
2320
- text: text.trim()
2854
+ text: text.trim(),
2855
+ ...anchorFor(file, range)
2321
2856
  })
2322
2857
  });
2323
2858
  comments = comments.concat(comment);
2324
2859
  } catch (err) {
2325
2860
  error = String(err.message || err);
2326
2861
  }
2327
- }, "j9", $scope0_id);
2862
+ }, "j16", $scope0_id);
2863
+ const deleteRemote = _resume((ids) => ids === "all" ? fetch(`/api/workspaces/${input.workspaceId}/review`, {
2864
+ method: "POST",
2865
+ headers: { "content-type": "application/json" },
2866
+ body: JSON.stringify({ action: "clear" })
2867
+ }) : Promise.all(ids.map((id) => fetch(`/api/workspaces/${input.workspaceId}/review/${id}`, { method: "DELETE" }))), "j17", $scope0_id);
2328
2868
  const removeComment = _resume(async (id) => {
2329
2869
  comments = comments.filter((c) => c.id !== id);
2330
- await fetch(`/api/review-comments/${id}`, { method: "DELETE" });
2331
- }, "j10", $scope0_id);
2332
- const clearComments = _resume(async () => {
2333
- comments = [];
2334
- draft = null;
2335
- await fetch(`/api/workspaces/${input.workspaceId}/review`, {
2336
- method: "POST",
2337
- headers: { "content-type": "application/json" },
2338
- body: JSON.stringify({ action: "clear" })
2339
- });
2340
- }, "j11", $scope0_id);
2341
- const postToSession = _resume(async (list, sessionId) => {
2342
- if (!list.length) return;
2343
- await api(`/api/sessions/${sessionId}/send`, {
2344
- method: "POST",
2345
- headers: { "content-type": "application/json" },
2346
- body: JSON.stringify({
2347
- text: `Please address this review feedback, then summarize what you changed.\n\n${commentMarkdown(list, repos)}`,
2348
- ...getTermDims() || {}
2349
- })
2350
- });
2351
- }, "j12", $scope0_id);
2352
- const copyMarkdown = _resume(async () => {
2353
- if (!await copyText(commentMarkdown(comments, repos))) {
2354
- error = "Copy failed: the clipboard needs HTTPS in this browser.";
2355
- return false;
2356
- }
2357
- await clearComments();
2358
- return true;
2359
- }, "j13", $scope0_id);
2360
- const sendTo = _resume(async (sessionId) => {
2361
- const batch = comments;
2870
+ await deleteRemote([id]).catch(() => {});
2871
+ }, "j18", $scope0_id);
2872
+ const dispatch = _resume(async (list, to, consume) => {
2873
+ if (!list.length) return true;
2362
2874
  sendGate.busy++;
2363
2875
  try {
2364
- await postToSession(batch, sessionId);
2365
- input.onSent?.(sessionId);
2366
- comments = [];
2876
+ const text = commentMarkdown(list, repos);
2877
+ if ("clipboard" in to) {
2878
+ if (!await copyText(text)) {
2879
+ error = "Copy failed: the clipboard needs HTTPS in this browser.";
2880
+ return false;
2881
+ }
2882
+ } else {
2883
+ await api(`/api/sessions/${to.session}/send`, {
2884
+ method: "POST",
2885
+ headers: { "content-type": "application/json" },
2886
+ body: JSON.stringify({
2887
+ text: `Please address this review feedback, then summarize what you changed.\n\n${text}`,
2888
+ ...getTermDims() || {}
2889
+ })
2890
+ });
2891
+ input.onSent?.(to.session);
2892
+ }
2367
2893
  draft = null;
2368
- await fetch(`/api/workspaces/${input.workspaceId}/review`, {
2369
- method: "POST",
2370
- headers: { "content-type": "application/json" },
2371
- body: JSON.stringify({ action: "clear" })
2372
- }).catch(() => {});
2894
+ if (consume === "all") comments = [];
2895
+ else {
2896
+ const gone = new Set(consume);
2897
+ comments = comments.filter((c) => !gone.has(c.id));
2898
+ }
2899
+ if (consume === "all" || consume.length) await deleteRemote(consume).catch(() => {});
2900
+ return true;
2373
2901
  } catch (err) {
2374
2902
  error = String(err.message || err);
2903
+ return false;
2375
2904
  } finally {
2376
2905
  sendGate.busy--;
2377
2906
  }
2378
- }, "j14", $scope0_id);
2379
- const sendDraftComment = _resume(async (file, text, sessionId) => {
2907
+ }, "j19", $scope0_id);
2908
+ const copyMarkdown = _resume(() => dispatch(comments, { clipboard: true }, "all"), "j20", $scope0_id);
2909
+ const sendTo = _resume((sessionId) => dispatch(comments, { session: sessionId }, "all"), "j21", $scope0_id);
2910
+ const sendOneComment = _resume((id, sessionId) => {
2911
+ const comment = comments.find((c) => c.id === id);
2912
+ return comment ? dispatch([comment], { session: sessionId }, [id]) : Promise.resolve(false);
2913
+ }, "j22", $scope0_id);
2914
+ const sendDraftComment = _resume((file, text, sessionId) => {
2380
2915
  const range = draft;
2381
- if (!range) return;
2382
2916
  const trimmed = text.trim();
2383
- if (!trimmed) return;
2917
+ if (!range || !trimmed) return Promise.resolve(false);
2384
2918
  const one = {
2385
2919
  id: -1,
2386
2920
  workspace_id: input.workspaceId,
@@ -2390,47 +2924,16 @@ var diff_view_default = _template("j", (input) => {
2390
2924
  line_start: range.start,
2391
2925
  line_end: range.end,
2392
2926
  text: trimmed,
2393
- created_at: ""
2927
+ created_at: "",
2928
+ ...anchorFor(file, range)
2394
2929
  };
2395
- sendGate.busy++;
2396
- try {
2397
- await postToSession([one], sessionId);
2398
- input.onSent?.(sessionId);
2399
- draft = null;
2400
- } catch (err) {
2401
- error = String(err.message || err);
2402
- } finally {
2403
- sendGate.busy--;
2404
- }
2405
- }, "j15", $scope0_id);
2406
- const sendOneComment = _resume(async (id, sessionId) => {
2407
- const comment = comments.find((c) => c.id === id);
2408
- if (!comment) return;
2409
- sendGate.busy++;
2410
- try {
2411
- await postToSession([comment], sessionId);
2412
- input.onSent?.(sessionId);
2413
- comments = comments.filter((c) => c.id !== id);
2414
- await fetch(`/api/review-comments/${id}`, { method: "DELETE" }).catch(() => {});
2415
- } catch (err) {
2416
- error = String(err.message || err);
2417
- } finally {
2418
- sendGate.busy--;
2419
- }
2420
- }, "j16", $scope0_id);
2421
- const openFile = _resume((key) => {
2422
- const el = ((scrollEl) => scrollEl())(_el_read_error)?.querySelector(`details[data-key="${CSS.escape(key)}"]`);
2423
- if (el) el.open = true;
2424
- return el;
2425
- }, "j17", $scope0_id);
2426
- const jumpTo = _resume((key) => {
2427
- openFile(key)?.scrollIntoView({ block: "start" });
2428
- }, "j18", $scope0_id);
2930
+ return dispatch([one], { session: sessionId }, []);
2931
+ }, "j23", $scope0_id);
2429
2932
  const openFind = _resume(() => {
2430
2933
  findOpen = true;
2431
2934
  findTick++;
2432
2935
  findFocusRef.focus();
2433
- }, "j19", $scope0_id);
2936
+ }, "j24", $scope0_id);
2434
2937
  const onFindState = _resume((next) => {
2435
2938
  findState = next;
2436
2939
  if (!next.hit) return;
@@ -2439,18 +2942,46 @@ var diff_view_default = _template("j", (input) => {
2439
2942
  const el = openFile(hit.key);
2440
2943
  if (!el) return;
2441
2944
  if (hit.line < 1) {
2442
- const root = ((scrollEl) => scrollEl())(_el_read_error);
2443
- if (root) {
2444
- const top = el.getBoundingClientRect().top - root.getBoundingClientRect().top + root.scrollTop;
2445
- root.scrollTo({ top: Math.max(0, top - 8) });
2446
- } else el.scrollIntoView({ block: "start" });
2945
+ pinToTop(el);
2447
2946
  return;
2448
2947
  }
2449
2948
  setSearchPaint(next.query, hit);
2450
2949
  revealSearchHit();
2451
2950
  }, 0);
2452
- }, "j20", $scope0_id);
2453
- _html(`<div${_attr_class("_d8")}><div${_attr_class("_ec")}><div${_attr_class(["_ed", { ["_ef"]: comments.length > 0 }])}><div${_attr_class("_ep")}>`);
2951
+ }, "j25", $scope0_id);
2952
+ const toggleSection = _resume((id) => {
2953
+ if (expandingRepos.has(id)) {
2954
+ const busy = new Set(expandingRepos);
2955
+ busy.delete(id);
2956
+ expandingRepos = busy;
2957
+ if (!collapsedRepos.has(id)) collapsedRepos = /* @__PURE__ */ new Set([...collapsedRepos, id]);
2958
+ return;
2959
+ }
2960
+ if (collapsedRepos.has(id)) {
2961
+ if (openedRepos.has(id)) {
2962
+ const next = new Set(collapsedRepos);
2963
+ next.delete(id);
2964
+ collapsedRepos = next;
2965
+ return;
2966
+ }
2967
+ expandingRepos = /* @__PURE__ */ new Set([...expandingRepos, id]);
2968
+ requestAnimationFrame(() => {
2969
+ requestAnimationFrame(() => {
2970
+ if (!expandingRepos.has(id)) return;
2971
+ const next = new Set(collapsedRepos);
2972
+ next.delete(id);
2973
+ collapsedRepos = next;
2974
+ const done = new Set(expandingRepos);
2975
+ done.delete(id);
2976
+ expandingRepos = done;
2977
+ });
2978
+ });
2979
+ } else {
2980
+ openedRepos = /* @__PURE__ */ new Set([...openedRepos, id]);
2981
+ collapsedRepos = /* @__PURE__ */ new Set([...collapsedRepos, id]);
2982
+ }
2983
+ }, "j26", $scope0_id);
2984
+ _html(`<div${_attr_class("_d8")}><div${_attr_class("_ec")}><div${_attr_class("_ed")}><div${_attr_class(["_en", { ["_em"]: !comments.length }])}>`);
2454
2985
  _if(() => {
2455
2986
  if (input.onExit) {
2456
2987
  const $scope1_id = _scope_id();
@@ -2461,606 +2992,270 @@ var diff_view_default = _template("j", (input) => {
2461
2992
  return 0;
2462
2993
  }
2463
2994
  }, $scope0_id, "e", _serialize_guard($scope0_reason, 0), _serialize_guard($scope0_reason, 4), 1, 0, 1);
2464
- _html(`<h1${_attr_class("_eh")}>Review</h1><div${_attr_class("_eq")}>`);
2465
- _set_serialize_reason(2);
2466
- const $childScope = _peek_scope_id();
2467
- file_filter_default({
2468
- value: fileFilter,
2469
- valueChange: _resume((_new_fileFilter) => {
2470
- fileFilter = _new_fileFilter;
2471
- }, "j21", $scope0_id)
2472
- });
2473
- _html(`</div><div${_attr_class("_eg")}><span${_attr_class("_er")}>`);
2474
- _if(() => {
2475
- if (lineStats.additions || lineStats.deletions) {
2476
- const $scope27_id = _scope_id();
2477
- _html(`<span${_attr_class("_es")}>+<!>${_escape(lineStats.additions)}${_el_resume($scope27_id, "b")}</span><span${_attr_class("_et")}>−<!>${_escape(lineStats.deletions)}${_el_resume($scope27_id, "d")}</span>`);
2478
- writeScope($scope27_id, {});
2479
- return 0;
2480
- } else {
2481
- const $scope29_id = _scope_id();
2482
- _html(`<span${_attr_class("_eu")}>0</span>`);
2483
- writeScope($scope29_id, {});
2484
- return 1;
2485
- }
2486
- }, $scope0_id, "k");
2995
+ _html(`<h1${_attr_class("_eh")}>Review</h1>`);
2487
2996
  _if(() => {
2488
2997
  if (comments.length) {
2489
- const $scope13_id = _scope_id();
2490
- _html(`<span${_attr_class("_ev")}>·</span>${_escape(comments.length)}${_el_resume($scope13_id, "b")} comment<!>${comments.length === 1 ? "" : "s"}${_el_resume($scope13_id, "c")}`);
2491
- writeScope($scope13_id, {});
2998
+ const $scope5_id = _scope_id();
2999
+ _html(`<span${_attr_class("_eg")}>${_escape(comments.length)}${_el_resume($scope5_id, "b")} comment<!>${comments.length === 1 ? "" : "s"}${_el_resume($scope5_id, "c")}</span>`);
3000
+ writeScope($scope5_id, {});
2492
3001
  return 0;
2493
3002
  }
2494
- }, $scope0_id, "l");
2495
- _html("</span></div>");
3003
+ }, $scope0_id, "g", 1, 1, 1, 0, 1);
2496
3004
  _if(() => {
2497
3005
  if (comments.length) {
2498
3006
  const $scope2_id = _scope_id();
3007
+ _html(`<span${_attr_class("_ef")}>`);
2499
3008
  _set_serialize_reason(_serialize_guard($scope0_reason, 5));
2500
- const $childScope2 = _peek_scope_id();
3009
+ const $childScope = _peek_scope_id();
2501
3010
  diff_send_default({
2502
3011
  sessions: input.sessions,
2503
3012
  onCopy: copyMarkdown,
2504
3013
  onSend: sendTo
2505
3014
  });
2506
- writeScope($scope2_id, { a: _existing_scope($childScope2) });
3015
+ _html("</span>");
3016
+ writeScope($scope2_id, { b: _existing_scope($childScope) });
2507
3017
  return 0;
2508
3018
  }
2509
- }, $scope0_id, "m", 1, 1, 1, 0, 1);
2510
- _html(`</div><div${_attr_class("_eb")}><button${_attr_class([
2511
- treeToggle,
2512
- "_d_",
2513
- { ["_d9"]: treeOpen }
2514
- ])} title=${treeOpen ? "\"Hide file tree\"" : "\"Show file tree\""}>`);
2515
- icon_sidebar_default({ size: 14 });
2516
- _html(`</button>${_el_resume($scope0_id, "o")}<button${_attr_class([iconBtnRow, "_d_"])} title="Refresh diff"${_attr("disabled", loading)}>`);
3019
+ }, $scope0_id, "h", 1, 1, 1, 0, 1);
3020
+ _html(`</div>${_el_resume($scope0_id, "d")}<div${_attr_class("_eb")}>`);
3021
+ _if(() => {
3022
+ if (hasFiles) {
3023
+ const $scope12_id = _scope_id();
3024
+ _html(`<button${_attr_class([
3025
+ treeToggle,
3026
+ "_d_",
3027
+ { ["_d9"]: treeOpen }
3028
+ ])} title=${treeOpen ? "\"Hide file tree\"" : "\"Show file tree\""}>`);
3029
+ icon_sidebar_default({ size: 14 });
3030
+ _html(`</button>${_el_resume($scope12_id, "a")}`);
3031
+ _script($scope12_id, "j42");
3032
+ writeScope($scope12_id, {});
3033
+ return 0;
3034
+ }
3035
+ }, $scope0_id, "j", 1, 1, 1, 0, 1);
3036
+ _html(`<button${_attr_class([iconBtnRow, "_d_"])} title="Refresh diff"${_attr("disabled", loading)}>`);
2517
3037
  _set_serialize_reason(1);
2518
- const $childScope3 = _peek_scope_id();
3038
+ const $childScope2 = _peek_scope_id();
2519
3039
  icon_refresh_default({
2520
3040
  size: 14,
2521
3041
  class: loading && "_B"
2522
3042
  });
2523
- _html(`</button>${_el_resume($scope0_id, "q")}<button${_attr_class(["_l", "_eW"])} title="Jump to file">Files (<!>${_escape(shownFiles.length)}${_el_resume($scope0_id, "t")})</button>${_el_resume($scope0_id, "s")}<div${_attr_class("_ew")} role=group aria-label="Review scope"><button type=button${_attr_class(["_ey", { ["_ex"]: !uncommitted }])} aria-pressed=${!uncommitted ? "true" : "false"} title="Committed changes only (base…tip, no working-tree edits)"${_attr("disabled", loading)}>Committed</button>${_el_resume($scope0_id, "v")}<button type=button${_attr_class(["_ey", { ["_ex"]: uncommitted }])} aria-pressed=${uncommitted ? "true" : "false"} title="Include uncommitted and untracked files in the working tree"${_attr("disabled", loading)}>Working tree</button>${_el_resume($scope0_id, "w")}</div><button type=button${_attr_class(["_ez", {
2524
- ["_ex"]: uncommitted,
2525
- ["_2"]: uncommitted
2526
- }])} aria-pressed=${uncommitted ? "true" : "false"} title=${uncommitted ? "\"Working tree, including uncommitted. Switch to committed only\"" : "\"Committed only. Switch to the working tree\""}${_attr("disabled", loading)}>${uncommitted ? "Working tree" : "Committed"}${_el_resume($scope0_id, "y")}</button>${_el_resume($scope0_id, "x")}<div${_attr_class(["_ek", { ["_ej"]: !findOpen }])}>`);
3043
+ _html(`</button>${_el_resume($scope0_id, "k")}`);
3044
+ _if(() => {
3045
+ if (hasFiles) {
3046
+ const $scope13_id = _scope_id();
3047
+ _html(`<button${_attr_class(["_l", "_ez"])} title="Jump to file">Files (<!>${_escape(shownFiles.length)}${_el_resume($scope13_id, "b")})</button>${_el_resume($scope13_id, "a")}`);
3048
+ _script($scope13_id, "j43");
3049
+ writeScope($scope13_id, {});
3050
+ return 0;
3051
+ }
3052
+ }, $scope0_id, "m", 1, 1, 1, 0, 1);
3053
+ _html(`<div${_attr_class("_eo")} role=group aria-label="Review scope"><button type=button${_attr_class(["_eq", { ["_ep"]: scope$1 === "committed" }])} aria-pressed=${scope$1 === "committed" ? "true" : "false"} title="Committed changes only (base…tip, no working-tree edits)"${_attr("disabled", loading)}>Committed</button>${_el_resume($scope0_id, "o")}<button type=button${_attr_class(["_eq", { ["_ep"]: scope$1 === "working" }])} aria-pressed=${scope$1 === "working" ? "true" : "false"} title="Committed changes plus uncommitted and untracked files"${_attr("disabled", loading)}>Working tree</button>${_el_resume($scope0_id, "p")}<button type=button${_attr_class(["_eq", { ["_ep"]: scope$1 === "dirty" }])} aria-pressed=${scope$1 === "dirty" ? "true" : "false"} title="Only uncommitted and untracked files, against HEAD"${_attr("disabled", loading)}>Uncommitted</button>${_el_resume($scope0_id, "q")}</div><span${_attr_class(["_j", "_er"])}>`);
3054
+ _attr_select_value($scope0_id, "s", scope$1, _resume(function(v) {
3055
+ setScope(v);
3056
+ }, "j0", $scope0_id), () => {
3057
+ _html(`<select${_attr_class(["_k", "_es"])} aria-label="Review scope"${_attr("disabled", loading)}><option${_attr_option_value("committed")}>Committed</option><option${_attr_option_value("working")}>Working tree</option><option${_attr_option_value("dirty")}>Uncommitted</option></select>`);
3058
+ });
3059
+ _html(`${_el_resume($scope0_id, "s")}</span><div${_attr_class(["_ek", { ["_ej"]: !findOpen }])}>`);
2527
3060
  _set_serialize_reason(2);
2528
- const $childScope4 = _peek_scope_id();
3061
+ const $childScope3 = _peek_scope_id();
2529
3062
  diff_find_default({
2530
3063
  files: fileFiltered,
2531
3064
  tick: findTick,
2532
3065
  open: findOpen,
2533
3066
  openChange: _resume((_new_findOpen) => {
2534
3067
  findOpen = _new_findOpen;
2535
- }, "j22", $scope0_id),
3068
+ }, "j27", $scope0_id),
2536
3069
  focusRef: findFocusRef,
2537
3070
  stateChange: _resume(function(s) {
2538
3071
  onFindState(s);
2539
- }, "j23", $scope0_id)
3072
+ }, "j28", $scope0_id)
2540
3073
  });
2541
- _html(`</div>${_el_resume($scope0_id, "z")}<button${_attr_class([
2542
- iconBtnRow,
2543
- "_ei",
2544
- "_d_"
2545
- ])} title="Find in review (⌘/Ctrl+F)" aria-label="Find in review"${_attr("hidden", findOpen)}>`);
2546
- icon_search_default({ size: 14 });
2547
- _html(`</button>${_el_resume($scope0_id, "a1")}</div></div>${_el_resume($scope0_id, "c")}<div${_attr_class("_en")} data-diff-main>`);
3074
+ _html(`</div>${_el_resume($scope0_id, "t")}`);
2548
3075
  _if(() => {
2549
- if (error) {
3076
+ if (hasFiles) {
2550
3077
  const $scope14_id = _scope_id();
3078
+ _html(`<button${_attr_class([
3079
+ iconBtnRow,
3080
+ "_ei",
3081
+ "_d_"
3082
+ ])} title="Find in review (⌘/Ctrl+F)" aria-label="Find in review"${_attr("hidden", findOpen)}>`);
3083
+ icon_search_default({ size: 14 });
3084
+ _html(`</button>${_el_resume($scope14_id, "a")}`);
3085
+ _script($scope14_id, "j44");
3086
+ writeScope($scope14_id, {});
3087
+ return 0;
3088
+ }
3089
+ }, $scope0_id, "v", 1, 1, 1, 0, 1);
3090
+ _html(`</div></div><div${_attr_class("_el")} data-diff-main>`);
3091
+ _if(() => {
3092
+ if (error) {
3093
+ const $scope6_id = _scope_id();
2551
3094
  toast_default({
2552
3095
  onDismiss: _resume(function() {
2553
3096
  error = null;
2554
- }, "j24", $scope14_id),
2555
- content: _content_resume("j36", () => {
3097
+ }, "j29", $scope6_id),
3098
+ content: _content_resume("j45", () => {
2556
3099
  _scope_reason();
2557
- const $scope15_id = _scope_id();
2558
- _html(`${_escape(error)}${_el_resume($scope15_id, "a")}`);
2559
- _subscribe($error__closures, writeScope($scope15_id, { _: _scope_with_id($scope14_id) }));
2560
- _resume_branch($scope15_id);
2561
- }, $scope14_id)
3100
+ const $scope7_id = _scope_id();
3101
+ _html(`${_escape(error)}${_el_resume($scope7_id, "a")}`);
3102
+ _subscribe($error__closures, writeScope($scope7_id, { _: _scope_with_id($scope6_id) }));
3103
+ _resume_branch($scope7_id);
3104
+ }, $scope6_id)
2562
3105
  });
2563
- writeScope($scope14_id, {});
3106
+ writeScope($scope6_id, {});
2564
3107
  return 0;
2565
3108
  }
2566
- }, $scope0_id, "a4", 1, 1, 1, 0, 1);
3109
+ }, $scope0_id, "x", 1, 1, 1, 0, 1);
2567
3110
  _if(() => {
2568
3111
  if (!repos && loading) {
2569
- const $scope30_id = _scope_id();
2570
- _html(`<p${_attr_class("_bB")}>Loading diff…</p>`);
2571
- writeScope($scope30_id, {});
3112
+ const $scope15_id = _scope_id();
3113
+ _html(`<div${_attr_class("_eu")} aria-hidden=true><div${_attr_class(["_ev", "_ew"])}></div><div${_attr_class(["_ev", "_ex"])}></div><div${_attr_class(["_ev", "_ey"])}></div><div${_attr_class(["_ev", "_ex"])}></div><div${_attr_class(["_ev", "_ey"])}></div></div>`);
3114
+ writeScope($scope15_id, {});
2572
3115
  return 0;
2573
3116
  }
2574
- }, $scope0_id, "a5", 1, 1, 1, 0, 1);
3117
+ }, $scope0_id, "y", 1, 1, 1, 0, 1);
2575
3118
  _for_of(repoList.filter((r) => r.baseMissing), (repo) => {
2576
- const $scope19_id = _scope_id();
2577
- const $for_content3__repo_base__closures = /* @__PURE__ */ new Set();
3119
+ const $scope9_id = _scope_id();
3120
+ const $for_content2__repo_base__closures = /* @__PURE__ */ new Set();
2578
3121
  _set_serialize_reason(356);
2579
- const $childScope5 = _peek_scope_id();
3122
+ const $childScope4 = _peek_scope_id();
2580
3123
  toast_default({
2581
3124
  kind: "warn",
2582
3125
  placement: "inline",
2583
3126
  title: `${repo.worktree}: base not found`,
2584
- content: _content_resume("j37", () => {
3127
+ content: _content_resume("j46", () => {
2585
3128
  _scope_reason();
2586
- const $scope20_id = _scope_id();
2587
- _html(`${_escape(repo.base)}${_el_resume($scope20_id, "a")}<!>${uncommitted ? ", showing uncommitted changes only" : ""}${_el_resume($scope20_id, "b")}.`);
2588
- _subscribe($for_content3__repo_base__closures, _subscribe($uncommitted__closures, writeScope($scope20_id, { _: _scope_with_id($scope19_id) })));
2589
- _resume_branch($scope20_id);
2590
- }, $scope19_id)
3129
+ const $scope10_id = _scope_id();
3130
+ _html(`${_escape(repo.base)}${_el_resume($scope10_id, "a")}<!>${scope$1 !== "committed" ? ", showing uncommitted changes only" : ""}${_el_resume($scope10_id, "b")}.`);
3131
+ _subscribe($for_content2__repo_base__closures, _subscribe($scope__closures, writeScope($scope10_id, { _: _scope_with_id($scope9_id) })));
3132
+ _resume_branch($scope10_id);
3133
+ }, $scope9_id)
2591
3134
  });
2592
- writeScope($scope19_id, {
3135
+ writeScope($scope9_id, {
2593
3136
  e: repo?.base,
2594
- f: $for_content3__repo_base__closures,
2595
- a: _existing_scope($childScope5)
2596
- });
2597
- }, "id", $scope0_id, "a6", 1, 1, 1, 0, 1);
2598
- _for_of(repoList.filter((r) => r.contained && r.files.length), (repo) => {
2599
- const $scope21_id = _scope_id();
2600
- const $for_content4__repo_base__closures = /* @__PURE__ */ new Set();
2601
- _set_serialize_reason(356);
2602
- const $childScope6 = _peek_scope_id();
2603
- toast_default({
2604
- kind: "info",
2605
- placement: "inline",
2606
- title: repo.pr ? `${repo.worktree} #${repo.pr.number}` : repo.worktree,
2607
- content: _content_resume("j38", () => {
2608
- _scope_reason();
2609
- const $scope22_id = _scope_id();
2610
- _html(`already in <!>${_escape(repo.base)}${_el_resume($scope22_id, "a")}<!>${uncommitted ? ", showing uncommitted changes only" : ""}${_el_resume($scope22_id, "b")}.`);
2611
- _subscribe($for_content4__repo_base__closures, _subscribe($uncommitted__closures, writeScope($scope22_id, {
2612
- _: _scope_with_id($scope21_id),
2613
- Cdw: 1
2614
- })));
2615
- _resume_branch($scope22_id);
2616
- }, $scope21_id)
2617
- });
2618
- writeScope($scope21_id, {
2619
- g: repo?.base,
2620
- h: $for_content4__repo_base__closures,
2621
- a: _existing_scope($childScope6)
2622
- });
2623
- }, "id", $scope0_id, "a7", 1, 1, 1, 0, 1);
2624
- _if(() => {
2625
- if (driftRepos.length) {
2626
- const $scope16_id = _scope_id();
2627
- _set_serialize_reason(4176);
2628
- const $childScope7 = _peek_scope_id();
2629
- toast_default({
2630
- kind: "info",
2631
- placement: "inline",
2632
- title: "GitHub is behind",
2633
- onDismiss: _resume(function() {
2634
- dismissDrift();
2635
- }, "j25", $scope16_id),
2636
- action: attrTag({ content: _content_resume("j40", () => {
2637
- _scope_reason();
2638
- const $scope17_id = _scope_id();
2639
- _html(`<button${_attr_class("_l")}${_attr("disabled", loading)}>${loading ? "Reloading…" : "Reload"}${_el_resume($scope17_id, "b")}</button>${_el_resume($scope17_id, "a")}`);
2640
- _script($scope17_id, "j39");
2641
- _subscribe($loading__closures, writeScope($scope17_id, { _: _scope_with_id($scope16_id) }));
2642
- _resume_branch($scope17_id);
2643
- }, $scope16_id) }),
2644
- content: _content_resume("j41", () => {
2645
- _scope_reason();
2646
- const $scope28_id = _scope_id();
2647
- _html(`<span${_attr_class("_t")}>`);
2648
- _for_of(driftRepos, (repo, i) => {
2649
- const $scope31_id = _scope_id();
2650
- _html(`${i > 0 ? " · " : ""}${_el_resume($scope31_id, "a")}<!>${_escape(repo.worktree)}${_el_resume($scope31_id, "b")} #<!>${_escape(repo.pr.number)}${_el_resume($scope31_id, "c")}`);
2651
- writeScope($scope31_id, {});
2652
- }, "id", $scope28_id, "b");
2653
- _html(` : this view has a newer tip than the PR page.</span><span${_attr_class(["_u", "_eo"])}>`);
2654
- _for_of(driftRepos, (repo, i) => {
2655
- const $scope32_id = _scope_id();
2656
- _html(`<span${_attr("title", `origin/${repo.pr.headRefName} ${repo.head} · GitHub ${repo.pr.headRefOid}`)}>${i > 0 ? " · " : ""}${_el_resume($scope32_id, "b")}<!>${_escape(shortSha(repo.head))}${_el_resume($scope32_id, "c")} → <!>${_escape(shortSha(repo.pr.headRefOid))}${_el_resume($scope32_id, "d")}</span>${_el_resume($scope32_id, "a")}`);
2657
- writeScope($scope32_id, {});
2658
- }, "id", $scope28_id, "c", 1, 1, 1, "</span>", 1);
2659
- _subscribe($driftRepos__closures, writeScope($scope28_id, { _: _scope_with_id($scope16_id) }));
2660
- _resume_branch($scope28_id);
2661
- }, $scope16_id)
2662
- });
2663
- writeScope($scope16_id, { a: _existing_scope($childScope7) });
2664
- return 0;
2665
- }
2666
- }, $scope0_id, "a8", 1, 1, 1, 0, 1);
2667
- _for_of(localDifferList, (repo) => {
2668
- const $scope23_id = _scope_id();
2669
- const $for_content5__repo_head__closures = /* @__PURE__ */ new Set();
2670
- const $for_content5__repo_pr_headRefName__closures = /* @__PURE__ */ new Set();
2671
- const $for_content5__repo_localHead__closures = /* @__PURE__ */ new Set();
2672
- const $for_content5__repo_branch__closures = /* @__PURE__ */ new Set();
2673
- _set_serialize_reason(356);
2674
- const $childScope8 = _peek_scope_id();
2675
- toast_default({
2676
- kind: "info",
2677
- placement: "inline",
2678
- title: `${repo.worktree} #${repo.pr.number}`,
2679
- content: _content_resume("j42", () => {
2680
- _scope_reason();
2681
- const $scope24_id = _scope_id();
2682
- _html(`this view is <!>${_escape(shortSha(repo.head))}${_el_resume($scope24_id, "a")} (<!>${_escape(repo.pr.headRefName)}${_el_resume($scope24_id, "b")}). Local is <!>${_escape(shortSha(repo.localHead))}${_el_resume($scope24_id, "c")} (<!>${_escape(repo.branch)}${_el_resume($scope24_id, "d")}<!>${uncommitted ? ", plus uncommitted" : ""}${_el_resume($scope24_id, "e")}).`);
2683
- _subscribe($for_content5__repo_branch__closures, _subscribe($for_content5__repo_localHead__closures, _subscribe($for_content5__repo_pr_headRefName__closures, _subscribe($for_content5__repo_head__closures, _subscribe($uncommitted__closures, writeScope($scope24_id, {
2684
- _: _scope_with_id($scope23_id),
2685
- Cdw: 2
2686
- }))))));
2687
- _resume_branch($scope24_id);
2688
- }, $scope23_id)
3137
+ f: $for_content2__repo_base__closures,
3138
+ a: _existing_scope($childScope4)
2689
3139
  });
2690
- writeScope($scope23_id, {
2691
- h: repo?.head,
2692
- i: repo?.pr?.headRefName,
2693
- j: repo?.localHead,
2694
- k: repo?.branch,
2695
- l: $for_content5__repo_head__closures,
2696
- m: $for_content5__repo_pr_headRefName__closures,
2697
- n: $for_content5__repo_localHead__closures,
2698
- o: $for_content5__repo_branch__closures,
2699
- a: _existing_scope($childScope8)
2700
- });
2701
- }, "id", $scope0_id, "a9", 1, 1, 1, 0, 1);
3140
+ }, "id", $scope0_id, "z", 1, 1, 1, 0, 1);
2702
3141
  _if(() => {
2703
3142
  if (repos && !allFiles.length) {
2704
- const $scope26_id = _scope_id();
2705
- _html(`<p${_attr_class("_bB")}>${repoList.some((r) => r.pr) ? "No file changes on these PRs." : "No changes vs base."}${_el_resume($scope26_id, "b")}</p>`);
2706
- writeScope($scope26_id, {});
3143
+ const $scope11_id = _scope_id();
3144
+ _html(`<p${_attr_class("_bB")}>${scope$1 === "dirty" ? "Nothing uncommitted." : repoList.some((r) => r.pr) ? "No file changes on these PRs." : "No changes vs base."}${_el_resume($scope11_id, "b")}</p>`);
3145
+ writeScope($scope11_id, {});
2707
3146
  return 0;
2708
3147
  } else if (repos && !shownFiles.length && !findState.hit) {
2709
- const $scope18_id = _scope_id();
2710
- _html(`<p${_attr_class("_bB")}>${findState.query.trim() ? "No matches in review." : `No files match "${_escape(`${fileFilter}`)}".`}${_el_resume($scope18_id, "b")}</p>`);
2711
- writeScope($scope18_id, {});
3148
+ const $scope8_id = _scope_id();
3149
+ _html(`<p${_attr_class("_bB")}>${findState.query.trim() ? "No matches in review." : onlyNew && !fileFilter ? "Nothing changed since your last visit." : `No files match "${_escape(`${fileFilter}`)}".`}${_el_resume($scope8_id, "b")}</p>`);
3150
+ writeScope($scope8_id, {});
2712
3151
  return 1;
2713
3152
  }
2714
- }, $scope0_id, "aa", 1, 1, 1, 0, 1);
3153
+ }, $scope0_id, "a0", 1, 1, 1, 0, 1);
2715
3154
  _for_of(repoList, (repo) => {
2716
3155
  const $scope3_id = _scope_id();
2717
- const $for_content__repo_pr_number__closures = /* @__PURE__ */ new Set();
2718
- const $for_content__repo_pr_url__closures = /* @__PURE__ */ new Set();
2719
- const $for_content__repo_pr_title__closures = /* @__PURE__ */ new Set();
2720
- const $for_content__repo_pr_headRefName__closures = /* @__PURE__ */ new Set();
2721
- const $for_content__repo_head__closures = /* @__PURE__ */ new Set();
2722
- const $for_content__repo_base__closures = /* @__PURE__ */ new Set();
2723
- const $for_content__repo_baseSha__closures = /* @__PURE__ */ new Set();
2724
- const $for_content__repo_full_name__closures = /* @__PURE__ */ new Set();
2725
- const $for_content__repo_branch__closures = /* @__PURE__ */ new Set();
2726
- const $for_content__repo_localHead__closures = /* @__PURE__ */ new Set();
2727
- const $for_content__repo_id__closures = /* @__PURE__ */ new Set();
2728
- const $for_content__repo_pr__closures = /* @__PURE__ */ new Set();
2729
- const $for_content__repo_worktree__closures = /* @__PURE__ */ new Set();
2730
- const $for_content__repo_pr_baseRefName__closures = /* @__PURE__ */ new Set();
2731
- const $for_content__repoFiles_length__closures = /* @__PURE__ */ new Set();
2732
- const $for_content__shownInRepo_length__closures = /* @__PURE__ */ new Set();
2733
- const $for_content__repoFiles__closures = /* @__PURE__ */ new Set();
2734
3156
  const repoFiles = filesByRepo.get(repo.id) || [];
2735
- const shownInRepo = shownByRepo.get(repo.id) || [];
2736
3157
  _if(() => {
2737
- if (repoFiles.length || repo.pr) {
3158
+ if (repoFiles.length || repo.pr && hasFiles) {
2738
3159
  const $scope4_id = _scope_id();
2739
- _html(`<section${_attr_class("_eA")}${repo.pr ? _attr("data-pr", `${repo.worktree}/${repo.pr.number}`) : ""}${_attr("hidden", !shownInRepo.length && !repo.pr && findState.hit?.repo !== repo.id)}>`);
2740
- _if(() => {
2741
- if (repoList.length > 1) {
2742
- const $scope5_id = _scope_id();
2743
- const repoCollapsed = collapsedRepos.has(repo.id);
2744
- const repoExpanding = expandingRepos.has(repo.id);
2745
- _html(`<button type=button${_attr_class(["_eB", repoCollapsed && "_eC"])} aria-expanded=${!repoCollapsed ? "true" : "false"} aria-busy=${repoExpanding ? "true" : "false"}${repoCollapsed ? _attr("title", `Show ${shownInRepo.length || repoFiles.length} files`) : " title=\"Hide files\""}><span${_attr_class([
2746
- "_eR",
2747
- !repoCollapsed && "_eS",
2748
- repoExpanding && "_eT"
2749
- ])} aria-hidden=true>${repoCollapsed ? "▸" : "▾"}${_el_resume($scope5_id, "c")}</span>${_el_resume($scope5_id, "b")}<span${_attr_class(repoWorktree)}>${_escape(repo.worktree)}${_el_resume($scope5_id, "e")}</span>`);
2750
- _if(() => {
2751
- if (repo.pr) {
2752
- const $scope33_id = _scope_id();
2753
- _html(`<a${_attr_class(["_p", "_r"])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", `${repo.pr.title}: ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}`)}>#<!>${_escape(repo.pr.number)}${_el_resume($scope33_id, "b")}</a>${_el_resume($scope33_id, "a")}<span${_attr_class(repoTitle)}>${_escape(repo.pr.title)}${_el_resume($scope33_id, "d")}</span>`);
2754
- _script($scope33_id, "j43");
2755
- _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_pr_title__closures, _subscribe($for_content__repo_pr_url__closures, _subscribe($for_content__repo_pr_number__closures, writeScope($scope33_id, {
2756
- Ca4: 2,
2757
- Ca5: 2,
2758
- Ca6: 2,
2759
- Ca7: 2
2760
- }))))))));
2761
- return 0;
2762
- } else {
2763
- const $scope34_id = _scope_id();
2764
- _html(`<span${_attr_class(repoTitle)}>${_escape(repoLabel(repo.full_name))}${_el_resume($scope34_id, "b")}</span>`);
2765
- _subscribe($for_content__repo_full_name__closures, writeScope($scope34_id, {}));
2766
- return 1;
2767
- }
2768
- }, $scope5_id, "f");
2769
- const compare$1 = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch || "", input.workspaceName || "");
2770
- _html(`<span${_attr_class("_eH")}${_attr("title", `${compare$1.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class(["_F", "_eI"])}>${_escape(compare$1.base)}${_el_resume($scope5_id, "i")}</span><span${_attr_class(["_H", "_eK"])} aria-hidden=true>vs</span><span${_attr_class(["_F", "_eJ"])}>${_escape(compare$1.head)}${_el_resume($scope5_id, "l")}</span>`);
2771
- _if(() => {
2772
- if (compare$1.topic) {
2773
- const $scope36_id = _scope_id();
2774
- _html(`<span${_attr_class([
2775
- "_F",
2776
- tone.accent,
2777
- "_eL"
2778
- ])}>${_escape(compare$1.topic)}${_el_resume($scope36_id, "b")}</span>`);
2779
- writeScope($scope36_id, {});
2780
- return 0;
2781
- }
2782
- }, $scope5_id, "m", 1, 1, 1, 0, 1);
2783
- _html(`</span>${_el_resume($scope5_id, "g")}`);
2784
- _if(() => {
2785
- if (localDifferIds.has(repo.id)) {
2786
- const $scope6_id = _scope_id();
2787
- _html(`<span${_attr_class("_p")}${_attr("title", `checked out ${repo.branch} ${repo.localHead}`)}>local <!>${_escape(shortBranch(repo.branch, input.workspaceBranch || "", input.workspaceName || ""))}${_el_resume($scope6_id, "b")}</span>${_el_resume($scope6_id, "a")}`);
2788
- _subscribe($for_content__repo_localHead__closures, _subscribe($for_content__repo_branch__closures, _subscribe($si__input_workspaceName && $input_workspaceName__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope6_id, {
2789
- Cdp: $si__input_workspaceBranch && 1,
2790
- Cdq: $si__input_workspaceName && 1,
2791
- Caa: 1
2792
- })))));
2793
- return 0;
2794
- }
2795
- }, $scope5_id, "n", 1, 1, 1, 0, 1);
2796
- _html(`<span${_attr_class("_eE")}>${_escape(shownInRepo.length || repoFiles.length)}${_el_resume($scope5_id, "p")} file<!>${(shownInRepo.length || repoFiles.length) === 1 ? "" : "s"}${_el_resume($scope5_id, "q")}</span></button>${_el_resume($scope5_id, "a")}`);
2797
- _script($scope5_id, "j44");
2798
- _subscribe($for_content__shownInRepo_length__closures, _subscribe($for_content__repoFiles_length__closures, _subscribe($for_content__repo_branch__closures, _subscribe($for_content__repo_pr_baseRefName__closures, _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_worktree__closures, _subscribe($for_content__repo_pr__closures, _subscribe($for_content__repo_id__closures, _subscribe($localDifferIds__closures, _subscribe($expandingRepos__closures, _subscribe($collapsedRepos__closures, _subscribe($si__input_workspaceName && $input_workspaceName__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope5_id, {
2799
- r: repoCollapsed,
2800
- t: repoExpanding,
2801
- a0: compare$1?.topic,
2802
- Ce1: 1
2803
- })))))))))))))))));
2804
- return 0;
2805
- } else {
2806
- const $scope7_id = _scope_id();
2807
- _html(`<p${_attr_class("_eG")}>`);
2808
- _if(() => {
2809
- if (repo.pr) {
2810
- const $scope35_id = _scope_id();
2811
- _html(`<a${_attr_class(["_p", "_r"])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", `${repo.pr.title}: ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}`)}>#<!>${_escape(repo.pr.number)}${_el_resume($scope35_id, "b")}</a>${_el_resume($scope35_id, "a")}<span${_attr_class("_t")}>${_escape(repo.pr.title)}${_el_resume($scope35_id, "d")}</span>`);
2812
- _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_pr_title__closures, _subscribe($for_content__repo_pr_url__closures, _subscribe($for_content__repo_pr_number__closures, writeScope($scope35_id, {
2813
- Ca1: 1,
2814
- Ca2: 1,
2815
- Ca3: 1,
2816
- Ca4: 3,
2817
- Ca5: 3,
2818
- Ca6: 3,
2819
- Ca7: 3
2820
- }))))))));
2821
- return 0;
2822
- }
2823
- }, $scope7_id, "b");
2824
- const compare$2 = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch || "", input.workspaceName || "");
2825
- _html(`<span${_attr_class("_eH")}${_attr("title", `${compare$2.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class(["_F", "_eI"])}>${_escape(compare$2.base)}${_el_resume($scope7_id, "e")}</span><span${_attr_class(["_H", "_eK"])} aria-hidden=true>vs</span><span${_attr_class(["_F", "_eJ"])}>${_escape(compare$2.head)}${_el_resume($scope7_id, "h")}</span>`);
2826
- _if(() => {
2827
- if (compare$2.topic) {
2828
- const $scope37_id = _scope_id();
2829
- _html(`<span${_attr_class([
2830
- "_F",
2831
- tone.accent,
2832
- "_eL"
2833
- ])}>${_escape(compare$2.topic)}${_el_resume($scope37_id, "b")}</span>`);
2834
- writeScope($scope37_id, {});
2835
- return 0;
2836
- }
2837
- }, $scope7_id, "i", 1, 1, 1, 0, 1);
2838
- _html(`</span>${_el_resume($scope7_id, "c")}`);
2839
- _if(() => {
2840
- if (localDifferIds.has(repo.id)) {
2841
- const $scope8_id = _scope_id();
2842
- _html(`<span${_attr_class("_p")}${_attr("title", `checked out ${repo.branch} ${repo.localHead}`)}>local <!>${_escape(shortBranch(repo.branch, input.workspaceBranch || "", input.workspaceName || ""))}${_el_resume($scope8_id, "b")}</span>${_el_resume($scope8_id, "a")}`);
2843
- _subscribe($for_content__repo_localHead__closures, _subscribe($for_content__repo_branch__closures, _subscribe($si__input_workspaceName && $input_workspaceName__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope8_id, {
2844
- Cdp: $si__input_workspaceBranch && 3,
2845
- Cdq: $si__input_workspaceName && 3,
2846
- Caa: 3,
2847
- Cab: 1
2848
- })))));
2849
- return 0;
2850
- }
2851
- }, $scope7_id, "j", 1, 1, 1, 0, 1);
2852
- _html("</p>");
2853
- _subscribe($for_content__repo_branch__closures, _subscribe($for_content__repo_pr_baseRefName__closures, _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_pr__closures, _subscribe($for_content__repo_id__closures, _subscribe($localDifferIds__closures, _subscribe($si__input_workspaceName && $input_workspaceName__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope7_id, {
2854
- p: compare$2?.topic,
2855
- Cdp: $si__input_workspaceBranch && 2,
2856
- Cdq: $si__input_workspaceName && 2,
2857
- Ced: 1,
2858
- Cy: 1,
2859
- Cz: 1,
2860
- Ca4: 1,
2861
- Ca5: 1,
2862
- Ca6: 1,
2863
- Ca7: 1,
2864
- Ca9: 1,
2865
- Caa: 2
2866
- }))))))))))));
2867
- return 1;
2868
- }
2869
- }, $scope4_id, "b", 1, 1, 1, 0, 1);
2870
- _if(() => {
2871
- if (repoList.length === 1 || !collapsedRepos.has(repo.id) || openedRepos.has(repo.id)) {
2872
- const $scope9_id = _scope_id();
2873
- const $show = repoList.length === 1 || !collapsedRepos.has(repo.id);
2874
- _show_start($show);
2875
- _html(`<div${_attr_class("_eM")}>`);
2876
- _for_of(repoFiles, (file$1) => {
2877
- const $scope10_id = _scope_id();
2878
- const $for_content2__file__closures = /* @__PURE__ */ new Set();
2879
- const $for_content2__file_key__closures = /* @__PURE__ */ new Set();
2880
- const $for_content2__fileComments__closures = /* @__PURE__ */ new Set();
2881
- const fileComments = commentsByFile.get(file$1.key) || [];
2882
- let expanded = true;
2883
- _html(`<details${_attr_details_or_dialog_open($scope10_id, "a", expanded)}${_attr_class(["_eN", findState.hit?.key === file$1.key && "_el"])}${_attr("data-key", file$1.key)}${_attr("hidden", !shownKeySet.has(file$1.key))}><summary${_attr_class("_eP")}><span${_attr_class("_eU")}${_attr("data-status", file$1.status)}>${_escape(file$1.status)}${_el_resume($scope10_id, "d")}</span>${_el_resume($scope10_id, "c")}<span${_attr_class(["_eV", findState.hit?.key === file$1.key && findState.hit.line < 1 && "_em"])}${_attr("title", file$1.path)}><bdi>${_escape(file$1.path)}${_el_resume($scope10_id, "f")}</bdi></span>${_el_resume($scope10_id, "e")}`);
2884
- _if(() => {
2885
- if (fileComments.length) {
2886
- const $scope38_id = _scope_id();
2887
- _html(`<span${_attr_class("_p")}>💬 <!>${_escape(fileComments.length)}${_el_resume($scope38_id, "b")}</span>`);
2888
- writeScope($scope38_id, {});
2889
- return 0;
2890
- }
2891
- }, $scope10_id, "g", 1, 1, 1, 0, 1);
2892
- _html("</summary>");
2893
- _if(() => {
2894
- if (file$1.binary) {
2895
- const $scope39_id = _scope_id();
2896
- _html(`<p${_attr_class(["_eX", "_eO"])}>binary file</p>`);
2897
- writeScope($scope39_id, {});
2898
- return 0;
2899
- } else if (file$1.tooLarge) {
2900
- const $scope40_id = _scope_id();
2901
- _html(`<p${_attr_class(["_eX", "_eO"])}>file too large to display</p>`);
2902
- writeScope($scope40_id, {});
2903
- return 1;
2904
- } else if (file$1.old == null && file$1.new == null) {
2905
- const $scope41_id = _scope_id();
2906
- _html(`<p${_attr_class(["_eX", "_eO"])}>file could not be read</p>`);
2907
- writeScope($scope41_id, {});
2908
- return 2;
2909
- } else {
2910
- const $scope11_id = _scope_id();
2911
- let near = false;
2912
- const forceNear = findState.hit?.key === file$1.key;
2913
- _if(() => {
2914
- if (!forceNear) {
2915
- const $scope25_id = _scope_id();
2916
- _html(`<div${_attr_class(["_eQ", "_eO"])}></div>${_el_resume($scope25_id, "a")}`);
2917
- _script($scope25_id, "j45");
2918
- writeScope($scope25_id, {});
2919
- return 0;
2920
- } else {
2921
- const $scope12_id = _scope_id();
2922
- const $childScope9 = _peek_scope_id();
2923
- diff_file_default({
2924
- class: "_eO",
2925
- file: file$1,
2926
- comments: fileComments,
2927
- draft: draft && draft.key === file$1.key ? draft : null,
2928
- sessions: input.sessions || [],
2929
- onSelect: _resume(function(range) {
2930
- draft = {
2931
- key: file$1.key,
2932
- side: range.side || "additions",
2933
- start: Math.min(range.start, range.end),
2934
- end: Math.max(range.start, range.end)
2935
- };
2936
- }, "j26", $scope12_id),
2937
- onSaveComment: _resume(function(text) {
2938
- saveComment(file$1, text);
2939
- }, "j27", $scope12_id),
2940
- onSendDraft: _resume(function(text, sessionId) {
2941
- sendDraftComment(file$1, text, sessionId);
2942
- }, "j28", $scope12_id),
2943
- onCancelDraft: _resume(function() {
2944
- draft = null;
2945
- }, "j29", $scope12_id),
2946
- onDeleteComment: _resume(function(id) {
2947
- removeComment(id);
2948
- }, "j30", $scope12_id),
2949
- onSendComment: _resume(function(id, sessionId) {
2950
- sendOneComment(id, sessionId);
2951
- }, "j31", $scope12_id),
2952
- onError: _resume(function(message) {
2953
- error = message;
2954
- }, "j32", $scope12_id)
2955
- });
2956
- _subscribe($for_content2__fileComments__closures, _subscribe($for_content2__file_key__closures, _subscribe($for_content2__file__closures, _subscribe($sendOneComment2__closures, _subscribe($sendDraftComment2__closures, _subscribe($removeComment2__closures, _subscribe($saveComment2__closures, _subscribe($draft__closures, _subscribe($si__input_sessions && $input_sessions__closures, writeScope($scope12_id, { a: _existing_scope($childScope9) }))))))))));
2957
- return 1;
2958
- }
2959
- }, $scope11_id, "a", 1, 1, 1, 0, 1);
2960
- _subscribe($findState_hit_key__closures, writeScope($scope11_id, {
2961
- b: near,
2962
- c: forceNear,
2963
- Cdy: 1
2964
- }));
2965
- return 3;
2966
- }
2967
- }, $scope10_id, "h");
2968
- _html(`</details>${_el_resume($scope10_id, "a")}`);
2969
- _script($scope10_id, "j46");
2970
- _subscribe($commentsByFile__closures, _subscribe($shownKeySet__closures, _subscribe($findState_hit_line__closures, _subscribe($findState_hit_key__closures, writeScope($scope10_id, {
2971
- j: file$1,
2972
- k: file$1?.key,
2973
- r: file$1?.binary,
2974
- s: file$1?.tooLarge,
2975
- t: file$1?.old,
2976
- u: file$1?.new,
2977
- v: fileComments,
2978
- w: fileComments.length,
2979
- x: expanded,
2980
- z: $for_content2__file__closures,
2981
- a0: $for_content2__file_key__closures,
2982
- a1: $for_content2__fileComments__closures
2983
- })))));
2984
- }, "key", $scope9_id, "b", 1, 1, 1, "</div>", 1);
2985
- _show_end($scope9_id, "c", $show, 1, 1, 0, 1);
2986
- _subscribe($for_content__repoFiles__closures, _subscribe($for_content__repo_id__closures, _subscribe($repoList_length__closures, _subscribe($collapsedRepos__closures, writeScope($scope9_id, {
2987
- Ce1: 2,
2988
- Ce6: 1,
2989
- Cy: 2
2990
- })))));
2991
- return 0;
2992
- }
2993
- }, $scope4_id, "c");
2994
- _html(`</section>${_el_resume($scope4_id, "a")}`);
2995
- _subscribe($repoList_length__closures, _subscribe($openedRepos__closures, _subscribe($collapsedRepos__closures, _subscribe($findState_hit_repo__closures, writeScope($scope4_id, {})))));
3160
+ _set_serialize_reason(1);
3161
+ const $childScope5 = _peek_scope_id();
3162
+ review_section_default({
3163
+ repo,
3164
+ files: repoFiles,
3165
+ shownKeys: shownKeySet,
3166
+ collapsible: repoList.length > 1,
3167
+ collapsed: collapsedRepos.has(repo.id),
3168
+ expanding: expandingRepos.has(repo.id),
3169
+ opened: openedRepos.has(repo.id),
3170
+ onToggle: _resume(function() {
3171
+ toggleSection(repo.id);
3172
+ }, "j30", $scope4_id),
3173
+ workspaceBranch: input.workspaceBranch || "",
3174
+ workspaceName: input.workspaceName || "",
3175
+ localDiffers: localDifferIds.has(repo.id),
3176
+ onlyNew,
3177
+ onToggleNew: _resume(function() {
3178
+ onlyNew = !onlyNew;
3179
+ }, "j31", $scope4_id),
3180
+ onReload: reload,
3181
+ loading,
3182
+ findHit: findState.hit,
3183
+ commentsByFile,
3184
+ draft,
3185
+ sessions: input.sessions || [],
3186
+ observeNear,
3187
+ onSelect: _resume(function(file, range) {
3188
+ draft = {
3189
+ key: file.key,
3190
+ side: range.side || "additions",
3191
+ start: Math.min(range.start, range.end),
3192
+ end: Math.max(range.start, range.end)
3193
+ };
3194
+ }, "j32", $scope4_id),
3195
+ onSaveComment: _resume(function(file, text) {
3196
+ saveComment(file, text);
3197
+ }, "j33", $scope4_id),
3198
+ onSendDraft: _resume(function(file, text, sessionId) {
3199
+ sendDraftComment(file, text, sessionId);
3200
+ }, "j34", $scope4_id),
3201
+ onCancelDraft: _resume(function() {
3202
+ draft = null;
3203
+ }, "j35", $scope4_id),
3204
+ onDeleteComment: _resume(function(id) {
3205
+ removeComment(id);
3206
+ }, "j36", $scope4_id),
3207
+ onSendComment: _resume(function(id, sessionId) {
3208
+ sendOneComment(id, sessionId);
3209
+ }, "j37", $scope4_id),
3210
+ onError: _resume(function(message) {
3211
+ error = message;
3212
+ }, "j38", $scope4_id)
3213
+ });
3214
+ _subscribe($toggleSection2__closures, _subscribe($sendDraftComment2__closures, _subscribe($sendOneComment2__closures, _subscribe($removeComment2__closures, _subscribe($saveComment2__closures, _subscribe($localDifferIds__closures, _subscribe($commentsByFile__closures, _subscribe($shownKeySet__closures, _subscribe($repoList_length__closures, _subscribe($reload2__closures, _subscribe($expandingRepos__closures, _subscribe($openedRepos__closures, _subscribe($collapsedRepos__closures, _subscribe($findState_hit__closures, _subscribe($onlyNew__closures, _subscribe($loading__closures, _subscribe($draft__closures, _subscribe($si__input_workspaceName && $input_workspaceName__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, _subscribe($si__input_sessions && $input_sessions__closures, writeScope($scope4_id, { a: _existing_scope($childScope5) })))))))))))))))))))));
2996
3215
  return 0;
2997
3216
  }
2998
3217
  }, $scope3_id, "a", 1, 1, 1, 0, 1);
2999
3218
  writeScope($scope3_id, {
3000
- d: repo?.id,
3001
- g: repo?.pr,
3002
- h: repo?.worktree,
3003
- i: repo?.pr?.number,
3004
- j: repo?.pr?.url,
3005
- k: repo?.pr?.title,
3006
- l: repo?.pr?.headRefName,
3007
- m: repo?.head,
3008
- n: repo?.base,
3009
- o: repo?.baseSha,
3010
- p: repo?.full_name,
3011
- q: repo?.pr?.baseRefName,
3012
- r: repo?.branch,
3013
- s: repo?.localHead,
3014
- t: repoFiles,
3015
- u: repoFiles.length,
3016
- x: shownInRepo.length,
3017
- a1: $for_content__repo_pr_number__closures,
3018
- a2: $for_content__repo_pr_url__closures,
3019
- a3: $for_content__repo_pr_title__closures,
3020
- a4: $for_content__repo_pr_headRefName__closures,
3021
- a5: $for_content__repo_head__closures,
3022
- a6: $for_content__repo_base__closures,
3023
- a7: $for_content__repo_baseSha__closures,
3024
- a8: $for_content__repo_full_name__closures,
3025
- aa: $for_content__repo_branch__closures,
3026
- ab: $for_content__repo_localHead__closures,
3027
- y: $for_content__repo_id__closures,
3028
- z: $for_content__repo_pr__closures,
3029
- a0: $for_content__repo_worktree__closures,
3030
- a9: $for_content__repo_pr_baseRefName__closures,
3031
- ad: $for_content__repoFiles_length__closures,
3032
- ae: $for_content__shownInRepo_length__closures,
3033
- ac: $for_content__repoFiles__closures
3219
+ c: repo,
3220
+ g: repoFiles
3034
3221
  });
3035
- }, "id", $scope0_id, "ab");
3036
- _html(`</div>${_el_resume($scope0_id, "a3")}</div>`);
3037
- _set_serialize_reason(430);
3038
- const $childScope10 = _peek_scope_id();
3222
+ }, "id", $scope0_id, "a1");
3223
+ _html(`</div>${_el_resume($scope0_id, "w")}</div>`);
3224
+ _set_serialize_reason(128382);
3225
+ const $childScope6 = _peek_scope_id();
3039
3226
  diff_tree_default({
3040
3227
  open: treeOpen,
3041
3228
  sections: treeSections,
3229
+ filter: fileFilter,
3230
+ filterChange: $filterChange,
3042
3231
  collapsedRepos,
3043
3232
  collapsedReposChange: _resume((_new_collapsedRepos) => {
3044
3233
  collapsedRepos = _new_collapsedRepos;
3045
- }, "j33", $scope0_id),
3234
+ }, "j39", $scope0_id),
3046
3235
  openedRepos,
3047
3236
  openedReposChange: _resume((_new_openedRepos) => {
3048
3237
  openedRepos = _new_openedRepos;
3049
- }, "j34", $scope0_id),
3238
+ }, "j40", $scope0_id),
3050
3239
  commentKeys,
3051
- onJump: jumpTo
3240
+ newKeys,
3241
+ workspaceId: input.workspaceId,
3242
+ scope: scope$1
3052
3243
  });
3053
- _set_serialize_reason(238);
3054
- const $childScope11 = _peek_scope_id();
3244
+ _set_serialize_reason(31486);
3245
+ const $childScope7 = _peek_scope_id();
3055
3246
  diff_file_sheet_default({
3056
3247
  open: fileSheet,
3057
3248
  openChange: _resume((_new_fileSheet) => {
3058
3249
  fileSheet = _new_fileSheet;
3059
- }, "j35", $scope0_id),
3250
+ }, "j41", $scope0_id),
3060
3251
  files: shownFiles,
3252
+ filter: fileFilter,
3253
+ filterChange: $filterChange,
3061
3254
  commentKeys,
3255
+ newKeys,
3062
3256
  total: allFiles.length,
3063
- onJump: jumpTo
3257
+ workspaceId: input.workspaceId,
3258
+ scope: scope$1
3064
3259
  });
3065
3260
  _html("</div>");
3066
3261
  _script($scope0_id, "j47");
@@ -3068,105 +3263,111 @@ var diff_view_default = _template("j", (input) => {
3068
3263
  _script($scope0_id, "j49");
3069
3264
  _script($scope0_id, "j50");
3070
3265
  writeScope($scope0_id, {
3071
- ag: _serialize_if($scope0_reason, 2) && input.findOpen,
3072
- ah: _serialize_if($scope0_reason, 1) && input.findOpenChange,
3073
- aj: input.findTick,
3074
- al: input.workspaceId,
3075
- am: input.focusPr,
3076
- an: input.active,
3077
- ao: input.focusNonce,
3078
- ap: input.onSent,
3079
- ar: input.sessions,
3080
- as: input.workspaceBranch,
3081
- at: input.workspaceName,
3082
- au: repos,
3083
- av: comments,
3084
- aw: comments?.length,
3085
- ax: draft,
3086
- ay: error,
3087
- az: loading,
3088
- b1: fileFilter,
3089
- b2: uncommitted,
3090
- b3: treeOpen,
3091
- b7: findTick,
3092
- b9: findFocusRef,
3093
- bc: findState?.query,
3094
- be: findState?.hit,
3095
- bf: findState?.hit?.key,
3096
- bg: findState?.hit?.repo,
3097
- bh: findState?.hit?.line,
3098
- bi: collapsedRepos,
3099
- bj: openedRepos,
3100
- bl: expandingRepos,
3101
- bm: dismissedDrift,
3102
- bo: nearBox.cbs,
3103
- bp: nearBox.io,
3104
- bq: nearBox.root,
3105
- bs: observeNear,
3106
- bt: focusPrSection,
3107
- bv: headBox.sig,
3108
- bw: headBox.timer,
3109
- by: loadBox.seq,
3110
- c0: load,
3111
- c3: sendGate.busy,
3112
- c5: loadReview,
3113
- c6: reload,
3114
- c8: reloadSoon,
3115
- ca: repoList,
3116
- cc: repoList.length,
3117
- cd: allFiles,
3118
- cf: allFiles?.length,
3119
- cg: fileFiltered,
3120
- ci: lineStats?.additions,
3121
- cj: lineStats?.deletions,
3266
+ a6: input.scope,
3267
+ a7: _serialize_if($scope0_reason, 2) && input.findOpen,
3268
+ a8: _serialize_if($scope0_reason, 1) && input.findOpenChange,
3269
+ aa: input.findTick,
3270
+ ac: input.onFileChange,
3271
+ ad: input.workspaceId,
3272
+ ae: input.focusPr,
3273
+ af: input.focusFile,
3274
+ ag: input.onScopeChange,
3275
+ ah: input.active,
3276
+ ai: input.focusNonce,
3277
+ aj: input.focusFileNonce,
3278
+ ak: input.onSent,
3279
+ am: input.sessions,
3280
+ an: input.workspaceBranch,
3281
+ ao: input.workspaceName,
3282
+ ap: repos,
3283
+ ar: comments,
3284
+ as: comments?.length,
3285
+ at: draft,
3286
+ au: error,
3287
+ av: loading,
3288
+ ax: fileFilter,
3289
+ az: onlyNew,
3290
+ b0: scope$1,
3291
+ b1: treeOpen,
3292
+ b3: findOpen,
3293
+ b5: findTick,
3294
+ b7: findFocusRef,
3295
+ ba: findState?.query,
3296
+ bc: findState?.hit,
3297
+ bd: findState?.hit?.key,
3298
+ be: collapsedRepos,
3299
+ bf: openedRepos,
3300
+ bg: expandingRepos,
3301
+ bj: nearBox.cbs,
3302
+ bk: nearBox.io,
3303
+ bl: nearBox.root,
3304
+ bn: observeNear,
3305
+ bo: pinToTop,
3306
+ bq: focusPrSection,
3307
+ br: openFile,
3308
+ bu: jumpTo,
3309
+ bw: headBox.sig,
3310
+ bx: headBox.timer,
3311
+ bz: loadBox.seq,
3312
+ c1: load,
3313
+ c4: setScope,
3314
+ c7: sendGate.busy,
3315
+ c9: loadReview,
3316
+ ca: reload,
3317
+ cc: reloadSoon,
3318
+ cd: markSeen,
3319
+ cf: repoList,
3320
+ cg: repoList.length,
3321
+ ch: allFiles,
3322
+ cj: allFiles?.length,
3323
+ ck: fileFiltered,
3122
3324
  cl: findKeys,
3325
+ cp: shownFiles?.length,
3123
3326
  cr: shownKeySet,
3124
- cs: filesByRepo,
3125
- ct: shownByRepo,
3126
- cv: commentsByFile,
3327
+ ct: filesByRepo,
3328
+ cw: commentsByFile,
3127
3329
  cz: localDifferIds,
3128
- d0: driftRepos,
3129
- d3: dismissDrift,
3130
- d4: fileWorktree,
3131
- d6: saveComment,
3132
- d7: removeComment,
3133
- d8: clearComments,
3134
- da: postToSession,
3135
- de: copyMarkdown,
3136
- df: sendTo,
3137
- dg: sendDraftComment,
3138
- dh: sendOneComment,
3139
- di: openFile,
3140
- dk: openFind,
3141
- dm: onFindState,
3142
- b6: input.findOpenChange || void 0,
3143
- h: _existing_scope($childScope),
3144
- r: _existing_scope($childScope3),
3145
- a0: _existing_scope($childScope4),
3146
- dt: $error__closures,
3147
- dw: $uncommitted__closures,
3148
- du: $loading__closures,
3149
- ee: $driftRepos__closures,
3150
- dp: $si__input_workspaceBranch && $input_workspaceBranch__closures,
3151
- dq: $si__input_workspaceName && $input_workspaceName__closures,
3152
- e1: $collapsedRepos__closures,
3153
- e3: $expandingRepos__closures,
3154
- ed: $localDifferIds__closures,
3155
- do: $si__input_sessions && $input_sessions__closures,
3156
- ds: $draft__closures,
3157
- eg: $saveComment2__closures,
3158
- eh: $removeComment2__closures,
3159
- ek: $sendDraftComment2__closures,
3160
- el: $sendOneComment2__closures,
3161
- dy: $findState_hit_key__closures,
3162
- e0: $findState_hit_line__closures,
3163
- e9: $shownKeySet__closures,
3164
- ec: $commentsByFile__closures,
3165
- e6: $repoList_length__closures,
3166
- dz: $findState_hit_repo__closures,
3167
- e2: $openedRepos__closures,
3168
- ac: _existing_scope($childScope10),
3169
- ad: _existing_scope($childScope11)
3330
+ d0: hasFiles,
3331
+ d1: fileWorktree,
3332
+ d2: anchorFor,
3333
+ d4: saveComment,
3334
+ d5: deleteRemote,
3335
+ d8: removeComment,
3336
+ d9: dispatch,
3337
+ dc: copyMarkdown,
3338
+ dd: sendTo,
3339
+ de: sendOneComment,
3340
+ df: sendDraftComment,
3341
+ dg: openFind,
3342
+ di: onFindState,
3343
+ dj: toggleSection,
3344
+ b4: input.findOpenChange || void 0,
3345
+ l: _existing_scope($childScope2),
3346
+ u: _existing_scope($childScope3),
3347
+ dq: $error__closures,
3348
+ du: $scope__closures,
3349
+ dl: $si__input_sessions && $input_sessions__closures,
3350
+ dm: $si__input_workspaceBranch && $input_workspaceBranch__closures,
3351
+ dn: $si__input_workspaceName && $input_workspaceName__closures,
3352
+ dp: $draft__closures,
3353
+ dr: $loading__closures,
3354
+ dt: $onlyNew__closures,
3355
+ dy: $findState_hit__closures,
3356
+ dz: $collapsedRepos__closures,
3357
+ e0: $openedRepos__closures,
3358
+ e1: $expandingRepos__closures,
3359
+ e3: $reload2__closures,
3360
+ e5: $repoList_length__closures,
3361
+ e7: $shownKeySet__closures,
3362
+ e9: $commentsByFile__closures,
3363
+ ea: $localDifferIds__closures,
3364
+ ec: $saveComment2__closures,
3365
+ ed: $removeComment2__closures,
3366
+ eg: $sendOneComment2__closures,
3367
+ eh: $sendDraftComment2__closures,
3368
+ ei: $toggleSection2__closures,
3369
+ a2: _existing_scope($childScope6),
3370
+ a3: _existing_scope($childScope7)
3170
3371
  });
3171
3372
  _resume_branch($scope0_id);
3172
3373
  });