fix: consolidate DagTask types, fix REST fallback shape, fix lint noqa

- Extract shared DagTask/DagTaskStatus types into www/app/lib/dagTypes.ts
- Re-export from useWebSockets.ts and UserEventsProvider.tsx
- Fix browse page REST fallback: dag_status is list[dict] directly, not {tasks: [...]}
- Add missing # noqa: PLC0415 for fork-safe deferred imports
This commit is contained in:
Igor Loskutov
2026-02-09 13:25:40 -05:00
parent ebae9124b6
commit 0c06cdd117
5 changed files with 29 additions and 46 deletions

View File

@@ -145,11 +145,9 @@ function TranscriptCard({
status={result.status}
dagStatus={
dagStatusMap?.get(result.id) ??
(
(result as Record<string, unknown>).dag_status as
| { tasks?: DagTask[] }
| undefined
)?.tasks ??
((result as Record<string, unknown>).dag_status as
| DagTask[]
| null) ??
null
}
/>

View File

@@ -14,25 +14,8 @@ import {
} from "../../lib/apiHooks";
import { NonEmptyString } from "../../lib/utils";
export type DagTaskStatus =
| "queued"
| "running"
| "completed"
| "failed"
| "cancelled";
export type DagTask = {
name: string;
status: DagTaskStatus;
started_at: string | null;
finished_at: string | null;
duration_seconds: number | null;
parents: string[];
error: string | null;
children_total: number | null;
children_completed: number | null;
progress_pct: number | null;
};
import type { DagTask } from "../../lib/dagTypes";
export type { DagTask, DagTaskStatus } from "../../lib/dagTypes";
export type UseWebSockets = {
transcriptTextLive: string;