@hanzo/dev 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{BinaryViewer-qn8xfPZp.js → BinaryViewer-CmFUK4zZ.js} +2 -2
  3. package/dist/{ChatMarkdown-Cyujn3JJ.js → ChatMarkdown-nvEI7iCv.js} +4 -4
  4. package/dist/{DiffCommentAnnotation-BZu1TP6E.js → DiffCommentAnnotation-BPTN_2a6.js} +1 -1
  5. package/dist/{DiffFileTree-CcJ91zOM.js → DiffFileTree-B_br90vY.js} +2 -2
  6. package/dist/{DiffPanel-BXC88NMs.js → DiffPanel-V5R5TPuK.js} +5 -5
  7. package/dist/{ExpandedImageDialog-BZnGRBJR.js → ExpandedImageDialog-CAorLacL.js} +1 -1
  8. package/dist/{FileExplorerPane-vBJS6V75.js → FileExplorerPane-CeHulcPz.js} +1 -1
  9. package/dist/{FilePreviewPanel-jJHWsMzm.js → FilePreviewPanel-BVNLvWOc.js} +8 -8
  10. package/dist/{MermaidDiagram-paNwQY33.js → MermaidDiagram-CTolIzQD.js} +1 -1
  11. package/dist/{MermaidFilePreview-B9KxfnIN.js → MermaidFilePreview-CP2zP4FU.js} +1 -1
  12. package/dist/{MermaidViewer-CAEGpLyD.js → MermaidViewer-BDfYkS9E.js} +2 -2
  13. package/dist/{NotebookPreview-D01mMCpR.js → NotebookPreview-Cybs5uM0.js} +1 -1
  14. package/dist/{OfficeFilePreview-DWaRgfQU.js → OfficeFilePreview-7JsmSoKU.js} +1 -1
  15. package/dist/{OfficeViewer-BudrZbBA.js → OfficeViewer-CJoojlJK.js} +1 -1
  16. package/dist/{OpenInPicker-Dd3ifHa1.js → OpenInPicker-BIMWUxBP.js} +7 -7
  17. package/dist/{OpenXmlOfficeViewer-CXcKdq7k.js → OpenXmlOfficeViewer-C24Kj8DM.js} +1 -1
  18. package/dist/{PreviewImage-C4Ku4z7v.js → PreviewImage-oY5YnuTr.js} +1 -1
  19. package/dist/{PreviewImageContent-BwOB9Lyd.js → PreviewImageContent-n6eLzY99.js} +1 -1
  20. package/dist/{PullRequestCodeTab-BcwyMk7d.js → PullRequestCodeTab-Dv_0kVad.js} +7 -7
  21. package/dist/{PullRequestReviewAnnotation-BU5t_1fC.js → PullRequestReviewAnnotation-LeuwO-iH.js} +4 -4
  22. package/dist/builder/activity.d.ts +16 -0
  23. package/dist/builder/activity.js +51 -0
  24. package/dist/builder/address.d.ts +11 -0
  25. package/dist/builder/address.js +50 -0
  26. package/dist/builder/ago.d.ts +2 -0
  27. package/dist/builder/ago.js +18 -0
  28. package/dist/builder/api/agents.d.ts +139 -0
  29. package/dist/builder/api/agents.js +253 -0
  30. package/dist/builder/api/auto.d.ts +166 -0
  31. package/dist/builder/api/auto.js +300 -0
  32. package/dist/builder/api/billing.d.ts +263 -0
  33. package/dist/builder/api/billing.js +401 -0
  34. package/dist/builder/api/call.d.ts +53 -0
  35. package/dist/builder/api/call.js +123 -0
  36. package/dist/builder/api/capabilities.d.ts +14 -0
  37. package/dist/builder/api/capabilities.js +41 -0
  38. package/dist/builder/api/changes.d.ts +74 -0
  39. package/dist/builder/api/changes.js +75 -0
  40. package/dist/builder/api/chat.d.ts +12 -0
  41. package/dist/builder/api/chat.js +28 -0
  42. package/dist/builder/api/cli.d.ts +59 -0
  43. package/dist/builder/api/cli.js +133 -0
  44. package/dist/builder/api/codebases.d.ts +46 -0
  45. package/dist/builder/api/codebases.js +100 -0
  46. package/dist/builder/api/coding.d.ts +117 -0
  47. package/dist/builder/api/coding.js +222 -0
  48. package/dist/builder/api/connectors.d.ts +76 -0
  49. package/dist/builder/api/connectors.js +111 -0
  50. package/dist/builder/api/consent.d.ts +22 -0
  51. package/dist/builder/api/consent.js +28 -0
  52. package/dist/builder/api/conversations.d.ts +20 -0
  53. package/dist/builder/api/conversations.js +23 -0
  54. package/dist/builder/api/draft.d.ts +38 -0
  55. package/dist/builder/api/draft.js +87 -0
  56. package/dist/builder/api/environment.d.ts +55 -0
  57. package/dist/builder/api/environment.js +126 -0
  58. package/dist/builder/api/gallery.d.ts +32 -0
  59. package/dist/builder/api/gallery.js +85 -0
  60. package/dist/builder/api/git.d.ts +31 -0
  61. package/dist/builder/api/git.js +47 -0
  62. package/dist/builder/api/github.d.ts +176 -0
  63. package/dist/builder/api/github.js +271 -0
  64. package/dist/builder/api/keys.d.ts +35 -0
  65. package/dist/builder/api/keys.js +72 -0
  66. package/dist/builder/api/library.d.ts +116 -0
  67. package/dist/builder/api/library.js +214 -0
  68. package/dist/builder/api/limits.d.ts +69 -0
  69. package/dist/builder/api/limits.js +86 -0
  70. package/dist/builder/api/links.d.ts +51 -0
  71. package/dist/builder/api/links.js +75 -0
  72. package/dist/builder/api/machines.d.ts +122 -0
  73. package/dist/builder/api/machines.js +238 -0
  74. package/dist/builder/api/mcp.d.ts +10 -0
  75. package/dist/builder/api/mcp.js +47 -0
  76. package/dist/builder/api/members.d.ts +35 -0
  77. package/dist/builder/api/members.js +95 -0
  78. package/dist/builder/api/memory.d.ts +14 -0
  79. package/dist/builder/api/memory.js +35 -0
  80. package/dist/builder/api/models.d.ts +17 -0
  81. package/dist/builder/api/models.js +20 -0
  82. package/dist/builder/api/places.d.ts +32 -0
  83. package/dist/builder/api/places.js +29 -0
  84. package/dist/builder/api/platform.d.ts +68 -0
  85. package/dist/builder/api/platform.js +87 -0
  86. package/dist/builder/api/plugins.d.ts +42 -0
  87. package/dist/builder/api/plugins.js +175 -0
  88. package/dist/builder/api/pref.d.ts +77 -0
  89. package/dist/builder/api/pref.js +93 -0
  90. package/dist/builder/api/profile.d.ts +11 -0
  91. package/dist/builder/api/profile.js +41 -0
  92. package/dist/builder/api/projects.d.ts +99 -0
  93. package/dist/builder/api/projects.js +166 -0
  94. package/dist/builder/api/provider.d.ts +49 -0
  95. package/dist/builder/api/provider.js +96 -0
  96. package/dist/builder/api/sandbox.d.ts +90 -0
  97. package/dist/builder/api/sandbox.js +223 -0
  98. package/dist/builder/api/sessions.d.ts +123 -0
  99. package/dist/builder/api/sessions.js +255 -0
  100. package/dist/builder/api/skills.d.ts +82 -0
  101. package/dist/builder/api/skills.js +117 -0
  102. package/dist/builder/api/sse.d.ts +24 -0
  103. package/dist/builder/api/sse.js +68 -0
  104. package/dist/builder/api/studio.d.ts +59 -0
  105. package/dist/builder/api/studio.js +91 -0
  106. package/dist/builder/api/talk.d.ts +48 -0
  107. package/dist/builder/api/talk.js +81 -0
  108. package/dist/builder/api/tools.d.ts +34 -0
  109. package/dist/builder/api/tools.js +37 -0
  110. package/dist/builder/api/turn.d.ts +202 -0
  111. package/dist/builder/api/turn.js +772 -0
  112. package/dist/builder/api/verdict.d.ts +3 -0
  113. package/dist/builder/api/verdict.js +21 -0
  114. package/dist/builder/api/webhooks.d.ts +47 -0
  115. package/dist/builder/api/webhooks.js +82 -0
  116. package/dist/builder/api/work.d.ts +110 -0
  117. package/dist/builder/api/work.js +218 -0
  118. package/dist/builder/ask.d.ts +51 -0
  119. package/dist/builder/ask.js +147 -0
  120. package/dist/builder/automations.d.ts +33 -0
  121. package/dist/builder/automations.js +453 -0
  122. package/dist/builder/awake.d.ts +24 -0
  123. package/dist/builder/awake.js +68 -0
  124. package/dist/builder/back.d.ts +30 -0
  125. package/dist/builder/back.js +105 -0
  126. package/dist/builder/builder.d.ts +12 -0
  127. package/dist/builder/builder.js +162 -0
  128. package/dist/builder/carry.d.ts +48 -0
  129. package/dist/builder/carry.js +278 -0
  130. package/dist/builder/choice.d.ts +134 -0
  131. package/dist/builder/choice.js +152 -0
  132. package/dist/builder/claims.d.ts +13 -0
  133. package/dist/builder/claims.js +35 -0
  134. package/dist/builder/clipboard.d.ts +2 -0
  135. package/dist/builder/clipboard.js +10 -0
  136. package/dist/builder/customize/agents.d.ts +11 -0
  137. package/dist/builder/customize/agents.js +513 -0
  138. package/dist/builder/customize/connectors.d.ts +2 -0
  139. package/dist/builder/customize/connectors.js +319 -0
  140. package/dist/builder/customize/drafted.d.ts +4 -0
  141. package/dist/builder/customize/drafted.js +92 -0
  142. package/dist/builder/customize/index.d.ts +8 -0
  143. package/dist/builder/customize/index.js +127 -0
  144. package/dist/builder/customize/inventory.d.ts +14 -0
  145. package/dist/builder/customize/inventory.js +127 -0
  146. package/dist/builder/customize/load.d.ts +9 -0
  147. package/dist/builder/customize/load.js +22 -0
  148. package/dist/builder/customize/ocean.d.ts +41 -0
  149. package/dist/builder/customize/ocean.js +332 -0
  150. package/dist/builder/customize/plugins.d.ts +2 -0
  151. package/dist/builder/customize/plugins.js +136 -0
  152. package/dist/builder/customize/roles.d.ts +4 -0
  153. package/dist/builder/customize/roles.js +105 -0
  154. package/dist/builder/customize/say.d.ts +13 -0
  155. package/dist/builder/customize/say.js +32 -0
  156. package/dist/builder/customize/skills.d.ts +2 -0
  157. package/dist/builder/customize/skills.js +208 -0
  158. package/dist/builder/customize/ui.d.ts +152 -0
  159. package/dist/builder/customize/ui.js +208 -0
  160. package/dist/builder/data.d.ts +57 -0
  161. package/dist/builder/data.js +322 -0
  162. package/dist/builder/design.d.ts +140 -0
  163. package/dist/builder/design.js +175 -0
  164. package/dist/builder/desk.d.ts +48 -0
  165. package/dist/builder/desk.js +449 -0
  166. package/dist/builder/dev-mode.d.ts +43 -0
  167. package/dist/builder/dev-mode.js +120 -0
  168. package/dist/builder/door.d.ts +11 -0
  169. package/dist/builder/door.js +126 -0
  170. package/dist/builder/environment.d.ts +23 -0
  171. package/dist/builder/environment.js +193 -0
  172. package/dist/builder/files.d.ts +23 -0
  173. package/dist/builder/files.js +175 -0
  174. package/dist/builder/find.d.ts +7 -0
  175. package/dist/builder/find.js +80 -0
  176. package/dist/builder/foot.d.ts +30 -0
  177. package/dist/builder/foot.js +79 -0
  178. package/dist/builder/forge.d.ts +4 -0
  179. package/dist/builder/forge.js +570 -0
  180. package/dist/builder/gear.d.ts +60 -0
  181. package/dist/builder/gear.js +180 -0
  182. package/dist/builder/git.d.ts +21 -0
  183. package/dist/builder/git.js +118 -0
  184. package/dist/builder/gutter.d.ts +17 -0
  185. package/dist/builder/gutter.js +25 -0
  186. package/dist/builder/handoff.d.ts +8 -0
  187. package/dist/builder/handoff.js +22 -0
  188. package/dist/builder/host.d.ts +189 -0
  189. package/dist/builder/host.js +46 -0
  190. package/dist/builder/index.d.ts +108 -0
  191. package/dist/builder/index.js +99 -0
  192. package/dist/builder/landing.d.ts +34 -0
  193. package/dist/builder/landing.js +725 -0
  194. package/dist/builder/library.d.ts +21 -0
  195. package/dist/builder/library.js +526 -0
  196. package/dist/builder/local.d.ts +80 -0
  197. package/dist/builder/local.js +124 -0
  198. package/dist/builder/make.d.ts +10 -0
  199. package/dist/builder/make.js +120 -0
  200. package/dist/builder/markdown.d.ts +49 -0
  201. package/dist/builder/markdown.js +125 -0
  202. package/dist/builder/marks.d.ts +15 -0
  203. package/dist/builder/marks.js +18 -0
  204. package/dist/builder/merge.d.ts +223 -0
  205. package/dist/builder/merge.js +380 -0
  206. package/dist/builder/meter.d.ts +31 -0
  207. package/dist/builder/meter.js +54 -0
  208. package/dist/builder/mind.d.ts +107 -0
  209. package/dist/builder/mind.js +335 -0
  210. package/dist/builder/names.d.ts +40 -0
  211. package/dist/builder/names.js +189 -0
  212. package/dist/builder/nav.d.ts +28 -0
  213. package/dist/builder/nav.js +218 -0
  214. package/dist/builder/out.d.ts +16 -0
  215. package/dist/builder/out.js +24 -0
  216. package/dist/builder/page.d.ts +55 -0
  217. package/dist/builder/page.js +217 -0
  218. package/dist/builder/pane.d.ts +30 -0
  219. package/dist/builder/pane.js +21 -0
  220. package/dist/builder/panel.d.ts +101 -0
  221. package/dist/builder/panel.js +408 -0
  222. package/dist/builder/pdf.d.ts +139 -0
  223. package/dist/builder/pdf.js +847 -0
  224. package/dist/builder/pick.d.ts +10 -0
  225. package/dist/builder/pick.js +38 -0
  226. package/dist/builder/plain.d.ts +59 -0
  227. package/dist/builder/plain.js +209 -0
  228. package/dist/builder/plan.d.ts +63 -0
  229. package/dist/builder/plan.js +155 -0
  230. package/dist/builder/plans.d.ts +1 -0
  231. package/dist/builder/plans.js +157 -0
  232. package/dist/builder/plugin.d.ts +60 -0
  233. package/dist/builder/plugin.js +1 -0
  234. package/dist/builder/plugins/design.d.ts +8 -0
  235. package/dist/builder/plugins/design.js +71 -0
  236. package/dist/builder/plugins/index.d.ts +46 -0
  237. package/dist/builder/plugins/index.js +117 -0
  238. package/dist/builder/plugins/pdf.d.ts +18 -0
  239. package/dist/builder/plugins/pdf.js +83 -0
  240. package/dist/builder/plugins/project.d.ts +5 -0
  241. package/dist/builder/plugins/project.js +68 -0
  242. package/dist/builder/plugins/research.d.ts +24 -0
  243. package/dist/builder/plugins/research.js +147 -0
  244. package/dist/builder/plugins/sketch.d.ts +9 -0
  245. package/dist/builder/plugins/sketch.js +101 -0
  246. package/dist/builder/plugins/slides.d.ts +14 -0
  247. package/dist/builder/plugins/slides.js +55 -0
  248. package/dist/builder/plugins/template.d.ts +13 -0
  249. package/dist/builder/plugins/template.js +95 -0
  250. package/dist/builder/prefs.d.ts +29 -0
  251. package/dist/builder/prefs.js +91 -0
  252. package/dist/builder/preview-url.d.ts +47 -0
  253. package/dist/builder/preview-url.js +107 -0
  254. package/dist/builder/project.d.ts +18 -0
  255. package/dist/builder/project.js +591 -0
  256. package/dist/builder/prose.d.ts +4 -0
  257. package/dist/builder/prose.js +57 -0
  258. package/dist/builder/publish.d.ts +18 -0
  259. package/dist/builder/publish.js +141 -0
  260. package/dist/builder/question.d.ts +33 -0
  261. package/dist/builder/question.js +64 -0
  262. package/dist/builder/redesign.d.ts +32 -0
  263. package/dist/builder/redesign.js +117 -0
  264. package/dist/builder/removal.d.ts +71 -0
  265. package/dist/builder/removal.js +73 -0
  266. package/dist/builder/reply.d.ts +50 -0
  267. package/dist/builder/reply.js +196 -0
  268. package/dist/builder/roles.d.ts +10 -0
  269. package/dist/builder/roles.js +28 -0
  270. package/dist/builder/route.d.ts +85 -0
  271. package/dist/builder/route.js +126 -0
  272. package/dist/builder/run.d.ts +4 -0
  273. package/dist/builder/run.js +804 -0
  274. package/dist/builder/runmeta.d.ts +16 -0
  275. package/dist/builder/runmeta.js +69 -0
  276. package/dist/builder/say.d.ts +2 -0
  277. package/dist/builder/say.js +7 -0
  278. package/dist/builder/scheduled.d.ts +3 -0
  279. package/dist/builder/scheduled.js +328 -0
  280. package/dist/builder/section.d.ts +27 -0
  281. package/dist/builder/section.js +60 -0
  282. package/dist/builder/settings/account.d.ts +1 -0
  283. package/dist/builder/settings/account.js +111 -0
  284. package/dist/builder/settings/billing.d.ts +1 -0
  285. package/dist/builder/settings/billing.js +210 -0
  286. package/dist/builder/settings/capabilities.d.ts +1 -0
  287. package/dist/builder/settings/capabilities.js +66 -0
  288. package/dist/builder/settings/card.d.ts +31 -0
  289. package/dist/builder/settings/card.js +140 -0
  290. package/dist/builder/settings/code.d.ts +1 -0
  291. package/dist/builder/settings/code.js +70 -0
  292. package/dist/builder/settings/credits.d.ts +10 -0
  293. package/dist/builder/settings/credits.js +123 -0
  294. package/dist/builder/settings/environments.d.ts +1 -0
  295. package/dist/builder/settings/environments.js +60 -0
  296. package/dist/builder/settings/general.d.ts +1 -0
  297. package/dist/builder/settings/general.js +58 -0
  298. package/dist/builder/settings/index.d.ts +4 -0
  299. package/dist/builder/settings/index.js +25 -0
  300. package/dist/builder/settings/integrations.d.ts +8 -0
  301. package/dist/builder/settings/integrations.js +138 -0
  302. package/dist/builder/settings/keys.d.ts +1 -0
  303. package/dist/builder/settings/keys.js +114 -0
  304. package/dist/builder/settings/list.d.ts +10 -0
  305. package/dist/builder/settings/list.js +28 -0
  306. package/dist/builder/settings/machines.d.ts +4 -0
  307. package/dist/builder/settings/machines.js +243 -0
  308. package/dist/builder/settings/members.d.ts +1 -0
  309. package/dist/builder/settings/members.js +77 -0
  310. package/dist/builder/settings/memory.d.ts +1 -0
  311. package/dist/builder/settings/memory.js +62 -0
  312. package/dist/builder/settings/notifications.d.ts +1 -0
  313. package/dist/builder/settings/notifications.js +111 -0
  314. package/dist/builder/settings/plan.d.ts +17 -0
  315. package/dist/builder/settings/plan.js +131 -0
  316. package/dist/builder/settings/privacy.d.ts +1 -0
  317. package/dist/builder/settings/privacy.js +76 -0
  318. package/dist/builder/settings/sections.d.ts +16 -0
  319. package/dist/builder/settings/sections.js +34 -0
  320. package/dist/builder/settings/shared.d.ts +6 -0
  321. package/dist/builder/settings/shared.js +58 -0
  322. package/dist/builder/settings/ui.d.ts +50 -0
  323. package/dist/builder/settings/ui.js +53 -0
  324. package/dist/builder/settings/usage.d.ts +1 -0
  325. package/dist/builder/settings/usage.js +24 -0
  326. package/dist/builder/shared.d.ts +26 -0
  327. package/dist/builder/shared.js +15 -0
  328. package/dist/builder/shelf.d.ts +16 -0
  329. package/dist/builder/shelf.js +219 -0
  330. package/dist/builder/side.d.ts +40 -0
  331. package/dist/builder/side.js +208 -0
  332. package/dist/builder/site.d.ts +75 -0
  333. package/dist/builder/site.js +138 -0
  334. package/dist/builder/spend.d.ts +21 -0
  335. package/dist/builder/spend.js +80 -0
  336. package/dist/builder/standing.d.ts +36 -0
  337. package/dist/builder/standing.js +66 -0
  338. package/dist/builder/suggest.d.ts +238 -0
  339. package/dist/builder/suggest.js +463 -0
  340. package/dist/builder/suggestions.d.ts +49 -0
  341. package/dist/builder/suggestions.js +260 -0
  342. package/dist/builder/summary.d.ts +60 -0
  343. package/dist/builder/summary.js +81 -0
  344. package/dist/builder/sync.d.ts +1 -0
  345. package/dist/builder/sync.js +164 -0
  346. package/dist/builder/tabs.d.ts +85 -0
  347. package/dist/builder/tabs.js +288 -0
  348. package/dist/builder/talk.d.ts +5 -0
  349. package/dist/builder/talk.js +108 -0
  350. package/dist/builder/thread.d.ts +60 -0
  351. package/dist/builder/thread.js +302 -0
  352. package/dist/builder/tools.d.ts +22 -0
  353. package/dist/builder/tools.js +52 -0
  354. package/dist/builder/transcript.d.ts +47 -0
  355. package/dist/builder/transcript.js +108 -0
  356. package/dist/builder/voice.d.ts +8 -0
  357. package/dist/builder/voice.js +24 -0
  358. package/dist/{changedFileKind-DqgCCDUs.js → changedFileKind-D6QYvIez.js} +1 -1
  359. package/dist/core.js +1 -0
  360. package/dist/{decodeImagePreview-CesVZYP4.js → decodeImagePreview-DnfFEjhw.js} +1 -1
  361. package/dist/{embed-DYP-OUlb.js → embed-c030vUqM.js} +11 -11
  362. package/dist/index.d.ts +2 -0
  363. package/dist/index.js +2 -1
  364. package/dist/{micromark-util-decode-string-NQjVkmZH.js → micromark-util-decode-string-C-5AXkOV.js} +5 -3
  365. package/dist/{readBinaryPreview-D2X4Uahu.js → readBinaryPreview-BAQ4fFjm.js} +1 -1
  366. package/dist/{useTextFieldSpeech-CyOZZPrV.js → useTextFieldSpeech-COa9XcRx.js} +1 -1
  367. package/package.json +101 -11
  368. /package/{index.d.ts → dist/core.d.ts} +0 -0
  369. /package/{keymap.d.ts → dist/keymap.d.ts} +0 -0
@@ -0,0 +1,570 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Projects and issues, read from the forge and opened in this window.
4
+ *
5
+ * A project is a repository, linked from GitHub or started from a template;
6
+ * choosing one opens its workspace, where every run works on it. Issues are
7
+ * the forge's and the task index's, merged (merge.ts): the same issue read
8
+ * from two boards is one row. A repository's GitHub issues sync onto it.
9
+ * Choosing an issue opens New on the issue's own repository — its GitHub
10
+ * address, or the forge repository it is filed on, never a board's key — with
11
+ * the issue as the ask; an issue no project answers to asks which one.
12
+ *
13
+ * The page's words are the reader's language (@hanzo/i18n `t`, the target is
14
+ * `target`); a repository's org, name, branch and description, an issue's
15
+ * title, labels and people, and the forge's own refusals are drawn as given.
16
+ */
17
+ import { SizableText, useMedia, XStack, YStack } from '@hanzo/gui';
18
+ import { phrase } from '@hanzo/i18n';
19
+ import { useI18n } from '@hanzo/i18n/react';
20
+ import { ArrowRight, Check, ChevronDown, CircleCheck, CircleDot, CircleSlash, Copy, ExternalLink, FolderGit2, GitBranch, Github, GitPullRequest, LayoutTemplate, MoreHorizontal, RefreshCw, Search, SlidersHorizontal, Trash2, X, } from '@hanzogui/lucide-icons-2';
21
+ import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, Input, Skeleton, toast } from '@hanzo/ui';
22
+ import { useEffect, useMemo, useState } from 'react';
23
+ import { copy as toClipboard } from './clipboard.js';
24
+ import { RING, RING_INSET } from './pane.js';
25
+ import { ago } from './ago.js';
26
+ import { codebases, remove as removeRepo } from './api/codebases.js';
27
+ import { unlink as removeLink } from './api/links.js';
28
+ import { remove as removeProject } from './api/projects.js';
29
+ import { Scheduled } from './scheduled.js';
30
+ import { boards, everything, sources, UNREAD } from './api/work.js';
31
+ import { boardKey, pinRepo, readPending, writePending } from './choice.js';
32
+ import { useKept, useRead } from './data.js';
33
+ import { useDevMode } from './dev-mode.js';
34
+ import { useHost, useTarget } from './host.js';
35
+ import { path } from './route.js';
36
+ import { Customize } from './customize/index.js';
37
+ import { Sync } from './sync.js';
38
+ import { changed, connect, connection, disconnect as unlink, grants, heard, installations, linked, syncIssues } from './api/github.js';
39
+ import { disconnect } from './api/provider.js';
40
+ import { here, useBack } from './back.js';
41
+ import { Out } from './out.js';
42
+ import { ask, assemble, attach, closes, facets, handle, home, keyOf, matches, pickProjects, place } from './merge.js';
43
+ import { removal, stopped } from './removal.js';
44
+ import { Confirm } from './ask.js';
45
+ function Note({ children }) {
46
+ return (_jsx(SizableText, { size: "$2", color: "$soft", children: children }));
47
+ }
48
+ const STATUS = {
49
+ backlog: phrase('Backlog'),
50
+ todo: phrase('To do'),
51
+ in_progress: phrase('In progress'),
52
+ done: phrase('Done'),
53
+ canceled: phrase('Canceled'),
54
+ };
55
+ export function Forge({ screen }) {
56
+ if (screen === 'automations')
57
+ return _jsx(Scheduled, {});
58
+ if (screen === 'sync')
59
+ return _jsx(Sync, {});
60
+ // The fleet's native servers are Connectors → Discover now; the old address lands there.
61
+ if (screen === 'mcp')
62
+ return _jsx(Customize, { tab: "connectors", view: "discover" });
63
+ if (screen === 'projects')
64
+ return _jsx(Projects, {});
65
+ return _jsx(Issues, {});
66
+ }
67
+ const PAGE = 25;
68
+ /**
69
+ * The organization's projects: its repositories on the forge, which arrive one
70
+ * of two ways — linked from GitHub, or started from a template. A project is a
71
+ * repository; opening one opens its workspace at `<org>/<repo>`, and every run
72
+ * there works on that repository. There is no project without one.
73
+ *
74
+ * Remove takes one away (../removal.ts): Hanzo's copy of a GitHub repository
75
+ * stops syncing and goes, with its project, and GitHub's is never touched; the
76
+ * forge's own goes with its history. It asks once, on the row, saying which.
77
+ */
78
+ function Projects() {
79
+ const host = useHost();
80
+ const target = useTarget();
81
+ const { t } = useI18n();
82
+ const signed = Boolean(host.person);
83
+ const [q, setQ] = useState('');
84
+ const [sort, setSort] = useState('updated');
85
+ const [page, setPage] = useState(0);
86
+ const [landed, setLanded] = useState(0);
87
+ useEffect(() => {
88
+ setPage(0);
89
+ }, [q, sort]);
90
+ const list = useRead(signed ? () => codebases(target) : null, [], [target, signed, landed]);
91
+ const needle = q.trim().toLowerCase();
92
+ const pending = readPending(host.org);
93
+ const pendingKey = pending.map((p) => p.fullName).join('\n');
94
+ const syncing = new Set(pending.map((p) => p.name));
95
+ // A repository asked for from GitHub is listed as syncing until the forge holds it.
96
+ useEffect(() => {
97
+ const waiting = readPending(host.org);
98
+ if (!signed || waiting.length === 0)
99
+ return;
100
+ let stop = false;
101
+ grants(target)
102
+ .then((g) => {
103
+ if (stop)
104
+ return;
105
+ const done = new Set(g.repos.filter((r) => r.imported).map((r) => r.fullName));
106
+ const left = waiting.filter((p) => !done.has(p.fullName));
107
+ if (left.length !== waiting.length) {
108
+ writePending(host.org, left);
109
+ setLanded((n) => n + 1);
110
+ }
111
+ })
112
+ .catch(() => { });
113
+ return () => {
114
+ stop = true;
115
+ };
116
+ }, [signed, target, host.org, pendingKey]);
117
+ const shown = [
118
+ ...list.value,
119
+ ...pending
120
+ .filter((p) => !list.value.some((c) => c.name === p.name))
121
+ .map((p) => ({
122
+ org: host.org ?? '',
123
+ name: p.name,
124
+ description: '',
125
+ branch: 'main',
126
+ public: false,
127
+ clone: '',
128
+ updated: '',
129
+ branches: ['main'],
130
+ })),
131
+ ]
132
+ .filter((c) => !needle || `${c.org}/${c.name} ${c.description}`.toLowerCase().includes(needle))
133
+ .slice()
134
+ .sort((a, b) => {
135
+ if (sort === 'updated') {
136
+ const d = (Date.parse(b.updated) || 0) - (Date.parse(a.updated) || 0);
137
+ if (d !== 0)
138
+ return d;
139
+ }
140
+ return a.name.localeCompare(b.name);
141
+ });
142
+ const pages = Math.max(1, Math.ceil(shown.length / PAGE));
143
+ const safePage = Math.min(page, pages - 1);
144
+ const slice = shown.slice(safePage * PAGE, safePage * PAGE + PAGE);
145
+ const from = shown.length === 0 ? 0 : safePage * PAGE + 1;
146
+ const to = safePage * PAGE + slice.length;
147
+ const none = !list.loading && !list.error && list.value.length === 0 && pending.length === 0;
148
+ const open = (c) => host.go(path({ kind: 'repo', org: c.org || host.org || '', name: c.name }));
149
+ const link = () => host.go(path({ kind: 'screen', screen: 'sync' }));
150
+ const template = () => host.go(path({ kind: 'screen', screen: 'templates' }));
151
+ // What each repository is tied to on Hanzo — the links into it, GitHub's names
152
+ // for the copies it made, the projects built from it — read for Remove alone.
153
+ const made = useRead(signed ? () => sources(target) : null, NONE, [target, signed, landed]);
154
+ const [confirming, setConfirming] = useState(null);
155
+ const [removing, setRemoving] = useState(false);
156
+ const [said, setSaid] = useState('');
157
+ const [saidError, setSaidError] = useState(false);
158
+ // A plan stands on the links, the forge and the projects all having answered:
159
+ // one that missed a link leaves a copy that syncs back, and one that missed a
160
+ // project leaves its site up. GitHub's grants only say which copies GitHub made.
161
+ const whole = !made.loading && made.value.missing.every((m) => m === UNREAD.hub);
162
+ // Any member may: the sync app, the forge and the projects app each confine a
163
+ // delete to the caller's own org and ask no more (cloud apps/sync delete,
164
+ // apps/git deleteRepo, apps/projects del). A row still syncing in is not
165
+ // offered, since its import would bring it back.
166
+ const plan = (c) => signed && whole && !syncing.has(c.name)
167
+ ? removal(c.name, { granted: made.value.hub, linked: made.value.linked, held: made.value.held, sites: made.value.sites }, t)
168
+ : null;
169
+ const drop = (s) => s.kind === 'link' ? removeLink(target, s.id) : s.kind === 'mirror' ? removeRepo(target, s.name) : removeProject(target, s.slug);
170
+ // One step at a time, in order, stopping at the first refusal: nothing is left half-removed unsaid.
171
+ const remove = async (r) => {
172
+ setRemoving(true);
173
+ setSaid('');
174
+ setSaidError(false);
175
+ let at = 0;
176
+ try {
177
+ for (; at < r.steps.length; at++)
178
+ await drop(r.steps[at]);
179
+ toast.success(t('{repo} is removed from Hanzo.', { repo: r.repo }));
180
+ }
181
+ catch (e) {
182
+ setSaid(stopped(r, at, e.message, t));
183
+ setSaidError(true);
184
+ }
185
+ finally {
186
+ setRemoving(false);
187
+ setConfirming(null);
188
+ // Read again either way: what went leaves the list, and the next plan names only what is left.
189
+ list.reload();
190
+ made.reload();
191
+ }
192
+ };
193
+ const copyRepo = (named) => {
194
+ void toClipboard(named).then((ok) => (ok ? toast.success(t('Copied {repo}', { repo: named })) : toast.error(t('Could not copy repository name'))));
195
+ };
196
+ return (_jsxs(YStack, { flex: 1, minH: 0, overflow: "scroll", px: "$6", py: "$6", "$max-md": { px: '$4' }, children: [_jsxs(YStack, { width: "100%", maxW: 1040, mx: "auto", gap: "$4", children: [_jsxs(XStack, { justify: "space-between", items: "flex-start", gap: "$4", flexWrap: "wrap", children: [_jsxs(YStack, { gap: "$1", flex: 1, minW: 240, children: [_jsx(SizableText, { render: "h1", size: "$6", fontWeight: "500", color: "$ink", children: t('Projects') }), _jsx(SizableText, { size: "$2", color: "$soft", children: host.org
197
+ ? t('{org}’s projects and linked GitHub repositories. Open one to work on it.', { org: host.org })
198
+ : t('Projects and linked GitHub repositories. Open one to work on it.') })] }), signed ? (_jsxs(XStack, { gap: "$2", items: "center", flexWrap: "wrap", children: [_jsxs(Button, { size: "sm", variant: "outline", onPress: template, children: [_jsx(LayoutTemplate, { size: 14 }), t('Create from template')] }), _jsxs(Button, { size: "sm", variant: none ? 'outline' : 'primary', borderColor: none ? 'var(--border-strong)' : undefined, onPress: link, children: [_jsx(Github, { size: 14 }), t('Link a GitHub repo')] })] })) : null] }), signed ? _jsx(GitHubLink, { onSync: link }) : null, said ? (_jsx(SizableText, { size: "$2", color: saidError ? 'var(--state-error)' : '$soft', role: "status", children: said })) : null, list.error ? (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", bg: "$panel", px: "$5", py: "$8", gap: "$3", items: "center", children: [_jsx(SizableText, { size: "$2", color: "var(--state-error)", text: "center", children: list.error.message }), _jsx(Button, { size: "sm", variant: "outline", onPress: list.reload, children: t('Try again') })] })) : !signed ? (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", bg: "$panel", px: "$5", py: "$8", gap: "$3", items: "center", children: [_jsx(SizableText, { size: "$2", color: "$soft", text: "center", children: t("Sign in to see this organization's projects.") }), _jsx(Button, { size: "sm", variant: "primary", onPress: () => host.signIn?.(), children: t('Sign in') })] })) : list.loading && list.value.length === 0 && pending.length === 0 ? (_jsxs(YStack, { gap: "$3", "aria-busy": true, children: [_jsx(Note, { children: t('Loading projects…') }), _jsx(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", bg: "$panel", overflow: "hidden", children: [0, 1, 2, 3].map((i) => (_jsxs(XStack, { items: "center", gap: "$3", px: "$3", py: "$3", borderTopWidth: i ? 1 : 0, borderColor: "$borderColor", children: [_jsx(Skeleton, { layout: "block", width: 18, height: 18, rounded: "$2", shrink: 0 }), _jsxs(YStack, { flex: 1, gap: "$1.5", children: [_jsx(Skeleton, { layout: "block", width: "38%", height: 14, rounded: "$2" }), _jsx(Skeleton, { layout: "block", width: "56%", height: 12, rounded: "$2" })] }), _jsx(Skeleton, { layout: "block", width: 64, height: 12, rounded: "$2", shrink: 0 })] }, i))) })] })) : none ? (_jsxs(YStack, { gap: "$4", children: [_jsx(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", bg: "$panel", px: "$5", py: "$6", gap: "$1.5", items: "center", children: _jsx(SizableText, { size: "$2", color: "$soft", text: "center", maxW: 460, children: t('No projects yet. A project is a repository: link one from GitHub, or start one from a template.') }) }), _jsxs(XStack, { gap: "$3", flexWrap: "wrap", children: [_jsx(Choice, { label: t('Link a GitHub repo'), icon: _jsx(Github, { size: 20 }), says: t('Mirror repositories you already have. They stay in step with GitHub, and their issues can come too.'), onPress: link }), _jsx(Choice, { label: t('Create from template'), icon: _jsx(LayoutTemplate, { size: 20 }), says: t('Start from a finished product — a site, an app, a store — and make it yours.'), onPress: template })] })] })) : (_jsxs(_Fragment, { children: [_jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(YStack, { flex: 1, "$max-md": { display: 'none' } }), _jsx(YStack, { width: 320, minW: 0, shrink: 1, "$max-md": { width: 'auto', flex: 1 }, children: _jsx(Input, { value: q, onChangeText: setQ, placeholder: t('Find a project…'), "aria-label": t('Find a project'), startAdornment: _jsx(Search, { size: 14, color: "$soft", "aria-hidden": true }), endAdornment: q ? (_jsx(XStack, { render: "button", "aria-label": t('Clear search'), onPress: () => setQ(''), minW: 24, minH: 24, items: "center", justify: "center", focusVisibleStyle: RING, children: _jsx(X, { size: 13, color: "$soft" }) })) : undefined, onKeyDown: (e) => {
199
+ if (e.key === 'Escape' && q)
200
+ setQ('');
201
+ } }) })] }), shown.length === 0 ? (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", bg: "$panel", px: "$5", py: "$7", gap: "$3", items: "center", children: [_jsx(Note, { children: t('Nothing matches.') }), _jsx(Button, { size: "sm", variant: "outline", onPress: () => setQ(''), children: t('Clear search') })] })) : (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: [_jsxs(XStack, { px: "$3", py: "$2", gap: "$3", items: "center", bg: "$panel", children: [_jsxs(XStack, { flex: 1, minW: 0, render: "button", "aria-label": t('Sort by name'), items: "center", gap: "$1", onPress: () => setSort('name'), children: [_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: t('Name') }), sort === 'name' ? _jsx(ChevronDown, { size: 12 }) : null] }), _jsx(SizableText, { size: "$1", color: "$soft", width: 120, "$max-md": { display: 'none' }, children: t('Branch') }), _jsxs(XStack, { render: "button", "aria-label": t('Sort by last updated'), items: "center", justify: "flex-end", gap: "$1", width: 120, shrink: 0, "$max-md": { width: 84 }, onPress: () => setSort('updated'), children: [_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: t('Updated') }), sort === 'updated' ? _jsx(ChevronDown, { size: 12 }) : null] }), _jsx(YStack, { width: 32, shrink: 0 })] }), slice.map((c) => {
202
+ const key = `${c.org}/${c.name}`;
203
+ const named = `${c.org ? `${c.org}/` : ''}${c.name}`;
204
+ const r = plan(c);
205
+ return (_jsx(YStack, { borderTopWidth: 1, borderColor: "$borderColor", children: _jsxs(XStack, { items: "center", gap: "$3", paddingInlineEnd: "$3", hoverStyle: { bg: '$hover' }, children: [_jsxs(XStack, { render: "button", "aria-label": t('Open {repo}', { repo: named }), onPress: () => open(c), "$platform-web": { textAlign: 'start' }, flex: 1, minW: 0, items: "center", gap: "$3", paddingInlineStart: "$3", py: "$2.5", minH: 44, focusVisibleStyle: RING_INSET, children: [_jsx(XStack, { shrink: 0, children: _jsx(FolderGit2, { size: 15, color: "$soft", "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsxs(XStack, { minW: 0, maxW: "100%", overflow: "hidden", items: "baseline", self: "flex-start", 'data-i18n-ltr': '', children: [c.org ? (_jsx(SizableText, { size: "$2", color: "$soft", numberOfLines: 1, shrink: 100, minW: 0, children: `${c.org}/` })) : null, _jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "500", numberOfLines: 1, shrink: 1, minW: 0, children: c.name })] }), c.description ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: c.description })) : null] }), _jsxs(XStack, { width: 120, items: "center", gap: "$1.5", minW: 0, "$max-md": { display: 'none' }, children: [_jsx(GitBranch, { size: 12, color: "$soft" }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: c.branch })] }), _jsx(SizableText, { size: "$1", color: "$soft", width: 120, shrink: 0, "$max-md": { width: 84 }, text: "end", numberOfLines: 1, children: syncing.has(c.name) ? t('Syncing…') : ago(c.updated) })] }), _jsx(XStack, { width: 32, shrink: 0, justify: "center", children: _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": t('Actions for {repo}', { repo: named }), disabled: removing, width: 32, height: 32, items: "center", justify: "center", focusVisibleStyle: RING, children: _jsx(MoreHorizontal, { size: 16, color: "$soft" }) }), items: [
206
+ { key: 'open', label: t('Open workspace'), icon: _jsx(ArrowRight, { size: 14 }), onSelect: () => open(c) },
207
+ { key: 'copy', label: t('Copy repository'), icon: _jsx(Copy, { size: 14 }), onSelect: () => copyRepo(named) },
208
+ ...(r
209
+ ? [
210
+ { type: 'separator' },
211
+ { key: 'remove', label: t('Remove from Hanzo'), icon: _jsx(Trash2, { size: 14 }), destructive: true, onSelect: () => setConfirming(r) },
212
+ ]
213
+ : []),
214
+ ] }) })] }) }, key));
215
+ }), _jsxs(XStack, { px: "$3", py: "$2", justify: "space-between", items: "center", gap: "$2", flexWrap: "wrap", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontVariant: ['tabular-nums'], children: t('Showing {from}–{to} of {total}', { from, to, total: shown.length }) }), _jsxs(XStack, { gap: "$3", items: "center", children: [_jsx(XStack, { render: "button", "aria-label": t('Previous page'), disabled: safePage === 0, onPress: () => setPage(safePage - 1), children: _jsx(SizableText, { size: "$1", color: safePage === 0 ? '$soft' : '$ink', children: t('Prev') }) }), _jsx(SizableText, { size: "$1", color: "$soft", fontVariant: ['tabular-nums'], children: `${safePage + 1} / ${pages}` }), _jsx(XStack, { render: "button", "aria-label": t('Next page'), disabled: safePage >= pages - 1, onPress: () => setPage(safePage + 1), children: _jsx(SizableText, { size: "$1", color: safePage >= pages - 1 ? '$soft' : '$ink', children: t('Next') }) })] })] })] }))] }))] }), _jsx(Confirm, { open: confirming !== null, onOpenChange: (o) => !o && !removing && setConfirming(null), title: confirming ? t('Remove {repo}?', { repo: confirming.repo }) : t('Remove project?'), says: confirming?.says ?? '', act: t('Remove'), run: async () => {
216
+ if (confirming)
217
+ await remove(confirming);
218
+ } })] }));
219
+ }
220
+ /** One of the two ways in, as a card you press. */
221
+ function Choice({ label, icon, says, onPress }) {
222
+ return (_jsxs(YStack, { render: "button", "aria-label": label, onPress: onPress, flex: 1, flexBasis: 240, minW: 0, gap: "$2", p: "$4", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", items: "flex-start", focusVisibleStyle: RING, children: [icon, _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(SizableText, { size: "$4", color: "$ink", fontWeight: "500", children: label }), _jsx(ArrowRight, { size: 14, 'data-i18n-mirror': '' })] }), _jsx(SizableText, { size: "$2", color: "$soft", text: "start", children: says })] }));
223
+ }
224
+ /**
225
+ * The GitHub connection, in one line: who it is connected as and the way to
226
+ * sync, or the one press that connects it. The person's own connection, or else
227
+ * the accounts the org has bound the App on (`linked`), so an org that installed
228
+ * the App in onboarding does not read as unconnected here. GitHub returns here,
229
+ * and this page finishes the connect (../back.ts).
230
+ *
231
+ * Disconnect lets go of it, so another account can be connected: the person's own
232
+ * link, or (for an org admin) the org's App accounts, which the platform also
233
+ * uninstalls on GitHub. It asks once before doing either.
234
+ *
235
+ * A change made here, in Settings or in the Hanzo app's Quick setup is said on
236
+ * the window (api/github.ts `changed`), and this line reads it again.
237
+ */
238
+ function GitHubLink({ onSync }) {
239
+ const host = useHost();
240
+ const target = useTarget();
241
+ const { t } = useI18n();
242
+ const me = useRead(() => connection(target), null, [target]);
243
+ // An org whose installations cannot be read falls back to the person's own connection.
244
+ const installed = useRead(() => installations(target).catch(() => []), [], [target]);
245
+ const [note, setNote] = useState('');
246
+ const [busy, setBusy] = useState(false);
247
+ const [asking, setAsking] = useState(false);
248
+ const { reload: readMe } = me;
249
+ const { reload: readInstalled } = installed;
250
+ useEffect(() => heard(() => {
251
+ readMe();
252
+ readInstalled();
253
+ }), [readMe, readInstalled]);
254
+ useBack(target, true, setNote);
255
+ const c = me.value ? linked(me.value, installed.value) : null;
256
+ // A connection that cannot be read says nothing here: Sync from GitHub above still works.
257
+ if (me.error || !c || !c.configured)
258
+ return note ? _jsx(Note, { children: note }) : null;
259
+ const link = async () => {
260
+ setBusy(true);
261
+ setNote('');
262
+ try {
263
+ host.open(await connect(target, here()));
264
+ }
265
+ catch (e) {
266
+ setNote(e.message);
267
+ setBusy(false);
268
+ }
269
+ };
270
+ // The person's own link is theirs to drop; the org's App accounts are an org admin's.
271
+ const own = me.value?.connected === true;
272
+ const leave = c.connected && (own || host.admin);
273
+ const drop = async () => {
274
+ setBusy(true);
275
+ setNote('');
276
+ try {
277
+ await (own ? unlink(target) : disconnect(target, 'github'));
278
+ setAsking(false);
279
+ setNote(t('GitHub is disconnected. Connect it again to choose another account.'));
280
+ changed();
281
+ }
282
+ catch (e) {
283
+ setNote(e.message);
284
+ }
285
+ finally {
286
+ setBusy(false);
287
+ }
288
+ };
289
+ return (_jsxs(XStack, { items: "center", gap: "$3", px: "$3", py: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", flexWrap: "wrap", children: [_jsx(Github, { size: 16 }), _jsxs(YStack, { flex: 1, minW: 200, children: [_jsx(SizableText, { size: "$2", color: "$ink", children: c.connected ? t('GitHub connected as {login}', { login: `@${c.login}` }) : t('Connect GitHub to bring your repositories here') }), _jsx(SizableText, { size: "$1", color: "$soft", children: asking
290
+ ? own
291
+ ? t('Disconnect your GitHub from Hanzo?')
292
+ : t('Disconnect @{login}? Hanzo’s GitHub App is removed from it too, unless another organization uses it.', { login: c.login })
293
+ : note || (c.connected ? t('Choose repositories to mirror; each stays in step with GitHub.') : t('One step on GitHub, then pick the repositories to sync.')) })] }), c.connected && asking ? (_jsxs(XStack, { gap: "$2", children: [_jsx(Button, { size: "sm", variant: "outline", disabled: busy, onPress: () => setAsking(false), children: t('Cancel') }), _jsx(Button, { size: "sm", variant: "primary", disabled: busy, onPress: () => void drop(), children: busy ? t('Disconnecting…') : t('Confirm disconnect') })] })) : c.connected ? (_jsxs(XStack, { gap: "$2", children: [_jsxs(Button, { size: "sm", variant: "outline", onPress: onSync, children: [_jsx(RefreshCw, { size: 14 }), t('Sync repositories')] }), leave ? (_jsx(Button, { size: "sm", variant: "outline", disabled: busy, onPress: () => setAsking(true), children: t('Disconnect') })) : null] })) : (_jsxs(Button, { size: "sm", variant: "primary", disabled: busy, onPress: () => void link(), children: [_jsx(Github, { size: 14 }), busy ? t('Opening GitHub…') : t('Connect GitHub')] }))] }));
294
+ }
295
+ /** The menus' words, marked (`phrase`) and drawn through `t`; GitHub and Hanzo are names, drawn as given. */
296
+ const KINDS = { all: phrase('Issues and pull requests'), issue: phrase('Issues'), pr: phrase('Pull requests') };
297
+ const ORIGINS = { all: phrase('Every source'), github: 'GitHub', hanzo: 'Hanzo' };
298
+ const ORDERS = { newest: phrase('Newest'), oldest: phrase('Oldest'), updated: phrase('Recently updated') };
299
+ /** Mirrored from GitHub: the task index carried it from GitHub (`extRef` github:…). */
300
+ const fromGitHub = (i) => i.sources.includes('github');
301
+ /** Done and canceled are closed; every other column is open work. */
302
+ const closed = (i) => i.state === 'closed';
303
+ /** An RFC 3339 time as milliseconds, 0 when there is none. */
304
+ const ms = (iso) => Date.parse(iso) || 0;
305
+ /** The repository an issue is for, once the projects have named it, else the forge's name for it, else its board. */
306
+ const projectOf = (i) => i.repo || i.forge || i.board;
307
+ /**
308
+ * Whether `i` is filed under the project `key`: its board, its forge
309
+ * repository, or its repository by address or by name — either case. A board
310
+ * and the repository it is named for are one project, as the forge files them.
311
+ */
312
+ function inProject(i, key) {
313
+ const k = key.toLowerCase();
314
+ return [i.board, i.forge, i.repo, i.repo.split('/')[1] ?? ''].some((v) => v !== '' && v.toLowerCase() === k);
315
+ }
316
+ /** How a person refers to an issue: `owner/name#N` on its own repository, the board's handle otherwise, '' with neither. */
317
+ function ref(i) {
318
+ const tag = handle(i);
319
+ const at = i.repo || i.forge;
320
+ return tag.startsWith('#') && at ? `${at}${tag}` : tag;
321
+ }
322
+ /** A dropdown that picks one of `options`, its trigger naming the choice. */
323
+ function Pick({ label, value, options, active = false, onPick }) {
324
+ return (_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": label, items: "center", gap: "$1", px: "$2", py: "$1", rounded: "$2", hoverStyle: { bg: '$hover' }, children: [_jsx(SizableText, { size: "$2", color: "$soft", numberOfLines: 1, children: options[value] }), _jsx(ChevronDown, { size: 12 })] }), items: Object.keys(options).map((k) => ({
325
+ key: k || '*',
326
+ label: options[k],
327
+ icon: k === value ? _jsx(Check, { size: 14 }) : _jsx(YStack, { width: 14 }),
328
+ onSelect: () => onPick(k),
329
+ })) }));
330
+ }
331
+ /** The words a list carries as a menu: every one of them, or `all`. */
332
+ const menu = (all, values) => Object.fromEntries([['', all], ...values.map((v) => [v, v])]);
333
+ function Mark({ i }) {
334
+ if (i.pull)
335
+ return _jsx(GitPullRequest, { size: 16, color: closed(i) ? '$soft' : '$ink' });
336
+ if (i.status === 'canceled')
337
+ return _jsx(CircleSlash, { size: 16, color: "$soft" });
338
+ if (closed(i))
339
+ return _jsx(CircleCheck, { size: 16, color: "$soft" });
340
+ return _jsx(CircleDot, { size: 16, color: "$ink" });
341
+ }
342
+ function Tag({ children }) {
343
+ return (_jsx(XStack, { px: "$2", py: 1, rounded: 999, borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: children }) }));
344
+ }
345
+ const NONE = { hub: [], linked: [], held: [], sites: [], owners: [], next: '', unread: [], missing: [] };
346
+ /**
347
+ * Pressing an issue: New, on the issue's own repository, holding the issue. A
348
+ * GitHub issue runs on GitHub, where its pull request closes it; a forge issue
349
+ * on the forge. A repository not among the projects read so far is looked up by
350
+ * its address; an issue no project answers to asks which one it is for — a
351
+ * board's key or a Linear team's is never taken for a repository.
352
+ */
353
+ function useOpen(list, work) {
354
+ const host = useHost();
355
+ const t = useTarget();
356
+ const [asking, setAsking] = useState(null);
357
+ const [finding, setFinding] = useState('');
358
+ const go = (i, p) => {
359
+ // A project the person picked for an issue that is not its own closes nothing there.
360
+ const own = place(i, [p]) !== null;
361
+ const n = own ? closes(i, p) : 0;
362
+ pinRepo(host.org, p, ask(i, n), n, own ? home(i, p) : undefined);
363
+ setAsking(null);
364
+ host.go('');
365
+ };
366
+ const open = async (i) => {
367
+ const p = place(i, list);
368
+ if (p && (p.forge || p.linked))
369
+ return go(i, p);
370
+ if (i.repo) {
371
+ setFinding(i.key);
372
+ const [owner = '', name = ''] = i.repo.split('/');
373
+ const found = await sources(t, { q: name, owner })
374
+ .then((s) => assemble({ granted: s.hub, linked: s.linked, held: s.held, sites: s.sites, work }).find((x) => x.key === keyOf(owner, name)) ?? null)
375
+ .catch(() => null);
376
+ setFinding('');
377
+ if (found && (found.forge || found.linked))
378
+ return go(i, found);
379
+ }
380
+ setAsking(i);
381
+ };
382
+ const dialog = _jsx(Which, { issue: asking, list: list, onPick: (p) => asking && go(asking, p), onClose: () => setAsking(null) });
383
+ return { open: (i) => void open(i), finding, dialog };
384
+ }
385
+ /** Asks which project an issue is for, from the org's own list: never a free string. */
386
+ function Which({ issue, list, onPick, onClose }) {
387
+ const { t } = useI18n();
388
+ const [q, setQ] = useState('');
389
+ useEffect(() => {
390
+ if (!issue)
391
+ setQ('');
392
+ }, [issue]);
393
+ const shown = pickProjects(list.filter((p) => p.forge || p.linked), { q }).slice(0, 50);
394
+ const named = issue?.repo || issue?.hint || '';
395
+ return (_jsx(Dialog, { open: issue !== null, onOpenChange: (o) => (o ? null : onClose()), children: _jsxs(DialogContent, { maxW: 480, gap: "$3", children: [_jsx(DialogTitle, { children: t('Which project is this for?') }), _jsx(SizableText, { size: "$2", color: "$soft", children: named
396
+ ? t('“{name}” is not one of this organization’s projects. Choose the repository the run works on.', { name: named })
397
+ : issue?.board
398
+ ? t('This issue names no repository: it is on the {board} board. Choose the one the run works on.', { board: issue.board })
399
+ : t('This issue names no repository. Choose the one the run works on.') }), _jsx(Input, { value: q, onChangeText: setQ, placeholder: t('Find a project…'), "aria-label": t('Find a project'), startAdornment: _jsx(Search, { size: 14, color: "$soft" }) }), _jsx(YStack, { gap: "$1", maxH: 320, overflow: "scroll", children: shown.length === 0 ? (_jsx(Note, { children: list.length ? t('Nothing matches.') : t('No projects are linked yet.') })) : (shown.map((p) => (_jsx(XStack, { render: "button", "aria-label": t('Work on {repo}', { repo: `${p.owner}/${p.name}` }), onPress: () => onPick(p), px: "$2.5", py: "$2", rounded: "$3", items: "center", justify: "flex-start", hoverStyle: { bg: '$hover' }, children: _jsxs(XStack, { minW: 0, shrink: 1, 'data-i18n-ltr': '', children: [_jsx(SizableText, { size: "$2", color: "$soft", numberOfLines: 1, shrink: 0, children: `${p.owner}/` }), _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, shrink: 1, children: p.name })] }) }, p.key)))) }), _jsx(XStack, { justify: "flex-end", children: _jsx(Button, { size: "sm", variant: "outline", onPress: onClose, children: t('Cancel') }) })] }) }));
400
+ }
401
+ /**
402
+ * Every project's issues, read the way GitHub reads them: open or closed, one
403
+ * project or all of them, narrowed by words, kind, source, label and assignee,
404
+ * and ordered. The same issue on two boards is one row. Each project syncs its
405
+ * own issues from GitHub; choosing an issue starts the next run on the issue's
406
+ * own repository with the issue as the ask.
407
+ */
408
+ function Issues() {
409
+ const host = useHost();
410
+ const target = useTarget();
411
+ const { t } = useI18n();
412
+ const media = useMedia();
413
+ const wideNav = Boolean(media.md);
414
+ const wideFilters = Boolean(media.sm);
415
+ const [devMode] = useDevMode();
416
+ const signed = Boolean(host.person);
417
+ const [board, setBoard] = useKept(boardKey(host.org), '');
418
+ const [state, setState] = useState('open');
419
+ const [kind, setKind] = useState('all');
420
+ const [origin, setOrigin] = useState('all');
421
+ const [order, setOrder] = useState('newest');
422
+ const [label, setLabel] = useState('');
423
+ const [assignee, setAssignee] = useState('');
424
+ const [q, setQ] = useState('');
425
+ const [moreBoards, setMoreBoards] = useState(false);
426
+ const [showFilters, setShowFilters] = useState(false);
427
+ const [pulled, setPulled] = useState(0);
428
+ const [busy, setBusy] = useState(false);
429
+ const [said, setSaid] = useState(null);
430
+ const list = useRead(signed ? () => everything(target) : null, [], [target, signed, pulled]);
431
+ const known = useRead(signed ? () => boards(target) : null, [], [target, signed]);
432
+ // What the org's projects are made from, so an issue is placed on its own repository.
433
+ const made = useRead(signed ? () => sources(target) : null, NONE, [target, signed]);
434
+ const projects = useMemo(() => assemble({ granted: made.value.hub, linked: made.value.linked, held: made.value.held, sites: made.value.sites, work: list.value }), [made.value, list.value]);
435
+ const work = useMemo(() => attach(list.value, projects), [list.value, projects]);
436
+ const { open, finding, dialog } = useOpen(projects, list.value);
437
+ // Another screen chose the board (the rail's Issues chooses every board) while this one is open.
438
+ useEffect(() => {
439
+ const on = (e) => setBoard(e.detail);
440
+ window.addEventListener('hanzo-board', on);
441
+ return () => window.removeEventListener('hanzo-board', on);
442
+ }, [setBoard]);
443
+ useEffect(() => setSaid(null), [board]);
444
+ // The projects: every board the forge names, and every repository an issue is filed under that no board is named for.
445
+ const column = new Map();
446
+ for (const b of known.value)
447
+ column.set(b.key.toLowerCase(), { key: b.key, name: b.name, open: 0 });
448
+ for (const i of work) {
449
+ const key = projectOf(i);
450
+ if (key && ![...column.values()].some((p) => inProject(i, p.key)))
451
+ column.set(key.toLowerCase(), { key, name: key, open: 0 });
452
+ }
453
+ for (const p of column.values())
454
+ p.open = work.filter((i) => !closed(i) && inProject(i, p.key)).length;
455
+ const rows = [...column.values()].sort((a, b) => a.name.localeCompare(b.name));
456
+ const current = board ? column.get(board.toLowerCase()) : undefined;
457
+ const title = current?.name ?? board;
458
+ // Progressive disclosure: cap visible project filters to 6 on desktop (4 on compact screens), keeping the selected project visible.
459
+ const allBoardChips = [{ key: '', name: t('All projects'), open: work.filter((i) => !closed(i)).length }, ...rows];
460
+ const boardCap = wideNav ? 6 : 4;
461
+ const boardOverflow = allBoardChips.length > boardCap;
462
+ const visibleBoards = !moreBoards && boardOverflow
463
+ ? (() => {
464
+ const base = allBoardChips.slice(0, boardCap);
465
+ if (base.some((b) => b.key.toLowerCase() === board.toLowerCase()))
466
+ return base;
467
+ const active = allBoardChips.find((b) => b.key.toLowerCase() === board.toLowerCase());
468
+ return active ? [...base.slice(0, Math.max(1, boardCap - 1)), active] : base;
469
+ })()
470
+ : allBoardChips;
471
+ const hiddenBoardCount = allBoardChips.length - visibleBoards.length;
472
+ const inBoard = work.filter((i) => !board || inProject(i, board));
473
+ const { labels, assignees } = facets(inBoard);
474
+ const scoped = inBoard
475
+ .filter((i) => kind === 'all' || (kind === 'pr') === i.pull)
476
+ .filter((i) => origin === 'all' || (origin === 'github') === fromGitHub(i))
477
+ .filter((i) => !label || i.labels.some((l) => l.toLowerCase() === label.toLowerCase()))
478
+ .filter((i) => !assignee || i.assignees.some((a) => a.toLowerCase() === assignee.toLowerCase()))
479
+ .filter((i) => matches(q, i.title, ref(i), projectOf(i), ...i.assignees, ...i.labels));
480
+ const opened = scoped.filter((i) => !closed(i));
481
+ const shut = scoped.filter(closed);
482
+ const shown = (state === 'open' ? opened : shut).slice().sort((a, b) => {
483
+ if (order === 'updated')
484
+ return ms(b.updated || b.created) - ms(a.updated || a.created);
485
+ if (order === 'oldest')
486
+ return ms(a.created) - ms(b.created);
487
+ return ms(b.created) - ms(a.created);
488
+ });
489
+ const secondaryFilterCount = (label ? 1 : 0) + (assignee ? 1 : 0) + (origin !== 'all' ? 1 : 0);
490
+ const narrowed = q.trim() !== '' || kind !== 'all' || secondaryFilterCount > 0;
491
+ const clearFilters = () => {
492
+ setQ('');
493
+ setKind('all');
494
+ setOrigin('all');
495
+ setLabel('');
496
+ setAssignee('');
497
+ };
498
+ const pull = async () => {
499
+ setBusy(true);
500
+ setSaid(null);
501
+ try {
502
+ const s = await syncIssues(target, board);
503
+ const where = board ? title : s.repos === 1 ? t('1 repository') : t('{n} repositories', { n: s.repos });
504
+ const parts = [
505
+ s.issues === 1 ? t('1 issue synced from {where}', { where }) : t('{n} issues synced from {where}', { n: s.issues, where }),
506
+ t('{n} new', { n: s.created }),
507
+ t('{n} updated', { n: s.updated }),
508
+ ];
509
+ if (s.failed)
510
+ parts.push(t('{n} failed', { n: s.failed }));
511
+ setSaid({ text: `${parts.join(' · ')}.${s.truncated ? ` ${t('More remain — sync again to continue.')}` : ''}` });
512
+ setPulled((n) => n + 1);
513
+ }
514
+ catch (e) {
515
+ const text = e.message;
516
+ setSaid({ text, connect: /not connected/i.test(text) });
517
+ }
518
+ finally {
519
+ setBusy(false);
520
+ }
521
+ };
522
+ const link = async () => {
523
+ try {
524
+ host.open(await connect(target, here()));
525
+ }
526
+ catch (e) {
527
+ setSaid({ text: e.message });
528
+ }
529
+ };
530
+ const copyRef = (named) => {
531
+ void toClipboard(named).then((ok) => (ok ? toast.success(t('Copied {ref}', { ref: named })) : toast.error(t('Could not copy reference'))));
532
+ };
533
+ const chip = (key, name, count) => {
534
+ const on = key.toLowerCase() === board.toLowerCase();
535
+ return (_jsxs(XStack, { render: "button", "aria-label": key ? t('Show {project}', { project: name }) : t('Show every project'), "aria-pressed": on, onPress: () => setBoard(key), items: "center", gap: "$2", px: "$2.5", py: "$1.5", minH: 32, rounded: "$3", shrink: 0, focusVisibleStyle: RING, children: [_jsx(SizableText, { flex: 1, size: "$2", color: on ? '$ink' : '$soft', numberOfLines: 1, text: "start", children: name }), count ? (_jsx(SizableText, { size: "$1", color: "$soft", fontVariant: ['tabular-nums'], children: count })) : null] }, key || '*'));
536
+ };
537
+ return (_jsxs(YStack, { flex: 1, minH: 0, overflow: "scroll", px: "$6", py: "$6", "$max-md": { px: '$4' }, children: [_jsxs(YStack, { width: "100%", maxW: 1120, mx: "auto", gap: "$4", children: [_jsxs(XStack, { justify: "space-between", items: "flex-start", gap: "$4", flexWrap: "wrap", children: [_jsxs(YStack, { gap: "$1", flex: 1, minW: 240, children: [_jsx(SizableText, { render: "h1", size: "$6", fontWeight: "500", color: "$ink", children: board ? t('Issues · {project}', { project: title }) : t('Issues') }), _jsx(SizableText, { size: "$2", color: "$soft", children: board
538
+ ? t('Work on {project}. Choosing an issue starts the next run on its own repository.', { project: title })
539
+ : t('Work across every project. Choosing an issue starts the next run on its own repository.') })] }), _jsxs(Button, { size: "sm", variant: "outline", disabled: !signed || busy, onPress: () => void pull(), children: [_jsx(Github, { size: 14 }), busy ? t('Syncing…') : board ? t('Sync {project} from GitHub', { project: title }) : t('Sync all from GitHub')] })] }), said ? (_jsxs(XStack, { items: "center", gap: "$3", flexWrap: "wrap", children: [_jsx(Note, { children: said.text }), said.connect ? (_jsxs(Button, { size: "sm", variant: "primary", onPress: () => void link(), children: [_jsx(Github, { size: 14 }), t('Connect GitHub')] })) : null] })) : null, _jsxs(XStack, { gap: "$5", items: "flex-start", "$max-md": { flexDirection: 'column', gap: '$3' }, children: [_jsxs(YStack, { render: "nav", "aria-label": t('Projects'), width: 220, shrink: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", px: "$2.5", pb: "$1", "$max-md": { display: 'none' }, children: t('Projects') }), visibleBoards.map((p) => chip(p.key, p.name, p.open)), boardOverflow ? (_jsx(XStack, { render: "button", "aria-expanded": moreBoards, "aria-label": moreBoards ? t('Show fewer projects') : t('Show {n} more projects', { n: hiddenBoardCount }), onPress: () => setMoreBoards((v) => !v), items: "center", px: "$2.5", py: "$1.5", minH: 32, shrink: 0, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", fontWeight: "500", color: "$ink", children: moreBoards ? t('Show less') : t('+{n} more', { n: hiddenBoardCount }) }) })) : null] }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$3", width: "100%", "$max-md": { flexBasis: 'auto', grow: 0, minW: 0, width: '100%' }, "$max-sm": { flexBasis: 'auto', grow: 0, minW: 0, width: '100%' }, children: [_jsx(Input, { value: q, onChangeText: setQ, placeholder: t('Search issues'), "aria-label": t('Search issues'), disabled: !signed, startAdornment: _jsx(Search, { size: 14, color: "$soft" }), endAdornment: q ? (_jsx(XStack, { render: "button", "aria-label": t('Clear search'), onPress: () => setQ(''), minW: 24, minH: 24, items: "center", justify: "center", focusVisibleStyle: RING, children: _jsx(X, { size: 13, color: "$soft" }) })) : undefined, onKeyDown: (e) => {
540
+ if (e.key === 'Escape' && q)
541
+ setQ('');
542
+ } }), list.error ? (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", bg: "$panel", px: "$5", py: "$8", gap: "$3", items: "center", children: [_jsx(SizableText, { size: "$2", color: "var(--state-error)", text: "center", children: list.error.message }), _jsx(Button, { size: "sm", variant: "outline", onPress: list.reload, children: t('Try again') })] })) : !signed ? (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", bg: "$panel", px: "$5", py: "$8", gap: "$3", items: "center", children: [_jsx(SizableText, { size: "$2", color: "$soft", text: "center", children: t("Sign in to see this organization's issues.") }), _jsx(Button, { size: "sm", variant: "primary", onPress: () => host.signIn?.(), children: t('Sign in') })] })) : list.loading && list.value.length === 0 ? (_jsxs(YStack, { gap: "$3", "aria-busy": true, children: [_jsx(Note, { children: t('Loading issues…') }), _jsx(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", bg: "$panel", overflow: "hidden", children: [0, 1, 2, 3, 4].map((i) => (_jsxs(XStack, { items: "center", gap: "$3", px: "$3", py: "$3", borderTopWidth: i ? 1 : 0, borderColor: "$borderColor", children: [_jsx(Skeleton, { layout: "block", width: 16, height: 16, rounded: 999, shrink: 0 }), _jsxs(YStack, { flex: 1, gap: "$1.5", children: [_jsx(Skeleton, { layout: "block", width: "54%", height: 14, rounded: "$2" }), _jsx(Skeleton, { layout: "block", width: "36%", height: 12, rounded: "$2" })] })] }, i))) })] })) : (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: [_jsxs(XStack, { px: "$3", py: "$2", gap: "$3", items: "center", bg: "$panel", flexWrap: "wrap", children: [_jsxs(XStack, { gap: "$3", items: "center", flex: 1, minW: 0, children: [_jsxs(XStack, { render: "button", "aria-label": t('Open issues'), "aria-pressed": state === 'open', items: "center", gap: "$1.5", onPress: () => setState('open'), children: [_jsx(CircleDot, { size: 14, color: state === 'open' ? '$ink' : '$soft' }), _jsx(SizableText, { size: "$2", color: state === 'open' ? '$ink' : '$soft', fontWeight: state === 'open' ? '500' : '400', fontVariant: ['tabular-nums'], children: t('{n} open', { n: opened.length }) })] }), _jsxs(XStack, { render: "button", "aria-label": t('Closed issues'), "aria-pressed": state === 'closed', items: "center", gap: "$1.5", onPress: () => setState('closed'), children: [_jsx(Check, { size: 14, color: state === 'closed' ? '$ink' : '$soft' }), _jsx(SizableText, { size: "$2", color: state === 'closed' ? '$ink' : '$soft', fontWeight: state === 'closed' ? '500' : '400', fontVariant: ['tabular-nums'], children: t('{n} closed', { n: shut.length }) })] })] }), _jsx(XStack, { flex: 1, "$max-sm": { display: 'none' } }), _jsxs(XStack, { gap: "$1", rowGap: "$1", items: "center", flexWrap: "wrap", shrink: 1, minW: 0, children: [wideFilters || showFilters ? (_jsxs(_Fragment, { children: [_jsx(Pick, { label: t('Label'), value: label, active: Boolean(label), options: menu(t('Any label'), labels), onPick: setLabel }), _jsx(Pick, { label: t('Assignee'), value: assignee, active: Boolean(assignee), options: menu(t('Anyone'), assignees), onPick: setAssignee })] })) : null, _jsx(Pick, { label: t('Kind'), value: kind, active: kind !== 'all', options: { all: t(KINDS.all), issue: t(KINDS.issue), pr: t(KINDS.pr) }, onPick: setKind }), wideFilters || showFilters ? (_jsx(Pick, { label: t('Source'), value: origin, active: origin !== 'all', options: { ...ORIGINS, all: t(ORIGINS.all) }, onPick: setOrigin })) : null, _jsx(Pick, { label: t('Sort'), value: order, active: order !== 'newest', options: { newest: t(ORDERS.newest), oldest: t(ORDERS.oldest), updated: t(ORDERS.updated) }, onPick: setOrder }), !wideFilters ? (_jsxs(XStack, { render: "button", "aria-expanded": showFilters, "aria-label": showFilters ? t('Hide filters') : t('More filters'), onPress: () => setShowFilters((v) => !v), items: "center", gap: "$1.5", px: "$2", py: "$1", minH: 44, focusVisibleStyle: RING, children: [_jsx(SlidersHorizontal, { size: 13, color: showFilters || secondaryFilterCount ? '$ink' : '$soft' }), _jsx(SizableText, { size: "$2", color: showFilters || secondaryFilterCount ? '$ink' : '$soft', children: secondaryFilterCount ? t('Filters ({n})', { n: secondaryFilterCount }) : t('Filters') })] })) : null] })] }), shown.length === 0 ? (_jsxs(YStack, { px: "$3", py: "$6", gap: "$3", items: "center", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(Note, { children: state === 'open' ? (narrowed ? t('No open issues match.') : t('Nothing open.')) : t('Nothing closed.') }), narrowed ? (_jsx(Button, { size: "sm", variant: "outline", onPress: clearFilters, children: t('Clear filters') })) : list.value.length === 0 ? (_jsxs(XStack, { gap: "$2", flexWrap: "wrap", justify: "center", children: [_jsxs(Button, { size: "sm", variant: "outline", disabled: busy, onPress: () => void pull(), children: [_jsx(Github, { size: 14 }), t('Sync from GitHub')] }), _jsx(Button, { size: "sm", onPress: () => host.go(''), children: t('Start a new run') })] })) : null] })) : (shown.map((i) => {
543
+ const named = ref(i);
544
+ return (_jsxs(XStack, { items: "center", gap: "$1.5", paddingInlineEnd: "$2.5", borderTopWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: [_jsxs(XStack, { render: "button", "aria-label": t('Build {issue}', { issue: named || i.title }), onPress: () => open(i), disabled: finding === i.key && i.key !== '', flex: 1, minW: 0, items: "flex-start", gap: "$3", paddingInlineStart: "$3", py: "$2.5", minH: 44, "$platform-web": { textAlign: 'start' }, focusVisibleStyle: RING_INSET, children: [_jsx(YStack, { pt: 2, children: _jsx(Mark, { i: i }) }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$1", items: "flex-start", children: [_jsxs(XStack, { gap: "$2", items: "center", flexWrap: "wrap", maxW: "100%", children: [_jsx(SizableText, { size: "$3", color: "$ink", fontWeight: "500", numberOfLines: 1, shrink: 1, children: i.title }), STATUS[i.status] && !closed(i) && i.status !== 'todo' ? _jsx(Tag, { children: t(STATUS[i.status]) }) : null, !STATUS[i.status] ? _jsx(Tag, { children: i.status }) : null, i.priority !== 'none' && i.priority ? _jsx(Tag, { children: i.priority }) : null, i.labels.slice(0, 4).map((l) => (_jsx(Tag, { children: l }, l)))] }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: [
545
+ named || (i.pull ? (devMode ? t('pr') : t('Pull request')) : i.kind),
546
+ !board && projectOf(i) && !named.startsWith(projectOf(i)) ? projectOf(i) : '',
547
+ i.created ? t('opened {when}', { when: ago(i.created) }) : '',
548
+ i.assignees.length ? t('assigned to {people}', { people: i.assignees.join(', ') }) : '',
549
+ fromGitHub(i) ? 'GitHub' : '',
550
+ finding === i.key && i.key !== '' ? t('opening…') : '',
551
+ ]
552
+ .filter(Boolean)
553
+ .join(' · ') })] })] }), i.url ? (_jsx(Out, { href: i.url, label: fromGitHub(i) ? t('Open {issue} on GitHub', { issue: named || i.title }) : t('Open {issue} in project', { issue: named || i.title }), children: _jsx(XStack, { width: 32, height: 32, $touchable: { minW: 44, minH: 44 }, "$max-sm": { minW: 44, minH: 44 }, items: "center", justify: "center", rounded: "$2", hoverStyle: { bg: '$raised' }, children: _jsx(ExternalLink, { size: 14, color: "$soft" }) }) })) : null, _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": t('Actions for {issue}', { issue: named || i.title }), width: 32, height: 32, items: "center", justify: "center", focusVisibleStyle: RING, children: _jsx(MoreHorizontal, { size: 16, color: "$soft" }) }), items: [
554
+ { key: 'work', label: t('Work on this issue'), icon: _jsx(ArrowRight, { size: 14 }), onSelect: () => open(i) },
555
+ ...(named
556
+ ? [{ key: 'copy', label: t('Copy reference'), icon: _jsx(Copy, { size: 14 }), onSelect: () => copyRef(named) }]
557
+ : []),
558
+ ...(i.url
559
+ ? [
560
+ {
561
+ key: 'external',
562
+ label: fromGitHub(i) ? t('Open on GitHub') : t('Open in project'),
563
+ icon: _jsx(ExternalLink, { size: 14 }),
564
+ onSelect: () => window.open(i.url, '_blank', 'noopener,noreferrer'),
565
+ },
566
+ ]
567
+ : []),
568
+ ] })] }, i.key || `${i.board}:${i.title}`));
569
+ }))] }))] })] })] }), dialog] }));
570
+ }