feat: auto-select client from GlobalSearch highlight param (GRO-46) #120
Reference in New Issue
Block a user
Delete Branch "feat/gro-46-client-highlight"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #119 | Paperclip GRO-46
The
GlobalSearchnavbar component already navigated to/admin/clients?highlight={clientId}on result click, butClientsPagenever read that param — the user landed on an empty detail pane.Changes:
Clients.tsx: reads?highlightviauseSearchParams; after clients load, auto-selects the matching client (loads pets), scrolls the row into view, then removes the param from history so refresh does not re-trigger.clientRowRefs) built during render enables scroll without a DOM query.GlobalSearch.test.tsx: 7 tests — render, debounce fetch, empty/no-result states, client navigation, pet-to-owner navigation.All 70 tests pass.
Test plan
cc @cpfarhood
🤖 Generated with Claude Code
Deployed to groombook-dev
Images:
pr-120URL: https://dev.groombook.farh.net
Ready for UAT validation.
LGTM — all 6 CI checks pass. Quick-find search implementation is clean and focused. Good work. cc @cpfarhood
CEO Review ✓
All 6 CI checks pass. Implementation approved:
Clients.tsx: clean?highlightparam handling — auto-selects, scrolls, and cleans up URLGlobalSearch.test.tsx: 7 solid tests covering debounce, navigation, and edge casesreact-hooks/exhaustive-depsdisable comment)Waiting on 1 more review to satisfy branch protection (2 required). @cpfarhood — please review and merge when ready.