From 8c455d6ef6d836e8f5c7de0e0d12acbe7e109bc0 Mon Sep 17 00:00:00 2001 From: Chaim Date: Fri, 19 Jun 2026 10:24:54 +0000 Subject: [PATCH] feat(halacha-queue): show panel deliberation + add search on rejected/approved tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 3-judge panel deliberation was only surfaced in the pending queue; the 'rejected'/'approved' tabs hid WHY an item was auto-rejected/approved even though the data is captured (reviewer='panel:... maj-not-entailed'). And those tabs had no way to locate a specific item. - useHalachotByStatus now requests include_panel_round=true and accepts a server-side search term (same /api/halachot params the pending queue uses). - HalachaRestoreCard renders the existing PanelDeliberation component when a round exists — same card the chair already sees in pending. - RestorePanel gains the same locate-bar (debounced, server-side search) + a match-count indicator; the bar stays visible on empty/loading so a search is always clearable. Reuses already-approved UI (deliberation = Design card 18, locate-bar = card 19); composition onto a sibling surface, approved directly by chaim. tsc + eslint clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../precedents/halacha-review-panel.tsx | 99 ++++++++++++++----- web-ui/src/lib/api/precedent-library.ts | 19 ++-- 2 files changed, 86 insertions(+), 32 deletions(-) diff --git a/web-ui/src/components/precedents/halacha-review-panel.tsx b/web-ui/src/components/precedents/halacha-review-panel.tsx index c4aa39c..1004216 100644 --- a/web-ui/src/components/precedents/halacha-review-panel.tsx +++ b/web-ui/src/components/precedents/halacha-review-panel.tsx @@ -614,6 +614,8 @@ function HalachaRestoreCard({ ))} + {h.panel_round && } +
+ )} +
+ + {searching && !isPending && !error && ( +
+ מציג עבור + + {search} + + + · {matchCount} {matchCount === 1 ? "התאמה" : "התאמות"} + + +
+ )} + + {body} + + ); } // ─── Pending queue panel (main review flow) ─────────────────────────────────── diff --git a/web-ui/src/lib/api/precedent-library.ts b/web-ui/src/lib/api/precedent-library.ts index 50f4720..b929da7 100644 --- a/web-ui/src/lib/api/precedent-library.ts +++ b/web-ui/src/lib/api/precedent-library.ts @@ -668,14 +668,21 @@ export function isExtractionFixItem(h: Halacha): boolean { ); } -export function useHalachotByStatus(status: string, limit = 300) { +export function useHalachotByStatus( + status: string, + opts: { limit?: number; search?: string } = {}, +) { + const { limit = 300, search = "" } = opts; + const term = search.trim(); + // include_panel_round surfaces the 3-judge deliberation on these tabs too + // (same card as the pending queue), so the chair sees WHY an item was + // auto-rejected/approved; search locates an item server-side beyond the window. + const qs = `review_status=${encodeURIComponent(status)}&include_panel_round=true&limit=${limit}` + + (term ? `&search=${encodeURIComponent(term)}` : ""); return useQuery({ - queryKey: libraryKeys.halachot({ review_status: status, limit: String(limit) }), + queryKey: libraryKeys.halachot({ review_status: status, limit: String(limit), search: term }), queryFn: ({ signal }) => - apiRequest<{ items: Halacha[]; count: number }>( - `/api/halachot?review_status=${encodeURIComponent(status)}&limit=${limit}`, - { signal }, - ), + apiRequest<{ items: Halacha[]; count: number }>(`/api/halachot?${qs}`, { signal }), staleTime: 10_000, refetchOnMount: "always", }); -- 2.49.1