From 0629f19d5f1248e2c7c279ac48cc9de5aabedf59 Mon Sep 17 00:00:00 2001 From: Chaim Date: Wed, 27 May 2026 09:58:23 +0000 Subject: [PATCH] ui(missing-precedents): drawer = notes + upload only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The drawer was showing a full metadata form (legal topic, case name, legal issue, cited-by-party + name, status) — most of it duplicated fields that get auto-extracted from the file once it's uploaded, or that are already known from when the row was detected. The visible placeholder text ('לינדאב בע"מ', 'אנטרים', 'זכות עמידה') looked like real data and confused readers. Strip the form down to a single "הערות" textarea — that's the only field the chair actually needs to edit. Reasons for who cited the decision and in what context belong there too. Everything else (shape of the precedent on the case_law side) is the LLM extractor's job. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../missing-precedent-detail-drawer.tsx | 162 ++++-------------- 1 file changed, 31 insertions(+), 131 deletions(-) diff --git a/web-ui/src/components/missing-precedents/missing-precedent-detail-drawer.tsx b/web-ui/src/components/missing-precedents/missing-precedent-detail-drawer.tsx index ac16276..9223119 100644 --- a/web-ui/src/components/missing-precedents/missing-precedent-detail-drawer.tsx +++ b/web-ui/src/components/missing-precedents/missing-precedent-detail-drawer.tsx @@ -19,10 +19,7 @@ import { useMissingPrecedent, useUpdateMissingPrecedent, useUploadMissingPrecedent, - CITED_BY_PARTY_LABELS, STATUS_LABELS, - type CitedByParty, - type MissingPrecedentStatus, type MissingPrecedentPatch, } from "@/lib/api/missing-precedents"; import { @@ -47,14 +44,13 @@ export function MissingPrecedentDetailDrawer({ id, onOpenChange }: Props) { const update = useUpdateMissingPrecedent(); const upload = useUploadMissingPrecedent(); - // Edit form for metadata. - const [legalTopic, setLegalTopic] = useState(""); - const [legalIssue, setLegalIssue] = useState(""); - const [cityParty, setCitedByParty] = useState("unknown"); - const [citedByPartyName, setCitedByPartyName] = useState(""); - const [caseName, setCaseName] = useState(""); + // The only chair-editable field on the missing-precedent is `notes` — + // free-text. Everything else (citation, who-cited-whom, status) is set + // when the row was detected, and updates automatically when the file + // is uploaded. The metadata of the *uploaded* precedent (case_name, + // chair, district, …) is auto-extracted by the LLM and lives on the + // case_law row, not here. const [notes, setNotes] = useState(""); - const [status, setStatus] = useState("open"); // Upload form fields. const [file, setFile] = useState(null); @@ -72,13 +68,7 @@ export function MissingPrecedentDetailDrawer({ id, onOpenChange }: Props) { const [syncedId, setSyncedId] = useState(null); if (mp && mp.id !== syncedId) { setSyncedId(mp.id); - setLegalTopic(mp.legal_topic ?? ""); - setLegalIssue(mp.legal_issue ?? ""); - setCitedByParty(mp.cited_by_party ?? "unknown"); - setCitedByPartyName(mp.cited_by_party_name ?? ""); - setCaseName(mp.case_name ?? ""); setNotes(mp.notes ?? ""); - setStatus(mp.status); } // Reset on close. The cascading-render warning is the intended side @@ -93,22 +83,14 @@ export function MissingPrecedentDetailDrawer({ id, onOpenChange }: Props) { setDistrict(""); setCommitteeCaseNumber(""); setSummary(""); }, [open]); - const handleSaveMetadata = async () => { + const handleSaveNotes = async () => { if (!mp) return; - const patch: MissingPrecedentPatch = { - legal_topic: legalTopic, - legal_issue: legalIssue, - cited_by_party: cityParty, - cited_by_party_name: citedByPartyName, - case_name: caseName, - notes, - status, - }; + const patch: MissingPrecedentPatch = { notes }; try { await update.mutateAsync({ id: mp.id, patch }); - toast.success("הרשומה עודכנה"); + toast.success("הערות נשמרו"); } catch (e) { - toast.error("העדכון נכשל"); + toast.error("שמירה נכשלה"); console.error(e); } }; @@ -128,7 +110,6 @@ export function MissingPrecedentDetailDrawer({ id, onOpenChange }: Props) { case_number: isCommittee ? committeeCaseNumber || undefined : undefined, chair_name: isCommittee ? chairName || undefined : undefined, district: isCommittee ? district || undefined : undefined, - case_name: caseName || undefined, court: court || undefined, decision_date: decisionDate || undefined, practice_area: practiceArea || undefined, @@ -216,110 +197,29 @@ export function MissingPrecedentDetailDrawer({ id, onOpenChange }: Props) { ) : null} - {/* ── Editable metadata ── */} -
-

מטא־דאטה

- -
-
- - setLegalTopic(e.target.value)} - placeholder="זכות עמידה" - dir="rtl" - /> -
-
- - setCaseName(e.target.value)} - placeholder="אנטרים" - dir="rtl" - /> -
-
- -
- -