Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Hi @a1-su! I was just testing the filtering logic, and I noticed something:
|
There was a problem hiding this comment.
Pull request overview
Implements the Volunteer Table filtering UI (modal + filter bar) and wires it into backend-driven filtering, including the default opt_in_communication filter.
Changes:
- Added filter modal + filter bar UI and integrated debounced filter application into
VolunteersTable. - Updated backend filtering to support role-type-specific fields (
current_roles,prior_roles,future_interests) and return filtered volunteer IDs. - Added the
opt_in_communicationcolumn/tag handling and adjusted styling/theme variables.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/lib/api/getVolunteersByMultipleColumns.test.ts | Updates tests for new role field names + new return shape (IDs) |
| src/styles/variables.css | Tweaks purple palette values |
| src/lib/api/getVolunteersTable.ts | Orders volunteer rows by id |
| src/lib/api/getVolunteersByMultipleColumns.ts | Adds role-type-specific filtering and returns volunteer IDs |
| src/hooks/useDebounce.ts | New debounce hook (default 400ms) |
| src/components/volunteers/volunteerColumns.tsx | New centralized column + filterable-column config |
| src/components/volunteers/utils.ts | Tag color mapping updated (incl. Yes/No) |
| src/components/volunteers/useCellSelection.ts | Makes CellCoords internal-only |
| src/components/volunteers/types.ts | Changes opt_in_communication presentation type for UI tags |
| src/components/volunteers/VolunteersTable.tsx | Integrates filtering UI/state + debounced backend filtering |
| src/components/volunteers/FilterModal.tsx | New modal component for creating/editing a filter |
| src/components/volunteers/FilterBar.tsx | New “Matches All/Any” bar + per-filter editing entry points |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| import React, { useState } from "react"; | ||
| import { FilterTuple } from "@/lib/api/getVolunteersByMultipleColumns"; | ||
| import { ChevronDown, Plus } from "lucide-react"; | ||
| import { clsx } from "clsx"; |
| import { FilterTuple } from "@/lib/api/getVolunteersByMultipleColumns"; | ||
| import { Trash2 } from "lucide-react"; | ||
| import { VolunteerTag } from "./VolunteerTag"; | ||
| import { clsx } from "clsx"; |
There was a problem hiding this comment.
Pull request overview
Implements the Volunteers Table filter modal + filter bar UI (per Figma/issues), adds a default opt_in_communication filter, and updates backend filtering to support role type–specific filters (prior/current/future interest).
Changes:
- Add
FilterModal+FilterBarcomponents and wire them intoVolunteersTablewith debounced backend filtering. - Refactor volunteer table columns into a shared config (
volunteerColumns.tsx) and add a reusableuseDebouncehook. - Update
getVolunteersByMultipleColumnsto handle role types and return filtered volunteer ids; update tests accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/lib/api/getVolunteersByMultipleColumns.test.ts | Updates unit/integration tests for new role field names + ids-only return shape. |
| src/styles/variables.css | Tweaks purple theme variables to better match Figma. |
| src/lib/api/getVolunteersTable.ts | Adds deterministic ordering to table fetch results. |
| src/lib/api/getVolunteersByMultipleColumns.ts | Adds server action directive, role-type aware filtering, returns volunteer ids, updates validation. |
| src/hooks/useDebounce.ts | New debounce hook used to reduce backend calls. |
| src/components/volunteers/volunteerColumns.tsx | Centralizes column definitions + filterable column metadata. |
| src/components/volunteers/utils.ts | Updates tag coloring logic (including Yes/No coloring). |
| src/components/volunteers/useCellSelection.ts | Minor type visibility change (internalizes CellCoords). |
| src/components/volunteers/types.ts | Adjusts UI Volunteer type to support table display fields (incl. opt-in display). |
| src/components/volunteers/VolunteersTable.tsx | Integrates filter modal/bar, default opt-in filter, and debounced backend-driven filtering. |
| src/components/volunteers/FilterModal.tsx | New modal for selecting filter column + values (with outside-click apply behavior). |
| src/components/volunteers/FilterBar.tsx | New bar showing active filters with edit/add interactions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Implements the Filter Modal for the Volunteer Table, related to issue #73. It is currently a draft as it depends on the Volunteer Table itself. Also closes the
opt_in_communicationticket.Screenshots
Description / Notes
getVolunteersTableendpoint to get the initial table data, and implements the filtering by using thegetVolunteersByMultipleColumnsendpoint, the latter of which was modified to account for the different types of roles including prior, current and future interestgetVolunteersTableitself was slightly modified as well to return the rows in order of the ids, for the demonstrationQuestions and Comments
Rolestable itself in the Supabase, which seems unintuitive when the type attribute is supposed to specify whether an individual volunteer has had that role in the past, has it currently, or is interested in it in the future, i.e. type is in relation to each volunteer themselvesRolestable to represent the 2 "Chat Counsellor" roles, one that is of apriortype and the other that is of acurrenttypeVolunteerRoles, we would only need a single role to represent this scenario and the type attribute could instead be in the relation between volunteer and rolegetVolunteersByMultipleColumnsonly return the rows in theVolunteerstable, and not any of the associated cohorts or roles of each individual volunteer which means instead of directly using their return values for the table, we are filtering the ids of the volunteers that are returned and using the data returned bygetVolunteersTableto show the data from the filtered volunteer's idsgetVolunteersByMultipleColumnsendpoint, when we could simply be returning only the ids of the filtered volunteersis_active; if a role is not active, should the tag colouring behave differently, such as being greyed out?Volunteerstable only allows lowercase versions of "member," "volunteer," and "staff"; in addition, the column itself is nullable, but the check does not allow that eithergetRolesandgetCohortshave not been merged yet, the current implementation searches for possible roles and cohorts in the returned data fromgetVolunteersTableinstead