@gobing-ai/spur 0.3.21 → 0.3.23
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/config/workflows/task-pipeline.yaml +6 -2
- package/config/workflows/wrapup-pipeline.yaml +4 -7
- package/package.json +1 -1
- package/schemas/spur-config.schema.json +13 -0
- package/spur.js +7804 -6771
- package/web/_astro/BoardApp.LygxZgOy.js +1 -0
- package/web/_astro/{BoardApp.DfUXxULJ.js → BoardApp.b8HvN_Uy.js} +82 -82
- package/web/_astro/{TaskDetail.CWHJA-V_.js → TaskDetail.BRr8ebLd.js} +1 -1
- package/web/_astro/{arc.B64JH2Yw.js → arc.D9I3ghf3.js} +1 -1
- package/web/_astro/{architectureDiagram-3BPJPVTR.CNsf8RqK.js → architectureDiagram-3BPJPVTR.B60VjZ82.js} +1 -1
- package/web/_astro/{blockDiagram-GPEHLZMM.B5L6Sdtp.js → blockDiagram-GPEHLZMM.B8xiXsGb.js} +1 -1
- package/web/_astro/{c4Diagram-AAUBKEIU.D2LUWzto.js → c4Diagram-AAUBKEIU.D8Q9jRJZ.js} +1 -1
- package/web/_astro/channel.BToTp7Lu.js +1 -0
- package/web/_astro/{chunk-2J33WTMH.BDCK4a2A.js → chunk-2J33WTMH.BVcogAuP.js} +1 -1
- package/web/_astro/{chunk-4BX2VUAB.DRG-P5ln.js → chunk-4BX2VUAB.pDodeppW.js} +1 -1
- package/web/_astro/{chunk-55IACEB6.BF6dAaDw.js → chunk-55IACEB6.5dYLJxJn.js} +1 -1
- package/web/_astro/{chunk-727SXJPM.GT8NEsK6.js → chunk-727SXJPM.C6GTI_n6.js} +1 -1
- package/web/_astro/{chunk-AQP2D5EJ.C6g9Ixyp.js → chunk-AQP2D5EJ.kgDX41bQ.js} +1 -1
- package/web/_astro/{chunk-FMBD7UC4.37t3ZahP.js → chunk-FMBD7UC4.CSnAi74r.js} +1 -1
- package/web/_astro/{chunk-ND2GUHAM.CIMe94Tp.js → chunk-ND2GUHAM.qQ8ldUUT.js} +1 -1
- package/web/_astro/{chunk-QZHKN3VN.BDk4vBSo.js → chunk-QZHKN3VN.PzPFlVri.js} +1 -1
- package/web/_astro/{classDiagram-4FO5ZUOK.BkZHAH5J.js → classDiagram-4FO5ZUOK.C7RulRYW.js} +1 -1
- package/web/_astro/{classDiagram-v2-Q7XG4LA2.BkZHAH5J.js → classDiagram-v2-Q7XG4LA2.C7RulRYW.js} +1 -1
- package/web/_astro/{cose-bilkent-S5V4N54A.-vmutMeo.js → cose-bilkent-S5V4N54A.Dw4HZHnT.js} +1 -1
- package/web/_astro/{dagre-BM42HDAG.YTN__ph-.js → dagre-BM42HDAG.MmGbZWM_.js} +1 -1
- package/web/_astro/{diagram-2AECGRRQ.CpwYXr6h.js → diagram-2AECGRRQ.DugWYvZC.js} +1 -1
- package/web/_astro/{diagram-5GNKFQAL.BLW_nNiA.js → diagram-5GNKFQAL.BL7D0BMi.js} +1 -1
- package/web/_astro/{diagram-KO2AKTUF.BTFC9CYM.js → diagram-KO2AKTUF.B9GQMjwM.js} +1 -1
- package/web/_astro/{diagram-LMA3HP47.CWXHZTYF.js → diagram-LMA3HP47.CbHPvhbu.js} +1 -1
- package/web/_astro/{diagram-OG6HWLK6.4DO1knJK.js → diagram-OG6HWLK6.Bx6GcKpw.js} +1 -1
- package/web/_astro/{erDiagram-TEJ5UH35.eWFFCa1s.js → erDiagram-TEJ5UH35._sHJgXD7.js} +1 -1
- package/web/_astro/{flowDiagram-I6XJVG4X.Qnt78_UD.js → flowDiagram-I6XJVG4X.D305L8m4.js} +1 -1
- package/web/_astro/{ganttDiagram-6RSMTGT7.CMqioE2G.js → ganttDiagram-6RSMTGT7.qjJ4kX00.js} +1 -1
- package/web/_astro/{gitGraphDiagram-PVQCEYII.DIHrO_gc.js → gitGraphDiagram-PVQCEYII.D-t4MzVO.js} +1 -1
- package/web/_astro/index.CmVh0AUD.css +1 -0
- package/web/_astro/{infoDiagram-5YYISTIA.DbzNXZsX.js → infoDiagram-5YYISTIA.WwSNIljZ.js} +1 -1
- package/web/_astro/{ishikawaDiagram-YF4QCWOH.C34rBvEh.js → ishikawaDiagram-YF4QCWOH.EWsUYdpd.js} +1 -1
- package/web/_astro/{journeyDiagram-JHISSGLW.B4Y56hm8.js → journeyDiagram-JHISSGLW.CqKE9hNP.js} +1 -1
- package/web/_astro/{kanban-definition-UN3LZRKU.CbkLbGD-.js → kanban-definition-UN3LZRKU.BDCCufoa.js} +1 -1
- package/web/_astro/{linear.CJu-zQ8Y.js → linear.CyHEakPy.js} +1 -1
- package/web/_astro/{mermaid.core.Cg8FpcnS.js → mermaid.core.B-9P_KDH.js} +4 -4
- package/web/_astro/{mindmap-definition-RKZ34NQL.CUS8uIx4.js → mindmap-definition-RKZ34NQL.bCxpjW2r.js} +1 -1
- package/web/_astro/{pieDiagram-4H26LBE5.DLoKfxBO.js → pieDiagram-4H26LBE5.x_CRiGMu.js} +1 -1
- package/web/_astro/{quadrantDiagram-W4KKPZXB.C4gJNQom.js → quadrantDiagram-W4KKPZXB.CnbQkwo7.js} +1 -1
- package/web/_astro/{requirementDiagram-4Y6WPE33.BsiW5Ob5.js → requirementDiagram-4Y6WPE33.CfeJKVEP.js} +1 -1
- package/web/_astro/{sankeyDiagram-5OEKKPKP.k6qljwMr.js → sankeyDiagram-5OEKKPKP.COYpTQlG.js} +1 -1
- package/web/_astro/{sequenceDiagram-3UESZ5HK.Bx0G-FfT.js → sequenceDiagram-3UESZ5HK.DVzoeimO.js} +1 -1
- package/web/_astro/{stateDiagram-AJRCARHV.CRbr10-B.js → stateDiagram-AJRCARHV.BVL5te9q.js} +1 -1
- package/web/_astro/{stateDiagram-v2-BHNVJYJU.iDwcqAkR.js → stateDiagram-v2-BHNVJYJU.C_x1GbV0.js} +1 -1
- package/web/_astro/{timeline-definition-PNZ67QCA.p4S9tDNI.js → timeline-definition-PNZ67QCA.DtZPbOJL.js} +1 -1
- package/web/_astro/{vennDiagram-CIIHVFJN.DgzRFt8Y.js → vennDiagram-CIIHVFJN.pexoUOut.js} +1 -1
- package/web/_astro/{wardley-L42UT6IY.DUFfR4J1.js → wardley-L42UT6IY.DLG5pKRN.js} +1 -1
- package/web/_astro/{wardleyDiagram-YWT4CUSO.BgE4haqE.js → wardleyDiagram-YWT4CUSO.CnYrM4tH.js} +1 -1
- package/web/_astro/{xychartDiagram-2RQKCTM6.BnitKCz8.js → xychartDiagram-2RQKCTM6.kBrlce_Y.js} +1 -1
- package/web/index.html +2 -2
- package/web/_astro/BoardApp.Bwxdbc0J.js +0 -1
- package/web/_astro/channel.DTWaHQwD.js +0 -1
- package/web/_astro/index.Bg28MlvM.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as ne,d as m,j as e,t as K,b as l,B as E,L as le,M as ie,c as ce,S as de,C as oe}from"./BoardApp.DfUXxULJ.js";import{r}from"./index.A0eX93qW.js";const xe={backlog:["refine","start","cancel"],todo:["plan","run","decompose","add-subtask","link-feature","block","cancel"],wip:["run","add-subtask","link-feature","block","cancel"],testing:["verify","complete","block","cancel"],blocked:["refine","unblock","cancel"],done:["reopen"],cancelled:[]},D={refine:"Refine",plan:"Plan",run:"Run",verify:"Verify",decompose:"Decompose","add-subtask":"+ Subtask","link-feature":"Link Feature",start:"Start",complete:"Complete",reopen:"Reopen",block:"Block",unblock:"Unblock",cancel:"Cancel"},ue={start:"todo",complete:"done",reopen:"wip",block:"blocked",unblock:"todo",cancel:"cancelled"},g=["backlog","todo","wip","testing","done"],pe=new Set(["blocked","cancelled"]);function he({task:a,onTransition:z,onClose:M}){const[f,h]=r.useState(""),[j,o]=r.useState(""),[T,x]=r.useState("preview"),[I,L]=r.useState(!1),[v,A]=r.useState(!1),[i,H]=r.useState({}),[b,U]=r.useState(!1),[w,B]=r.useState(null),[V,u]=r.useState(!1),[c,p]=r.useState(null),[_,W]=r.useState("claude"),[F,Y]=r.useState(!1),{setTasks:q}=ne(),N=a?.wbs;if(r.useEffect(()=>{if(!N){h(""),o(""),x("preview");return}let s=!1;return L(!0),m.task.show({wbs:N}).then(t=>{if(s)return;const{content:d,frontmatter:n}=t.data;h(d),o(d),H(n)}).catch(t=>{if(s)return;const d=t instanceof Error?t.message:"Failed to load task body";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:d}}))}).finally(()=>{s||L(!1)}),()=>{s=!0}},[N]),!a)return e.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Select a task to view details"});const G=()=>{o(f),x("edit")},J=()=>{o(f),x("preview")},Q=async()=>{A(!0);try{await m.task.body({wbs:a.wbs,body:j}),h(j),x("preview");const t=(await m.task.show({wbs:a.wbs})).data.content;h(t),o(t)}catch(s){o(f),x("preview");const t=s instanceof Error?s.message:"Save failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{A(!1)}},X=s=>{const t=ue[s];if(t!==void 0){if(s==="cancel"&&a){u(!0);return}a&&z(a.wbs,t);return}p(s)},Z=async()=>{if(!(!c||!a)){B(c),p(null);try{await m.task.action({wbs:a.wbs,action:c,channel:_,skipDeps:F});const s=await m.task.list({});q(s.data??[])}catch(s){const t=s instanceof Error?s.message:"Action failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{B(null)}}},ee=s=>{const t=g.indexOf(s);return t>=0?t:-1},P=s=>{if(!s)return"";try{const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}},R=s=>{if(!s)return"";try{const t=new Date(s);if(Number.isNaN(t.getTime()))return"";const d=Date.now()-t.getTime(),n=Math.floor(d/864e5);return n===0?"today":n===1?"yesterday":n<30?`${n}d ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`}catch{return""}},y=Array.isArray(i.tags)?i.tags:[],k=P(i.created_at),se=R(i.created_at),C=P(i.updated_at),te=R(i.updated_at),$=ee(a.status),O=i.estimated_hours,S=i.impl_progress,ae=["planning","design","implementation","review","testing"],re=s=>s==="done"?"bg-green-500":s==="in_progress"?"bg-amber-500":"bg-gray-400";return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 p-3 border-b border-spur-border shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[e.jsxs("h3",{className:"text-sm font-semibold text-spur-text truncate",children:[a.wbs," — ",a.name]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"header-chips",children:[e.jsxs("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted","data-testid":"status-pill",children:[K(a.status)," ",a.status]}),a.priority&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-accent/15 text-xs text-spur-accent",children:a.priority}),a.featureId&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-info/15 text-xs text-spur-info",children:a.featureId}),y.map(s=>e.jsx("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted",children:s},s))]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1 shrink-0",children:[(xe[a.status]??[]).map(s=>e.jsx(l,{variant:s==="cancel"?"error":"accent",size:"xs",onClick:()=>X(s),disabled:w===s,"aria-label":D[s],children:w===s?"…":D[s]},s)),M&&e.jsx(l,{variant:"ghost",size:"xs",className:"text-spur-text-muted",onClick:M,"aria-label":"Close detail",children:"✕"})]})]}),e.jsxs("div",{className:"border-b border-spur-border shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>U(s=>!s),className:"flex items-center justify-between w-full p-3 text-xs font-semibold text-spur-text-muted uppercase tracking-wide hover:text-spur-text transition-colors","aria-expanded":b,children:[e.jsx("span",{children:"Metadata"}),e.jsxs("svg",{className:`w-3 h-3 transition-transform ${b?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:b?"Collapse metadata":"Expand metadata"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),b&&e.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Status"}),e.jsxs("span",{className:"text-sm text-spur-text","data-testid":"metadata-status",children:[K(a.status)," ",a.status]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Progress"}),S?e.jsx("div",{className:"space-y-1",children:ae.map(s=>{const t=S[s]??"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-spur-text-muted w-20 shrink-0",children:s}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-spur-border overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${re(t)}`,style:{width:t==="done"?"100%":t==="in_progress"?"50%":"0%"}})}),e.jsx("span",{className:"text-[10px] text-spur-text-muted w-16 shrink-0",children:t})]},s)})}):pe.has(a.status)?e.jsx(E,{variant:"warning",size:"xs",children:a.status}):e.jsx("div",{className:"flex items-center gap-1",children:g.map((s,t)=>{const d=t<=$,n=t===$;return e.jsxs("div",{className:"flex items-center gap-1 flex-1 last:flex-none",children:[e.jsx("div",{className:`h-1.5 rounded-full flex-1 ${d?"bg-spur-accent":"bg-spur-border"} ${n?"ring-1 ring-spur-accent/50":""}`,title:s}),t<g.length-1&&e.jsx("span",{className:"text-[10px] text-spur-text-muted w-0"})]},s)})}),!S&&e.jsx("div",{className:"flex justify-between mt-0.5",children:g.map(s=>e.jsx("span",{className:"text-[10px] text-spur-text-muted",children:s},s))})]}),(k||C)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-spur-text-muted block",children:"Dates"}),k&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Created"}),e.jsx("span",{className:"text-spur-text",children:k}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",se,")"]})]}),C&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Updated"}),e.jsx("span",{className:"text-spur-text",children:C}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",te,")"]})]})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(s=>e.jsx(E,{variant:"outline",size:"xs",className:"text-spur-text-muted",children:s},s))})]}),e.jsxs("div",{className:"space-y-1.5",children:[a.priority&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Priority"}),e.jsx(E,{variant:"outline",size:"xs",children:a.priority})]}),O!==void 0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Est. Hours"}),e.jsxs("span",{className:"text-spur-text",children:[O,"h"]})]}),a.featureId&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Feature"}),e.jsx("span",{className:"text-spur-text",children:a.featureId})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"File"}),e.jsx("span",{className:"text-spur-text font-mono truncate",children:a.filePath})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3","data-testid":"task-body-section",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[e.jsx("span",{className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:"Body"}),e.jsx("div",{className:"flex gap-1",children:T==="preview"?e.jsx(l,{variant:"ghost",size:"xs",onClick:G,disabled:I,"aria-label":"Edit body",children:"Edit"}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"primary",size:"xs",onClick:Q,disabled:v,"aria-label":"Save body",children:v?"Saving…":"Save"}),e.jsx(l,{variant:"ghost",size:"xs",onClick:J,disabled:v,"aria-label":"Cancel edit",children:"Cancel"})]})})]}),I?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-spur-text-muted",children:[e.jsx(le,{size:"xs",className:"text-spur-accent"}),"Loading body…"]}):T==="edit"?e.jsx("div",{className:"flex-1 min-h-0","data-testid":"body-editor",children:e.jsx(ie,{value:j,onChange:s=>o(s??""),height:"100%","data-color-mode":"light"})}):e.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"body-preview",children:e.jsx(ce,{source:f})})]}),V&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Confirm cancel task",tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&u(!1)},onKeyDown:s=>{s.key==="Escape"&&u(!1)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-lg shadow-xl p-4 mx-4 max-w-xs w-full",children:[e.jsxs("p",{className:"text-sm text-spur-text mb-4",children:["Cancel task ",e.jsx("strong",{children:a.wbs}),"? This marks it as cancelled and cannot be undone from the board."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>u(!1),children:"Keep"}),e.jsx(l,{variant:"error",size:"xs",onClick:()=>{u(!1),z(a.wbs,"cancelled")},children:"Cancel task"})]})]})}),c&&a&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":`Configure ${c} action`,tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&p(null)},onKeyDown:s=>{s.key==="Escape"&&p(null)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-lg shadow-xl p-4 mx-4 max-w-sm w-full",children:[e.jsxs("h4",{className:"text-sm font-semibold text-spur-text mb-3",children:[D[c]??c," — Select Channel"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(de,{variant:"bordered",size:"sm",className:"w-full bg-spur-bg text-spur-text",value:_,onChange:s=>W(s.target.value),children:["claude","codex","gemini","pi","opencode","antigravity","openclaw"].map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsxs("label",{htmlFor:"skip-deps",className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(oe,{id:"skip-deps",size:"xs",checked:F,onChange:s=>Y(s.target.checked)}),e.jsx("span",{className:"text-xs text-spur-text",children:"Skip dependencies"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>p(null),children:"Cancel"}),e.jsx(l,{variant:"primary",size:"xs",onClick:Z,children:w===c?"Dispatching…":"Dispatch"})]})]})})]})}export{he as default};
|
|
1
|
+
import{u as ne,d as m,j as e,t as K,b as l,B as E,L as le,M as ie,c as ce,S as de,C as oe}from"./BoardApp.b8HvN_Uy.js";import{r}from"./index.A0eX93qW.js";const xe={backlog:["refine","start","cancel"],todo:["plan","run","decompose","add-subtask","link-feature","block","cancel"],wip:["run","add-subtask","link-feature","block","cancel"],testing:["verify","complete","block","cancel"],blocked:["refine","unblock","cancel"],done:["reopen"],cancelled:[]},D={refine:"Refine",plan:"Plan",run:"Run",verify:"Verify",decompose:"Decompose","add-subtask":"+ Subtask","link-feature":"Link Feature",start:"Start",complete:"Complete",reopen:"Reopen",block:"Block",unblock:"Unblock",cancel:"Cancel"},ue={start:"todo",complete:"done",reopen:"wip",block:"blocked",unblock:"todo",cancel:"cancelled"},g=["backlog","todo","wip","testing","done"],pe=new Set(["blocked","cancelled"]);function he({task:a,onTransition:z,onClose:M}){const[f,h]=r.useState(""),[j,o]=r.useState(""),[T,x]=r.useState("preview"),[I,L]=r.useState(!1),[v,A]=r.useState(!1),[i,H]=r.useState({}),[b,U]=r.useState(!1),[w,B]=r.useState(null),[V,u]=r.useState(!1),[c,p]=r.useState(null),[_,W]=r.useState("claude"),[F,Y]=r.useState(!1),{setTasks:q}=ne(),N=a?.wbs;if(r.useEffect(()=>{if(!N){h(""),o(""),x("preview");return}let s=!1;return L(!0),m.task.show({wbs:N}).then(t=>{if(s)return;const{content:d,frontmatter:n}=t.data;h(d),o(d),H(n)}).catch(t=>{if(s)return;const d=t instanceof Error?t.message:"Failed to load task body";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:d}}))}).finally(()=>{s||L(!1)}),()=>{s=!0}},[N]),!a)return e.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Select a task to view details"});const G=()=>{o(f),x("edit")},J=()=>{o(f),x("preview")},Q=async()=>{A(!0);try{await m.task.body({wbs:a.wbs,body:j}),h(j),x("preview");const t=(await m.task.show({wbs:a.wbs})).data.content;h(t),o(t)}catch(s){o(f),x("preview");const t=s instanceof Error?s.message:"Save failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{A(!1)}},X=s=>{const t=ue[s];if(t!==void 0){if(s==="cancel"&&a){u(!0);return}a&&z(a.wbs,t);return}p(s)},Z=async()=>{if(!(!c||!a)){B(c),p(null);try{await m.task.action({wbs:a.wbs,action:c,channel:_,skipDeps:F});const s=await m.task.list({});q(s.data??[])}catch(s){const t=s instanceof Error?s.message:"Action failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{B(null)}}},ee=s=>{const t=g.indexOf(s);return t>=0?t:-1},P=s=>{if(!s)return"";try{const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}},R=s=>{if(!s)return"";try{const t=new Date(s);if(Number.isNaN(t.getTime()))return"";const d=Date.now()-t.getTime(),n=Math.floor(d/864e5);return n===0?"today":n===1?"yesterday":n<30?`${n}d ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`}catch{return""}},y=Array.isArray(i.tags)?i.tags:[],k=P(i.created_at),se=R(i.created_at),C=P(i.updated_at),te=R(i.updated_at),$=ee(a.status),O=i.estimated_hours,S=i.impl_progress,ae=["planning","design","implementation","review","testing"],re=s=>s==="done"?"bg-green-500":s==="in_progress"?"bg-amber-500":"bg-gray-400";return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 p-3 border-b border-spur-border shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[e.jsxs("h3",{className:"text-sm font-semibold text-spur-text truncate",children:[a.wbs," — ",a.name]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"header-chips",children:[e.jsxs("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted","data-testid":"status-pill",children:[K(a.status)," ",a.status]}),a.priority&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-accent/15 text-xs text-spur-accent",children:a.priority}),a.featureId&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-info/15 text-xs text-spur-info",children:a.featureId}),y.map(s=>e.jsx("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted",children:s},s))]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1 shrink-0",children:[(xe[a.status]??[]).map(s=>e.jsx(l,{variant:s==="cancel"?"error":"accent",size:"xs",onClick:()=>X(s),disabled:w===s,"aria-label":D[s],children:w===s?"…":D[s]},s)),M&&e.jsx(l,{variant:"ghost",size:"xs",className:"text-spur-text-muted",onClick:M,"aria-label":"Close detail",children:"✕"})]})]}),e.jsxs("div",{className:"border-b border-spur-border shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>U(s=>!s),className:"flex items-center justify-between w-full p-3 text-xs font-semibold text-spur-text-muted uppercase tracking-wide hover:text-spur-text transition-colors","aria-expanded":b,children:[e.jsx("span",{children:"Metadata"}),e.jsxs("svg",{className:`w-3 h-3 transition-transform ${b?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:b?"Collapse metadata":"Expand metadata"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),b&&e.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Status"}),e.jsxs("span",{className:"text-sm text-spur-text","data-testid":"metadata-status",children:[K(a.status)," ",a.status]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Progress"}),S?e.jsx("div",{className:"space-y-1",children:ae.map(s=>{const t=S[s]??"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-spur-text-muted w-20 shrink-0",children:s}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-spur-border overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${re(t)}`,style:{width:t==="done"?"100%":t==="in_progress"?"50%":"0%"}})}),e.jsx("span",{className:"text-[10px] text-spur-text-muted w-16 shrink-0",children:t})]},s)})}):pe.has(a.status)?e.jsx(E,{variant:"warning",size:"xs",children:a.status}):e.jsx("div",{className:"flex items-center gap-1",children:g.map((s,t)=>{const d=t<=$,n=t===$;return e.jsxs("div",{className:"flex items-center gap-1 flex-1 last:flex-none",children:[e.jsx("div",{className:`h-1.5 rounded-full flex-1 ${d?"bg-spur-accent":"bg-spur-border"} ${n?"ring-1 ring-spur-accent/50":""}`,title:s}),t<g.length-1&&e.jsx("span",{className:"text-[10px] text-spur-text-muted w-0"})]},s)})}),!S&&e.jsx("div",{className:"flex justify-between mt-0.5",children:g.map(s=>e.jsx("span",{className:"text-[10px] text-spur-text-muted",children:s},s))})]}),(k||C)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-spur-text-muted block",children:"Dates"}),k&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Created"}),e.jsx("span",{className:"text-spur-text",children:k}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",se,")"]})]}),C&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Updated"}),e.jsx("span",{className:"text-spur-text",children:C}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",te,")"]})]})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(s=>e.jsx(E,{variant:"outline",size:"xs",className:"text-spur-text-muted",children:s},s))})]}),e.jsxs("div",{className:"space-y-1.5",children:[a.priority&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Priority"}),e.jsx(E,{variant:"outline",size:"xs",children:a.priority})]}),O!==void 0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Est. Hours"}),e.jsxs("span",{className:"text-spur-text",children:[O,"h"]})]}),a.featureId&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Feature"}),e.jsx("span",{className:"text-spur-text",children:a.featureId})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"File"}),e.jsx("span",{className:"text-spur-text font-mono truncate",children:a.filePath})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3","data-testid":"task-body-section",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[e.jsx("span",{className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:"Body"}),e.jsx("div",{className:"flex gap-1",children:T==="preview"?e.jsx(l,{variant:"ghost",size:"xs",onClick:G,disabled:I,"aria-label":"Edit body",children:"Edit"}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"primary",size:"xs",onClick:Q,disabled:v,"aria-label":"Save body",children:v?"Saving…":"Save"}),e.jsx(l,{variant:"ghost",size:"xs",onClick:J,disabled:v,"aria-label":"Cancel edit",children:"Cancel"})]})})]}),I?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-spur-text-muted",children:[e.jsx(le,{size:"xs",className:"text-spur-accent"}),"Loading body…"]}):T==="edit"?e.jsx("div",{className:"flex-1 min-h-0","data-testid":"body-editor",children:e.jsx(ie,{value:j,onChange:s=>o(s??""),height:"100%","data-color-mode":"light"})}):e.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"body-preview",children:e.jsx(ce,{source:f})})]}),V&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Confirm cancel task",tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&u(!1)},onKeyDown:s=>{s.key==="Escape"&&u(!1)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-lg shadow-xl p-4 mx-4 max-w-xs w-full",children:[e.jsxs("p",{className:"text-sm text-spur-text mb-4",children:["Cancel task ",e.jsx("strong",{children:a.wbs}),"? This marks it as cancelled and cannot be undone from the board."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>u(!1),children:"Keep"}),e.jsx(l,{variant:"error",size:"xs",onClick:()=>{u(!1),z(a.wbs,"cancelled")},children:"Cancel task"})]})]})}),c&&a&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":`Configure ${c} action`,tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&p(null)},onKeyDown:s=>{s.key==="Escape"&&p(null)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-lg shadow-xl p-4 mx-4 max-w-sm w-full",children:[e.jsxs("h4",{className:"text-sm font-semibold text-spur-text mb-3",children:[D[c]??c," — Select Channel"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(de,{variant:"bordered",size:"sm",className:"w-full bg-spur-bg text-spur-text",value:_,onChange:s=>W(s.target.value),children:["claude","codex","gemini","pi","opencode","antigravity","openclaw"].map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsxs("label",{htmlFor:"skip-deps",className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(oe,{id:"skip-deps",size:"xs",checked:F,onChange:s=>Y(s.target.checked)}),e.jsx("span",{className:"text-xs text-spur-text",children:"Skip dependencies"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>p(null),children:"Cancel"}),e.jsx(l,{variant:"primary",size:"xs",onClick:Z,children:w===c?"Dispatching…":"Dispatch"})]})]})})]})}export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bk as ln,aO as an,H as k,b7 as w,F as G,ah as un,W as y,bc as tn,b8 as C,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core.
|
|
1
|
+
import{bk as ln,aO as an,H as k,b7 as w,F as G,ah as un,W as y,bc as tn,b8 as C,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core.B-9P_KDH.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function Q(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/C(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*C(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*k(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*k(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):C(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),J=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=J*2)>y?(J*=t?1:-1,m+=J,g-=J):(D=0,m=g=(f+c)/2)}var z=s*k(m),B=s*w(m),K=u*k(T),L=u*w(T);if(b>y){var M=s*k(g),N=s*w(g),U=u*k(R),V=u*w(R),O;if(S<an)if(O=pn(z,B,U,V,M,N,K,L)){var X=z-O[0],Y=B-O[1],Z=M-O[0],$=N-O[1],nn=1/w(fn((X*Z+Y*$)/(C(X*X+Y*Y)*C(Z*Z+$*$)))/2),en=C(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=Q(U,V,z,B,s,x,t),r=Q(M,N,K,L,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(z,B),a.arc(0,0,s,m,g,!t)):a.moveTo(z,B),!(u>y)||!(P>y)?a.lineTo(K,L):p>y?(e=Q(K,L,M,N,u,-p,t),r=Q(z,B,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[k(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|