From 4ea6326766fae749daa6b9b618107c43e4bba8cc Mon Sep 17 00:00:00 2001 From: Chaim Date: Fri, 12 Jun 2026 04:29:07 +0000 Subject: [PATCH] =?UTF-8?q?fix(precedents):=20=D7=A4=D7=99=D7=A6=D7=95?= =?UTF-8?q?=D7=9C=20=D7=AA=D7=92-=D7=94=D7=9C=D7=9B=D7=95=D7=AA=20=D7=9C-?= =?UTF-8?q?=D7=9E=D7=90=D7=95=D7=A9=D7=A8/=D7=9E=D7=9E=D7=AA=D7=99=D7=9F/?= =?UTF-8?q?=D7=A0=D7=93=D7=97=D7=94=20+=20=D7=94=D7=93=D7=92=D7=A9=D7=AA?= =?UTF-8?q?=20=D7=A9=D7=95=D7=A8=D7=95=D7=AA-=D7=98=D7=99=D7=A4=D7=95?= =?UTF-8?q?=D7=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit התג בספריית-הפסיקה הציג "approved/total" — total כלל גם הלכות שנדחו, כך ש-17/27 נקרא כאילו 10 ממתינות בעוד שבפועל הן נדחו. כעת: - backend: list_external_case_law מחזיר pending_count (pending_review+deferred) ו-rejected_count לצד approved_count (approved+published). מקור-אמת אחד לספירה, אותה שאילתה — אין מסלול מקבילי (G2). - UI: התג מציג 17/0/10 (מאושר/ממתין/נדחה), צבעי-משמעות, tooltip מפרש. ממתין נצבע אדום-בולט רק כשגדול מ-0. - UI: שורה עם הלכות ממתינות (pending_count>0) מקבלת רקע אדמדם דרך rowClassName() — חל על שורות פסיקה ועל שורות ועדות-ערר. Invariants: G2 (ספירה ממקור-אמת יחיד, ללא מסלול מקבילי). שינוי-UI ויזואלי לפי אפיון מפורש של היו"ר (שער-עיצוב). Co-Authored-By: Claude Opus 4.8 (1M context) --- mcp-server/src/legal_mcp/services/db.py | 6 +++- .../precedents/library-list-panel.tsx | 32 ++++++++++++++++--- web-ui/src/lib/api/precedent-library.ts | 2 ++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/mcp-server/src/legal_mcp/services/db.py b/mcp-server/src/legal_mcp/services/db.py index 5815120..1f3bdb2 100644 --- a/mcp-server/src/legal_mcp/services/db.py +++ b/mcp-server/src/legal_mcp/services/db.py @@ -3700,7 +3700,11 @@ async def list_external_case_law( created_at, (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id) AS halachot_count, (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id - AND h.review_status IN ('approved', 'published')) AS approved_count + AND h.review_status IN ('approved', 'published')) AS approved_count, + (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id + AND h.review_status IN ('pending_review', 'deferred')) AS pending_count, + (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id + AND h.review_status = 'rejected') AS rejected_count FROM case_law WHERE {where_sql} ORDER BY created_at DESC diff --git a/web-ui/src/components/precedents/library-list-panel.tsx b/web-ui/src/components/precedents/library-list-panel.tsx index 65403c3..501653f 100644 --- a/web-ui/src/components/precedents/library-list-panel.tsx +++ b/web-ui/src/components/precedents/library-list-panel.tsx @@ -138,13 +138,37 @@ function StatusPill({ p }: { p: Precedent }) { if (p.halachot_count === 0) { return ללא הלכות; } + // Split the count into approved / pending / rejected so a high total no + // longer reads as "lots waiting" when the remainder is actually rejected. + // Pending is the only state that needs the chair — highlight it in red. + const hasPending = p.pending_count > 0; return ( - - {p.approved_count}/{p.halachot_count} מאושרות + + {p.approved_count} + / + + {p.pending_count} + + / + {p.rejected_count} + הלכות ); } +// Rows with halachot still awaiting the chair get a reddish wash so the +// "needs attention" queue is visible at a glance without opening each row. +function rowClassName(p: Precedent): string { + return p.pending_count > 0 + ? "border-rule bg-danger-bg/40 hover:bg-danger-bg/60 align-top" + : "border-rule hover:bg-gold-wash/30 align-top"; +} + function CourtRow({ p, onEdit }: { p: Precedent; onEdit: (id: string) => void }) { const del = useDeletePrecedent(); const reqHalachot = useRequestHalachotExtraction(); @@ -175,7 +199,7 @@ function CourtRow({ p, onEdit }: { p: Precedent; onEdit: (id: string) => void }) }; return ( - + voi }; return ( - +