@kubitnodes/stellaris 0.3.6 → 0.3.8

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 (38) hide show
  1. package/dist/cli/index.js +108 -18
  2. package/dist/server/index.js +179 -36
  3. package/package.json +1 -1
  4. package/web/dist/assets/{BackLink-Cr1RWb4K.js → BackLink-DrYyD7II.js} +1 -1
  5. package/web/dist/assets/{ChannelView-iK3ug1lV.js → ChannelView-B2sufhRs.js} +1 -1
  6. package/web/dist/assets/CitizenView-B9u0X7ZY.js +2 -0
  7. package/web/dist/assets/{CitizensView-CFrD6f7m.js → CitizensView-B60Z7gmH.js} +1 -1
  8. package/web/dist/assets/KnowledgeView-Cppc2D7_.js +1 -0
  9. package/web/dist/assets/{Markdown-CYcTTxcR.js → Markdown-B390nfRS.js} +1 -1
  10. package/web/dist/assets/{MessageItem-DDC_1Jqn.js → MessageItem-D54BS9OS.js} +1 -1
  11. package/web/dist/assets/MetricsView-CsoRuj4g.js +1 -0
  12. package/web/dist/assets/{NeedsYouView-I7j_cnda.js → NeedsYouView-BPjjyZRx.js} +1 -1
  13. package/web/dist/assets/{Overview-DI7LPNEY.js → Overview-BWEXLQaq.js} +1 -1
  14. package/web/dist/assets/{Pane-BNjb76U4.js → Pane-DvocjNie.js} +1 -1
  15. package/web/dist/assets/ProjectView-BIC7kE4L.js +1 -0
  16. package/web/dist/assets/{ProposalView-DrP3Cv9y.js → ProposalView-cPi-EUXR.js} +1 -1
  17. package/web/dist/assets/{ProposalsView-90rufsQN.js → ProposalsView-Bq7iCMtk.js} +1 -1
  18. package/web/dist/assets/{RunnersView-iMbemuCe.js → RunnersView-BiJmbsoG.js} +1 -1
  19. package/web/dist/assets/{SocietyView-C9FdIFZY.js → SocietyView-6iPyxKze.js} +1 -1
  20. package/web/dist/assets/{SubjectThread-Bw6wEJpH.js → SubjectThread-D2BHnecl.js} +1 -1
  21. package/web/dist/assets/{TaskFileView-D0n7kzt2.js → TaskFileView-DDs6OHWY.js} +1 -1
  22. package/web/dist/assets/{TaskView-BZ6U_XpQ.js → TaskView-3_2vs2fy.js} +1 -1
  23. package/web/dist/assets/{TasksView-CtGF3i-n.js → TasksView-B7a0sWKu.js} +1 -1
  24. package/web/dist/assets/{ThreadCard-FPtAzvNM.js → ThreadCard-9h03aKCB.js} +1 -1
  25. package/web/dist/assets/{ThreadForms-LFw2EF6r.js → ThreadForms-uORhDqAo.js} +1 -1
  26. package/web/dist/assets/{ThreadView-DnDx2SCv.js → ThreadView-DVSe1HGK.js} +1 -1
  27. package/web/dist/assets/{citizen-Bm_r8vBY.js → citizen-CDTy3g7f.js} +1 -1
  28. package/web/dist/assets/format-C6tBTRKZ.js +55 -0
  29. package/web/dist/assets/index-CugUsWCm.js +23 -0
  30. package/web/dist/assets/{tasks-tFehkpRz.js → tasks-Bh3GaY7V.js} +1 -1
  31. package/web/dist/assets/{useStickyScroll-XrG6M-hT.js → useStickyScroll-C6bu36lV.js} +1 -1
  32. package/web/dist/index.html +3 -3
  33. package/web/dist/assets/CitizenView-BiaYYmCh.js +0 -2
  34. package/web/dist/assets/KnowledgeView-CR3cXdj0.js +0 -1
  35. package/web/dist/assets/MetricsView-xdvE7pFA.js +0 -1
  36. package/web/dist/assets/ProjectView-DYDcDsWg.js +0 -1
  37. package/web/dist/assets/format-Cj7NW9Y9.js +0 -55
  38. package/web/dist/assets/index-CthEgIzf.js +0 -23
@@ -1 +1 @@
1
- import{A as e,b as t,h as n,ht as r,k as i,ln as a,ot as o,p as s,w as c,y as l}from"./format-Cj7NW9Y9.js";import{n as u,t as d}from"./Pane-BNjb76U4.js";import{n as f,r as p,t as m}from"./Overview-DI7LPNEY.js";var h=a();function g(){let a=e(),g=n(),_=t(),v=c(),y=i(),b=s(o),x=l(3e4);if(a.data===void 0||g.data===void 0)return(0,h.jsx)(u,{children:`Reading the society…`});let S=g.data.filter(e=>e.cli!==null),C=S.filter(e=>e.status===`active`),w=S.filter(e=>e.status===`retired`),T=(v.data??[]).filter(e=>e.name!==r);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{title:a.data.name,subtitle:`${C.length} citizens · ${_.data?.length??0} projects · ${T.length} roles`}),(0,h.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,h.jsxs)(f,{title:`Citizens`,children:[(0,h.jsx)(m,{members:C,scope:o}),w.length===0?null:(0,h.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,w.map(e=>e.name).join(`, `)]})]}),(0,h.jsx)(f,{title:`Roles`,children:(0,h.jsx)(`ul`,{className:`space-y-2.5`,children:T.map(e=>{let t=C.filter(t=>t.role===e.name).length;return(0,h.jsxs)(`li`,{children:[(0,h.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,h.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,h.jsx)(f,{title:`Knowledge`,children:(0,h.jsx)(p,{scope:o,topics:b.data,now:x})}),(0,h.jsx)(f,{title:`Skills`,children:y.data===void 0?(0,h.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):y.data.length===0?(0,h.jsx)(`p`,{className:`text-meta`,children:`None yet. A citizen's skill joins the society by proposal.`}):(0,h.jsx)(`ul`,{className:`space-y-1.5`,children:y.data.map(e=>(0,h.jsxs)(`li`,{className:`text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,h.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})})]})]})}export{g as SocietyView};
1
+ import{A as e,b as t,g as n,ht as r,k as i,ln as a,m as o,ot as s,w as c,y as l}from"./format-C6tBTRKZ.js";import{n as u,t as d}from"./Pane-DvocjNie.js";import{n as f,r as p,t as m}from"./Overview-BWEXLQaq.js";var h=a();function g(){let a=e(),g=n(),_=t(),v=c(),y=i(),b=o(s),x=l(3e4);if(a.data===void 0||g.data===void 0)return(0,h.jsx)(u,{children:`Reading the society…`});let S=g.data.filter(e=>e.cli!==null),C=S.filter(e=>e.status===`active`),w=S.filter(e=>e.status===`retired`),T=(v.data??[]).filter(e=>e.name!==r);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{title:a.data.name,subtitle:`${C.length} citizens · ${_.data?.length??0} projects · ${T.length} roles`}),(0,h.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,h.jsxs)(f,{title:`Citizens`,children:[(0,h.jsx)(m,{members:C,scope:s}),w.length===0?null:(0,h.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,w.map(e=>e.name).join(`, `)]})]}),(0,h.jsx)(f,{title:`Roles`,children:(0,h.jsx)(`ul`,{className:`space-y-2.5`,children:T.map(e=>{let t=C.filter(t=>t.role===e.name).length;return(0,h.jsxs)(`li`,{children:[(0,h.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,h.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,h.jsx)(f,{title:`Knowledge`,children:(0,h.jsx)(p,{scope:s,topics:b.data,now:x})}),(0,h.jsx)(f,{title:`Skills`,children:y.data===void 0?(0,h.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):y.data.length===0?(0,h.jsx)(`p`,{className:`text-meta`,children:`None yet. A citizen's skill joins the society by proposal.`}):(0,h.jsx)(`ul`,{className:`space-y-1.5`,children:y.data.map(e=>(0,h.jsxs)(`li`,{className:`text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,h.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})})]})]})}export{g as SocietyView};
@@ -1 +1 @@
1
- import{D as e,Ht as t,h as n,ln as r,pn as i,t as a,un as o}from"./format-Cj7NW9Y9.js";import{I as s}from"./index-CthEgIzf.js";import{t as c}from"./Markdown-CYcTTxcR.js";import{t as l}from"./MessageItem-DDC_1Jqn.js";var u=i(o(),1),d=r();function f({thread:r,now:i,task:o,empty:f}){let{api:p}=e(),m=n(),h=t({queryKey:[`thread`,r.id],queryFn:()=>p.thread(r.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(r.id,_),[r.id,_]),h.data===void 0)return(0,d.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the thread…`});let v=h.data.thread;return(0,d.jsxs)(`div`,{className:`-mx-4 mt-1`,children:[g.length===0?(0,d.jsx)(`p`,{className:`mx-4 mt-1 text-meta`,children:f}):g.map(e=>(0,d.jsx)(l,{message:e,members:m.data,now:i,task:o},e.id)),r.state===`closed`?(0,d.jsxs)(`div`,{className:`mx-4 mt-2`,children:[(0,d.jsxs)(`p`,{className:`text-meta`,children:[`Closed`,v.closedAt===void 0?``:` ${a(v.closedAt,i)}`,v.body.trim()===``?`.`:`:`]}),v.body.trim()===``?null:(0,d.jsx)(c,{text:v.body})]}):null]})}export{f as t};
1
+ import{D as e,Ht as t,g as n,ln as r,pn as i,t as a,un as o}from"./format-C6tBTRKZ.js";import{I as s}from"./index-CugUsWCm.js";import{t as c}from"./Markdown-B390nfRS.js";import{t as l}from"./MessageItem-D54BS9OS.js";var u=i(o(),1),d=r();function f({thread:r,now:i,task:o,empty:f}){let{api:p}=e(),m=n(),h=t({queryKey:[`thread`,r.id],queryFn:()=>p.thread(r.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(r.id,_),[r.id,_]),h.data===void 0)return(0,d.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the thread…`});let v=h.data.thread;return(0,d.jsxs)(`div`,{className:`-mx-4 mt-1`,children:[g.length===0?(0,d.jsx)(`p`,{className:`mx-4 mt-1 text-meta`,children:f}):g.map(e=>(0,d.jsx)(l,{message:e,members:m.data,now:i,task:o},e.id)),r.state===`closed`?(0,d.jsxs)(`div`,{className:`mx-4 mt-2`,children:[(0,d.jsxs)(`p`,{className:`text-meta`,children:[`Closed`,v.closedAt===void 0?``:` ${a(v.closedAt,i)}`,v.body.trim()===``?`.`:`:`]}),v.body.trim()===``?null:(0,d.jsx)(c,{text:v.body})]}):null]})}export{f as t};
@@ -1,4 +1,4 @@
1
- import{N as e,R as t,Y as n,b as r,j as i,ln as a,pn as o,t as s,un as c,y as l}from"./format-Cj7NW9Y9.js";import{B as u,R as d,V as f}from"./index-CthEgIzf.js";import{c as p,d as m,f as h,i as g,l as _,n as v,o as y,p as b,r as x,t as S}from"./Markdown-CYcTTxcR.js";import{n as C,t as w}from"./Pane-BNjb76U4.js";import{t as T}from"./BackLink-Cr1RWb4K.js";var E=o(c(),1),D=a(),O=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,k=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,A=1e3,j=2e4;function M({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,D.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,D.jsx)(`span`,{children:`Files`}):(0,D.jsx)(v,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,D.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,D.jsx)(v,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function N({taskId:e,file:t}){let n=t.entries.toSorted((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1);return(0,D.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,D.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,D.jsx)(v,{taskId:e,path:t.path===``?n.name:`${t.path}/${n.name}`,className:`text-sm text-fg-secondary hover:text-fg-primary`,children:n.kind===`dir`?`${n.name}/`:n.name}),n.size===null?null:(0,D.jsx)(`span`,{className:`text-meta`,children:h(n.size)})]},n.name))})}function P({rows:e}){let[t,...n]=e;if(t===void 0)return(0,D.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,A),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,D.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,D.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsx)(`tr`,{children:t.map((e,t)=>(0,D.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,D.jsx)(`tbody`,{children:r.map((e,t)=>(0,D.jsx)(`tr`,{children:e.map((e,t)=>(0,D.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,D.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,A,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function F({text:e,line:t}){let n=e.endsWith(`
1
+ import{N as e,R as t,Y as n,b as r,j as i,ln as a,pn as o,t as s,un as c,y as l}from"./format-C6tBTRKZ.js";import{B as u,R as d,V as f}from"./index-CugUsWCm.js";import{c as p,d as m,f as h,i as g,l as _,n as v,o as y,p as b,r as x,t as S}from"./Markdown-B390nfRS.js";import{n as C,t as w}from"./Pane-DvocjNie.js";import{t as T}from"./BackLink-DrYyD7II.js";var E=o(c(),1),D=a(),O=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,k=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,A=1e3,j=2e4;function M({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,D.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,D.jsx)(`span`,{children:`Files`}):(0,D.jsx)(v,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,D.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,D.jsx)(v,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function N({taskId:e,file:t}){let n=t.entries.toSorted((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1);return(0,D.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,D.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,D.jsx)(v,{taskId:e,path:t.path===``?n.name:`${t.path}/${n.name}`,className:`text-sm text-fg-secondary hover:text-fg-primary`,children:n.kind===`dir`?`${n.name}/`:n.name}),n.size===null?null:(0,D.jsx)(`span`,{className:`text-meta`,children:h(n.size)})]},n.name))})}function P({rows:e}){let[t,...n]=e;if(t===void 0)return(0,D.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,A),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,D.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,D.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsx)(`tr`,{children:t.map((e,t)=>(0,D.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,D.jsx)(`tbody`,{children:r.map((e,t)=>(0,D.jsx)(`tr`,{children:e.map((e,t)=>(0,D.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,D.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,A,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function F({text:e,line:t}){let n=e.endsWith(`
2
2
  `)?e.slice(0,-1).split(`
3
3
  `):e.split(`
4
4
  `),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>j?(0,D.jsx)(`pre`,{className:r,children:e}):(0,D.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,D.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,D.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function I({taskId:e,file:t,url:r,line:i}){let a=(0,E.useMemo)(()=>t.content===null?null:b(t.path,g(t.content)),[t.path,t.content]),o=t.path.split(`/`).at(-1)??t.path;return a===null?(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is `,h(t.size),`, more than the `,h(n),` the board shows. Its runner still has it on the task's branch.`]}):a.kind===`markdown`?(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(S,{text:a.text,base:{taskId:e,dir:m(t.path)},line:i})}):a.kind===`image`?r===null?null:(0,D.jsx)(`img`,{src:r,alt:o,className:`mt-3 max-w-full rounded-lg`}):a.kind===`table`?(0,D.jsx)(P,{rows:a.rows}):a.kind===`text`?(0,D.jsx)(F,{text:a.text,line:i}):(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is not text (`,h(t.size),`). Download it to open it.`]})}function L(){let{taskId:n,_splat:a}=f({from:`/task/$taskId/files/$`}),o=u({from:`/task/$taskId/files/$`}),c=y(_(a??``)??``),m=c.path,h=o.line??c.line,g=i(n),v=r(),b=e(n,m),S=l(3e4),A=b.data,j=A?.kind===`file`?A.content:null,P=x(j,p(m)??`application/octet-stream`),F=m===``?`Files`:m.split(`/`).at(-1)??m,L=g.data?.title??n,R=(0,E.useRef)(null);(0,E.useEffect)(()=>{h!==void 0&&A!==void 0&&R.current?.querySelector(`.line-target`)?.scrollIntoView({block:`center`})},[h,A]);let z;if(A!==void 0)z=A.kind===`dir`?(0,D.jsx)(N,{taskId:n,file:A}):(0,D.jsx)(I,{taskId:n,file:A,url:P,line:h});else if(b.error instanceof t&&b.error.status===404)z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[m===``?`Nothing`:m,` is not on task/`,n,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(b.error instanceof t&&b.error.status===503){let e=v.data?.find(e=>e.slug===g.data?.project);z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[e?.runner===void 0?`The runner`:`${e.runner}, the runner`,` `,e?.name??`the project`,` lives on, is not connected, so the task's files cannot be read now.`]})}else z=b.error===null?(0,D.jsxs)(C,{children:[`Reading `,F,` from the task's runner…`]}):(0,D.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:b.error.message});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{leading:(0,D.jsx)(T,{fallback:(0,D.jsx)(d,{to:`/task/$taskId`,params:{taskId:n},"aria-label":`Back to the task ${L}`,className:O,children:`←`})}),title:F,subtitle:A===void 0?L:`${L}${h===void 0?``:` · line ${h}`} · committed by ${A.commit.author} ${s(A.commit.at,S)} · ${A.commit.id.slice(0,7)}`,trailing:P===null?null:(0,D.jsx)(`a`,{href:P,download:F,className:k,children:`Download`})}),(0,D.jsxs)(`div`,{ref:R,className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,D.jsx)(M,{taskId:n,path:m}),z]})]})}export{L as TaskFileView};
@@ -1 +1 @@
1
- import{D as e,F as t,M as n,R as r,b as i,cn as a,h as o,j as s,ln as c,pn as l,t as u,un as d,y as f}from"./format-Cj7NW9Y9.js";import{a as p,c as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./tasks-tFehkpRz.js";import{H as x,R as S,V as C,c as w,d as T,i as E,u as D,x as O}from"./index-CthEgIzf.js";import{a as k,n as A,s as j,t as M,u as N}from"./Markdown-CYcTTxcR.js";import{n as P,t as F}from"./Pane-BNjb76U4.js";import{t as I}from"./BackLink-Cr1RWb4K.js";import{t as L}from"./SubjectThread-Bw6wEJpH.js";var R=l(d(),1),z=c();function B({last:e,now:t}){return e===void 0?null:(0,z.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,u(e.at,t)]})}function V({taskId:e,nodes:t,nested:n,isOpen:r,toggle:i,now:a}){return(0,z.jsx)(`ul`,{className:n?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:t.map(t=>{if(t.kind===`dir`){let n=r(t);return(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>i(t),className:`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${n?`rotate-90`:``}`,children:`▸`}),(0,z.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[t.name,`/`]}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,z.jsx)(B,{last:t.lastChange,now:a})]}),n?(0,z.jsx)(V,{taskId:e,nodes:t.children,nested:!0,isOpen:r,toggle:i,now:a}):null]},`dir:${t.path}`)}let{change:n}=t;return(0,z.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5 text-sm`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`}),n.status===`deleted`?(0,z.jsx)(`span`,{className:`min-w-0 truncate text-fg-tertiary line-through`,title:n.path,children:t.name}):(0,z.jsx)(A,{taskId:e,path:n.path,className:`min-w-0 truncate text-fg-secondary hover:text-fg-primary`,children:t.name}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:k(n)}),(0,z.jsx)(B,{last:n.lastChange,now:a})]},n.path)})})}function H({taskId:e,changes:t,now:n}){let r=(0,R.useMemo)(()=>j(t),[t]),i=(0,R.useMemo)(()=>N(r),[r]),[a,o]=(0,R.useState)(new Map);return(0,z.jsx)(V,{taskId:e,nodes:r.children,nested:!1,isOpen:e=>a.get(e.path)??i.has(e.path),toggle:e=>{o(t=>new Map(t).set(e.path,!(t.get(e.path)??i.has(e.path))))},now:n})}function U({task:e,now:t}){let a=n(e.id),o=i(),s=`task/${e.id}`,c;if(a.data!==void 0){let{files:n,total:r,head:i}=a.data;c=n.length===0?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[r===1?`1 file`:`${r} files`,` changed · newest commit by `,i.author,` `,u(i.at,t)]}),(0,z.jsx)(H,{taskId:e.id,changes:n,now:t}),r>n.length?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,r,`; browse the branch for the rest.`]}):null]})}else if(a.error instanceof r&&a.error.status===404)c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(a.error instanceof r&&a.error.status===503){let t=o.data?.find(t=>t.slug===e.project);c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[t?.runner===void 0?`The runner`:`${t.runner}, the runner`,` `,t?.name??e.project,` lives on, is not connected, so the task's files cannot be listed now.`]})}else c=a.error===null?(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:a.error.message});return(0,z.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,z.jsx)(A,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),c]})}function W({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=_(n,e),s=t===n.stages.length-1,c=o&&n.status===`claimed`?n.claimedBy:void 0,l=e.holders.filter(t=>t!==c&&t!==e.completedBy),d=n.returned?.from===e.id?n.returned:void 0;return(0,z.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`relative z-10 grid size-5 shrink-0 place-items-center rounded-full text-[10px] ${a?`bg-emerald-400/20 text-emerald-300`:o?`bg-fg-primary text-surface-0`:`bg-surface-2 text-fg-muted`}`,children:a?`✓`:t+1}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,z.jsx)(`span`,{className:`ml-2 rounded-md bg-sky-400/10 px-1.5 py-px text-[11px] text-sky-300`,children:`gate`}):null]}),(0,z.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,v(e),c===void 0?null:(0,z.jsxs)(z.Fragment,{children:[` · held by `,(0,z.jsx)(D,{name:c,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${u(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${u(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${u(d.at,i)}`]})]})]})}function G({taskId:t}){let{api:n}=e(),r=a(),i=x({mutationFn:()=>n.openThread({task_id:t}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,z.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,z.jsx)(w,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,z.jsx)(`p`,{className:`text-meta`,children:i.error===null?`This task is older than task threads. It closes when the task ends.`:i.error.message})]})}function K(){let{taskId:e}=C({from:`/task/$taskId`}),n=s(e),a=t(),c=i(),l=o(),d=f(3e4),_=T();if(n.data===void 0)return(0,z.jsx)(P,{children:n.error instanceof r&&n.error.status===404?`There is no task ${e}.`:`Reading the task…`});let v=n.data,x=y(v),w=c.data?.find(e=>e.slug===v.project),D=a.data?.find(e=>e.id===v.id);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(F,{leading:(0,z.jsx)(I,{fallback:(0,z.jsx)(S,{to:`/p/$slug/tasks`,params:{slug:v.project},"aria-label":`Back to the tasks of ${w?.name??v.project}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:v.title,subtitle:`${w?.name??v.project} · ${m(v)} · created by ${_(v.createdBy)} ${u(v.createdAt,d)}`,trailing:(0,z.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${g[x]}`,children:b.find(e=>e.phase===x)?.label.toLowerCase()})}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Plan`}),v.returned===void 0?null:(0,z.jsxs)(`p`,{className:`mt-2 rounded-lg bg-orange-500/10 px-3 py-2 text-xs leading-relaxed text-orange-200`,children:[`Sent back from `,h(v,v.returned.from),` by `,v.returned.by,` `,u(v.returned.at,d),`. The work is redone from`,` `,h(v,v.stage),` until it reaches that stage again.`]}),(0,z.jsx)(`ol`,{className:`mt-3`,children:v.stages.map((e,t)=>(0,z.jsx)(W,{stage:e,index:t,task:v,members:l.data,now:d},e.id))}),(0,z.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,v.onDone===`merge`?`task/${v.id} merges onto the default branch`:`nothing more`,v.blockedBy.length>0?(0,z.jsxs)(z.Fragment,{children:[` · blocked by `,(0,z.jsx)(O,{text:v.blockedBy.join(`, `)})]}):null]}),v.body.trim()===``?null:(0,z.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(M,{text:v.body})})]}),(0,z.jsx)(U,{task:v,now:d}),(0,z.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Thread`}),a.data===void 0?null:D===void 0?p(v)?(0,z.jsx)(G,{taskId:v.id}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,z.jsx)(L,{thread:D,now:d,task:v,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),D?.state===`open`?(0,z.jsx)(E,{target:{threadId:v.id},placeholder:`Write in the task's thread`}):null]})}export{K as TaskView};
1
+ import{D as e,F as t,M as n,R as r,b as i,cn as a,g as o,j as s,ln as c,pn as l,t as u,un as d,y as f}from"./format-C6tBTRKZ.js";import{a as p,c as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./tasks-Bh3GaY7V.js";import{H as x,R as S,V as C,c as w,d as T,i as E,u as D,x as O}from"./index-CugUsWCm.js";import{a as k,n as A,s as j,t as M,u as N}from"./Markdown-B390nfRS.js";import{n as P,t as F}from"./Pane-DvocjNie.js";import{t as I}from"./BackLink-DrYyD7II.js";import{t as L}from"./SubjectThread-D2BHnecl.js";var R=l(d(),1),z=c();function B({last:e,now:t}){return e===void 0?null:(0,z.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,u(e.at,t)]})}function V({taskId:e,nodes:t,nested:n,isOpen:r,toggle:i,now:a}){return(0,z.jsx)(`ul`,{className:n?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:t.map(t=>{if(t.kind===`dir`){let n=r(t);return(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>i(t),className:`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${n?`rotate-90`:``}`,children:`▸`}),(0,z.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[t.name,`/`]}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,z.jsx)(B,{last:t.lastChange,now:a})]}),n?(0,z.jsx)(V,{taskId:e,nodes:t.children,nested:!0,isOpen:r,toggle:i,now:a}):null]},`dir:${t.path}`)}let{change:n}=t;return(0,z.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5 text-sm`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`}),n.status===`deleted`?(0,z.jsx)(`span`,{className:`min-w-0 truncate text-fg-tertiary line-through`,title:n.path,children:t.name}):(0,z.jsx)(A,{taskId:e,path:n.path,className:`min-w-0 truncate text-fg-secondary hover:text-fg-primary`,children:t.name}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:k(n)}),(0,z.jsx)(B,{last:n.lastChange,now:a})]},n.path)})})}function H({taskId:e,changes:t,now:n}){let r=(0,R.useMemo)(()=>j(t),[t]),i=(0,R.useMemo)(()=>N(r),[r]),[a,o]=(0,R.useState)(new Map);return(0,z.jsx)(V,{taskId:e,nodes:r.children,nested:!1,isOpen:e=>a.get(e.path)??i.has(e.path),toggle:e=>{o(t=>new Map(t).set(e.path,!(t.get(e.path)??i.has(e.path))))},now:n})}function U({task:e,now:t}){let a=n(e.id),o=i(),s=`task/${e.id}`,c;if(a.data!==void 0){let{files:n,total:r,head:i}=a.data;c=n.length===0?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[r===1?`1 file`:`${r} files`,` changed · newest commit by `,i.author,` `,u(i.at,t)]}),(0,z.jsx)(H,{taskId:e.id,changes:n,now:t}),r>n.length?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,r,`; browse the branch for the rest.`]}):null]})}else if(a.error instanceof r&&a.error.status===404)c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(a.error instanceof r&&a.error.status===503){let t=o.data?.find(t=>t.slug===e.project);c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[t?.runner===void 0?`The runner`:`${t.runner}, the runner`,` `,t?.name??e.project,` lives on, is not connected, so the task's files cannot be listed now.`]})}else c=a.error===null?(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:a.error.message});return(0,z.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,z.jsx)(A,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),c]})}function W({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=_(n,e),s=t===n.stages.length-1,c=o&&n.status===`claimed`?n.claimedBy:void 0,l=e.holders.filter(t=>t!==c&&t!==e.completedBy),d=n.returned?.from===e.id?n.returned:void 0;return(0,z.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`relative z-10 grid size-5 shrink-0 place-items-center rounded-full text-[10px] ${a?`bg-emerald-400/20 text-emerald-300`:o?`bg-fg-primary text-surface-0`:`bg-surface-2 text-fg-muted`}`,children:a?`✓`:t+1}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,z.jsx)(`span`,{className:`ml-2 rounded-md bg-sky-400/10 px-1.5 py-px text-[11px] text-sky-300`,children:`gate`}):null]}),(0,z.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,v(e),c===void 0?null:(0,z.jsxs)(z.Fragment,{children:[` · held by `,(0,z.jsx)(D,{name:c,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${u(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${u(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${u(d.at,i)}`]})]})]})}function G({taskId:t}){let{api:n}=e(),r=a(),i=x({mutationFn:()=>n.openThread({task_id:t}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,z.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,z.jsx)(w,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,z.jsx)(`p`,{className:`text-meta`,children:i.error===null?`This task is older than task threads. It closes when the task ends.`:i.error.message})]})}function K(){let{taskId:e}=C({from:`/task/$taskId`}),n=s(e),a=t(),c=i(),l=o(),d=f(3e4),_=T();if(n.data===void 0)return(0,z.jsx)(P,{children:n.error instanceof r&&n.error.status===404?`There is no task ${e}.`:`Reading the task…`});let v=n.data,x=y(v),w=c.data?.find(e=>e.slug===v.project),D=a.data?.find(e=>e.id===v.id);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(F,{leading:(0,z.jsx)(I,{fallback:(0,z.jsx)(S,{to:`/p/$slug/tasks`,params:{slug:v.project},"aria-label":`Back to the tasks of ${w?.name??v.project}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:v.title,subtitle:`${w?.name??v.project} · ${m(v)} · created by ${_(v.createdBy)} ${u(v.createdAt,d)}`,trailing:(0,z.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${g[x]}`,children:b.find(e=>e.phase===x)?.label.toLowerCase()})}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Plan`}),v.returned===void 0?null:(0,z.jsxs)(`p`,{className:`mt-2 rounded-lg bg-orange-500/10 px-3 py-2 text-xs leading-relaxed text-orange-200`,children:[`Sent back from `,h(v,v.returned.from),` by `,v.returned.by,` `,u(v.returned.at,d),`. The work is redone from`,` `,h(v,v.stage),` until it reaches that stage again.`]}),(0,z.jsx)(`ol`,{className:`mt-3`,children:v.stages.map((e,t)=>(0,z.jsx)(W,{stage:e,index:t,task:v,members:l.data,now:d},e.id))}),(0,z.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,v.onDone===`merge`?`task/${v.id} merges onto the default branch`:`nothing more`,v.blockedBy.length>0?(0,z.jsxs)(z.Fragment,{children:[` · blocked by `,(0,z.jsx)(O,{text:v.blockedBy.join(`, `)})]}):null]}),v.body.trim()===``?null:(0,z.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(M,{text:v.body})})]}),(0,z.jsx)(U,{task:v,now:d}),(0,z.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Thread`}),a.data===void 0?null:D===void 0?p(v)?(0,z.jsx)(G,{taskId:v.id}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,z.jsx)(L,{thread:D,now:d,task:v,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),D?.state===`open`?(0,z.jsx)(E,{target:{threadId:v.id},placeholder:`Write in the task's thread`}):null]})}export{K as TaskView};
@@ -1 +1 @@
1
- import{P as e,b as t,ct as n,h as r,ln as i,pn as a,t as o,un as s,y as c}from"./format-Cj7NW9Y9.js";import{c as l,i as u,l as d,o as f,r as p,s as m,t as h}from"./tasks-tFehkpRz.js";import{R as g,V as _,u as v}from"./index-CthEgIzf.js";import{n as y,t as b}from"./Pane-BNjb76U4.js";var x=a(s(),1),S=i();function C({task:e}){let t=m(e);return(0,S.jsx)(`ol`,{className:`flex gap-1`,"aria-hidden":`true`,children:e.stages.map((n,r)=>{let i=n.completedBy!==void 0,a=f(e,n),o=i?`bg-emerald-400/60`:a?e.status===`claimed`?`bg-fg-primary/90`:`bg-amber-300/80`:t===`abandoned`?`bg-surface-2/50`:`bg-surface-2`;return(0,S.jsx)(`li`,{title:`${r+1}. ${n.name} · ${p(n)}${n.gate?` · gate`:``}`,className:`h-1.5 min-w-3 flex-1 rounded-full ${o} ${n.gate?`ring-1 ring-sky-300/70 ring-offset-1 ring-offset-surface-1`:``}`},n.id)})})}var w=5;function T({task:e,members:t,now:r}){let i=m(e),a=n(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(g,{to:`/task/$taskId`,params:{taskId:e.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,S.jsx)(`span`,{className:`shrink-0 text-meta`,children:l(e)})]}),(0,S.jsx)(`div`,{className:`mt-2`,children:(0,S.jsx)(C,{task:e})}),e.returned===void 0?null:(0,S.jsxs)(`p`,{className:`mt-1.5 truncate text-xs text-orange-300/90`,children:[`Sent back from `,d(e,e.returned.from),` by `,e.returned.by,` `,o(e.returned.at,r)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&i!==`landing`&&a!==void 0?(0,S.jsxs)(S.Fragment,{children:[a.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&i!==`landing`&&a!==void 0?`${a.name} · waiting for ${p(a)} since ${o(e.stageSince,r)}`:i===`landing`?`landing task/${e.id} on the default branch`:`${i} ${o(e.updatedAt,r)}`})]})})}function E(){let{slug:n}=_({from:`/p/$slug/tasks`}),i=e(n),a=t(),o=r(),s=c(3e4),[l,d]=(0,x.useState)(new Set),f=a.data?.find(e=>e.slug===n),p=u(i.data??[]),m=p.filter(e=>e.phase!==`done`&&e.phase!==`abandoned`).reduce((e,t)=>e+t.tasks.length,0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(b,{title:`Tasks`,subtitle:`${f?.name??n} · ${m} in play · ${i.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:i.data===void 0?(0,S.jsx)(y,{children:`Reading the tasks…`}):p.length===0?(0,S.jsx)(y,{children:`No tasks in this project yet.`}):p.map(e=>{let t=e.phase!==`done`&&e.phase!==`abandoned`||l.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[h.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:o.data,now:s},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>d(new Set([...l,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
1
+ import{P as e,b as t,ct as n,g as r,ln as i,pn as a,t as o,un as s,y as c}from"./format-C6tBTRKZ.js";import{c as l,i as u,l as d,o as f,r as p,s as m,t as h}from"./tasks-Bh3GaY7V.js";import{R as g,V as _,u as v}from"./index-CugUsWCm.js";import{n as y,t as b}from"./Pane-DvocjNie.js";var x=a(s(),1),S=i();function C({task:e}){let t=m(e);return(0,S.jsx)(`ol`,{className:`flex gap-1`,"aria-hidden":`true`,children:e.stages.map((n,r)=>{let i=n.completedBy!==void 0,a=f(e,n),o=i?`bg-emerald-400/60`:a?e.status===`claimed`?`bg-fg-primary/90`:`bg-amber-300/80`:t===`abandoned`?`bg-surface-2/50`:`bg-surface-2`;return(0,S.jsx)(`li`,{title:`${r+1}. ${n.name} · ${p(n)}${n.gate?` · gate`:``}`,className:`h-1.5 min-w-3 flex-1 rounded-full ${o} ${n.gate?`ring-1 ring-sky-300/70 ring-offset-1 ring-offset-surface-1`:``}`},n.id)})})}var w=5;function T({task:e,members:t,now:r}){let i=m(e),a=n(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(g,{to:`/task/$taskId`,params:{taskId:e.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,S.jsx)(`span`,{className:`shrink-0 text-meta`,children:l(e)})]}),(0,S.jsx)(`div`,{className:`mt-2`,children:(0,S.jsx)(C,{task:e})}),e.returned===void 0?null:(0,S.jsxs)(`p`,{className:`mt-1.5 truncate text-xs text-orange-300/90`,children:[`Sent back from `,d(e,e.returned.from),` by `,e.returned.by,` `,o(e.returned.at,r)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&i!==`landing`&&a!==void 0?(0,S.jsxs)(S.Fragment,{children:[a.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&i!==`landing`&&a!==void 0?`${a.name} · waiting for ${p(a)} since ${o(e.stageSince,r)}`:i===`landing`?`landing task/${e.id} on the default branch`:`${i} ${o(e.updatedAt,r)}`})]})})}function E(){let{slug:n}=_({from:`/p/$slug/tasks`}),i=e(n),a=t(),o=r(),s=c(3e4),[l,d]=(0,x.useState)(new Set),f=a.data?.find(e=>e.slug===n),p=u(i.data??[]),m=p.filter(e=>e.phase!==`done`&&e.phase!==`abandoned`).reduce((e,t)=>e+t.tasks.length,0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(b,{title:`Tasks`,subtitle:`${f?.name??n} · ${m} in play · ${i.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:i.data===void 0?(0,S.jsx)(y,{children:`Reading the tasks…`}):p.length===0?(0,S.jsx)(y,{children:`No tasks in this project yet.`}):p.map(e=>{let t=e.phase!==`done`&&e.phase!==`abandoned`||l.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[h.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:o.data,now:s},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>d(new Set([...l,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
@@ -1 +1 @@
1
- import{ln as e,n as t,t as n}from"./format-Cj7NW9Y9.js";import{R as r,x as i}from"./index-CthEgIzf.js";var a=e();function o(e){return e?.kind??`topic`}function s({state:e}){return(0,a.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${e===`open`?`bg-emerald-500/15 text-emerald-300`:`bg-surface-2 text-fg-tertiary`}`,children:e})}function c({thread:e,now:c}){let l=e.state===`closed`?t(e.body,180):``,u=e.messages===1?`1 message`:`${e.messages} messages`;return(0,a.jsxs)(r,{to:`/thread/$threadId`,params:{threadId:e.id},className:`mx-4 my-2 block rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:bg-surface-2/70`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`↳`}),(0,a.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,a.jsx)(s,{state:e.state})]}),(0,a.jsxs)(`p`,{className:`mt-1 text-meta`,children:[o(e.subject),` thread by `,e.openedBy,` · `,u,` · opened`,` `,n(e.openedAt,c)]}),l===``?null:(0,a.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-secondary`,children:(0,a.jsx)(i,{text:l,links:!1})})]})}export{c as n,o as r,s as t};
1
+ import{ln as e,n as t,t as n}from"./format-C6tBTRKZ.js";import{R as r,x as i}from"./index-CugUsWCm.js";var a=e();function o(e){return e?.kind??`topic`}function s({state:e}){return(0,a.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${e===`open`?`bg-emerald-500/15 text-emerald-300`:`bg-surface-2 text-fg-tertiary`}`,children:e})}function c({thread:e,now:c}){let l=e.state===`closed`?t(e.body,180):``,u=e.messages===1?`1 message`:`${e.messages} messages`;return(0,a.jsxs)(r,{to:`/thread/$threadId`,params:{threadId:e.id},className:`mx-4 my-2 block rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:bg-surface-2/70`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`↳`}),(0,a.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,a.jsx)(s,{state:e.state})]}),(0,a.jsxs)(`p`,{className:`mt-1 text-meta`,children:[o(e.subject),` thread by `,e.openedBy,` · `,u,` · opened`,` `,n(e.openedAt,c)]}),l===``?null:(0,a.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-secondary`,children:(0,a.jsx)(i,{text:l,links:!1})})]})}export{c as n,o as r,s as t};
@@ -1 +1 @@
1
- import{D as e,R as t,cn as n,h as r,ln as i,pn as a,un as o,w as s}from"./format-Cj7NW9Y9.js";import{H as c,a as l,c as u,o as d,z as f}from"./index-CthEgIzf.js";var p=a(o(),1),m=i(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof t?e.message:`The board did not take it.`})}function _({channel:t,onDone:i}){let{api:a}=e(),o=n(),_=f(),v=r(),y=s(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=c({mutationFn:async()=>{let e=await a.openThread({channel:t,title:b.trim()});return S.trim()!==``&&await a.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{o.invalidateQueries({queryKey:[`threads`]}),i(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:d(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${l(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:t,channel:r,onDone:i}){let{api:a}=e(),o=n(),[s,l]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>a.closeThread({thread_id:t,summary:s.trim()}),onSuccess:()=>{for(let e of[[`thread`,t],[`threads`],[`channel`,r]])o.invalidateQueries({queryKey:e});i()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,m.jsx)(`textarea`,{ref:d,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${r}.`,"aria-label":`Closing summary`,onChange:e=>l(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:f.error})]})}export{_ as i,h as n,g as r,v as t};
1
+ import{D as e,R as t,cn as n,g as r,ln as i,pn as a,un as o,w as s}from"./format-C6tBTRKZ.js";import{H as c,a as l,c as u,o as d,z as f}from"./index-CugUsWCm.js";var p=a(o(),1),m=i(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof t?e.message:`The board did not take it.`})}function _({channel:t,onDone:i}){let{api:a}=e(),o=n(),_=f(),v=r(),y=s(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=c({mutationFn:async()=>{let e=await a.openThread({channel:t,title:b.trim()});return S.trim()!==``&&await a.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{o.invalidateQueries({queryKey:[`threads`]}),i(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:d(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${l(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:t,channel:r,onDone:i}){let{api:a}=e(),o=n(),[s,l]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>a.closeThread({thread_id:t,summary:s.trim()}),onSuccess:()=>{for(let e of[[`thread`,t],[`threads`],[`channel`,r]])o.invalidateQueries({queryKey:e});i()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,m.jsx)(`textarea`,{ref:d,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${r}.`,"aria-label":`Closing summary`,onChange:e=>l(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:f.error})]})}export{_ as i,h as n,g as r,v as t};
@@ -1 +1 @@
1
- import{D as e,Ht as t,R as n,h as r,j as i,ln as a,pn as o,t as s,un as c,y as l}from"./format-Cj7NW9Y9.js";import{I as u,R as d,V as f,c as p,d as m,i as h}from"./index-CthEgIzf.js";import{t as g}from"./Markdown-CYcTTxcR.js";import{t as _}from"./MessageItem-DDC_1Jqn.js";import{n as v,t as y}from"./Pane-BNjb76U4.js";import{r as b,t as x}from"./ThreadCard-FPtAzvNM.js";import{t as S}from"./ThreadForms-LFw2EF6r.js";import{t as C}from"./useStickyScroll-XrG6M-hT.js";import{t as w}from"./BackLink-Cr1RWb4K.js";var T=o(c(),1),E=a();function D(){let{threadId:e}=f({from:`/thread/$threadId`});return(0,E.jsx)(O,{id:e},e)}function O({id:a}){let{api:o}=e(),c=t({queryKey:[`thread`,a],queryFn:()=>o.thread(a)}),f=r(),D=l(3e4),O=m(),k=c.data?.messages??[],A=k.at(-1)?.id??null;(0,T.useEffect)(()=>u(a,A),[a,A]);let{ref:j,onScroll:M}=C(),[N,P]=(0,T.useState)(!1),F=c.data?.thread.subject,I=i(F?.kind===`task`?F.id:null);if(c.data===void 0)return(0,E.jsx)(v,{children:c.error instanceof n&&c.error.status===404?`There is no thread ${a}.`:`Reading the thread…`});let{thread:L}=c.data;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(y,{leading:(0,E.jsx)(w,{fallback:(0,E.jsx)(d,{to:`/c/$`,params:{_splat:L.channel},"aria-label":`Back to #${L.channel}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:L.title,subtitle:`${b(L.subject)} thread in #${L.channel} · opened by ${O(L.openedBy)} ${s(L.openedAt,D)}`,trailing:(0,E.jsxs)(E.Fragment,{children:[L.subject?.kind===`task`?(0,E.jsx)(d,{to:`/task/$taskId`,params:{taskId:L.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Task →`}):L.subject?.kind===`proposal`?(0,E.jsx)(d,{to:`/proposal/$proposalId`,params:{proposalId:L.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Proposal →`}):null,L.state===`open`&&!N&&L.subject?.kind!==`task`?(0,E.jsx)(p,{onClick:()=>P(!0),children:`Close`}):(0,E.jsx)(x,{state:L.state})]})}),N&&L.state===`open`?(0,E.jsx)(S,{threadId:L.id,channel:L.channel,onDone:()=>P(!1)}):null,(0,E.jsxs)(`div`,{ref:j,onScroll:M,className:`flex-1 overflow-y-auto py-2`,children:[k.length===0?(0,E.jsx)(v,{children:`No messages in this thread yet.`}):null,k.map(e=>(0,E.jsx)(_,{message:e,members:f.data,now:D,task:I.data},e.id)),L.state===`closed`?(0,E.jsxs)(`section`,{className:`mx-4 mt-3 mb-2 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,E.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,O(L.closedBy??`board`),L.closedAt===void 0?``:` ${s(L.closedAt,D)}`]}),L.body.trim()===``?(0,E.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,b(L.subject),`.`]}):(0,E.jsx)(g,{text:L.body})]}):null]}),L.state===`open`?(0,E.jsx)(h,{target:{threadId:L.id},placeholder:`Reply in the thread`}):null]})}export{D as ThreadView};
1
+ import{D as e,Ht as t,R as n,g as r,j as i,ln as a,pn as o,t as s,un as c,y as l}from"./format-C6tBTRKZ.js";import{I as u,R as d,V as f,c as p,d as m,i as h}from"./index-CugUsWCm.js";import{t as g}from"./Markdown-B390nfRS.js";import{t as _}from"./MessageItem-D54BS9OS.js";import{n as v,t as y}from"./Pane-DvocjNie.js";import{r as b,t as x}from"./ThreadCard-9h03aKCB.js";import{t as S}from"./ThreadForms-uORhDqAo.js";import{t as C}from"./useStickyScroll-C6bu36lV.js";import{t as w}from"./BackLink-DrYyD7II.js";var T=o(c(),1),E=a();function D(){let{threadId:e}=f({from:`/thread/$threadId`});return(0,E.jsx)(O,{id:e},e)}function O({id:a}){let{api:o}=e(),c=t({queryKey:[`thread`,a],queryFn:()=>o.thread(a)}),f=r(),D=l(3e4),O=m(),k=c.data?.messages??[],A=k.at(-1)?.id??null;(0,T.useEffect)(()=>u(a,A),[a,A]);let{ref:j,onScroll:M}=C(),[N,P]=(0,T.useState)(!1),F=c.data?.thread.subject,I=i(F?.kind===`task`?F.id:null);if(c.data===void 0)return(0,E.jsx)(v,{children:c.error instanceof n&&c.error.status===404?`There is no thread ${a}.`:`Reading the thread…`});let{thread:L}=c.data;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(y,{leading:(0,E.jsx)(w,{fallback:(0,E.jsx)(d,{to:`/c/$`,params:{_splat:L.channel},"aria-label":`Back to #${L.channel}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:L.title,subtitle:`${b(L.subject)} thread in #${L.channel} · opened by ${O(L.openedBy)} ${s(L.openedAt,D)}`,trailing:(0,E.jsxs)(E.Fragment,{children:[L.subject?.kind===`task`?(0,E.jsx)(d,{to:`/task/$taskId`,params:{taskId:L.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Task →`}):L.subject?.kind===`proposal`?(0,E.jsx)(d,{to:`/proposal/$proposalId`,params:{proposalId:L.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Proposal →`}):null,L.state===`open`&&!N&&L.subject?.kind!==`task`?(0,E.jsx)(p,{onClick:()=>P(!0),children:`Close`}):(0,E.jsx)(x,{state:L.state})]})}),N&&L.state===`open`?(0,E.jsx)(S,{threadId:L.id,channel:L.channel,onDone:()=>P(!1)}):null,(0,E.jsxs)(`div`,{ref:j,onScroll:M,className:`flex-1 overflow-y-auto py-2`,children:[k.length===0?(0,E.jsx)(v,{children:`No messages in this thread yet.`}):null,k.map(e=>(0,E.jsx)(_,{message:e,members:f.data,now:D,task:I.data},e.id)),L.state===`closed`?(0,E.jsxs)(`section`,{className:`mx-4 mt-3 mb-2 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,E.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,O(L.closedBy??`board`),L.closedAt===void 0?``:` ${s(L.closedAt,D)}`]}),L.body.trim()===``?(0,E.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,b(L.subject),`.`]}):(0,E.jsx)(g,{text:L.body})]}):null]}),L.state===`open`?(0,E.jsx)(h,{target:{threadId:L.id},placeholder:`Reply in the thread`}):null]})}export{D as ThreadView};
@@ -1 +1 @@
1
- import{Q as e,ot as t}from"./format-Cj7NW9Y9.js";import{p as n}from"./index-CthEgIzf.js";function r(e){return e===`society`?`the society`:e}function i(e){return[...e.memberships,t]}function a(e){return e.startedAt===void 0?null:n(e.startedAt,Date.parse(e.ts))}var o={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function s(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:o[e.exitReason]??e.exitReason}function c(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}var l=new Intl.NumberFormat(`en`,{notation:`compact`}),u=new Intl.NumberFormat(`en`);function d(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function f(e){return`${l.format(d(e))} in · ${l.format(e.outputTokens)} out`}function p(e){return[`${u.format(d(e))} input tokens: ${u.format(e.cacheReadTokens)} read from the cache,`,`${u.format(e.cacheWriteTokens)} written to it, ${u.format(e.inputTokens)} neither;`,`${u.format(e.outputTokens)} output tokens`].join(` `)}function m(t){let n=t.flatMap(e=>e.usage===void 0?[]:[e.usage]);return{turns:t.length,failed:t.filter(c).length,usage:n.length===0?null:n.reduce(e),withUsage:n.length}}function h(e,t){let n=/^\s*#{1,6}\s+(.+?)\s*(?:\n|$)/.exec(e);return n?.[1]?.toLowerCase()===t.toLowerCase()?e.slice(n[0].length).trim():e}function g(e,t){let n=[...e.homeRunner===void 0?[]:[{what:`outside projects`,runner:e.homeRunner}],...e.memberships.map(e=>({what:e,runner:t.get(e)}))],r=[...new Set(n.flatMap(e=>e.runner===void 0?[]:[e.runner]))],i=n.map(e=>`${e.what}: ${e.runner??`placed on its first turn`}`).join(`; `);return{label:r.length===0?`no runner yet`:`on ${r.join(`, `)}`,detail:i===``?`pinned to a runner on its first turn`:i}}export{p as a,i as c,r as i,h as l,m as n,f as o,g as r,a as s,s as t};
1
+ import{Q as e,ot as t}from"./format-C6tBTRKZ.js";import{p as n}from"./index-CugUsWCm.js";function r(e){return e===`society`?`the society`:e}function i(e){return[...e.memberships,t]}function a(e){return e.startedAt===void 0?null:n(e.startedAt,Date.parse(e.ts))}var o={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function s(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:o[e.exitReason]??e.exitReason}function c(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}var l=new Intl.NumberFormat(`en`,{notation:`compact`}),u=new Intl.NumberFormat(`en`);function d(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function f(e){return`${l.format(d(e))} in · ${l.format(e.outputTokens)} out`}function p(e){return[`${u.format(d(e))} input tokens: ${u.format(e.cacheReadTokens)} read from the cache,`,`${u.format(e.cacheWriteTokens)} written to it, ${u.format(e.inputTokens)} neither;`,`${u.format(e.outputTokens)} output tokens`].join(` `)}function m(t){let n=t.flatMap(e=>e.usage===void 0?[]:[e.usage]);return{turns:t.length,failed:t.filter(c).length,usage:n.length===0?null:n.reduce(e),withUsage:n.length}}function h(e,t){let n=/^\s*#{1,6}\s+(.+?)\s*(?:\n|$)/.exec(e);return n?.[1]?.toLowerCase()===t.toLowerCase()?e.slice(n[0].length).trim():e}function g(e,t){let n=[...e.homeRunner===void 0?[]:[{what:`outside projects`,runner:e.homeRunner}],...e.memberships.map(e=>({what:e,runner:t.get(e)}))],r=[...new Set(n.flatMap(e=>e.runner===void 0?[]:[e.runner]))],i=n.map(e=>`${e.what}: ${e.runner??`placed on its first turn`}`).join(`; `);return{label:r.length===0?`no runner yet`:`on ${r.join(`, `)}`,detail:i===``?`pinned to a runner on its first turn`:i}}export{p as a,i as c,r as i,h as l,m as n,f as o,g as r,a as s,s as t};