@dubusoft/toodo-linux-arm64 1.11.1-dev.188 → 1.11.1-dev.190
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-CxXDVdxg.js → Item-CYeHP9x3.js} +2 -2
- package/web/assets/{MenuBottomSheet-mlD8Gm29.js → MenuBottomSheet-DTrICmho.js} +1 -1
- package/web/assets/{MenuBottomSheetActionList-Dbjqtifj.js → MenuBottomSheetActionList-PkbkLEyi.js} +1 -1
- package/web/assets/{Selector-B5jbIiZk.js → Selector-D_XL1cT9.js} +2 -2
- package/web/assets/{SwipeActionsLayer-Bejm-fRw.js → SwipeActionsLayer-DIWq2pow.js} +1 -1
- package/web/assets/{details-sheet-m1U7cINQ.js → details-sheet-Bi7DoMJh.js} +1 -1
- package/web/assets/{index-CEWalcgJ.js → index-CsInHoHY.js} +5 -5
- package/web/assets/{markdown-qm8X61w7.js → markdown-Bh9eEY5s.js} +1 -1
- package/web/assets/{offline-screen-Dd05eBVY.js → offline-screen-DE0QwTVx.js} +1 -1
- package/web/assets/queries-01NiAvqS.js +1 -0
- package/web/assets/{review-DMyn842Z.js → review-2RqEEvjf.js} +1 -1
- package/web/assets/{server-access-Bq8jX3SY.js → server-access-dLztdn9t.js} +1 -1
- package/web/assets/{task-details-9__-MrOK.js → task-details-DK77SGWd.js} +1 -1
- package/web/assets/{task-graph-DPobWe6a.js → task-graph-CZXSZ3LO.js} +1 -1
- package/web/index.html +5 -5
- package/web/sw.js +2 -2
- package/web/version.json +1 -1
- package/web/assets/queries-qy-Fgikw.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{n as r,t as i}from"./button-CBaPb4j9.js";import{t as a}from"./details-sheet-m1U7cINQ.js";import{At as o,F as s,Ft as c,H as l,I as u,It as d,Mt as f,Ot as p,Q as m,U as h,Vt as g,W as _,X as v,Z as y,et as b,nt as x,tt as S}from"./index-CEWalcgJ.js";import{l as C,t as w}from"./Selector-B5jbIiZk.js";import{E as T,Ft as E,J as D,M as O,St as k,Z as A,a as j,gt as M,tt as N,u as P,xt as ee,yt as te}from"./queries-qy-Fgikw.js";import{t as ne}from"./opener-DWhHPoCL.js";import{t as F}from"./createLucideIcon-DtNDbJdC.js";var I={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`]};I.node;var L=F(I),R={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`]};R.node;var z=F(R),B={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};B.node;var V=F(B),H=e(t(),1),U=n();function W({onClose:e,children:t}){let n=(0,H.useRef)(null),[r,o]=(0,H.useState)(!1);function s(){n.current?.querySelector(`form[data-dirty]`)?o(!0):e()}return(0,H.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[aria-haspopup='menu'][aria-expanded='true']`)||(r?o(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select, [role=combobox], [role=listbox]`)||s())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,U.jsx)(a,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:s,banner:r&&(0,U.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,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,U.jsx)(i,{size:`sm`,variant:`secondary`,label:`Keep editing`,autoFocus:!0,onClick:()=>o(!1)}),(0,U.jsx)(i,{size:`sm`,variant:`destructive`,label:`Discard changes`,onClick:e})]}),children:t})}function G(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 K({task:e}){let t=e.timeline.filter(e=>e.reason!==null);return t.length===0?null:(0,U.jsx)(`ol`,{"aria-label":`Reasons of #${e.id}`,className:`mt-1 flex flex-col gap-0.5`,children:t.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 max-md:flex-wrap max-md:gap-y-0`,children:[(0,U.jsx)(M,{className:`shrink-0 text-muted-foreground`,at:e.at}),(0,U.jsx)(`span`,{className:`shrink-0 font-medium`,children:G(e)}),(0,U.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words-keep max-md:basis-full`,children:e.reason})]},t))})}var q={lane:`Lane`,discord:`Discord`,pr:`PR`};function J({value:e}){if(/^https?:\/\//i.test(e)){let t=t=>{t.preventDefault(),ne(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,U.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?q[e.slice(0,t)]:void 0;return n===void 0?(0,U.jsx)(`code`,{className:`min-w-0 break-all`,children:e}):(0,U.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,U.jsx)(`code`,{className:`min-w-0 break-all`,children:e.slice(t+1)})]})}function Y({task:e}){return e.refs.length===0?null:(0,U.jsx)(v,{label:`Refs`,children:(0,U.jsx)(`ul`,{"aria-label":`Refs of #${e.id}`,className:`flex flex-col gap-0.5`,children:e.refs.map(e=>(0,U.jsx)(`li`,{className:`flex min-w-0`,children:(0,U.jsx)(J,{value:e})},e))})})}function X({task:e,detailed:t}){let n=k(e.milestones);return n.length===0?null:t?(0,U.jsxs)(v,{label:`Timeline`,children:[(0,U.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,U.jsxs)(`div`,{className:`contents`,children:[(0,U.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(M,{at:t})})]},e))}),(0,U.jsx)(K,{task:e})]}):(0,U.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,U.jsx)(M,{at:t,prefix:`${e} `},e))})}function re({task:e,tasks:t,context:n,navigation:a}){let o=D(),s=j(),c=O(),l=(o.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&&!l.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),p=x(),m=s.isPending||c.isPending||p,h=s.error??c.error;if(l.length===0&&f.length===0)return null;let g=f.length>0&&(0,U.jsx)(w,{label:`Add related task to #${e.id}`,isLabelHidden:!0,size:`sm`,width:192,placeholder:`Add related task...`,value:``,isDisabled:m,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&&s.mutate({taskId:e.id,relatedId:Number(t)})}}),_=h&&(0,U.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:h.message});return l.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs`,children:[g,_]}):(0,U.jsxs)(v,{label:`Related`,children:[(0,U.jsxs)(`ul`,{"aria-label":`Related tasks of #${e.id}`,className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[l.map(t=>{let o=n.byId.get(t),s=S(t,e.workspaceId,n);return(0,U.jsxs)(`li`,{className:`inline-flex min-w-0 items-center max-md:gap-2`,children:[(0,U.jsx)(i,{size:`sm`,variant:`secondary`,label:o===void 0?s:`${s} ${o.title}`,"aria-label":`Open related task ${s}`,tooltip:o?.title,className:`min-w-0 max-w-56 tabular-nums`,isDisabled:a===void 0||!a.canOpen(t),onClick:()=>a?.open(t)}),(0,U.jsx)(r,{size:`sm`,variant:`ghost`,label:`Remove related task #${t} from #${e.id}`,tooltip:`Remove related task`,icon:(0,U.jsx)(d,{}),isDisabled:m,onClick:()=>c.mutate({taskId:e.id,relatedId:t})})]},t)}),g]}),_]})}function ie({task:e}){let t=A();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{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,U.jsx)(g,{"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,U.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}function ae({task:e}){let t=N(),n=T(),r=x(),i=t.data??[];return i.length<2?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`inline-flex`,title:`Move the task to another workspace; its history, notes, criteria, refs, and links stay`,children:(0,U.jsx)(w,{label:`Workspace of #${e.id}`,isLabelHidden:!0,size:`sm`,width:160,value:String(e.workspaceId),isDisabled:n.isPending||r,options:i.map(e=>({value:String(e.id),label:e.name})),onChange:t=>n.mutate({id:e.id,workspaceId:Number(t)})})}),n.error&&(0,U.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function oe({task:e}){return(0,U.jsxs)(U.Fragment,{children:[(e.estimate!==null||e.dueDate!==null)&&(0,U.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,U.jsxs)(`span`,{children:[`Estimate `,p(e.estimate)]}),e.dueDate!==null&&(0,U.jsx)(y,{task:e})]}),(0,U.jsx)(b,{task:e}),(0,U.jsx)(Y,{task:e})]})}var se={progress:`Progress`,blocker:`Blocker`,decision:`Decision`},ce={progress:`neutral`,blocker:`warning`,decision:`info`};function Z({kind:e}){return(0,U.jsx)(o,{"data-note-kind":e,className:`shrink-0`,variant:ce[e],label:se[e]})}function le({task:e,detailed:t}){let n=e.notes;if(n.length===0)return null;if(!t){let t=n[n.length-1];return(0,U.jsxs)(`p`,{"aria-label":`Latest note of #${e.id}`,className:`flex min-w-0 items-center gap-1.5 text-xs`,title:te(t.at),children:[(0,U.jsx)(Z,{kind:t.kind}),(0,U.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:_(t.body)}),n.length>1&&(0,U.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`+${n.length-1} more`})]})}return(0,U.jsx)(v,{label:`Notes (${n.length})`,children:(0,U.jsx)(`ol`,{"aria-label":`Notes of #${e.id}`,className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Z,{kind:e.kind}),(0,U.jsx)(M,{className:`text-muted-foreground`,at:e.at})]}),(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`p`,{className:`whitespace-pre-line break-words-keep`,children:e.body}),children:(0,U.jsx)(m,{source:e.body})})]},t))})})}var ue={pending:`Pending`,met:`Met`,failed:`Failed`},de={pending:E.neutral,met:E.success,failed:E.danger},Q={user:`you`,agent:`an agent`,toodo:`Toodo`};function $({state:e}){let t=e===`met`?L:e===`failed`?z:V;return(0,U.jsx)(`span`,{role:`img`,"aria-label":ue[e],className:f(`flex size-4 shrink-0 items-center justify-center`,de[e]),children:(0,U.jsx)(t,{"aria-hidden":!0,className:`size-3.5`})})}function fe(e){if(e.checkedBy===null)return null;let t=e.checkedAt===null?``:` ${ee(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,U.jsx)(`ul`,{"aria-label":`Criteria of #${e.id}`,className:`flex flex-col gap-0.5`,children:n.map(n=>(0,U.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,U.jsx)(v,{label:`Criteria (${i} of ${n.length} met)`,children:r})}function me({task:e,criterion:t,detailed:n}){let r=P(),a=x(),[d,p]=(0,H.useState)(!1),[m,g]=(0,H.useState)(``),_=t.kind===`manual`&&e.status!==`done`,v=fe(t),y=u(t.kind)?t.target:null;function b(){p(!1),g(``)}let S=h(m.trim()!==``,b,r.isPending);function w(n){d?b():n?(r.reset(),p(!0)):r.mutate({taskId:e.id,criterionId:t.id,met:!1,evidence:null})}function T(n){n.preventDefault(),r.mutate({taskId:e.id,criterionId:t.id,met:!0,evidence:m.trim()||null},{onSuccess:b})}return(0,U.jsxs)(`li`,{"data-criterion-state":t.state,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,title:n?void 0:[v,t.evidence,y].filter(Boolean).join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{n as r,t as i}from"./button-CBaPb4j9.js";import{t as a}from"./details-sheet-Bi7DoMJh.js";import{At as o,F as s,Ft as c,H as l,I as u,It as d,Mt as f,Ot as p,Q as m,U as h,Vt as g,W as _,X as v,Z as y,et as b,nt as x,tt as S}from"./index-CsInHoHY.js";import{l as C,t as w}from"./Selector-D_XL1cT9.js";import{E as T,Ft as E,J as D,M as O,St as k,Z as A,a as j,gt as M,tt as N,u as P,xt as ee,yt as te}from"./queries-01NiAvqS.js";import{t as ne}from"./opener-DWhHPoCL.js";import{t as F}from"./createLucideIcon-DtNDbJdC.js";var I={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`]};I.node;var L=F(I),R={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`]};R.node;var z=F(R),B={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};B.node;var V=F(B),H=e(t(),1),U=n();function W({onClose:e,children:t}){let n=(0,H.useRef)(null),[r,o]=(0,H.useState)(!1);function s(){n.current?.querySelector(`form[data-dirty]`)?o(!0):e()}return(0,H.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[aria-haspopup='menu'][aria-expanded='true']`)||(r?o(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select, [role=combobox], [role=listbox]`)||s())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,U.jsx)(a,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:s,banner:r&&(0,U.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,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,U.jsx)(i,{size:`sm`,variant:`secondary`,label:`Keep editing`,autoFocus:!0,onClick:()=>o(!1)}),(0,U.jsx)(i,{size:`sm`,variant:`destructive`,label:`Discard changes`,onClick:e})]}),children:t})}function G(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 K({task:e}){let t=e.timeline.filter(e=>e.reason!==null);return t.length===0?null:(0,U.jsx)(`ol`,{"aria-label":`Reasons of #${e.id}`,className:`mt-1 flex flex-col gap-0.5`,children:t.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 max-md:flex-wrap max-md:gap-y-0`,children:[(0,U.jsx)(M,{className:`shrink-0 text-muted-foreground`,at:e.at}),(0,U.jsx)(`span`,{className:`shrink-0 font-medium`,children:G(e)}),(0,U.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words-keep max-md:basis-full`,children:e.reason})]},t))})}var q={lane:`Lane`,discord:`Discord`,pr:`PR`};function J({value:e}){if(/^https?:\/\//i.test(e)){let t=t=>{t.preventDefault(),ne(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,U.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?q[e.slice(0,t)]:void 0;return n===void 0?(0,U.jsx)(`code`,{className:`min-w-0 break-all`,children:e}):(0,U.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,U.jsx)(`code`,{className:`min-w-0 break-all`,children:e.slice(t+1)})]})}function Y({task:e}){return e.refs.length===0?null:(0,U.jsx)(v,{label:`Refs`,children:(0,U.jsx)(`ul`,{"aria-label":`Refs of #${e.id}`,className:`flex flex-col gap-0.5`,children:e.refs.map(e=>(0,U.jsx)(`li`,{className:`flex min-w-0`,children:(0,U.jsx)(J,{value:e})},e))})})}function X({task:e,detailed:t}){let n=k(e.milestones);return n.length===0?null:t?(0,U.jsxs)(v,{label:`Timeline`,children:[(0,U.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,U.jsxs)(`div`,{className:`contents`,children:[(0,U.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(M,{at:t})})]},e))}),(0,U.jsx)(K,{task:e})]}):(0,U.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,U.jsx)(M,{at:t,prefix:`${e} `},e))})}function re({task:e,tasks:t,context:n,navigation:a}){let o=D(),s=j(),c=O(),l=(o.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&&!l.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),p=x(),m=s.isPending||c.isPending||p,h=s.error??c.error;if(l.length===0&&f.length===0)return null;let g=f.length>0&&(0,U.jsx)(w,{label:`Add related task to #${e.id}`,isLabelHidden:!0,size:`sm`,width:192,placeholder:`Add related task...`,value:``,isDisabled:m,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&&s.mutate({taskId:e.id,relatedId:Number(t)})}}),_=h&&(0,U.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:h.message});return l.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs`,children:[g,_]}):(0,U.jsxs)(v,{label:`Related`,children:[(0,U.jsxs)(`ul`,{"aria-label":`Related tasks of #${e.id}`,className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[l.map(t=>{let o=n.byId.get(t),s=S(t,e.workspaceId,n);return(0,U.jsxs)(`li`,{className:`inline-flex min-w-0 items-center max-md:gap-2`,children:[(0,U.jsx)(i,{size:`sm`,variant:`secondary`,label:o===void 0?s:`${s} ${o.title}`,"aria-label":`Open related task ${s}`,tooltip:o?.title,className:`min-w-0 max-w-56 tabular-nums`,isDisabled:a===void 0||!a.canOpen(t),onClick:()=>a?.open(t)}),(0,U.jsx)(r,{size:`sm`,variant:`ghost`,label:`Remove related task #${t} from #${e.id}`,tooltip:`Remove related task`,icon:(0,U.jsx)(d,{}),isDisabled:m,onClick:()=>c.mutate({taskId:e.id,relatedId:t})})]},t)}),g]}),_]})}function ie({task:e}){let t=A();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{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,U.jsx)(g,{"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,U.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}function ae({task:e}){let t=N(),n=T(),r=x(),i=t.data??[];return i.length<2?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`inline-flex`,title:`Move the task to another workspace; its history, notes, criteria, refs, and links stay`,children:(0,U.jsx)(w,{label:`Workspace of #${e.id}`,isLabelHidden:!0,size:`sm`,width:160,value:String(e.workspaceId),isDisabled:n.isPending||r,options:i.map(e=>({value:String(e.id),label:e.name})),onChange:t=>n.mutate({id:e.id,workspaceId:Number(t)})})}),n.error&&(0,U.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function oe({task:e}){return(0,U.jsxs)(U.Fragment,{children:[(e.estimate!==null||e.dueDate!==null)&&(0,U.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,U.jsxs)(`span`,{children:[`Estimate `,p(e.estimate)]}),e.dueDate!==null&&(0,U.jsx)(y,{task:e})]}),(0,U.jsx)(b,{task:e}),(0,U.jsx)(Y,{task:e})]})}var se={progress:`Progress`,blocker:`Blocker`,decision:`Decision`},ce={progress:`neutral`,blocker:`warning`,decision:`info`};function Z({kind:e}){return(0,U.jsx)(o,{"data-note-kind":e,className:`shrink-0`,variant:ce[e],label:se[e]})}function le({task:e,detailed:t}){let n=e.notes;if(n.length===0)return null;if(!t){let t=n[n.length-1];return(0,U.jsxs)(`p`,{"aria-label":`Latest note of #${e.id}`,className:`flex min-w-0 items-center gap-1.5 text-xs`,title:te(t.at),children:[(0,U.jsx)(Z,{kind:t.kind}),(0,U.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:_(t.body)}),n.length>1&&(0,U.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`+${n.length-1} more`})]})}return(0,U.jsx)(v,{label:`Notes (${n.length})`,children:(0,U.jsx)(`ol`,{"aria-label":`Notes of #${e.id}`,className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Z,{kind:e.kind}),(0,U.jsx)(M,{className:`text-muted-foreground`,at:e.at})]}),(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`p`,{className:`whitespace-pre-line break-words-keep`,children:e.body}),children:(0,U.jsx)(m,{source:e.body})})]},t))})})}var ue={pending:`Pending`,met:`Met`,failed:`Failed`},de={pending:E.neutral,met:E.success,failed:E.danger},Q={user:`you`,agent:`an agent`,toodo:`Toodo`};function $({state:e}){let t=e===`met`?L:e===`failed`?z:V;return(0,U.jsx)(`span`,{role:`img`,"aria-label":ue[e],className:f(`flex size-4 shrink-0 items-center justify-center`,de[e]),children:(0,U.jsx)(t,{"aria-hidden":!0,className:`size-3.5`})})}function fe(e){if(e.checkedBy===null)return null;let t=e.checkedAt===null?``:` ${ee(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,U.jsx)(`ul`,{"aria-label":`Criteria of #${e.id}`,className:`flex flex-col gap-0.5`,children:n.map(n=>(0,U.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,U.jsx)(v,{label:`Criteria (${i} of ${n.length} met)`,children:r})}function me({task:e,criterion:t,detailed:n}){let r=P(),a=x(),[d,p]=(0,H.useState)(!1),[m,g]=(0,H.useState)(``),_=t.kind===`manual`&&e.status!==`done`,v=fe(t),y=u(t.kind)?t.target:null;function b(){p(!1),g(``)}let S=h(m.trim()!==``,b,r.isPending);function w(n){d?b():n?(r.reset(),p(!0)):r.mutate({taskId:e.id,criterionId:t.id,met:!1,evidence:null})}function T(n){n.preventDefault(),r.mutate({taskId:e.id,criterionId:t.id,met:!0,evidence:m.trim()||null},{onSuccess:b})}return(0,U.jsxs)(`li`,{"data-criterion-state":t.state,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,title:n?void 0:[v,t.evidence,y].filter(Boolean).join(`
|
|
2
2
|
`)||void 0,children:[_?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(c,{size:`sm`,className:`shrink-0`,label:`Check criterion ${t.id} of #${e.id}`,isLabelHidden:!0,value:t.state===`met`||d,isDisabled:r.isPending||a,onChange:w}),t.state===`failed`&&(0,U.jsx)($,{state:`failed`})]}):(0,U.jsx)($,{state:t.state}),(0,U.jsx)(`span`,{className:f(`min-w-0`,n?`break-words-keep`:`truncate`,t.state===`failed`&&E.danger),children:t.text}),t.kind!==`manual`&&(0,U.jsx)(o,{className:`shrink-0`,label:s[t.kind]}),!n&&t.evidence&&(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:t.evidence})]}),n&&y&&(0,U.jsx)(`code`,{className:`ml-5.5 break-all text-muted-foreground`,children:y}),n&&(t.evidence||v)&&(0,U.jsxs)(`p`,{className:`ml-5.5 whitespace-pre-line break-words-keep text-muted-foreground`,children:[t.evidence,t.evidence&&v&&` · `,t.checkedBy!==null&&(0,U.jsxs)(U.Fragment,{children:[`Checked by `,Q[t.checkedBy],t.checkedAt!==null&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(M,{at:t.checkedAt})]})]})]}),d&&(0,U.jsxs)(`form`,{onSubmit:T,className:`ml-5.5 flex flex-wrap items-center gap-1`,onKeyDown:S.onKeyDown,children:[(0,U.jsx)(C,{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:m,onChange:g,hasAutoFocus:!0}),S.asking?(0,U.jsx)(l,{label:`Discard evidence for criterion ${t.id}`,question:`Discard the evidence?`,onKeep:S.keep,onDiscard:S.discard}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{type:`submit`,size:`sm`,variant:`primary`,label:r.isPending?`Saving...`:`Save`,isDisabled:r.isPending}),(0,U.jsx)(i,{type:`button`,size:`sm`,variant:`ghost`,label:`Cancel`,onClick:S.request})]})]}),r.isError&&(0,U.jsx)(`p`,{role:`alert`,className:`ml-5.5 text-destructive`,children:r.error.message})]})}export{ie as AutopilotToggle,re as RelatedTasks,pe as TaskCriteria,W as TaskDetailsSheet,le as TaskNotes,oe as TaskPlan,X as TaskTimeline,ae as TaskWorkspace};
|