From d9b57f28e2dfae460af5c3deceb1cc863f1c7dd8 Mon Sep 17 00:00:00 2001 From: Silo Server Developer Date: Thu, 28 May 2026 04:23:10 +0200 Subject: [PATCH] style(admin): prettier-format match dialog; reset unmatched page in onChange Run prettier over the Tooltip-wrapped poster JSX, and reset the unmatched-items page in the search input's onChange rather than a useEffect (avoids the react-hooks/set-state-in-effect warning / cascading renders). Co-Authored-By: Claude Opus 4.7 (1M context) --- web/src/components/MatchItemDialog.tsx | 124 ++++++++++++------------- web/src/pages/AdminLibraries.tsx | 13 ++- 2 files changed, 68 insertions(+), 69 deletions(-) diff --git a/web/src/components/MatchItemDialog.tsx b/web/src/components/MatchItemDialog.tsx index f83bf702..7abd52e0 100644 --- a/web/src/components/MatchItemDialog.tsx +++ b/web/src/components/MatchItemDialog.tsx @@ -172,69 +172,69 @@ export default function MatchItemDialog({ item, open, onOpenChange }: MatchItemD
-
- {candidates.map((candidate, index) => { - const candidateKey = Object.entries(candidate.provider_ids) - .map(([k, v]) => `${k}-${v}`) - .join("_"); - return ( - - ); - })} -
+ + ); + })} +
)} diff --git a/web/src/pages/AdminLibraries.tsx b/web/src/pages/AdminLibraries.tsx index 08a5e7f9..5097a979 100644 --- a/web/src/pages/AdminLibraries.tsx +++ b/web/src/pages/AdminLibraries.tsx @@ -1666,12 +1666,6 @@ function UnmatchedItemsSection() { const rangeEnd = Math.min((clamped + 1) * UNMATCHED_PAGE_SIZE, total); const items = data?.items ?? []; - // The search is applied server-side (spans the whole table, not just this - // page); reset to the first page whenever the debounced query changes. - useEffect(() => { - setPage(0); - }, [debouncedSearch]); - // Hide the section only when there are genuinely no unmatched items and no // active search — keep it mounted while searching so the box and the // "no matches" state stay visible even when a query returns nothing. @@ -1700,7 +1694,12 @@ function UnmatchedItemsSection() { setSearch(e.target.value)} + onChange={(e) => { + // Search is server-side and spans the whole table; jump back to + // the first page so results start at the top as the query changes. + setSearch(e.target.value); + setPage(0); + }} className="h-8 pl-8 text-xs" />