Skip to content

implement volunteer scoped availability settings content#187

Open
jansm04 wants to merge 5 commits intomainfrom
159-availability-settings-content
Open

implement volunteer scoped availability settings content#187
jansm04 wants to merge 5 commits intomainfrom
159-availability-settings-content

Conversation

@jansm04
Copy link
Contributor

@jansm04 jansm04 commented Mar 2, 2026

Implemented as per #159.

One note - I added an "unsaved" badge to the availability input so users know that only the "save changes" button saves their availability and not the "done" button when editing the time slots. Another option is to have it so that "done" also saves the availability, and then I can get rid of the badge. Or something else. Lmk what u think

image image image

@greptile-apps
Copy link

greptile-apps bot commented Mar 2, 2026

Greptile Summary

Implements volunteer-scoped availability settings with a well-structured form approach. The PR reorganizes the availability feature into dedicated components, adds a new preferred time commitment field, and extends the availability grid to show all 24 hours instead of just 9-18.

Key Changes:

  • Created new form architecture with provider pattern for availability settings
  • Added "Unsaved" badge to clarify that grid edits aren't saved until "Save Changes" is clicked
  • Extended availability time range from 9am-6pm to full 24-hour display
  • Moved preferredTimeCommitmentHours from profile update to availability update API
  • Increased dialog width to 64rem to better accommodate the expanded layout
  • Properly integrated form validation with zod schema

Minor Issue:

  • One syntax issue with equality operator (== vs ===) on line 42 of availability-input.tsx

Confidence Score: 4/5

  • This PR is safe to merge with one minor syntax fix needed
  • Well-structured implementation with proper form handling, validation, and API changes. The only issue is a minor syntax preference (== vs ===) that should be fixed before merging. The code follows good patterns with form providers, proper error handling, and cache invalidation.
  • Only src/components/profile/availability-input.tsx needs the equality operator fix on line 42

Important Files Changed

Filename Overview
src/components/profile/availability-input.tsx Extended time range to 24 hours, added unsaved changes badge, renamed Save to Done button; minor syntax issue with equality operator
src/components/settings/pages/availability/availability-section.tsx New component integrating availability input with form and time commitment field
src/components/settings/pages/availability/availability-settings-content.tsx New main content component orchestrating data fetching, form state, and submission logic
src/models/api/volunteer.ts Moved preferredTimeCommitmentHours field from profile to availability update schema
src/server/services/entity/volunteerService.ts Refactored to accept full input object and properly destructure for database update

Last reviewed commit: 83e74be

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

jansm04 and others added 3 commits March 1, 2026 17:20
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

1 participant