fix(precedents): wrap citation column + extractor fills source_type
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m27s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m27s
Two follow-ups after running the metadata extractor on 403-17: 1. Library table: shadcn TableCell defaults to whitespace-nowrap and the table wrapper has overflow-x-auto, so the long citation forced a horizontal scrollbar inside the row. Override on the citation cell only — whitespace-normal + break-words + min/max-w to keep the column readable. Same for the case-name cell. Row aligns to top so wrapping doesn't push neighbours up. 2. Extractor now also fills source_type (court_ruling / appeals_committee). The previous round added decision_date_iso, precedent_level, and court but left source_type empty. Same closed-enum + merge-only-if-empty policy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ METADATA_EXTRACTION_PROMPT = """אתה מסייע משפטי בכיר. קרא א
|
||||
"subject_tags": ["תגיות", "נושא", "בעברית"],
|
||||
"decision_date_iso": "YYYY-MM-DD — תאריך מתן ההחלטה כפי שמופיע בטקסט (בכותרת או בחתימה הסופית). אם לא ניתן לזהות במדויק — מחרוזת ריקה.",
|
||||
"precedent_level": "אחד מ-4: 'עליון' / 'מנהלי' / 'ועדת_ערר_ארצית' / 'ועדת_ערר_מחוזית'. בחר לפי הערכאה שמסומנת בכותרת הפסק. אם לא ברור — מחרוזת ריקה.",
|
||||
"source_type": "אחד מ-2: 'court_ruling' (פסק דין של בית משפט — עליון/מנהלי) / 'appeals_committee' (החלטה של ועדת ערר). אם לא ברור — מחרוזת ריקה.",
|
||||
"court": "שם הערכאה כפי שהוא מופיע בכותרת (למשל 'בית המשפט העליון', 'בית המשפט המחוזי בירושלים בשבתו כבית משפט לעניינים מנהליים', 'ועדת הערר לתכנון ובניה פיצויים והיטלי השבחה — מחוז ירושלים'). מחרוזת ריקה אם לא ניתן לזהות."
|
||||
}
|
||||
|
||||
@@ -61,7 +62,8 @@ METADATA_EXTRACTION_PROMPT = """אתה מסייע משפטי בכיר. קרא א
|
||||
6. **subject_tags** — 3-7 תגיות בעברית, snake_case (חניה, קווי_בניין, שיקול_דעת, פגם_פרוצדורלי, סמכות, מועדים, פגיעה_במקרקעין, ירידת_ערך, תכנית_רחביה, מימוש_במכר, וכד'). שייך לתחום של ועדת ערר תכנון ובניה.
|
||||
7. **decision_date_iso** — תאריך מדויק בלבד. אם בטקסט יש "ניתנה היום, ט' באלול תשפ"א, 5 בספטמבר 2022" — הפלט: "2022-09-05".
|
||||
8. **precedent_level** — קבע לפי הערכאה: בית המשפט העליון = "עליון"; בית משפט מחוזי בשבתו כבית משפט לעניינים מנהליים = "מנהלי"; ועדת ערר ארצית = "ועדת_ערר_ארצית"; ועדת ערר מחוזית (כמו ועדות תכנון ובניה ירושלים/מחוז המרכז וכד') = "ועדת_ערר_מחוזית". השתמש ב-underscore כפי שמופיע — לא ברווח.
|
||||
9. **court** — מהכותרת הראשית של הפסק. ניסוח מלא (לא קיצור). מחרוזת ריקה אם לא ניתן לזהות.
|
||||
9. **source_type** — שני ערכים בלבד: "court_ruling" כשהמסמך הוא פסק דין/החלטה של בית משפט (עליון/בג"ץ/מנהלי/מחוזי); "appeals_committee" כשהמסמך הוא החלטה של ועדת ערר (ארצית או מחוזית). זה משלים את `precedent_level` — שני השדות צריכים להיות תואמים.
|
||||
10. **court** — מהכותרת הראשית של הפסק. ניסוח מלא (לא קיצור). מחרוזת ריקה אם לא ניתן לזהות.
|
||||
"""
|
||||
|
||||
|
||||
@@ -153,6 +155,10 @@ async def extract_metadata(case_law_id: UUID | str) -> dict:
|
||||
lvl = result["precedent_level"].strip()
|
||||
if lvl in {"עליון", "מנהלי", "ועדת_ערר_ארצית", "ועדת_ערר_מחוזית"}:
|
||||
out["precedent_level"] = lvl
|
||||
if isinstance(result.get("source_type"), str):
|
||||
st = result["source_type"].strip()
|
||||
if st in {"court_ruling", "appeals_committee"}:
|
||||
out["source_type"] = st
|
||||
if isinstance(result.get("court"), str):
|
||||
out["court"] = result["court"].strip()
|
||||
return out
|
||||
@@ -234,6 +240,11 @@ async def apply_to_record(
|
||||
if lvl:
|
||||
fields_to_update["precedent_level"] = lvl
|
||||
|
||||
if not (record.get("source_type") or "").strip():
|
||||
st = (suggested.get("source_type") or "").strip()
|
||||
if st:
|
||||
fields_to_update["source_type"] = st
|
||||
|
||||
if not (record.get("court") or "").strip():
|
||||
c = (suggested.get("court") or "").strip()
|
||||
if c:
|
||||
|
||||
@@ -83,11 +83,20 @@ function PrecedentRow({
|
||||
};
|
||||
|
||||
return (
|
||||
<TableRow className="border-rule hover:bg-gold-wash/30">
|
||||
<TableCell className="font-semibold text-navy text-right" dir="rtl">
|
||||
<TableRow className="border-rule hover:bg-gold-wash/30 align-top">
|
||||
<TableCell
|
||||
/* shadcn TableCell defaults to whitespace-nowrap which forces the
|
||||
* row wider than the container; for this column we want the long
|
||||
* citation to wrap onto a second line instead of triggering the
|
||||
* horizontal scroll on the table wrapper. min-w/max-w keeps the
|
||||
* column wide enough to avoid awkward 2-word lines while leaving
|
||||
* room for the other columns. */
|
||||
className="font-semibold text-navy text-right whitespace-normal break-words min-w-[280px] max-w-[420px] py-3"
|
||||
dir="rtl"
|
||||
>
|
||||
<span dir="auto">{cleanCitation(p.case_number)}</span>
|
||||
</TableCell>
|
||||
<TableCell className="text-ink">
|
||||
<TableCell className="text-ink whitespace-normal break-words max-w-[260px] py-3">
|
||||
<div className="font-medium">{cleanCitation(p.case_name)}</div>
|
||||
{p.court ? (
|
||||
<div className="text-[0.72rem] text-ink-muted">{p.court}</div>
|
||||
|
||||
Reference in New Issue
Block a user