From b0411db80b1b14283da4b1e747027aca7ecc0dc9 Mon Sep 17 00:00:00 2001 From: Chaim Date: Fri, 12 Jun 2026 04:40:26 +0000 Subject: [PATCH] =?UTF-8?q?fix(precedents):=20deferred=20(snooze)=20=D7=9C?= =?UTF-8?q?=D7=90=20=D7=A0=D7=A1=D7=A4=D7=A8=20=D7=9B"=D7=9E=D7=9E=D7=AA?= =?UTF-8?q?=D7=99=D7=9F"=20=D7=95=D7=9C=D7=90=20=D7=A6=D7=95=D7=91=D7=A2?= =?UTF-8?q?=20=D7=A9=D7=95=D7=A8=D7=94=20=D7=90=D7=93=D7=95=D7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit המשך ל-#215. תור-הסקירה האמיתי (list_halachot) מסנן pending_review בלבד — deferred ("נדחה למועד", #84 snooze) מוסט במכוון מהתור הפעיל. לכן ספירתו כ"ממתין" צבעה שורות אדום על עבודה שדפנה כבר הסיטה הצידה — בדיוק ההטעיה ש-#215 בא לתקן. - backend: pending_count = pending_review בלבד (היה pending_review+deferred); deferred_count חדש ונפרד. אותה שאילתה, מקור-אמת יחיד (G2). - UI: deferred מוצג כמקטע מושתק (⏸ N) רק כשקיים — לא צובע אדום, לא נספר בממתינות. הצבע האדום + רקע-השורה מונעים מ-pending_count (=pending_review) בלבד, בעקביות עם התור. Invariants: G2 (ספירה ממקור-אמת יחיד תואמת-תור). שינוי-UI לפי החלטת היו"ר. Co-Authored-By: Claude Opus 4.8 (1M context) --- mcp-server/src/legal_mcp/services/db.py | 6 ++++-- .../components/precedents/library-list-panel.tsx | 15 +++++++++++++-- web-ui/src/lib/api/precedent-library.ts | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mcp-server/src/legal_mcp/services/db.py b/mcp-server/src/legal_mcp/services/db.py index b26800a..7f6181d 100644 --- a/mcp-server/src/legal_mcp/services/db.py +++ b/mcp-server/src/legal_mcp/services/db.py @@ -3702,9 +3702,11 @@ async def list_external_case_law( (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id 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, + AND h.review_status = 'pending_review') AS pending_count, (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id - AND h.review_status = 'rejected') AS rejected_count + AND h.review_status = 'rejected') AS rejected_count, + (SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id + AND h.review_status = 'deferred') AS deferred_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 501653f..c4a94d0 100644 --- a/web-ui/src/components/precedents/library-list-panel.tsx +++ b/web-ui/src/components/precedents/library-list-panel.tsx @@ -140,14 +140,20 @@ function StatusPill({ p }: { p: Precedent }) { } // 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. + // Only pending_review needs the chair — it (and only it) is highlighted red + // and tints the row. deferred ("snoozed", #84) was deliberately set aside and + // is excluded from the active review queue, so it never alarms — it shows as + // a separate muted segment, surfaced only when present. const hasPending = p.pending_count > 0; + const title = + `${p.approved_count} מאושרות · ${p.pending_count} ממתינות · ${p.rejected_count} נדחו` + + (p.deferred_count > 0 ? ` · ${p.deferred_count} נדחו למועד` : ""); return ( {p.approved_count} / @@ -156,6 +162,11 @@ function StatusPill({ p }: { p: Precedent }) { / {p.rejected_count} + {p.deferred_count > 0 ? ( + + (⏸ {p.deferred_count}) + + ) : null} הלכות ); diff --git a/web-ui/src/lib/api/precedent-library.ts b/web-ui/src/lib/api/precedent-library.ts index eb2c195..65e1302 100644 --- a/web-ui/src/lib/api/precedent-library.ts +++ b/web-ui/src/lib/api/precedent-library.ts @@ -59,6 +59,7 @@ export type Precedent = { approved_count: number; pending_count: number; rejected_count: number; + deferred_count: number; }; export type Halacha = {