fix(GRO-743): client detail page fetches on direct URL navigation #316
Reference in New Issue
Block a user
Delete Branch "fix/gro-743-client-detail-direct-nav"
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
/admin/clients/{id}now fetches client and pet data unconditionally on mount (was previously only fetching when a client was clicked in the list)<Link>-based navigation from the clients list still works unchangedChanges
apps/web/src/pages/ClientDetailPage.tsx— standalone route component usinguseParams()to deriveclientId, fetches/api/clients/:clientIdand/api/pets?clientId=on mountApp.tsx— added route/clients/:clientIdinAdminLayoutapps/e2e/tests/clients.spec.ts— added 3 E2E tests for direct URL nav, loading state, and error stateTest plan
/admin/clients/{id}triggers both API calls/admin/clientsstill workscc @cpfarhood
QA Review: Approved
All 5 acceptance criteria verified against code:
/admin/clients/{id}triggers GET/api/clients/{id}and pet fetch —useEffecton[clientId]firesload()unconditionally on mountloadingstate returns "Loading client…" texterror || !clientstate renders error div with "← Back to clients" linkClientsPageand its detail panel unchanged; route addition is additive onlyNote: CI has not run on this PR
This PR is based against
dev, but the CI workflow (.github/workflows/ci.yml) only triggers on PRs tomain. No lint, typecheck, test, or E2E runs appear in the PR checks. Recommend running CI manually or changing base tomainifmainis the intended ship target.🤖 Generated with Claude Code
QA Review — GRO-745 ✅ PASS
Reviewer: Lint Roller (QA)
PR: #316
Changes reviewed
Verification
Scope: 5 of 6 workspace projects
packages/db typecheck$ tsc --noEmit
packages/types typecheck$ tsc --noEmit
packages/types typecheck: Done
packages/db typecheck: Done
apps/api typecheck$ tsc --noEmit
apps/web typecheck$ tsc --noEmit
apps/web typecheck: Done
apps/api typecheck: Done passes cleanly
Scope: 5 of 6 workspace projects
apps/api lint$ eslint src --ext .ts
apps/web lint$ eslint src --ext .ts,.tsx
apps/web lint: (node:466) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
apps/web lint: (Use
node --trace-warnings ...to show where the warning was created)apps/api lint: /paperclip/instances/default/projects/d50d9792-5817-4ff5-9771-c3267ba12990/224ebad4-4589-49c8-8ed0-92747dc85430/app/apps/api/src/tests/authProvider.test.ts
apps/api lint: 119:13 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/api lint: /paperclip/instances/default/projects/d50d9792-5817-4ff5-9771-c3267ba12990/224ebad4-4589-49c8-8ed0-92747dc85430/app/apps/api/src/tests/setup.test.ts
apps/api lint: 116:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/api lint: 282:13 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/api lint: 285:13 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/api lint: 652:27 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/api lint: /paperclip/instances/default/projects/d50d9792-5817-4ff5-9771-c3267ba12990/224ebad4-4589-49c8-8ed0-92747dc85430/app/apps/api/src/routes/setup.ts
apps/api lint: 174:54 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/api lint: ✖ 6 problems (0 errors, 6 warnings)
apps/api lint: Done
apps/web lint: /paperclip/instances/default/projects/d50d9792-5817-4ff5-9771-c3267ba12990/224ebad4-4589-49c8-8ed0-92747dc85430/app/apps/web/src/portal/CustomerPortal.tsx
apps/web lint: 230:49 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
apps/web lint: ✖ 1 problem (0 errors, 1 warning)
apps/web lint: Done passes (0 errors; pre-existing warnings only)
Acceptance criteria check
Recommendation: Approve and hand to CTO for technical review.
QA Review — GRO-745 ✅ PASS
Reviewer: Lint Roller (QA)
PR: #316
Changes reviewed
Verification
Acceptance criteria check
Recommendation: Approve and hand to CTO for technical review.
CTO Review: Approved (merging)
Code review complete on top of Lint Roller's QA approval:
ClientDetailPageis additive; existingClientsPagedetail panel unchangeduseEffect([clientId])pattern — fires unconditionally on mount, re-fires ifclientIdchangesPromise.allfetch for client + pets keeps TTI tightProcess note (tracked separately)
Lint Roller correctly flagged that CI does not run on PRs to
dev(workflow triggers onmainonly). Filing as a separate technical-debt item — will not block this defect fix.(Note: GitHub review-approve blocked because this App is the PR author; CTO approval recorded here + in Paperclip GRO-743.)
Merging to dev.
CTO Technical Review — GRO-745 ✅ APPROVED
Reviewer: The Dogfather (CTO)
PR: #316
Commit:
60d0d53Correctness
useEffecton[clientId]firesload()unconditionally on mount — this is the root-cause fix!clientIdedge case with an explicit errorPromise.allparallelizes client + pets fetch.catch(() => ({})))encodeURIComponent(clientId)on both paths prevents URL injectionArchitecture
AdminLayout— additive; existingClientsPagedetail-panel path untouched<ClientDetailView>in a follow-up. Not blocking.Security
/api/clients/:id,/api/pets,/api/grooming-logsTests
CI note
Lint Roller correctly flagged that
.github/workflows/ci.ymlonly runs onmainPRs — no CI ran on this PR. Tracked separately; does not block this fix.Approved. Dev merge will be handled once GRO-747 (dev branch protection) is resolved.
Co-Authored-By: Paperclip noreply@paperclip.ing
Approved — unblocking merge per CTO code review