fix(precedents): deferred (snooze) לא נספר כ"ממתין" ולא צובע שורה אדום
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 6s
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 6s
המשך ל-#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) <noreply@anthropic.com>
This commit is contained in:
@@ -3702,9 +3702,11 @@ async def list_external_case_law(
|
|||||||
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
(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
|
(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
|
(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
|
FROM case_law
|
||||||
WHERE {where_sql}
|
WHERE {where_sql}
|
||||||
ORDER BY created_at DESC
|
ORDER BY created_at DESC
|
||||||
|
|||||||
@@ -140,14 +140,20 @@ function StatusPill({ p }: { p: Precedent }) {
|
|||||||
}
|
}
|
||||||
// Split the count into approved / pending / rejected so a high total no
|
// Split the count into approved / pending / rejected so a high total no
|
||||||
// longer reads as "lots waiting" when the remainder is actually rejected.
|
// 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 hasPending = p.pending_count > 0;
|
||||||
|
const title =
|
||||||
|
`${p.approved_count} מאושרות · ${p.pending_count} ממתינות · ${p.rejected_count} נדחו` +
|
||||||
|
(p.deferred_count > 0 ? ` · ${p.deferred_count} נדחו למועד` : "");
|
||||||
return (
|
return (
|
||||||
<Badge
|
<Badge
|
||||||
variant="outline"
|
variant="outline"
|
||||||
dir="ltr"
|
dir="ltr"
|
||||||
className="bg-gold-wash text-gold-deep border-gold/40 tabular-nums"
|
className="bg-gold-wash text-gold-deep border-gold/40 tabular-nums"
|
||||||
title={`${p.approved_count} מאושרות · ${p.pending_count} ממתינות · ${p.rejected_count} נדחו`}
|
title={title}
|
||||||
>
|
>
|
||||||
<span className="text-success font-semibold">{p.approved_count}</span>
|
<span className="text-success font-semibold">{p.approved_count}</span>
|
||||||
<span className="text-ink-light">/</span>
|
<span className="text-ink-light">/</span>
|
||||||
@@ -156,6 +162,11 @@ function StatusPill({ p }: { p: Precedent }) {
|
|||||||
</span>
|
</span>
|
||||||
<span className="text-ink-light">/</span>
|
<span className="text-ink-light">/</span>
|
||||||
<span className="text-ink-muted">{p.rejected_count}</span>
|
<span className="text-ink-muted">{p.rejected_count}</span>
|
||||||
|
{p.deferred_count > 0 ? (
|
||||||
|
<span className="ms-1 text-[0.7rem] text-ink-light">
|
||||||
|
(⏸ {p.deferred_count})
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
<span className="ms-1 text-[0.7rem] text-ink-muted">הלכות</span>
|
<span className="ms-1 text-[0.7rem] text-ink-muted">הלכות</span>
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export type Precedent = {
|
|||||||
approved_count: number;
|
approved_count: number;
|
||||||
pending_count: number;
|
pending_count: number;
|
||||||
rejected_count: number;
|
rejected_count: number;
|
||||||
|
deferred_count: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Halacha = {
|
export type Halacha = {
|
||||||
|
|||||||
Reference in New Issue
Block a user