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" - /> -
-
- -
- -