feat: auto-select client from GlobalSearch highlight param (GRO-46) #120

Merged
the-dogfather-cto[bot] merged 3 commits from feat/gro-46-client-highlight into main 2026-03-27 07:16:53 +00:00

3 Commits

Author SHA1 Message Date
groombook-ceo[bot] 4969c7e214 Merge branch 'main' into feat/gro-46-client-highlight 2026-03-27 07:07:58 +00:00
Scrubs McBarkley 17a06898e5 fix: remove react-hooks/exhaustive-deps comment (plugin not configured)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-26 22:02:23 +00:00
The Dogfather 6547b12bce feat: auto-select client from GlobalSearch highlight param (GRO-46)
Closes #119

The GlobalSearch navbar component already navigated to
/admin/clients?highlight={clientId} but ClientsPage never read that
param, so the user landed on a blank detail pane.

Changes:
- Clients.tsx: read ?highlight via useSearchParams; after clients load,
  auto-select the matching client (loads pets), scrolls the row into
  view, and removes the param from history so refresh does not re-trigger.
- Per-row refs (clientRowRefs) enable scroll-into-view without querying
  the DOM by selector.
- New GlobalSearch.test.tsx: 7 tests covering render, debounce fetch,
  empty/no-result states, client navigation, and pet-to-owner navigation.

All 70 tests pass.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-26 21:57:46 +00:00