diff --git a/frontend/app/trees/[id]/page.tsx b/frontend/app/trees/[id]/page.tsx index e533e59..ba31b7f 100644 --- a/frontend/app/trees/[id]/page.tsx +++ b/frontend/app/trees/[id]/page.tsx @@ -268,6 +268,7 @@ export default function FamilyViewPage() { const matches = search ? sorted.filter((p) => (p.primary_name ?? "").toLowerCase().includes(search.toLowerCase())) : sorted; + const shown = matches.slice(0, 200); // cap DOM nodes; refine search to narrow return (
@@ -325,32 +326,44 @@ export default function FamilyViewPage() {
- {/* Searchable index of everyone in the tree */} + {/* Scrollable, searchable people directory (scales to large trees) */}
-
-

All people ({people.length})

+
+

People ({people.length})

setSearch(e.target.value)} />
-
- {matches.map((p) => ( - - ))} -
+ +
+ {shown.length === 0 ? ( +
No matches.
+ ) : ( + shown.map((p, i) => ( + + )) + )} +
+ {matches.length > shown.length && ( +
+ Showing {shown.length} of {matches.length} — refine your search to narrow. +
+ )} +
);