You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -134,16 +134,17 @@ function patchWebviewBundleJs(source) {
134
134
/* CODEX_WORKFLOW_FOLD_PATCH_V2 */
135
135
/* CODEX_WORKFLOW_FOLD_PATCH_V3 */
136
136
/* CODEX_WORKFLOW_FOLD_PATCH_V4 */
137
+
/* CODEX_WORKFLOW_FOLD_PATCH_V5 */
137
138
function __codexWorkflowCollapseMode(){const m=globalThis.document?.querySelector('meta[name="codex-workflow-collapse"]');const v=m?.getAttribute("content")?.trim();return v==="collapse"||v==="expand"||v==="disable"?v:"collapse"}
138
139
function __codexWorkflowFormatElapsed(ms){const s=Math.max(0,Math.floor(ms/1e3));const h=Math.floor(s/3600),m=Math.floor((s%3600)/60),ss=s%60;const p=n=>String(n).padStart(2,"0");if(h>0)return \`\${h}h\${p(m)}m\${p(ss)}s\`;return \`\${m}m\${p(ss)}s\`}
139
140
function __codexWorkflowFoldItems(items,mode){if(mode==="disable")return items;if(!Array.isArray(items))return items;const out=[];let inTurn=!1;let children=[];let turnIndex=-1;const pushWorkflow=()=>{if(children.length===0)return;out.push({type:"workflow",id:\`workflow-\${turnIndex}\`,children,defaultCollapsed:mode==="collapse"})};for(const it of items){if(it?.type==="user-message"){inTurn=!0;turnIndex++;out.push(it);children=[];continue}if(inTurn&&it?.type==="assistant-message"){pushWorkflow();out.push(it);inTurn=!1;children=[];continue}if(inTurn)children.push(it);else out.push(it)}inTurn&&pushWorkflow();return out}
function __CodexWorkflowItem(rt){const {item:it}=rt,mode=__codexWorkflowCollapseMode();if(mode==="disable")return null;const intl=useIntl();const startedAt=reactExports.useRef(Date.now());const isRunning=(it.children??[]).some(ch=>__codexOrigIsAgentItemStillRunning?__codexOrigIsAgentItemStillRunning(ch):!1);const [now,setNow]=reactExports.useState(Date.now());reactExports.useEffect(()=>{if(!isRunning)return;const id=setInterval(()=>setNow(Date.now()),1e3);return()=>clearInterval(id)},[isRunning]);const [collapsed,setCollapsed]=reactExports.useState(it.defaultCollapsed===!0);const statusLabel=isRunning?intl.formatMessage({id:"codex.workflow.status.working",defaultMessage:"Working",description:"Status shown in Workflow header when the agent is still running"}):intl.formatMessage({id:"codex.workflow.status.done",defaultMessage:"Done",description:"Status shown in Workflow header when the agent has finished"});const elapsed=__codexWorkflowFormatElapsed((isRunning?now:Date.now())-startedAt.current);const header=jsxRuntimeExports.jsx("div",{className:"flex items-center gap-1.5",children:jsxRuntimeExports.jsx("span",{className:"truncate",children:intl.formatMessage({id:"codex.workflow.label",defaultMessage:"Workflow",description:"Label for the Workflow folding header"})})});const meta=jsxRuntimeExports.jsx("span",{className:"text-token-description-foreground text-xs whitespace-nowrap",children:intl.formatMessage({id:"codex.workflow.headerSuffix",defaultMessage:"({status}, {elapsed})",description:"Suffix in Workflow header with status and elapsed time"},{status:statusLabel,elapsed})});const title=jsxRuntimeExports.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[header,meta]});const chevron=jsxRuntimeExports.jsx(typeof SvgChevronRight!=="undefined"?SvgChevronRight:"span",{className:clsx("icon-xs transition-transform",collapsed?"rotate-0":"rotate-90")});const action=jsxRuntimeExports.jsx("div",{className:"flex items-center",children:chevron});const expanded=!collapsed&&(it.children??[]).length>0?jsxRuntimeExports.jsx("div",{className:"border-token-border/80 border-x border-b bg-token-input-background/70 flex flex-col gap-2 px-3 py-2",children:(it.children??[]).map((ch,idx)=>jsxRuntimeExports.jsx(__codexOrigLocalConversationItemContent,{...rt,item:ch},ch?.callId??ch?.id??\`\${it.id}-\${idx}\`))}):null;return jsxRuntimeExports.jsx(InProgressFixedContentItem,{onClick:()=>setCollapsed(v=>!v),children:title,action,expandedContent:expanded})}
0 commit comments