Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Page render errors are now caught by a nested errorElement under the layout, so the navbar stays visible. The layout is a full-height column and the availability page fills the remaining space instead of 100vh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- parseVolunteerId rejects IDs above Number.MAX_SAFE_INTEGER, which previously turned into values like 1e+23 - Navbar logs a console warning when the volunteer request fails - Restore the console.error spy in app.error.spec Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ℹ️ Issue
Closes MSPCA-51
📝 Description
Adds the site navbar from the Figma header component: the MSPCA logo on the left, and the volunteer's avatar and "My Profile" on the right. It's rendered once in a shared layout, so every page gets it without importing it. Until sign-in exists, the current volunteer comes from a
?volunteerId=query param, e.g./animal-availability?volunteerId=1.Navbarcomponent (components/Navbar.tsx), built from the final "Header desktop" / "Header mobile" components rather than the older frame linked in the ticket. Desktop is 120px tall with a 196×88 logo, a 66px avatar and "My Profile", which underlines on hover. Below Chakra'smdbreakpoint the logo is 142×64, the avatar is 50px and "My Profile" is hidden, matching the mobile design.GET /api/volunteers/:volunteerIdthrough a newapiClient.getVolunteer. The avatar shows the volunteer's initials on a color picked from their ID, so each volunteer always gets the same color. With no ID, an invalid one (abc,0,-3, or a number too large to be a real ID), or a failed request, the avatar is a plain gray circle. A failed request also logs a console warning.containers/Layout.tsx. Unknown URLs render a "Page not found" message under the navbar instead of a blank error page, and if a page crashes, its error shows under the navbar too.useVolunteerId()(utils/useVolunteerId.ts) is the one place that reads the ID from the URL, so swapping it for the signed-in user later is a one-file change.AnimalModalnow uses it instead of the hardcodedCURRENT_VOLUNTEER_ID = 1, and its Apply button is disabled when there's no ID.PageHeaderfrom the Animal Availability page, since the navbar replaces it. The page now fills the space under the navbar instead of being100vhtall, which made it always scroll.Decisions open to review:
volunteerId % 6). Figma only has the one purple, so I'll swap in Matt's colors when we have them. They're a single list inutils/volunteer.ts.✔️ Verification
AnimalModalsending the URL's ID. All 31 frontend tests pass, and lint and typecheck are clean.nx test frontendis still broken on this branch, as onmain(parseCLI is not a function), so I rannpx vitest runinapps/frontendinstead. The oldapp.spec.tsx"Welcome frontend" test was replaced with the route tests.http://localhost:4200/animal-availability?volunteerId=1. IfCOGNITO_USER_POOL_IDandCOGNITO_CLIENT_IDare set in.env, the sign-in form shows first, so comment them out and restart the dev server.🏕️ (Optional) Future Work / Notes
?volunteerId=and request a match as another volunteer. The old hardcoded1had the same problem. The real fix is forPOST /matchesto take the volunteer from the Cognito token instead of the request body, which fits with the sign-in ticket.?volunteerId=isn't carried over when you navigate within the app. There are no in-app links yet, so it doesn't matter today, and sign-in will replace it.app.spec.tsxlogs a Reactact()warning from the Animal Availability page's data load. The tests still pass.🤖 Generated with Claude Code