fix(status): render pipeline phase for legacy statuses (analyst_verified)
A case parked on a status the trimmed PHASES list dropped — but the agents still set, e.g. `analyst_verified` (HEARTBEAT.md), `research_complete` (legal-researcher) — rendered with NO active phase: phaseIndexOf returned -1, so the pipeline stepper went fully blank and the chair couldn't see where the case stood (reported on 1043-02-26, currently at analyst_verified). Add LEGACY_STATUS_PHASE in case-status.ts mapping each legacy/intermediate status to its display phase (analyst_verified/research_complete → "ניתוח וכיוון"), and a single phaseIndexOf() exported from the SSoT. status-hero.tsx and workflow-timeline.tsx both dropped their identical local phaseIndexOf (which had the bug) and import the shared one — no parallel path (G2). Display-only data-mapping fix; the stepper design is unchanged. Does NOT address the root drift (agents still set analyst_verified) — that prompt-alignment is a separate, carefully-sequenced follow-up needing cross-company agent sync. Invariants: G2 (single phase-resolution path, legacy handled in the SSoT, no new parallel logic). No backend / status-model change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { PHASES, type CaseStatus, type PhaseKey } from "@/lib/api/case-status";
|
||||
import { PHASES, phaseIndexOf, type CaseStatus, type PhaseKey } from "@/lib/api/case-status";
|
||||
import { STATUS_LABELS, STATUS_ICONS, STATUS_DESCRIPTIONS } from "@/components/cases/status-badge";
|
||||
import {
|
||||
FolderInput, ClipboardList, Brain, PenLine, CheckCircle2,
|
||||
@@ -21,11 +21,6 @@ const PHASE_ICONS: Record<PhaseKey, LucideIcon> = {
|
||||
done: CheckCircle2,
|
||||
};
|
||||
|
||||
function phaseIndexOf(status?: CaseStatus): number {
|
||||
if (!status) return -1;
|
||||
return PHASES.findIndex((p) => p.statuses.includes(status));
|
||||
}
|
||||
|
||||
export function WorkflowTimeline({ status }: { status?: CaseStatus }) {
|
||||
const currentIdx = phaseIndexOf(status);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user