Skip to content

eddie/browse-page-item-category-filter - #179

Merged
Arsh-S merged 2 commits into
mainfrom
eddie/item-category-filter
Nov 4, 2026
Merged

Arsh-S merged 2 commits into
mainfrom
eddie/item-category-filter

Conversation

@8ddieHu0314

@8ddieHu0314 8ddieHu0314 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Buyers can filter the browse page by item category (Desserts, Food, Drinks, Apparel, Others). This follows #175, which added the category field, and turns back on the Items filter that was hidden in 271325a.

Task: https://app.notion.com/p/Add-item-categories-into-browse-filter-4060ad723ce180baba40e6d3432ebcfa?v=a70ed4d4260644abbf58c725c46f01f2&source=copy_link

Changes

  • common: new BrowseFundraiserSchema = BasicFundraiserSchema + itemCategories: ItemCategory[], used only by the browse list. CompleteFundraiserSchema is unchanged.
  • backend: getAllFundraisers includes items: { select: { category: true } } and returns the distinct categories per fundraiser. GET /api/fundraiser stays one request with 4 queries (fundraisers, organizations, pickup events, items) however many fundraisers there are, and it doesn't bring back the per-fundraiser item calls removed in b206383.
  • frontend:
    • filterFundraisers keeps fundraisers with at least one item in a selected category.
    • The Items section in the filter menu and its chips are restored.
    • The category list comes from lib/item-categories, so labels and icons match the seller dropdown and buyer badges.

How to test

  1. Run pnpm assemble. common changed. There's no migration.
  2. Items default to Others, so first set a few categories with the seller item editor (Edit, then the pencil on an item).
  3. Open /buyer/browse (works signed out), open Filter, and tick Drinks under Items. The grid and calendar show only fundraisers selling a drink, and a Drinks chip appears. Removing the chip clears the filter.
  4. Tick a second category: fundraisers matching either one show. Add a club as well: a fundraiser must match both the club and a category.
  5. On a phone-sized window, open Filter, tick a category, then Apply.

Screenshots

Category.Filter.Demo.mp4

Checklist

  • Targets main
  • Runs locally with pnpm assemble and both dev servers
  • If schema.prisma changed: migration file is included and existing rows are backfilled
  • If common/ changed: pnpm build in common and both consumers updated
  • No .env* files, keys, or real user data in the diff or screenshots
  • I read every line of this diff and can explain it in review

Note

Off-sale items count toward a fundraiser's categories, since buyers still see them on the fundraiser page.

Adds BrowseFundraiserSchema (BasicFundraiserSchema plus itemCategories) for the browse list. getAllFundraisers includes only each item's category and returns the distinct values, so the list stays one request with a fixed number of queries. itemCategories defaults to [] so a frontend deployed before the backend still parses the response.
Restores the Items section in the filter menu and its chips (hidden in 271325a) and keeps fundraisers that sell at least one item in a selected category. The category list comes from lib/item-categories, so it matches the seller dropdown and the buyer badges.
@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
curaise Ready Ready Preview Oct 28, 2026 9:20am UTC

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 60216038-9c42-483b-8baf-3d8b8e7d2563

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@8ddieHu0314 8ddieHu0314 changed the title Filter the browse page by item category eddie/browse-page-item-category-filter Oct 28, 2026
@Arsh-S

Arsh-S commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks for working on this - Looks good, merging!

@Arsh-S
Arsh-S merged commit 87f4e4a into main Nov 4, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8995d3d4 Deployed Oct 28, 2026 by vercel[bot]
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