fix(ui): scale touch targets to the pointer, not the window width

A coarse-pointer-only floor keeps switches, tab triggers and scrolled nav
strips from being deformed on a phone, and the topbar reveals the current
section after a route change.
This commit is contained in:
sam committed 2026-10-18 12:32:10 +11:00
1 parent 2ce94306e8
commit 185ecd09ee
5 files changed
+26 -8

No files matched your search

+1 -1
View File
@@ -1 +1 @@
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
+1 -1
View File
@@ -164,4 +164,4 @@ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function M7(e){let t=iJ(e).toJS(),n=new Map;for(let r of zJ(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function N7(e,t,n){let r=M7(e),i=M7(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var P7={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},F7={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},I7=[`aria-current`,`onClick`],L7={class:`flex items-center gap-2 text-sm`},R7={class:`font-mono text-xs text-fg-subtle`},z7=[`title`],B7={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},V7={key:0,class:`flex min-h-0 flex-col gap-2`},H7={class:`flex items-center gap-2`},U7={class:`text-xs text-muted-foreground`},W7={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},G7={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},K7={class:`inline-block w-4 select-none text-fg-subtle`},q7={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},J7={class:`flex min-h-0 flex-col gap-1`},Y7={class:`text-xs font-medium text-muted-foreground`},X7={class:`min-h-0 flex-1`},Z7={class:`flex min-h-0 flex-col gap-1`},Q7={class:`min-h-0 flex-1`},$7=k({__name:`WorkflowHistory`,props:mt({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:mt([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Ge(e,`selected`),a=Ge(e,`mode`);F(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=I(()=>n.revisions.find(e=>e.version===i.value)),s=I(()=>o.value?.yaml??null),c=I(()=>s.value===null?[]:j7(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:N7(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:N7(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),W(`div`,P7,[U(`ol`,F7,[(R(!0),W(V,null,G(e.revisions,e=>(R(),W(`li`,{key:e.version},[U(`button`,{type:`button`,class:N([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[U(`span`,L7,[U(`span`,R7,`v`+B(e.version),1),M(z(tn),{variant:f[e.change]},{default:j(()=>[A(B(e.change),1)]),_:2},1032,[`variant`])]),U(`span`,{class:`mt-0.5 block truncate text-xs text-muted-foreground`,title:e.at},B(e.actor||`unknown`)+` · `+B(e.source||`unknown`)+` · `+B(z(kg)(e.at)),9,z7)],10,I7)]))),128)),e.revisions.length?L(``,!0):(R(),W(`li`,B7,B(e.error||`No recorded changes`),1))]),o.value?(R(),W(`div`,V7,[U(`div`,H7,[M(z(fb),{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{default:j(()=>[M(z(mb),null,{default:j(()=>[M(z(hb),{value:`yaml`},{default:j(()=>[...n[2]||=[A(`YAML`,-1)]]),_:1}),M(z(hb),{value:`canvas`},{default:j(()=>[...n[3]||=[A(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),U(`span`,U7,B(l.value?`Same as the current definition`:`Compared with the current definition`),1),M(z(J),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`Workflow removed`:void 0,onClick:n[1]||=e=>r(`restore`,s.value)},{default:j(()=>[M(z(uc),{"data-icon":`inline-start`}),n[4]||=A(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(R(),W(`p`,W7,`Workflow removed in this revision.`)):a.value===`yaml`?(R(),W(`pre`,G7,[U(`code`,null,[(R(!0),W(V,null,G(c.value,(e,t)=>(R(),W(`span`,{key:t,class:N([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[U(`span`,K7,B(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),A(B(e.text),1)],2))),128))])])):(R(),W(`div`,q7,[U(`div`,J7,[U(`span`,Y7,`v`+B(o.value.version),1),U(`div`,X7,[M(D7,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),U(`div`,Z7,[n[5]||=U(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),U(`div`,Q7,[M(D7,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):L(``,!0)]))}}),e9=`workflow-definitions`;function t9(e){let t=O(),n=q([]),r=q(``);async function i(){try{n.value=await t.history(e9),r.value=``}c Line truncated
`);s=n.pop()||``;for(let e of n){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.type===`delta`&&(a.value+=n.text??``),n.type===`tool`&&n.tool&&(o.value=n.tool.replaceAll(`_`,` `)),n.type===`done`&&(c=!0,a.value||=n.text??``),n.type===`error`)throw Error(n.text)}if(t)break}if(!c)throw Error(`the turn ended early`)}catch(e){e.name!==`AbortError`&&(s.value=!0,a.value=String(e.message||e))}finally{c.value=!1,o.value=``,l=void 0,r(`proposed`)}}}return(t,n)=>(R(),W(`div`,c9,[a.value?(R(),W(`p`,{key:0,class:N([`max-h-40 overflow-y-auto whitespace-pre-wrap border-b border-border px-3 py-2 text-sm`,s.value&&`text-danger`]),role:s.value?`alert`:`status`},B(a.value),11,l9)):L(``,!0),U(`form`,{class:`flex items-center gap-2 px-3 py-2`,onSubmit:Mt(u,[`prevent`])},[M(z(_c),{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`}),rt(U(`input`,{"onUpdate:modelValue":n[0]||=e=>i.value=e,class:`min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-fg-subtle`,placeholder:e.empty?`Build with Archie`:`Iterate with Archie`,"aria-label":e.empty?`Build with Archie`:`Iterate with Archie`,disabled:c.value},null,8,u9),[[Pt,i.value]]),c.value?(R(),W(`span`,d9,[M(z(Bv)),A(B(o.value),1)])):L(``,!0),c.value?(R(),K(z(J),{key:1,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Stop`,onClick:n[1]||=e=>z(l)?.abort()},{default:j(()=>[M(z(yc))]),_:1})):(R(),K(z(J),{key:2,type:`submit`,size:`icon-sm`,"aria-label":`Send`,disabled:!i.value.trim()},{default:j(()=>[M(z(Es))]),_:1},8,[`disabled`]))],32)]))}}),p9=20;function m9(e){let t=q([]),n=q(``),r=q([]),i=q(0),a=!1,o=q(``),s=q(!1),c=0;async function l(){let r=e.value,i=++c;s.value=!0;try{let s=r?await Y.taskPage({workflow:r,limit:p9}):null;if(e.value!==r||i!==c)return;t.value=(s?.tasks??[]).sort((e,t)=>Number(t.id)-Number(e.id)),o.value=``,(!a||n.value&&!t.value.some(e=>String(e.id)===n.value))&&(n.value=t.value[0]?String(t.value[0].id):``)}catch(t){e.value===r&&i===c&&(o.value=String(t.message||t))}finally{i===c&&(s.value=!1)}}async function u(){if(!n.value){r.value.length&&(r.value=[]),i.value=0;return}let e=n.value,t=await Y.taskAttempts(e).catch(()=>null);if(n.value!==e)return;let a=[...t?.attempts??[]].sort((e,t)=>t.attempt-e.attempt)[0],o=a?.stages??[];JSON.stringify(o)!==JSON.stringify(r.value)&&(r.value=o),i.value=a?.attempt??0}function d(e){a=!0,n.value=e}async function f(){await l(),await u()}F(e,()=>{a=!1,t.value=[],n.value=``,o.value=``,f()},{immediate:!0}),F(n,()=>{r.value=[],i.value=0,u()}),ne(`tasks`,()=>void f(),300);let p=I(()=>t.value.find(e=>String(e.id)===n.value));async function m(e){a=!0,n.value=String(e),await f()}return{runs:t,error:o,loading:s,watched:n,watchedRun:p,stages:r,attempt:i,pick:d,follow:m,refresh:f}}function h9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g9(e){try{return aJ(e)}catch{return null}}function _9(e,t){let n=[];for(let[r,i]of Object.entries(t.routes))i===e&&n.push(r==="default"?{kind:`issue`,label:`Unlabelled issues`,detail:`anything no label routes elsewhere`}:{kind:`issue`,label:`Issues labelled ${r}`});for(let r of t.bindings)r.workflow===e&&n.push({kind:`event`,label:r.name||`Event binding`,detail:r.matcher?.source,binding:r});for(let r of t.playbooks){let t=g9(r.yaml);if(!h9(t)||!Array.isArray(t.actions)||!t.actions.some(t=>h9(t)&&t.workflow===e))continue;let i=h9(t.trigger)?t.trigger:{},a=Array.isArray(i.labels)?i.labels.join(`, `):``;n.push({kind:`playbook`,label:r.id,detail:[i.kind,a].filter(Boolean).join(` · `)})}for(let r of t.definitions){if(r.id===e)continue;let t=v9(g9(r.yaml),e);t&&n.push({kind:`workflow`,label:r.id,detail:t})}return n}function v9(e,t){let n=(h9(e)&&Array.isArray(e.steps)?e.steps:[]).flatMap(e=>lJ(e)?.branches.flatMap(([,e])=>e)??[e]);for(let e of n){if(!h9(e)||!h9(e.settings))continue;let r=e.settings;switch(e.type){case`workflow.call`:if(r.workflow===t)return`calls it`;break;case`workflow.handoff`:if(r.workflow===t||y9(n,r.workflow).includes(t))return`hands off to it`;break;case`human.approve`:if(r.then===t)return`runs it once approved`}}return``}function y9(e,t){let n=typeof t==`string`?/\{\{\s*steps\.([\w-]+)\.result\.([\w-]+)\s*\}\}/.exec(t):null;if(!n)return[];let r=e.find(e=>h9(e)&&e.id===n[1]),i=h9(r)&&h9(r.settings)?r.settings.result:void 0,a=h9(i)&&h9(i.properties)?i.properties[n[2]]:void 0;return h9(a)&&Array.isArray(a.enum)?a.enum.map(String):[]}function b9(e){let t=O(),n=OU(),r=q([]);async function i(){let e=await Y.bindings().catch(()=>null);r.value=e?.bindings??[]}return gt(i),{triggers:I(()=>_9(e.value,{routes:n.intakeRoutes,bindings:r.value,playbooks:t.stateFor(`eda-playbooks`).resource?.value?.playbooks??[],definitions:n.collection.definitions})),reload:i}}var x9={class:`flex flex-wrap items-center gap-2`},S9={class:`ml-1 font-mono text-xs text-fg-subtle`},C9={key:0,class:`flex min-w-0 items-center gap-1`},w9=[`title`],T9={key:2,class:`ml-auto`},E9={key:0,class:`text-xs text-fg-muted`,role:`status`},D9={key:1,class:`text-sm text-danger`,role:`alert`}, Line truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.type===`delta`&&(a.value+=n.text??``),n.type===`tool`&&n.tool&&(o.value=n.tool.replaceAll(`_`,` `)),n.type===`done`&&(c=!0,a.value||=n.text??``),n.type===`error`)throw Error(n.text)}if(t)break}if(!c)throw Error(`the turn ended early`)}catch(e){e.name!==`AbortError`&&(s.value=!0,a.value=String(e.message||e))}finally{c.value=!1,o.value=``,l=void 0,r(`proposed`)}}}return(t,n)=>(R(),W(`div`,c9,[a.value?(R(),W(`p`,{key:0,class:N([`max-h-40 overflow-y-auto whitespace-pre-wrap border-b border-border px-3 py-2 text-sm`,s.value&&`text-danger`]),role:s.value?`alert`:`status`},B(a.value),11,l9)):L(``,!0),U(`form`,{class:`flex items-center gap-2 px-3 py-2`,onSubmit:Mt(u,[`prevent`])},[M(z(_c),{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`}),rt(U(`input`,{"onUpdate:modelValue":n[0]||=e=>i.value=e,class:`min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-fg-subtle`,placeholder:e.empty?`Build with Archie`:`Iterate with Archie`,"aria-label":e.empty?`Build with Archie`:`Iterate with Archie`,disabled:c.value},null,8,u9),[[Pt,i.value]]),c.value?(R(),W(`span`,d9,[M(z(Bv)),A(B(o.value),1)])):L(``,!0),c.value?(R(),K(z(J),{key:1,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Stop`,onClick:n[1]||=e=>z(l)?.abort()},{default:j(()=>[M(z(yc))]),_:1})):(R(),K(z(J),{key:2,type:`submit`,size:`icon-sm`,"aria-label":`Send`,disabled:!i.value.trim()},{default:j(()=>[M(z(Es))]),_:1},8,[`disabled`]))],32)]))}}),p9=20;function m9(e){let t=q([]),n=q(``),r=q([]),i=q(0),a=!1,o=q(``),s=q(!1),c=0;async function l(){let r=e.value,i=++c;s.value=!0;try{let s=r?await Y.taskPage({workflow:r,limit:p9}):null;if(e.value!==r||i!==c)return;t.value=(s?.tasks??[]).sort((e,t)=>Number(t.id)-Number(e.id)),o.value=``,(!a||n.value&&!t.value.some(e=>String(e.id)===n.value))&&(n.value=t.value[0]?String(t.value[0].id):``)}catch(t){e.value===r&&i===c&&(o.value=String(t.message||t))}finally{i===c&&(s.value=!1)}}async function u(){if(!n.value){r.value.length&&(r.value=[]),i.value=0;return}let e=n.value,t=await Y.taskAttempts(e).catch(()=>null);if(n.value!==e)return;let a=[...t?.attempts??[]].sort((e,t)=>t.attempt-e.attempt)[0],o=a?.stages??[];JSON.stringify(o)!==JSON.stringify(r.value)&&(r.value=o),i.value=a?.attempt??0}function d(e){a=!0,n.value=e}async function f(){await l(),await u()}F(e,()=>{a=!1,t.value=[],n.value=``,o.value=``,f()},{immediate:!0}),F(n,()=>{r.value=[],i.value=0,u()}),ne(`tasks`,()=>void f(),300);let p=I(()=>t.value.find(e=>String(e.id)===n.value));async function m(e){a=!0,n.value=String(e),await f()}return{runs:t,error:o,loading:s,watched:n,watchedRun:p,stages:r,attempt:i,pick:d,follow:m,refresh:f}}function h9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g9(e){try{return aJ(e)}catch{return null}}function _9(e,t){let n=[];for(let[r,i]of Object.entries(t.routes))i===e&&n.push(r==="default"?{kind:`issue`,label:`Unlabelled issues`,detail:`anything no label routes elsewhere`}:{kind:`issue`,label:`Issues labelled ${r}`});for(let r of t.bindings)r.workflow===e&&n.push({kind:`event`,label:r.name||`Event binding`,detail:r.matcher?.source,binding:r});for(let r of t.playbooks){let t=g9(r.yaml);if(!h9(t)||!Array.isArray(t.actions)||!t.actions.some(t=>h9(t)&&t.workflow===e))continue;let i=h9(t.trigger)?t.trigger:{},a=Array.isArray(i.labels)?i.labels.join(`, `):``;n.push({kind:`playbook`,label:r.id,detail:[i.kind,a].filter(Boolean).join(` · `)})}for(let r of t.definitions){if(r.id===e)continue;let t=v9(g9(r.yaml),e);t&&n.push({kind:`workflow`,label:r.id,detail:t})}return n}function v9(e,t){let n=(h9(e)&&Array.isArray(e.steps)?e.steps:[]).flatMap(e=>lJ(e)?.branches.flatMap(([,e])=>e)??[e]);for(let e of n){if(!h9(e)||!h9(e.settings))continue;let r=e.settings;switch(e.type){case`workflow.call`:if(r.workflow===t)return`calls it`;break;case`workflow.handoff`:if(r.workflow===t||y9(n,r.workflow).includes(t))return`hands off to it`;break;case`human.approve`:if(r.then===t)return`runs it once approved`}}return``}function y9(e,t){let n=typeof t==`string`?/\{\{\s*steps\.([\w-]+)\.result\.([\w-]+)\s*\}\}/.exec(t):null;if(!n)return[];let r=e.find(e=>h9(e)&&e.id===n[1]),i=h9(r)&&h9(r.settings)?r.settings.result:void 0,a=h9(i)&&h9(i.properties)?i.properties[n[2]]:void 0;return h9(a)&&Array.isArray(a.enum)?a.enum.map(String):[]}function b9(e){let t=O(),n=OU(),r=q([]);async function i(){let e=await Y.bindings().catch(()=>null);r.value=e?.bindings??[]}return gt(i),{triggers:I(()=>_9(e.value,{routes:n.intakeRoutes,bindings:r.value,playbooks:t.stateFor(`eda-playbooks`).resource?.value?.playbooks??[],definitions:n.collection.definitions})),reload:i}}var x9={class:`flex flex-wrap items-center gap-2`},S9={class:`ml-1 font-mono text-xs text-fg-subtle`},C9={key:0,class:`flex min-w-0 items-center gap-1`},w9=[`title`],T9={key:2,class:`ml-auto`},E9={key:0,class:`text-xs text-fg-muted`,role:`status`},D9={key:1,class:`text-sm text-danger`,role:`alert`}, Line truncated
+13 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed } from "vue";
import { computed, onMounted, watch } from "vue";
import { useRoute } from "vue-router";
import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
@@ -11,6 +11,18 @@ const links = computed(() =>
navTree(props.hidden).flatMap((node): NavEntry[] => (node.kind === "link" ? [node.entry] : [])),
);
const activePath = computed(() => activeNavPath(route.path));
// The strip scrolls sideways on a narrow window, so the current section can sit
// outside it. Centre it after each route change; block:"nearest" keeps it from
// scrolling the page too.
function revealActive(): void {
document
.querySelector('nav[aria-label="Sections"] [aria-current="page"]')
?.scrollIntoView({ inline: "center", block: "nearest" });
}
onMounted(revealActive);
watch(activePath, revealActive, { flush: "post" });
</script>
<template>
+1 -1
View File
@@ -45,7 +45,7 @@ const items = computed(() =>
:aria-current="route.path === item.path ? 'page' : undefined"
:class="
cn(
'flex h-8 items-center rounded-md px-3 text-[13px] whitespace-nowrap text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring',
'flex h-8 shrink-0 items-center rounded-md px-3 text-[13px] whitespace-nowrap text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring',
route.path === item.path &&
'bg-secondary font-medium text-foreground',
)
+10 -4
View File
@@ -257,23 +257,29 @@
/* Fingers need 44px targets (WCAG 2.5.5). Min sizes rather than heights, so
a component's own sizing still applies wherever it is already larger,
and inline links in prose are unaffected because min sizes do not apply
to inline boxes. */
@media (pointer: coarse), (width < 48rem) {
to inline boxes. Only a coarse pointer means a finger: a narrow window on
a desktop still uses a mouse. Switches and tab triggers are exempt because
they shrink their own box (a switch draws its hit area with ::after, tabs
share a fixed-height strip), so a min size deforms them instead. */
@media (pointer: coarse) {
:where(
button,
button:not([role="switch"], [role="tab"]),
a[href],
summary,
select,
textarea,
input:not([type="checkbox"], [type="radio"], [type="hidden"]),
[role="button"],
[role="tab"],
[role="menuitem"],
[role="option"]
) {
min-height: 44px;
min-width: 44px;
}
/* Tabs fill their list, so the list carries the touch height instead. */
[data-slot="tabs-list"] {
min-height: 44px;
}
}
/* An accessibility invariant, not a nicety: nothing animates for someone
who has asked it not to. */