From dd0312e457cc0fa4300819e124e36c4b1f068833 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 20 Jun 2026 13:34:36 +0000 Subject: [PATCH] fix(missing-precedents): load full set so accordion counts match the header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The table fetched limit:200 while the header shows the true open count (~497, via a separate COUNT). With accordion grouping this became visible: sections summed to exactly 200 (e.g. 16 chair / 173 digest / 11 other) — and 90 of the 106 committee rows (the high-value "cited by Dafna" ones) were hidden past row 200. True buckets: chair 106 / digest 328 / other 63. - web-ui: list limit 200 → 1000 so all open rows load; accordion section counts (computed from the loaded set) now equal the header total. - backend: list cap 500 → 2000 to allow it (response stays a few hundred KB). Logic/data only — no visual change (bug-fix exception to the design gate). tsc --noEmit clean; py_compile clean. Follow-up: when the backlog (digests grow daily) approaches the cap, move to server-side per-bucket counts + pagination/virtualization (design gate). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../missing-precedents/missing-precedents-table.tsx | 6 +++++- web/app.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web-ui/src/components/missing-precedents/missing-precedents-table.tsx b/web-ui/src/components/missing-precedents/missing-precedents-table.tsx index a04d4dc..594608d 100644 --- a/web-ui/src/components/missing-precedents/missing-precedents-table.tsx +++ b/web-ui/src/components/missing-precedents/missing-precedents-table.tsx @@ -141,7 +141,11 @@ export function MissingPrecedentsTable({ status, q, legalTopic }: Props) { status: status === "" ? undefined : status, q, legalTopic, - limit: 200, + // Load the full set so the accordion section counts (chair/digest/other) + // reflect the real totals — at limit:200 the page showed only the first + // page (e.g. 16 of 106 committee rows) while the header showed the true + // count, so the sections didn't sum to it. Backend caps at 2000. + limit: 1000, }); const del = useDeleteMissingPrecedent(); diff --git a/web/app.py b/web/app.py index e1ffbb5..07c6974 100644 --- a/web/app.py +++ b/web/app.py @@ -7877,7 +7877,7 @@ async def missing_precedents_list( case_id=case_uuid, legal_topic=legal_topic.strip() or None, q=q.strip() or None, - limit=max(1, min(int(limit), 500)), + limit=max(1, min(int(limit), 2000)), offset=max(0, int(offset)), ) # Counters useful for the sidebar badge.