From 5745d36bb4f3df0417f838112cf7e5cec3845b3d Mon Sep 17 00:00:00 2001 From: Chaim Date: Mon, 8 Jun 2026 08:14:23 +0000 Subject: [PATCH] =?UTF-8?q?feat(digests-ui):=20publication=20filter=20+=20?= =?UTF-8?q?'=D7=9E=D7=90=D7=9E=D7=A8'/source=20badges=20for=20bulletins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit משלים את #154 בצד-לקוח: - פילטר "מקור" בדף /digests (כל המקורות / כל יום / עו"ד על נדל"ן) — backend: list_digests + /api/digests מקבלים publication. - DigestCard: תג "מאמר" ל-digest_kind='article', ו-chip מקור לפרסום שאינו 'כל יום'. build (webpack) עובר, lint נקי. digests = hand-written types (אין api:types). Co-Authored-By: Claude Opus 4.8 (1M context) --- mcp-server/src/legal_mcp/services/db.py | 8 +++++++- .../src/legal_mcp/services/digest_library.py | 3 ++- web-ui/src/components/digests/digest-card.tsx | 10 ++++++++++ .../components/digests/digest-list-panel.tsx | 19 +++++++++++++++++++ web-ui/src/lib/api/digests.ts | 3 +++ web/app.py | 3 ++- 6 files changed, 43 insertions(+), 3 deletions(-) diff --git a/mcp-server/src/legal_mcp/services/db.py b/mcp-server/src/legal_mcp/services/db.py index 896372d..43816e8 100644 --- a/mcp-server/src/legal_mcp/services/db.py +++ b/mcp-server/src/legal_mcp/services/db.py @@ -3800,11 +3800,13 @@ async def list_digests( concept_tag: str = "", linked: bool | None = None, search: str = "", + publication: str = "", limit: int = 100, offset: int = 0, ) -> list[dict]: """List digests with simple filters. linked=True/False filters on whether - the underlying ruling is in the library yet (INV-DIG3 gap surfacing).""" + the underlying ruling is in the library yet (INV-DIG3 gap surfacing). + publication filters the source ('כל יום' daily vs 'עו"ד על נדל"ן' monthly).""" pool = await get_pool() conditions: list[str] = [] params: list = [] @@ -3813,6 +3815,10 @@ async def list_digests( conditions.append(f"practice_area = ${idx}") params.append(practice_area) idx += 1 + if publication: + conditions.append(f"publication = ${idx}") + params.append(publication) + idx += 1 if concept_tag: conditions.append(f"concept_tag ILIKE ${idx}") params.append(f"%{concept_tag}%") diff --git a/mcp-server/src/legal_mcp/services/digest_library.py b/mcp-server/src/legal_mcp/services/digest_library.py index 6371139..af9bfa5 100644 --- a/mcp-server/src/legal_mcp/services/digest_library.py +++ b/mcp-server/src/legal_mcp/services/digest_library.py @@ -404,12 +404,13 @@ async def list_digests( concept_tag: str = "", linked: bool | None = None, search: str = "", + publication: str = "", limit: int = 100, offset: int = 0, ) -> list[dict]: return await db.list_digests( practice_area=practice_area, concept_tag=concept_tag, linked=linked, - search=search, limit=limit, offset=offset, + search=search, publication=publication, limit=limit, offset=offset, ) diff --git a/web-ui/src/components/digests/digest-card.tsx b/web-ui/src/components/digests/digest-card.tsx index 434eeb6..f94beeb 100644 --- a/web-ui/src/components/digests/digest-card.tsx +++ b/web-ui/src/components/digests/digest-card.tsx @@ -44,6 +44,11 @@ export function DigestCard({ יומון {digest.yomon_number} )} + {digest.publication && digest.publication !== "כל יום" && ( + + {digest.publication} + + )} {digest.digest_date && · {formatDate(digest.digest_date)}} {digest.practice_area && ( · {practiceAreaLabel(digest.practice_area)} @@ -53,6 +58,11 @@ export function DigestCard({ עדכון )} + {digest.digest_kind === "article" && ( + + מאמר + + )} {digest.extraction_status !== "completed" && ( {digest.extraction_status === "pending" ? "ממתין לעיבוד" : digest.extraction_status} diff --git a/web-ui/src/components/digests/digest-list-panel.tsx b/web-ui/src/components/digests/digest-list-panel.tsx index af32d2f..baca1a7 100644 --- a/web-ui/src/components/digests/digest-list-panel.tsx +++ b/web-ui/src/components/digests/digest-list-panel.tsx @@ -18,13 +18,21 @@ import { DigestUploadDialog } from "./digest-upload-dialog"; type LinkedFilter = "all" | "linked" | "unlinked"; +const PUBLICATIONS = [ + { value: "_all", label: "כל המקורות" }, + { value: "כל יום", label: "כל יום (יומי)" }, + { value: 'עו"ד על נדל"ן', label: 'עו"ד על נדל"ן (חודשי)' }, +]; + export function DigestListPanel() { const [practiceArea, setPracticeArea] = useState(""); const [linked, setLinked] = useState("all"); + const [publication, setPublication] = useState("_all"); const filters: DigestListFilters = { practiceArea: practiceArea || undefined, linked: linked === "all" ? undefined : linked === "linked", + publication: publication === "_all" ? undefined : publication, limit: 200, }; const { data, isLoading, error } = useDigests(filters); @@ -66,6 +74,17 @@ export function DigestListPanel() { +
+ + +