mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-25 06:35:18 +00:00
feat: add DAG progress dots to browse page via WebSocket events
- Add TRANSCRIPT_DAG_STATUS handler to UserEventsProvider with DagStatusContext and useDagStatusMap hook for live DAG task updates - Clean up dagStatusMap entries when TRANSCRIPT_STATUS transitions away from "processing" - Create DagProgressDots component rendering color-coded dots per DAG task (green=completed, blue pulsing=running, hollow=queued, red=failed, gray=cancelled) with humanized tooltip names - Wire dagStatusMap through browse page -> TranscriptCards -> TranscriptStatusIcon, falling back to REST dag_status field
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
generateTextFragment,
|
||||
} from "../../../lib/textHighlight";
|
||||
import type { components } from "../../../reflector-api";
|
||||
import type { DagTask } from "../../../lib/UserEventsProvider";
|
||||
|
||||
type SearchResult = components["schemas"]["SearchResult"];
|
||||
type SourceKind = components["schemas"]["SourceKind"];
|
||||
@@ -29,6 +30,7 @@ interface TranscriptCardsProps {
|
||||
isLoading?: boolean;
|
||||
onDelete: (transcriptId: string) => void;
|
||||
onReprocess: (transcriptId: string) => void;
|
||||
dagStatusMap?: Map<string, DagTask[]>;
|
||||
}
|
||||
|
||||
function highlightText(text: string, query: string): React.ReactNode {
|
||||
@@ -102,11 +104,13 @@ function TranscriptCard({
|
||||
query,
|
||||
onDelete,
|
||||
onReprocess,
|
||||
dagStatusMap,
|
||||
}: {
|
||||
result: SearchResult;
|
||||
query: string;
|
||||
onDelete: (transcriptId: string) => void;
|
||||
onReprocess: (transcriptId: string) => void;
|
||||
dagStatusMap?: Map<string, DagTask[]>;
|
||||
}) {
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
|
||||
@@ -137,7 +141,18 @@ function TranscriptCard({
|
||||
<Box borderWidth={1} p={4} borderRadius="md" fontSize="sm">
|
||||
<Flex justify="space-between" alignItems="flex-start" gap="2">
|
||||
<Box>
|
||||
<TranscriptStatusIcon status={result.status} />
|
||||
<TranscriptStatusIcon
|
||||
status={result.status}
|
||||
dagStatus={
|
||||
dagStatusMap?.get(result.id) ??
|
||||
(
|
||||
(result as Record<string, unknown>).dag_status as
|
||||
| { tasks?: DagTask[] }
|
||||
| undefined
|
||||
)?.tasks ??
|
||||
null
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
<Box flex="1">
|
||||
{/* Title with highlighting and text fragment for deep linking */}
|
||||
@@ -284,6 +299,7 @@ export default function TranscriptCards({
|
||||
isLoading,
|
||||
onDelete,
|
||||
onReprocess,
|
||||
dagStatusMap,
|
||||
}: TranscriptCardsProps) {
|
||||
return (
|
||||
<Box position="relative">
|
||||
@@ -315,6 +331,7 @@ export default function TranscriptCards({
|
||||
query={query}
|
||||
onDelete={onDelete}
|
||||
onReprocess={onReprocess}
|
||||
dagStatusMap={dagStatusMap}
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user