Files
legal-ai/web-ui/src/components/cases/status-guide.tsx
Chaim ba542f9c21
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 11s
refactor(cases): צמצום תפריט-סטטוס 17→10 + מקור-אמת יחיד (UI-B1/G2)
תפריט הסטטוס-הידני הכיל 17 סטטוסים שמתוכם ~9 דקורציה טהורה — שלבי-ביניים
שאף קוד בפייפליין לא קבע ושום לוגיקה לא הסתעפה לפיהם, עם רשימות כפולות
לא-עקביות ב-6+ קבצים (UI-B1) ו-exported כסטטוס-רפאים (באג agent-audit).

הליבה (10): new, processing, documents_ready, outcome_set, direction_approved,
qa_review, drafted, exported, reviewed, final.

- SSoT חדש web-ui/src/lib/api/case-status.ts (רשימה/שלבים/תוויות/statusLabel);
  כל הצרכנים (badge/changer/timeline/guide/donut/kpi/compose) מייבאים משם.
- statusLabel() מבטיח תווית עברית תמיד — גם לערך-מורשת (נפילה עברית, לא סלאג).
- בקאנד: STATUS_ORDER 10, models.CaseStatus מיושר, set_outcome קובע
  outcome_set/direction_approved (במקום in_progress) כמו endpoint ה-web.
- exported מוקשח אחרי export-DOCX מוצלח (forward-only); widget "נכשל ב-QA"
  עודכן ל-qa_review (הסטטוס שנקבע בפועל בכשל-QA).
- scripts/backfill_case_status_trim.py: מיפוי שורות-מורשת לסטטוס-הליבה הקודם.

Invariants: UI-B1 (מקור-אמת יחיד)  · G2 (אין מסלול מקביל)  · GAP-42 (חלקי).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 09:47:13 +00:00

61 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { useState } from "react";
import { ChevronDown, ChevronUp } from "lucide-react";
import { PHASES as PHASE_GROUPS } from "@/lib/api/case-status";
import { STATUS_LABELS, STATUS_ICONS, STATUS_DESCRIPTIONS, STATUS_TONE } from "@/components/cases/status-badge";
/*
* Collapsible guide showing the core statuses grouped by phase,
* each with its icon, Hebrew label, color badge, and description.
* Phases come from the SSoT (@/lib/api/case-status).
* Intended to sit below the WorkflowTimeline in the case sidebar.
*/
export function StatusGuide() {
const [open, setOpen] = useState(false);
return (
<div className="mt-4 border-t border-rule pt-3">
<button
type="button"
onClick={() => setOpen(!open)}
className="flex items-center gap-1.5 text-[0.72rem] text-ink-muted hover:text-navy transition-colors w-full"
>
{open ? <ChevronUp className="w-3 h-3" /> : <ChevronDown className="w-3 h-3" />}
מפת סטטוסים
</button>
{open && (
<div className="mt-3 space-y-3">
{PHASE_GROUPS.map((group) => (
<div key={group.label}>
<h4 className="text-[0.7rem] font-semibold text-navy mb-1.5">
{group.label}
</h4>
<ul className="space-y-1.5">
{group.statuses.map((s) => {
const Icon = STATUS_ICONS[s];
return (
<li key={s} className="flex items-start gap-2">
<span
className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[0.65rem] font-medium shrink-0 ${STATUS_TONE[s]}`}
>
<Icon className="w-2.5 h-2.5" />
{STATUS_LABELS[s]}
</span>
<span className="text-[0.65rem] text-ink-muted leading-snug">
{STATUS_DESCRIPTIONS[s]}
</span>
</li>
);
})}
</ul>
</div>
))}
</div>
)}
</div>
);
}