Skip to content

MSPCA-51 Add navbar to the app layout - #31

Merged
Juwang110 merged 18 commits into
pk/mspca-46-animal-availability-frontend-endpointfrom
jw/mspca-51-navbar
Nov 13, 2026
Merged

Juwang110 merged 18 commits into
pk/mspca-46-animal-availability-frontend-endpointfrom
jw/mspca-51-navbar

Conversation

@Juwang110

@Juwang110 Juwang110 commented Nov 6, 2026 •

Copy link
Copy Markdown

ℹ️ Issue

Closes MSPCA-51

Stacked on #30 (MSPCA-46). Once #30 merges, the base switches to main.

📝 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.

  1. Navbar component (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". Below Chakra's md breakpoint the logo is 142×64, the avatar is 50px and "My Profile" is hidden, matching the mobile design.
  2. Volunteer info comes from GET /api/volunteers/:volunteerId through a new apiClient.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.

Important Notes

  • Avatar colors are the Trello label colors (No Restrictions, Cat-Free Home, etc.), per Matt, chosen by volunteerId % 7. They're read from colors.trello in theme.ts, so changing a label color there updates the avatars too.
  • "My Profile" is a button that doesn't go anywhere yet, because there's no profile page.

✔️ Verification

  • Lint and typecheck are clean.
  • I ran the app in a browser at 1440px and 402px wide and compared it to the Figma components. Sizes and positions match, there's no horizontal scroll on mobile, and the empty Animal Availability page no longer scrolls. The backend wasn't running, so the volunteer response was stubbed with the same shape the endpoint returns.
  • To try it, run the backend and frontend and open http://localhost:4200/animal-availability?volunteerId=1. If COGNITO_USER_POOL_ID and COGNITO_CLIENT_ID are set in .env, the sign-in form shows first, so comment them out and restart the dev server.
image

🏕️ (Optional) Future Work / Notes

🤖 Generated with Claude Code

Juwang110 and others added 6 commits November 4, 2026 22:27
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>
@Juwang110
Juwang110 requested review from dburkhart07 and shreeyaadhikari and removed request for shreeyaadhikari November 9, 2026 23:50
Juwang110 and others added 2 commits November 9, 2026 18:50
Frontend component tests aren't needed. app.spec.tsx is restored to its
original scaffold version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-51-navbar

Resolve conflicts with the updated animal availability UI:
- Volunteer type moves to types.ts alongside the other API types
- AnimalModal keeps the new design and uses useVolunteerId
- AnimalAvailability drops the restyled PageHeader in favor of Navbar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juwang110 and others added 3 commits November 9, 2026 19:35
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>
@Juwang110
Juwang110 marked this pull request as ready for review November 10, 2026 00:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!!! all small things. never cease to amaze me justin

Comment thread apps/frontend/src/utils/volunteer.ts Resolved
Comment thread apps/frontend/src/app.tsx Resolved
Comment thread apps/frontend/src/components/Navbar.tsx Resolved
Comment thread apps/frontend/src/components/Navbar.tsx Resolved
Comment thread apps/frontend/src/components/Navbar.tsx Resolved
Juwang110 and others added 5 commits November 10, 2026 16:09
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rline

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Remove the stale greeting test and stub apiClient so no network call is made.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…_tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-51-navbar

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@pujitakalinadhabhotla pujitakalinadhabhotla left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me nothing else to add!

Per design, avatar colors come from the theme's Trello label palette, so
changing those colors in theme.ts updates avatars too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Juwang110
Juwang110 merged commit e0b7c84 into pk/mspca-46-animal-availability-frontend-endpoint Nov 13, 2026
12 checks passed
@Juwang110
Juwang110 deleted the jw/mspca-51-navbar branch November 13, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants