ui(precedents): edit sheet — make citation_formatted editable
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 46s

The "ערוך פרטים" sheet labeled the case_number field "מראה מקום" and
marked it read-only — confusing because the formal citation IS supposed
to be editable. Rename the read-only field to "מספר תיק (מזהה ייחודי)"
to clarify it's the system key, and add a separate Textarea for the
true formal citation (citation_formatted) with the same markdown-bold
convention used by the inline editor on the detail page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-27 09:40:08 +00:00
parent c4046cc0a0
commit f920cfc738

View File

@@ -36,6 +36,7 @@ type Props = {
* happened in the background. */
type FormState = {
citation: string;
citation_formatted: string;
case_name: string;
court: string;
district: string;
@@ -53,7 +54,8 @@ type FormState = {
};
const EMPTY: FormState = {
citation: "", case_name: "", court: "", district: "", chair_name: "",
citation: "", citation_formatted: "",
case_name: "", court: "", district: "", chair_name: "",
decision_date: "", practice_area: "", appeal_subtype: "", source_type: "",
precedent_level: "", is_binding: true, subject_tags: "",
summary: "", headnote: "", key_quote: "",
@@ -75,6 +77,7 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
setSyncedRecordId(record.id as string);
setForm({
citation: record.case_number || "",
citation_formatted: record.citation_formatted || "",
case_name: record.case_name || "",
court: record.court || "",
district: record.district || "",
@@ -97,6 +100,7 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
if (!caseLawId) return;
try {
const patch: Record<string, unknown> = {
citation_formatted: form.citation_formatted.trim(),
case_name: form.case_name.trim(),
court: form.court.trim(),
district: form.district.trim(),
@@ -144,7 +148,7 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
<DialogHeader className="px-6 pt-6">
<DialogTitle className="text-navy">עריכת פרטי פסיקה</DialogTitle>
<DialogDescription className="text-ink-muted">
כל השדות ניתנים לעריכה חוץ ממראה המקום (מזהה ייחודי).
כל השדות ניתנים לעריכה חוץ ממספר התיק (מזהה ייחודי במערכת).
כפתור &quot;חלץ מטא-דאטה&quot; שולח בקשה לתור מקומי שאני מרוקן
מ-Claude Code (ה-LLM רץ מקומית עם <code>claude session</code>,
לא ב-API).
@@ -160,7 +164,7 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
<form onSubmit={onSubmit} className="px-6 pb-6 space-y-4 mt-4">
<div className="rounded-lg border border-rule bg-rule-soft/40 p-3 flex items-start gap-3">
<div className="flex-1 min-w-0">
<div className="text-[0.78rem] text-ink-muted">מראה מקום (לא ניתן לעריכה)</div>
<div className="text-[0.78rem] text-ink-muted">מספר תיק (מזהה ייחודי לא ניתן לעריכה)</div>
<div className="text-navy font-mono text-sm break-all" dir="ltr">
{record.case_number}
</div>
@@ -177,6 +181,26 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
</Button>
</div>
<div className="space-y-1">
<Label htmlFor="citation-formatted">
מראה מקום (כללי הציטוט האחיד)
</Label>
<Textarea
id="citation-formatted"
value={form.citation_formatted}
onChange={(e) =>
setForm({ ...form, citation_formatted: e.target.value })
}
rows={3}
dir="rtl"
className="font-mono text-sm"
placeholder='ערר (ועדות ערר ...) 1234/24 **עורר נ&apos; הוועדה המקומית** (נבו 1.2.2025)'
/>
<p className="text-[0.7rem] text-ink-muted">
הקף את שמות הצדדים בכפול-כוכבית <code className="font-mono">**שם**</code> להדגשה. שדה זה משמש את כפתור ההעתקה בעמוד הפסיקה.
</p>
</div>
<div className="grid grid-cols-2 gap-3">
<div className="space-y-1">
<Label htmlFor="case-name">שם קצר</Label>