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 = {