feat(halachot): חיפוש/איתור בתור-ההלכות + הערת חלון-תצוגה (פסיקה מחוץ ל-500 נגישה)
תור-ההלכות שלף רק 500 ממתינות בעלות-עדיפות מתוך ~1,372, בלי שום דרך לאתר פס"ד מסוים. הלכה מדורגת מתחת לחלון (למשל 1180-11-25, מקומות 921/1305) פשוט נעלמה — הספירה בספרייה הציגה "2 ממתינות" אך התור לא הראה אותן. - list_halachot: פרמטר search (case_number/case_name/rule_statement, ILIKE) — סינון בצד-השרת כך שפריט מתחת לחלון נשאר נגיש. מרחיב את מסלול-השליפה היחיד, לא יוצר מסלול מקביל (G2). - count_halachot: ספירה מלאה לאותו פילטר (ל-"N מתוך TOTAL"). - /api/halachot: search + with_total (ברירת-מחדל off; קוראים קיימים לא מושפעים). - UI (תור-הלכות): שורת-חיפוש מהוקצבת (debounce 300ms), הערת "חלון התצוגה" (500 מתוך הסך), ושורת-הקשר-תוצאה עם ניקוי. בחיפוש — כל הקבוצות התואמות נפתחות; הניווט המקלדתי והשערים (G10) ללא שינוי. מאומת מול ה-DB: search='1180-11-25' → 2 הממתינות (index 20 נקייה→להכרעתך, index 23 nli_unsupported→דורש תיקון-חילוץ); count=2. עיצוב: עבר שער Claude Design (X17, כרטיס 19-halacha-queue-unified) ואושר. Invariants: מקיים G2 (מסלול-שליפה יחיד), INV-G10 (שער-יו"ר ללא שינוי), INV-IA (מקור-אמת יחיד לתור). ללא בליעת-שגיאות. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -211,7 +211,7 @@ export const libraryKeys = {
|
||||
search: (q: string, filters: Record<string, string | boolean>) =>
|
||||
[...libraryKeys.all, "search", q, filters] as const,
|
||||
stats: () => [...libraryKeys.all, "stats"] as const,
|
||||
halachotPending: () => [...libraryKeys.all, "halachot", "pending"] as const,
|
||||
halachotPending: (search = "") => [...libraryKeys.all, "halachot", "pending", search] as const,
|
||||
halachot: (filters: Record<string, string>) =>
|
||||
[...libraryKeys.all, "halachot", filters] as const,
|
||||
};
|
||||
@@ -615,15 +615,18 @@ export function useRequestHalachotExtraction() {
|
||||
* review panel splits this client-side by ACTION — "להכרעה" (has a panel round)
|
||||
* vs "תיקון-חילוץ" (flagged, never adjudicated) — instead of the old empty
|
||||
* clean/needsfix toggle. */
|
||||
export function useHalachotPending(opts: { limit?: number } = {}) {
|
||||
const { limit = 200 } = opts;
|
||||
export function useHalachotPending(opts: { limit?: number; search?: string } = {}) {
|
||||
const { limit = 200, search = "" } = opts;
|
||||
const term = search.trim();
|
||||
const qs = `review_status=pending_review&exclude_low_quality=false`
|
||||
+ `&order_by_priority=true&cluster=true&include_equivalents=true`
|
||||
+ `&include_panel_round=true&limit=${limit}`;
|
||||
+ `&include_panel_round=true&with_total=true&limit=${limit}`
|
||||
+ (term ? `&search=${encodeURIComponent(term)}` : "");
|
||||
return useQuery({
|
||||
queryKey: libraryKeys.halachotPending(),
|
||||
queryKey: libraryKeys.halachotPending(term),
|
||||
queryFn: ({ signal }) =>
|
||||
apiRequest<{ items: Halacha[]; count: number }>(`/api/halachot?${qs}`, { signal }),
|
||||
apiRequest<{ items: Halacha[]; count: number; total?: number }>(
|
||||
`/api/halachot?${qs}`, { signal }),
|
||||
staleTime: 5_000,
|
||||
refetchOnMount: "always",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user