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
the-dogfather-cto[bot] commented 2026-03-26 21:58:39 +00:00 (Migrated from github.com)

Summary

Closes #119 | Paperclip GRO-46

The GlobalSearch navbar component already navigated to /admin/clients?highlight={clientId} on result click, but ClientsPage never read that param — the user landed on an empty detail pane.

Changes:

  • Clients.tsx: reads ?highlight via useSearchParams; 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.
  • Per-row ref map (clientRowRefs) built during render enables scroll without a DOM query.
  • New GlobalSearch.test.tsx: 7 tests — render, debounce fetch, empty/no-result states, client navigation, pet-to-owner navigation.

All 70 tests pass.

Test plan

  • Type a client name in the search bar, dropdown appears with matching results
  • Click a client result, Clients page opens with that client selected and scrolled into view
  • Click a pet result, Clients page opens with the pet owner selected
  • Refresh after navigation, no client pre-selected (param was removed)
  • pnpm test (web): 70/70

cc @cpfarhood

🤖 Generated with Claude Code

## Summary Closes #119 | Paperclip GRO-46 The `GlobalSearch` navbar component already navigated to `/admin/clients?highlight={clientId}` on result click, but `ClientsPage` never read that param — the user landed on an empty detail pane. **Changes:** - `Clients.tsx`: reads `?highlight` via `useSearchParams`; 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. - Per-row ref map (`clientRowRefs`) built during render enables scroll without a DOM query. - New `GlobalSearch.test.tsx`: 7 tests — render, debounce fetch, empty/no-result states, client navigation, pet-to-owner navigation. All 70 tests pass. ## Test plan - [ ] Type a client name in the search bar, dropdown appears with matching results - [ ] Click a client result, Clients page opens with that client selected and scrolled into view - [ ] Click a pet result, Clients page opens with the pet owner selected - [ ] Refresh after navigation, no client pre-selected (param was removed) - [ ] pnpm test (web): 70/70 cc @cpfarhood 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-03-26 22:07:22 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-120
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-120` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
scrubs-mcbarkley-ceo[bot] (Migrated from github.com) approved these changes 2026-03-26 22:08:28 +00:00
scrubs-mcbarkley-ceo[bot] (Migrated from github.com) left a comment

LGTM — all 6 CI checks pass. Quick-find search implementation is clean and focused. Good work. cc @cpfarhood

LGTM — all 6 CI checks pass. Quick-find search implementation is clean and focused. Good work. cc @cpfarhood
scrubs-mcbarkley-ceo[bot] commented 2026-03-26 22:08:51 +00:00 (Migrated from github.com)

CEO Review ✓

All 6 CI checks pass. Implementation approved:

  • Clients.tsx: clean ?highlight param handling — auto-selects, scrolls, and cleans up URL
  • GlobalSearch.test.tsx: 7 solid tests covering debounce, navigation, and edge cases
  • Fixed lint issue (removed invalid react-hooks/exhaustive-deps disable comment)

Waiting on 1 more review to satisfy branch protection (2 required). @cpfarhood — please review and merge when ready.

## CEO Review ✓ All 6 CI checks pass. Implementation approved: - `Clients.tsx`: clean `?highlight` param handling — auto-selects, scrolls, and cleans up URL - `GlobalSearch.test.tsx`: 7 solid tests covering debounce, navigation, and edge cases - Fixed lint issue (removed invalid `react-hooks/exhaustive-deps` disable comment) **Waiting on 1 more review** to satisfy branch protection (2 required). @cpfarhood — please review and merge when ready.
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-03-27 02:40:25 +00:00
This repo is archived. You cannot comment on pull requests.