@dubusoft/toodo-linux-arm64 1.9.2-dev.125 → 1.10.1-dev.127
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.
- package/bin/toodo +0 -0
- package/bin/toodo-server +0 -0
- package/package.json +1 -1
- package/web/assets/{Item-C7BxCNvf.js → Item-GiNVg_EO.js} +2 -2
- package/web/assets/{ItemSwipeLayer-jN40T5gS.js → ItemSwipeLayer-BtPKbsnL.js} +1 -1
- package/web/assets/{MenuBottomSheet-CmD10JPc.js → MenuBottomSheet-C6rgp8qI.js} +1 -1
- package/web/assets/{MenuBottomSheetActionList-Dvr545sr.js → MenuBottomSheetActionList-CXoiMPMS.js} +1 -1
- package/web/assets/{Selector-C7eBvI7H.js → Selector-ViEvQgfb.js} +2 -2
- package/web/assets/{details-sheet-D4sK3yzZ.js → details-sheet-B6OGmEKK.js} +1 -1
- package/web/assets/{index-CgAbg1dR.js → index-B3s952eE.js} +19 -19
- package/web/assets/{index-C9oMU97F.css → index-D-zV9pKv.css} +1 -1
- package/web/assets/{markdown-RgnX1GWp.js → markdown-vY_iUj1e.js} +1 -1
- package/web/assets/{offline-screen-BDixxLRf.js → offline-screen-C2k8-v8e.js} +1 -1
- package/web/assets/{queries-DHYhlMyq.js → queries-BwOQXCYo.js} +1 -1
- package/web/assets/review-BJsNQP_f.js +1 -0
- package/web/assets/{server-access-vIbRjx81.js → server-access-BiQWXff-.js} +1 -1
- package/web/assets/task-details-CsDCFUY1.js +2 -0
- package/web/assets/task-graph-CjVYDc6u.js +8 -0
- package/web/index.html +6 -6
- package/web/sw.js +2 -2
- package/web/version.json +1 -1
- package/web/assets/review-DO4wWU6-.js +0 -1
- package/web/assets/task-details-BPeO8--U.js +0 -2
- package/web/assets/task-graph-D-AtA90u.js +0 -8
package/web/sw.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by vite-pwa.ts for this build.
|
|
2
|
-
const CACHE = "toodo-shell-
|
|
3
|
-
const SHELL = ["/","/assets/Item-
|
|
2
|
+
const CACHE = "toodo-shell-30d981f7fe37f44d";
|
|
3
|
+
const SHELL = ["/","/assets/Item-GiNVg_EO.js","/assets/ItemSwipeLayer-BtPKbsnL.js","/assets/LayoutChangeSnapshot-B4oZH00p.js","/assets/MenuBottomSheet-C6rgp8qI.js","/assets/MenuBottomSheetActionList-CXoiMPMS.js","/assets/Selector-ViEvQgfb.js","/assets/Tooltip-D2KklOm3.js","/assets/button-CN-K3abk.js","/assets/createLucideIcon-BVHtiYZr.js","/assets/details-sheet-B6OGmEKK.js","/assets/devWarning-WNHQ_jrU.js","/assets/disabledInteraction-u9yjM5Jo.js","/assets/event-CQKPwXyA.js","/assets/focusOutline.stylex-C8peqGyQ.js","/assets/focusReturn-sK-DMBDt.js","/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2","/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2","/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2","/assets/geist-latin-wght-normal-BgDaEnEv.woff2","/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2","/assets/index-B3s952eE.js","/assets/index-D-zV9pKv.css","/assets/jsx-runtime-D3jfb0Ew.js","/assets/markdown-vY_iUj1e.js","/assets/mergeProps-ptS-gIMz.js","/assets/offline-screen-C2k8-v8e.js","/assets/opener-DWhHPoCL.js","/assets/padding.stylex-DZAzBtx2.js","/assets/presentation-vnGoTO8Y.js","/assets/queries-BwOQXCYo.js","/assets/review-BJsNQP_f.js","/assets/server-access-BiQWXff-.js","/assets/session-Cf4paMWb.js","/assets/task-details-CsDCFUY1.js","/assets/task-graph-CjVYDc6u.js","/assets/task-graph-DLioOiRN.css","/assets/useLayerDismissal-DhnWLnTJ.js","/assets/useLinkComponent-Cokdl8Ls.js","/assets/useMediaQuery-oNWJZ4E0.js","/assets/useTooltip-BCo1T06f.js","/favicon.svg","/manifest.webmanifest","/pwa/apple-touch-icon.png","/pwa/icon-192.png","/pwa/icon-512.png","/pwa/icon-maskable-192.png","/pwa/icon-maskable-512.png"];
|
|
4
4
|
const SERVER_PATHS = ["/api","/mcp"];
|
|
5
5
|
const NOTIFICATION_ICON = "/pwa/icon-192.png";
|
|
6
6
|
// The message that asks an open page to show a task; see listenForOpenTask in src/web/push.ts.
|
package/web/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":"
|
|
1
|
+
{"build":"1961215c8c622193"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./Selector-C7eBvI7H.js";import{I as i,L as a,Mt as o,Ot as s,R as c,V as l,W as u,_ as d,_t as f,bt as p,et as ee,gt as m,ht as h,mt as te,n as ne,o as re,pt as ie,xt as g,z as _}from"./queries-DHYhlMyq.js";import{n as v,t as y}from"./button-CN-K3abk.js";import{A as b,C as ae,Ct as x,D as S,E as oe,G as C,L as w,M as se,Mt as T,N as E,Nt as ce,O as D,P as le,Pt as ue,S as de,St as O,T as k,Tt as A,U as j,X as fe,Z as pe,_ as me,b as M,c as he,d as ge,et as N,f as P,g as F,h as I,j as L,k as _e,l as R,m as z,nt as ve,p as B,s as ye,tt as be,u as V,v as H,w as xe,x as U,y as W}from"./index-CgAbg1dR.js";import{t as G}from"./opener-DWhHPoCL.js";var K=e(t(),1),q=n(),Se={completed:o.success,opened_for_review:o.review,started:o.progress,worked_on:o.progress,planned:o.neutral},J=`live`,Y=`all`,X=`any`,Ce=[{kind:`week`,label:`Week`},{kind:`month`,label:`Month`},{kind:`quarter`,label:`Quarter`},{kind:`year`,label:`Year`},{kind:`custom`,label:`Custom`}];function we(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}function Te({disabled:e,items:t}){return(0,q.jsx)(j,{items:t,alignment:`end`,menuWidth:192,renderTrigger:t=>(0,q.jsx)(y,{...t,size:`sm`,variant:`primary`,icon:(0,q.jsx)(T,{}),label:`Export`,isDisabled:e})})}function Z(e,t){return`${e} ${t}${e===1?``:`s`}`}function Ee(){let e=_(),t=u(),[n,r]=(0,K.useState)(!1),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),c=typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[];async function l(e){s(null);try{await t.mutateAsync(e),r(!1)}catch(e){s(e instanceof Error?e.message:String(e))}}if(!e.data)return null;let{timeZone:d,configured:f}=e.data;return n?(0,q.jsxs)(`form`,{"aria-label":`Review time zone`,className:`flex flex-wrap items-center gap-2 print:hidden`,onSubmit:e=>{e.preventDefault(),l(i)},children:[(0,q.jsx)(`label`,{htmlFor:`review-time-zone`,className:`text-xs`,children:`Time zone for every device`}),(0,q.jsx)(`input`,{id:`review-time-zone`,list:`review-time-zones`,required:!0,className:A(N,`w-56`),value:i,onChange:e=>a(e.target.value)}),(0,q.jsx)(`datalist`,{id:`review-time-zones`,children:c.map(e=>(0,q.jsx)(`option`,{value:e},e))}),(0,q.jsx)(y,{size:`sm`,variant:`primary`,type:`submit`,label:`Save`,isDisabled:t.isPending}),f!==null&&(0,q.jsx)(y,{size:`sm`,variant:`secondary`,label:`Use the server's`,onClick:()=>void l(null)}),(0,q.jsx)(y,{size:`sm`,variant:`ghost`,label:`Cancel`,onClick:()=>r(!1)}),o&&(0,q.jsx)(`span`,{role:`alert`,className:`w-full text-xs text-destructive`,children:o})]}):(0,q.jsxs)(`span`,{children:[`Days are in `,d,f===null&&` (the server's time zone)`,`.`,` `,(0,q.jsx)(y,{size:`sm`,variant:`ghost`,label:`Change time zone`,className:`print:hidden`,onClick:()=>{a(f??d),r(!0)}})]})}function Q({onShowTask:e}){let[t,n]=(0,K.useState)(()=>U(`week`,m(Date.now()/1e3))),[o,s]=(0,K.useState)(null),[u,p]=(0,K.useState)(W),[h,g]=(0,K.useState)(null),[_,oe]=(0,K.useState)(null),T=i(t.from,t.to),E=c(),D=a(_),O=l(),k=d(),j=_!==null,N=j?D:T,P=ee(),F=re(),I=j?D.data?.workspaces??[]:[...P.data??[],...F.data?.workspaces??[]],L=new Map(I.map(e=>[e.id,e.name])),R=j?D.data&&{period:{kind:D.data.summary.period,from:D.data.summary.from,to:D.data.summary.to},entries:D.data.entries,start:D.data.summary.start,end:D.data.summary.end,timeZone:D.data.summary.timeZone,now:D.data.summary.savedAt}:T.data&&{period:t,entries:T.data.entries,start:T.data.start,end:T.data.end,timeZone:T.data.timeZone,now:Date.now()/1e3},z=R?.period??t,B=R&&ge(R.entries,u),V=_e(R?.entries??[]);u.label!==null&&!V.includes(u.label)&&V.push(u.label);let H=[u.workspaceId===null?`across all workspaces`:`in ${L.get(u.workspaceId)??`workspace ${u.workspaceId}`}`,u.label!==null&&`labelled ${u.label}`].filter(Boolean).join(`, `),G=ae[z.kind];function Q(e){s(null),n(e)}function $(e){s(null),g(null),oe(e)}async function Me(){try{let e=await O.mutateAsync({period:t.kind,from:t.from,to:t.kind===`custom`?t.to:null,workspaceId:u.workspaceId,label:u.label,title:null});s(`Saved "${e.title}" with ${Z(e.entryCount,`task`)}; reopen it from Saved reviews.`)}catch(e){s(`Could not save the review: ${e instanceof Error?e.message:String(e)}`)}}async function Ne(e){try{await k.mutateAsync(e),$(null),s(`Deleted the saved review.`)}catch(e){s(`Could not delete the saved review: ${e instanceof Error?e.message:String(e)}`)}}function Pe(e){e!==t.kind&&Q(e===`custom`?{...t,kind:e}:U(e,t.from))}function Fe(e){return j?D.data?Promise.resolve(e===`csv`?D.data.csv:D.data.markdown):Promise.reject(Error(`the saved review is still loading`)):ne(ie.reviewReport({period:t.kind,date:null,from:t.from,to:t.kind===`custom`?t.to:null,format:e,timeZone:null,workspaceId:u.workspaceId,label:u.label}))}async function Ie(){try{let e=Fe(`markdown`);if(typeof ClipboardItem>`u`)await navigator.clipboard.writeText((await e).contents);else{let t=e.then(({contents:e})=>new Blob([e],{type:`text/plain`}));await navigator.clipboard.write([new ClipboardItem({"text/plain":t})])}s(`Copied as Markdown.`)}catch(e){s(`Could not copy: ${String(e)}`)}}async function Le(e){try{let t=await Fe(e);we(t.fileName,t.contents,t.mediaType),s(`Downloaded ${t.fileName}`)}catch(e){s(`Could not export: ${String(e)}`)}}return(0,q.jsxs)(`section`,{"aria-labelledby":`review-heading`,className:`flex flex-col gap-4`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h2`,{id:`review-heading`,className:`text-xl font-semibold tracking-tight`,children:j&&D.data?D.data.summary.title:xe[z.kind]}),(0,q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Work recorded from `,z.from,` to `,z.to,` `,H,`.`,` `,j?D.data&&(0,q.jsxs)(`span`,{children:[`Saved `,f(D.data.summary.savedAt),`, with days in `,D.data.summary.timeZone,`; it stays as it was when saved.`]}):(0,q.jsx)(Ee,{})]})]}),(j||(E.data?.length??0)>0)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,q.jsx)(r,{label:`Saved reviews`,isLabelHidden:!0,size:`sm`,options:[{value:J,label:`Live review`},...(E.data??[]).map(e=>({value:String(e.id),label:`${e.title} (saved ${m(e.savedAt)})`}))],value:_===null?J:String(_),onChange:e=>$(e===J?null:Number(e))}),_!==null&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(y,{size:`sm`,variant:`secondary`,label:`Back to the live review`,onClick:()=>$(null)}),(0,q.jsx)(y,{size:`sm`,variant:`ghost`,label:`Delete saved review`,isDisabled:k.isPending,onClick:()=>void Ne(_)})]})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 print:hidden`,children:[!j&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ve,{label:`Review period`,size:`sm`,value:t.kind,onChange:e=>typeof e==`string`&&Pe(e),children:Ce.map(({kind:e,label:t})=>(0,q.jsx)(be,{value:e,label:t},e))}),t.kind===`week`&&(0,q.jsx)(w,{label:`Week starting`,size:`sm`,format:`system_date`,value:t.from,onChange:e=>e&&Q(se(e))}),t.kind===`custom`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(w,{label:`From`,size:`sm`,format:`system_date`,max:t.to,value:t.from,onChange:e=>e&&e<=t.to&&Q({...t,from:e})}),(0,q.jsx)(w,{label:`To`,size:`sm`,format:`system_date`,min:t.from,value:t.to,onChange:e=>e&&e>=t.from&&Q({...t,to:e})})]}),t.kind!==`week`&&t.kind!==`custom`&&(0,q.jsx)(`span`,{className:`px-1 text-sm font-medium`,children:de(t)}),(0,q.jsx)(v,{size:`sm`,variant:`secondary`,icon:(0,q.jsx)(ce,{}),label:`Previous ${G}`,tooltip:`Previous ${G}`,onClick:()=>Q(b(t,-1))}),(0,q.jsx)(v,{size:`sm`,variant:`secondary`,icon:(0,q.jsx)(ue,{}),label:`Next ${G}`,tooltip:`Next ${G}`,onClick:()=>Q(b(t,1))}),t.kind!==`custom`&&(0,q.jsx)(y,{size:`sm`,variant:`ghost`,label:`This ${G}`,onClick:()=>Q(U(t.kind,m(Date.now()/1e3)))})]}),(0,q.jsx)(`div`,{className:`ml-auto`,children:(0,q.jsx)(Te,{disabled:!B,items:[...j?[]:[{label:`Save as snapshot`,onClick:()=>void Me()}],{label:`Copy as Markdown`,onClick:()=>void Ie()},{label:`Save as Markdown`,onClick:()=>void Le(`markdown`)},{label:`Save as CSV`,onClick:()=>void Le(`csv`)},{label:`Print or save as PDF`,onClick:()=>window.print()}]})})]}),(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Review filters`,className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,q.jsx)(r,{label:`Workspace`,isLabelHidden:!0,size:`sm`,options:[{value:Y,label:`All workspaces`},...I.map(e=>({value:String(e.id),label:e.name}))],value:u.workspaceId===null?Y:String(u.workspaceId),onChange:e=>p({...u,workspaceId:e===Y?null:Number(e)})}),(0,q.jsx)(r,{label:`Label`,isLabelHidden:!0,size:`sm`,options:[{value:X,label:V.length===0?`No labels in this period`:`Any label`},...V.map(e=>({value:`label:${e}`,label:e}))],value:u.label===null?X:`label:${u.label}`,onChange:e=>p({...u,label:e===X?null:e.slice(6)})}),(u.workspaceId!==null||u.label!==null)&&(0,q.jsx)(y,{size:`sm`,variant:`ghost`,label:`Clear filters`,onClick:()=>p(W)})]}),o&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground print:hidden`,children:o}),(0,q.jsx)(`p`,{role:`status`,className:A(`text-sm text-muted-foreground`,!N.isPending&&`sr-only`),children:N.isPending?`Loading the review...`:B?`Showing ${B.length} ${B.length===1?`task`:`tasks`} with activity in this ${G}.`:``}),N.isError&&(0,q.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load the review: `,N.error.message]}),B?.length===0&&(0,q.jsx)(ye,{title:R?.entries.length===0?`No recorded activity in this ${G}.`:`No recorded activity in this ${G} matches the filters.`,hint:j?`This saved review keeps the tasks it had when it was saved.`:R?.entries.length===0?`Toodo records each task as it is planned, started, moved to review, and completed, so reviews fill up as you work.`:`Pick another period or change the filters to look at other work.`,action:j?void 0:(0,q.jsx)(`div`,{className:`flex flex-wrap justify-center gap-2 print:hidden`,children:(0,q.jsx)(y,{size:`sm`,variant:`secondary`,label:`Show the ${G} before`,onClick:()=>Q(b(t,-1))})})}),R&&B&&B.length>0&&(0,q.jsx)(je,{shown:R,entries:B,workspaces:I}),R&&B&&(0,q.jsx)(Ae,{shown:R,entries:B,editable:!j}),z.kind===`year`&&B&&(0,q.jsx)(ke,{entries:B}),B&&me(B).map(t=>(0,q.jsxs)(`section`,{"aria-label":M[t.outcome],className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`h3`,{className:A(`text-sm font-semibold`,Se[t.outcome]),children:[M[t.outcome],` `,(0,q.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.entries.length,`)`]})]}),(0,q.jsx)(`ul`,{className:`flex flex-col divide-y rounded-lg border`,children:t.entries.map(({task:t,at:n,commits:r,archived:i,pullRequest:a})=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 px-3 py-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(C,{type:t.taskType}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`#`,t.id]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Open #${t.id} ${t.title}`,title:t.title,onClick:()=>e?.(t.id),className:`min-w-0 flex-1 truncate text-left text-sm font-medium hover:underline max-md:min-h-11`,children:t.title}),t.resolution===`not_adopted`&&(0,q.jsx)(x,{className:`shrink-0`,label:`Not adopted`}),i&&(0,q.jsx)(x,{className:`shrink-0`,label:`Archived`}),t.resolution===`completed`&&(0,q.jsx)(x,{className:`shrink-0`,variant:`green`,label:`Completed`}),S(t)&&(0,q.jsx)(Oe,{url:S(t),stats:a}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground max-md:hidden print:inline`,children:[L.get(t.workspaceId)??`Workspace ${t.workspaceId}`,` · `,(0,q.jsx)(te,{at:n})]})]}),(0,q.jsx)(pe,{task:t}),i||j?null:h?.id===t.id?(0,q.jsx)(le,{task:t,focusPlan:h.field,onDone:()=>g(null)}):(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground empty:hidden print:hidden`,children:(0,q.jsx)(fe,{task:t,onEdit:e=>g({id:t.id,field:e})})}),t.completionNote&&(0,q.jsx)(`p`,{"aria-label":`Completion note of #${t.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:t.completionNote}),R&&(0,q.jsx)(De,{task:t,shown:R}),r.length>0&&(0,q.jsx)(`ul`,{"aria-label":`Commits of #${t.id} this ${G}`,className:`flex flex-col gap-0.5`,children:r.map(e=>(0,q.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,q.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,q.jsx)(`span`,{className:`truncate`,children:he(e.message)})]},e.sha))})]},t.id))})]},t.outcome))]})}function $(e){return e===0?`0h`:z(e)}function De({task:e,shown:t}){let{start:n,end:r,now:i}=t,a=h(e.timeline,i),o=p(e.timeline,i);if(a===null||o===null)return null;let s=g(e.timeline).filter(e=>e.state===`paused`&&e.start<r&&(e.end??i)>n);return(0,q.jsxs)(`div`,{"aria-label":`Time of #${e.id}`,className:`flex flex-col gap-0.5 text-xs text-muted-foreground`,children:[(0,q.jsxs)(`p`,{children:[$(a),` active, `,$(o),` waiting`]}),s.length>0&&(0,q.jsx)(`ul`,{"aria-label":`Waits of #${e.id}`,className:`flex flex-col gap-0.5`,children:s.map(e=>(0,q.jsxs)(`li`,{className:`break-words-keep`,children:[`Waiting `,$(Math.max((e.end??i)-e.start,0)),` from `,m(e.start),e.end===null&&`, still waiting`,`: `,e.reason??`no reason recorded`]},e.start))})]})}function Oe({url:e,stats:t}){let n=oe(e),r=t=>{t.preventDefault(),G(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,q.jsx)(`a`,{href:e,title:t?`${e} \u00b7 ${D(t)}`:e,"aria-label":n?`Pull request #${n}`:`Pull request`,onClick:r,onAuxClick:r,className:`shrink-0 text-xs text-primary underline underline-offset-2 hover:no-underline max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:n?`#${n}`:`PR`})}function ke({entries:e}){let t=E(e);return t===null?null:(0,q.jsxs)(`section`,{"aria-labelledby":`year-in-review-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsx)(`h3`,{id:`year-in-review-heading`,className:`text-sm font-semibold`,children:`Year in review`}),t.pullRequests&&(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Merged pull requests`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.pullRequests})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Lines changed`}),(0,q.jsxs)(`dd`,{className:`text-lg font-semibold`,children:[(0,q.jsxs)(`span`,{children:[`+`,t.pullRequests.additions]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,q.jsxs)(`span`,{children:[`-`,t.pullRequests.deletions]})]})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Files changed`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.changedFiles})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Reviews`}),(0,q.jsxs)(`dd`,{className:`text-lg font-semibold`,title:F(t.pullRequests),children:[t.pullRequests.reviews,(0,q.jsxs)(`span`,{className:`ml-1 text-xs font-normal text-muted-foreground`,children:[`on `,t.pullRequests.reviewed,` of `,t.pullRequests.pullRequests]})]})]})]}),t.largest.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest pull requests`}),(0,q.jsx)(`ol`,{"aria-label":`Largest pull requests`,className:`flex flex-col gap-1`,children:t.largest.map(({task:e,pullRequest:t})=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(C,{type:e.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:D(t)})]},e.id))})]}),t.research.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Research conclusions`}),(0,q.jsx)(`ul`,{"aria-label":`Research conclusions`,className:`flex flex-col divide-y rounded-md border`,children:t.research.map(({task:e,at:t,adopted:n})=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsx)(x,{className:`shrink-0`,variant:n?`green`:`neutral`,label:n?`Adopted`:`Not adopted`}),(0,q.jsx)(te,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,at:t})]}),(0,q.jsx)(`p`,{"aria-label":`Research conclusion of #${e.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:e.completionNote??(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`No conclusion written.`})})]},e.id))})]}),t.overruns.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest estimate overruns`}),(0,q.jsx)(`ol`,{"aria-label":`Largest estimate overruns`,className:`flex flex-col gap-1`,children:t.overruns.map(({task:e,estimated:t,actual:n})=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(C,{type:e.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[`estimated `,z(t),`, `,z(n),` active`]})]},e.id))})]})]})}function Ae({shown:e,entries:t,editable:n}){let r=k(e.end,t,e.now),i=n?t.filter(({archived:e})=>!e).map(({task:e})=>O(e)):[],a=i.filter(e=>e.includes(`estimate`)).length,s=i.filter(e=>e.includes(`dueDate`)).length;if(r===null&&a+s===0)return null;let c=(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Missing plan`}),(0,q.jsxs)(`dd`,{children:[[a>0&&`${Z(a,`task`)} without an estimate`,s>0&&`${Z(s,`task`)} without a due date`].filter(Boolean).join(`, `),`; add them from the marks on the tasks below`]})]});return(0,q.jsxs)(`section`,{"aria-labelledby":`plan-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsx)(`h3`,{id:`plan-heading`,className:`text-sm font-semibold`,children:`Plan vs actual`}),r===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-sm`,children:`No reviewed task has an estimate or a due date, so there is nothing to compare yet.`}),(0,q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:c})]}):(0,q.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Estimate vs active time`}),(0,q.jsx)(`dd`,{children:r.time?I(r.time):`No completed task had an estimate`})]}),(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Due dates met`}),(0,q.jsx)(`dd`,{children:r.dueDates?B(r.dueDates):`No completed task had a due date`})]}),a+s>0&&c]}),r!==null&&r.late.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Late tasks`}),(0,q.jsx)(`ul`,{"aria-label":`Late tasks`,className:`flex flex-col gap-1`,children:r.late.map(e=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[(0,q.jsx)(C,{type:e.task.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.task.title})]}),(0,q.jsx)(`span`,{className:A(`ml-auto shrink-0 text-xs`,o.danger),children:H(e)})]},e.task.id))})]})]})}function je({shown:e,entries:t,workspaces:n}){let r=L(e.period,t,n,e.timeZone),i=Math.max(1,...(r.completedPerMonth??[]).map(({count:e})=>e));return(0,q.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[r.outcomes.map(({outcome:e,count:t})=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:M[e]}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t})]},e)),r.notAdopted>0&&(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Not adopted`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.notAdopted})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Commits`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.commits})]})]}),(0,q.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[R.map(e=>{let t=r[e];return(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:V[e]}),(0,q.jsx)(`dd`,{children:t===null?`No data`:`${z(t.median)} (${t.tasks} ${t.tasks===1?`task`:`tasks`})`})]},e)}),r.changes&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Changes in completed pull requests`}),(0,q.jsx)(`dd`,{children:P(r.changes)})]}),r.completedByType.length>0&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by type`}),(0,q.jsx)(`dd`,{children:r.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)})]}),r.completedByWorkspace.length>0&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by workspace`}),(0,q.jsx)(`dd`,{children:r.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)})]})]}),r.completedPerMonth&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Completed per month`}),(0,q.jsx)(`ul`,{"aria-label":`Completed per month`,className:`flex flex-col gap-0.5`,children:r.completedPerMonth.map(({month:e,count:t})=>(0,q.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`w-16 shrink-0 font-mono text-muted-foreground`,children:e}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:A(`h-2 rounded-sm`,s.success),style:{width:`${t/i*60}%`,minWidth:t>0?4:0}}),(0,q.jsx)(`span`,{children:t})]},e))})]})]})}export{Q as Review};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{l as r,t as i}from"./Selector-C7eBvI7H.js";import{E as a,Mt as o,X as s,_t as c,a as l,et as u,j as d,mt as f,q as p,u as m,vt as h,yt as g}from"./queries-DHYhlMyq.js";import{t as _}from"./createLucideIcon-BVHtiYZr.js";import{n as v,t as y}from"./button-CN-K3abk.js";import{$ as b,At as x,B as S,Ct as C,F as w,Ft as T,H as E,I as D,J as O,Q as k,Tt as A,V as ee,Y as te,Z as ne,kt as re,q as j,xt as M}from"./index-CgAbg1dR.js";import{t as N}from"./opener-DWhHPoCL.js";import{t as P}from"./details-sheet-D4sK3yzZ.js";var F={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};F.node;var I=_(F),L={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};L.node;var R=_(L),z={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};z.node;var B=_(z),V=e(t(),1),H=n();function U({onClose:e,children:t}){let n=(0,V.useRef)(null),[r,i]=(0,V.useState)(!1);function a(){n.current?.querySelector(`form[data-dirty]`)?i(!0):e()}return(0,V.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[aria-haspopup='menu'][aria-expanded='true']`)||(r?i(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select, [role=combobox], [role=listbox]`)||a())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,H.jsx)(P,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:a,banner:r&&(0,H.jsxs)(`div`,{role:`group`,"aria-label":`Unsaved changes`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-muted px-4 py-2 text-xs`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,H.jsx)(y,{size:`sm`,variant:`secondary`,label:`Keep editing`,autoFocus:!0,onClick:()=>i(!1)}),(0,H.jsx)(y,{size:`sm`,variant:`destructive`,label:`Discard changes`,onClick:e})]}),children:t})}function W(e){switch(e.status){case`in_progress`:return`Started`;case`in_review`:return`In review`;case`done`:return`Completed`;case`planned`:return e.reopened?`Reopened`:`Paused`}}function G({task:e}){let t=e.timeline.filter(e=>e.reason!==null);return t.length===0?null:(0,H.jsx)(`ol`,{"aria-label":`Reasons of #${e.id}`,className:`mt-1 flex flex-col gap-0.5`,children:t.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 max-md:flex-wrap max-md:gap-y-0`,children:[(0,H.jsx)(f,{className:`shrink-0 text-muted-foreground`,at:e.at}),(0,H.jsx)(`span`,{className:`shrink-0 font-medium`,children:W(e)}),(0,H.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words-keep max-md:basis-full`,children:e.reason})]},t))})}var K={lane:`Lane`,discord:`Discord`,pr:`PR`};function ie({value:e}){if(/^https?:\/\//i.test(e)){let t=t=>{t.preventDefault(),N(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,H.jsx)(`a`,{href:e,onClick:t,onAuxClick:t,className:`min-w-0 break-all text-primary underline underline-offset-2 hover:no-underline`,children:e})}let t=e.indexOf(`:`),n=t>0?K[e.slice(0,t)]:void 0;return n===void 0?(0,H.jsx)(`code`,{className:`min-w-0 break-all`,children:e}):(0,H.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1`,children:[(0,H.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,H.jsx)(`code`,{className:`min-w-0 break-all`,children:e.slice(t+1)})]})}function q({task:e}){return e.refs.length===0?null:(0,H.jsx)(j,{label:`Refs`,children:(0,H.jsx)(`ul`,{"aria-label":`Refs of #${e.id}`,className:`flex flex-col gap-0.5`,children:e.refs.map(e=>(0,H.jsx)(`li`,{className:`flex min-w-0`,children:(0,H.jsx)(ie,{value:e})},e))})})}function J({task:e,detailed:t}){let n=g(e.milestones);return n.length===0?null:t?(0,H.jsxs)(j,{label:`Timeline`,children:[(0,H.jsx)(`dl`,{"aria-label":`Timeline of #${e.id}`,className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:n.map(({label:e,at:t})=>(0,H.jsxs)(`div`,{className:`contents`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(f,{at:t})})]},e))}),(0,H.jsx)(G,{task:e})]}):(0,H.jsx)(`p`,{"aria-label":`Timeline of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:n.map(({label:e,at:t})=>(0,H.jsx)(f,{at:t,prefix:`${e} `},e))})}function Y({task:e,tasks:t,context:n,navigation:r}){let a=p(),o=l(),s=d(),c=(a.data??[]).flatMap(({taskId:t,relatedId:n})=>t===e.id?[n]:n===e.id?[t]:[]).filter(e=>n.byId.has(e)),u=t.filter(t=>t.id!==e.id&&!c.includes(t.id)),f=[...new Set([e.workspaceId,...u.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:u.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),m=b(),h=o.isPending||s.isPending||m,g=o.error??s.error;if(c.length===0&&f.length===0)return null;let _=f.length>0&&(0,H.jsx)(i,{label:`Add related task to #${e.id}`,isLabelHidden:!0,size:`sm`,width:192,placeholder:`Add related task...`,value:``,isDisabled:h,options:f.map(e=>({type:`section`,title:n.workspaceName(e.workspaceId),options:e.tasks.map(e=>({value:String(e.id),label:`#${e.id} ${e.title}`}))})),onChange:t=>{t&&o.mutate({taskId:e.id,relatedId:Number(t)})}}),S=g&&(0,H.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:g.message});return c.length===0?(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs`,children:[_,S]}):(0,H.jsxs)(j,{label:`Related`,children:[(0,H.jsxs)(`ul`,{"aria-label":`Related tasks of #${e.id}`,className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[c.map(t=>{let i=n.byId.get(t),a=k(t,e.workspaceId,n);return(0,H.jsxs)(`li`,{className:`inline-flex min-w-0 items-center max-md:gap-2`,children:[(0,H.jsx)(y,{size:`sm`,variant:`secondary`,label:i===void 0?a:`${a} ${i.title}`,"aria-label":`Open related task ${a}`,tooltip:i?.title,className:`min-w-0 max-w-56 tabular-nums`,isDisabled:r===void 0||!r.canOpen(t),onClick:()=>r?.open(t)}),(0,H.jsx)(v,{size:`sm`,variant:`ghost`,label:`Remove related task #${t} from #${e.id}`,tooltip:`Remove related task`,icon:(0,H.jsx)(x,{}),isDisabled:h,onClick:()=>s.mutate({taskId:e.id,relatedId:t})})]},t)}),_]}),S]})}function ae({task:e}){let t=s();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(y,{size:`sm`,variant:e.autopilot?`primary`:`secondary`,changesData:!0,"aria-pressed":e.autopilot,"aria-label":`Autopilot of #${e.id}`,label:e.autopilot?`Autopilot on`:`Autopilot off`,icon:(0,H.jsx)(T,{"aria-hidden":!0}),tooltip:e.autopilot?`Marked for autopilot: an executor may take it up on its own once it is ready. Click to clear.`:`Not marked for autopilot. Click to let an executor take it up on its own once it is ready.`,isDisabled:t.isPending,onClick:()=>t.mutate({status:null,id:e.id,taskType:e.taskType,title:e.title,description:e.description,estimate:e.estimate,dueDate:e.dueDate,autopilot:!e.autopilot,criteria:null}),className:`shrink-0`}),t.error&&(0,H.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}function oe({task:e}){let t=u(),n=a(),r=b(),o=t.data??[];return o.length<2?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`inline-flex`,title:`Move the task to another workspace; its history, notes, criteria, refs, and links stay`,children:(0,H.jsx)(i,{label:`Workspace of #${e.id}`,isLabelHidden:!0,size:`sm`,width:160,value:String(e.workspaceId),isDisabled:n.isPending||r,options:o.map(e=>({value:String(e.id),label:e.name})),onChange:t=>n.mutate({id:e.id,workspaceId:Number(t)})})}),n.error&&(0,H.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function se({task:e}){return(0,H.jsxs)(H.Fragment,{children:[(e.estimate!==null||e.dueDate!==null)&&(0,H.jsxs)(`p`,{"aria-label":`Plan of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:[e.estimate!==null&&(0,H.jsxs)(`span`,{children:[`Estimate `,M(e.estimate)]}),e.dueDate!==null&&(0,H.jsx)(O,{task:e})]}),(0,H.jsx)(ne,{task:e}),(0,H.jsx)(q,{task:e})]})}var ce={progress:`Progress`,blocker:`Blocker`,decision:`Decision`},le={progress:`neutral`,blocker:`warning`,decision:`info`};function X({kind:e}){return(0,H.jsx)(C,{"data-note-kind":e,className:`shrink-0`,variant:le[e],label:ce[e]})}function ue({task:e,detailed:t}){let n=e.notes;if(n.length===0)return null;if(!t){let t=n[n.length-1];return(0,H.jsxs)(`p`,{"aria-label":`Latest note of #${e.id}`,className:`flex min-w-0 items-center gap-1.5 text-xs`,title:c(t.at),children:[(0,H.jsx)(X,{kind:t.kind}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:E(t.body)}),n.length>1&&(0,H.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`+${n.length-1} more`})]})}return(0,H.jsx)(j,{label:`Notes (${n.length})`,children:(0,H.jsx)(`ol`,{"aria-label":`Notes of #${e.id}`,className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(X,{kind:e.kind}),(0,H.jsx)(f,{className:`text-muted-foreground`,at:e.at})]}),(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(`p`,{className:`whitespace-pre-line break-words-keep`,children:e.body}),children:(0,H.jsx)(te,{source:e.body})})]},t))})})}var de={pending:`Pending`,met:`Met`,failed:`Failed`},Z={pending:o.neutral,met:o.success,failed:o.danger},Q={user:`you`,agent:`an agent`,toodo:`Toodo`};function $({state:e}){let t=e===`met`?I:e===`failed`?R:B;return(0,H.jsx)(`span`,{role:`img`,"aria-label":de[e],className:A(`flex size-4 shrink-0 items-center justify-center`,Z[e]),children:(0,H.jsx)(t,{"aria-hidden":!0,className:`size-3.5`})})}function fe(e){if(e.checkedBy===null)return null;let t=e.checkedAt===null?``:` ${h(e.checkedAt)}`;return`Checked by ${Q[e.checkedBy]}${t}`}function pe({task:e,detailed:t}){let n=e.criteria;if(n.length===0)return null;let r=(0,H.jsx)(`ul`,{"aria-label":`Criteria of #${e.id}`,className:`flex flex-col gap-0.5`,children:n.map(n=>(0,H.jsx)(me,{task:e,criterion:n,detailed:t},n.id))});if(!t)return r;let i=n.filter(e=>e.state===`met`).length;return(0,H.jsx)(j,{label:`Criteria (${i} of ${n.length} met)`,children:r})}function me({task:e,criterion:t,detailed:n}){let i=m(),a=b(),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(``),d=t.kind===`manual`&&e.status!==`done`,p=fe(t),h=D(t.kind)?t.target:null;function g(){c(!1),u(``)}let _=ee(l.trim()!==``,g,i.isPending);function v(n){s?g():n?(i.reset(),c(!0)):i.mutate({taskId:e.id,criterionId:t.id,met:!1,evidence:null})}function x(n){n.preventDefault(),i.mutate({taskId:e.id,criterionId:t.id,met:!0,evidence:l.trim()||null},{onSuccess:g})}return(0,H.jsxs)(`li`,{"data-criterion-state":t.state,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,title:n?void 0:[p,t.evidence,h].filter(Boolean).join(`
|
|
2
|
-
`)||void 0,children:[d?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(re,{size:`sm`,className:`shrink-0`,label:`Check criterion ${t.id} of #${e.id}`,isLabelHidden:!0,value:t.state===`met`||s,isDisabled:i.isPending||a,onChange:v}),t.state===`failed`&&(0,H.jsx)($,{state:`failed`})]}):(0,H.jsx)($,{state:t.state}),(0,H.jsx)(`span`,{className:A(`min-w-0`,n?`break-words-keep`:`truncate`,t.state===`failed`&&o.danger),children:t.text}),t.kind!==`manual`&&(0,H.jsx)(C,{className:`shrink-0`,label:w[t.kind]}),!n&&t.evidence&&(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:t.evidence})]}),n&&h&&(0,H.jsx)(`code`,{className:`ml-5.5 break-all text-muted-foreground`,children:h}),n&&(t.evidence||p)&&(0,H.jsxs)(`p`,{className:`ml-5.5 whitespace-pre-line break-words-keep text-muted-foreground`,children:[t.evidence,t.evidence&&p&&` · `,t.checkedBy!==null&&(0,H.jsxs)(H.Fragment,{children:[`Checked by `,Q[t.checkedBy],t.checkedAt!==null&&(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(f,{at:t.checkedAt})]})]})]}),s&&(0,H.jsxs)(`form`,{onSubmit:x,className:`ml-5.5 flex flex-wrap items-center gap-1`,onKeyDown:_.onKeyDown,children:[(0,H.jsx)(r,{size:`sm`,containerClassName:`flex-1 basis-48`,label:`Evidence for criterion ${t.id}`,isLabelHidden:!0,placeholder:`Evidence (optional), e.g. a link or what you checked`,value:l,onChange:u,hasAutoFocus:!0}),_.asking?(0,H.jsx)(S,{label:`Discard evidence for criterion ${t.id}`,question:`Discard the evidence?`,onKeep:_.keep,onDiscard:_.discard}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(y,{type:`submit`,size:`sm`,variant:`primary`,label:i.isPending?`Saving...`:`Save`,isDisabled:i.isPending}),(0,H.jsx)(y,{type:`button`,size:`sm`,variant:`ghost`,label:`Cancel`,onClick:_.request})]})]}),i.isError&&(0,H.jsx)(`p`,{role:`alert`,className:`ml-5.5 text-destructive`,children:i.error.message})]})}export{ae as AutopilotToggle,Y as RelatedTasks,pe as TaskCriteria,U as TaskDetailsSheet,ue as TaskNotes,se as TaskPlan,J as TaskTimeline,oe as TaskWorkspace};
|