feat(ui): אינדיקטור התקדמות לחילוץ מטא-דאטה + מתג-מקטעים בספריית הפסיקה

שתי בעיות UX בדף /precedents:

1. חילוץ מטא-דאטה לא נתן שום אינדיקציה שהוא רץ. בניגוד לחילוץ טקסט/הלכות
   (extraction_status / halacha_extraction_status) למטא-דאטה היתה רק חותמת-זמן
   metadata_extraction_requested_at — אין מצב "processing", לכן StatusPill לא
   הציג כלום. נוספה עמודת metadata_extraction_status ('pending'|'processing'|
   'completed'|'failed') במתכונת העמודות הקיימות, וה-worker
   (process_pending_extractions + reextract_metadata) מעדכן אותה: processing
   בתחילת פריט, completed בסיום (מנקה גם את החותמת), pending בכשל (לריטריי).
   ה-UI מציג תג "מחלץ מטא-דאטה" + באנר מונה-אצווה עם אחוז התקדמות (high-water-mark
   של עומק-התור) שמתעדכן אוטומטית דרך ה-polling הקיים (5ש').

2. שתי טבלאות מוערמות (בתי משפט / ועדות ערר) חייבו גלילה ארוכה. הוחלפו במתג-
   מקטעים — טבלה אחת בכל פעם, עם שמירה על העמודות הייעודיות לכל סוג.

Invariants: G2 (מרחיב מנגנון-סטטוס קיים, לא מסלול מקביל), INV-TOOL4/GAP-45
(המשך חשיפת תור-החילוץ הסמוי). אין נגיעה בתוכן משפטי (G11).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 16:21:41 +00:00
parent 9c77123fa3
commit 6bf19bd0d7
4 changed files with 215 additions and 29 deletions

View File

@@ -51,6 +51,7 @@ export type Precedent = {
citation_formatted: string;
extraction_status: string;
halacha_extraction_status: string;
metadata_extraction_status: string;
metadata_extraction_requested_at: string | null;
halacha_extraction_requested_at: string | null;
created_at: string;
@@ -232,12 +233,14 @@ export function isPrecedentActive(p: Precedent): boolean {
return true;
}
// Metadata extraction has no status column — only the timestamp.
// Treat as active only when extraction hasn't yet fully completed
// (otherwise stale timestamps linger after success).
// Metadata extraction now has its own status column. Active while the
// worker is processing the row, or while it's queued (timestamp set) and
// hasn't reached a terminal state yet.
if (p.metadata_extraction_status === "processing") return true;
if (
p.metadata_extraction_requested_at !== null &&
p.extraction_status !== "completed"
p.metadata_extraction_status !== "completed" &&
p.metadata_extraction_status !== "failed"
) {
return true;
}