mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-13 19:50:54 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d24e734f19 |
@@ -478,7 +478,7 @@ function WorkerAssetBadge({ assets }: { assets: IntentAsset[] }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function SessionsTab({ taskId }: { taskId: string }) {
|
||||
export function SessionsTab({ taskId, taskPaused = false }: { taskId: string; taskPaused?: boolean }) {
|
||||
const approvalFocus = useApprovalFocus({ taskId });
|
||||
const [selectedSessionId, setActiveId] = React.useState(MAIN_ID);
|
||||
const focusSession = React.useMemo<Session | undefined>(() => {
|
||||
@@ -1416,6 +1416,9 @@ export function SessionsTab({ taskId }: { taskId: string }) {
|
||||
|
||||
// Run duration = span from this session's first step to its last (for a live
|
||||
// session, "now" so it ticks up — the 1.5s setTick above re-renders it).
|
||||
// While the TASK is paused nothing time-derived may advance (#84): sessions
|
||||
// keep state='running' in the store during a pause, so live alone would keep
|
||||
// ticking and misrepresent the frozen budget. Freeze at the last step instead.
|
||||
const runDuration = React.useMemo(() => {
|
||||
let min = Infinity,
|
||||
max = 0;
|
||||
@@ -1426,9 +1429,9 @@ export function SessionsTab({ taskId }: { taskId: string }) {
|
||||
if (t > max) max = t;
|
||||
}
|
||||
if (!Number.isFinite(min) || max === 0) return null;
|
||||
const end = active.live ? Date.now() : max;
|
||||
const end = active.live && !taskPaused ? Date.now() : max;
|
||||
return Math.max(0, end - min);
|
||||
}, [activity, active.live]);
|
||||
}, [activity, active.live, taskPaused]);
|
||||
|
||||
// ---- transcript auto-scroll (open → bottom; stick to bottom unless scrolled up) ----
|
||||
const contentRef = React.useRef<HTMLDivElement | null>(null);
|
||||
|
||||
@@ -420,7 +420,7 @@ function TaskDetailInner() {
|
||||
{/* Tab content */}
|
||||
<div className="flex-1 p-4 lg:p-6">
|
||||
<TabsContent value="sessions" className="mt-0">
|
||||
<SessionsTab taskId={id} />
|
||||
<SessionsTab taskId={id} taskPaused={task?.status === "paused"} />
|
||||
</TabsContent>
|
||||
<TabsContent value="overview" className="mt-0">
|
||||
<OverviewTab taskId={id} />
|
||||
|
||||
Reference in New Issue
Block a user