Skip to content

feat(ui): filter beans by roast type and brews by method - #35

Merged
jpizquierdo merged 2 commits into
mainfrom
feat/beans-brews-filters
Jul 28, 2026
Merged

feat(ui): filter beans by roast type and brews by method#35
jpizquierdo merged 2 commits into
mainfrom
feat/beans-brews-filters

Conversation

@jpizquierdo

Copy link
Copy Markdown
Owner

Two new filters on the list pages, both client-side like the existing ones.

Beans — roast type. Reuses ROAST_TYPES from lib/domain.ts rather than a second hardcoded list, so it stays in sync with the bean dialog. Includes Unknown, which is the default for a bean nobody has labelled — that makes it a way to find the ones still missing the field.

Brews — method. Filters by the specific method (V60, Espresso, AeroPress…), from the same brewMethodsListBrewMethods query the page already loads to name each card.

Both pages had a Clear button that only reset the roaster. On Beans it now resets both filters (it previously did not know about roast type at all), and on Brews it already reset roaster + bean, so method joined that. The button appears as soon as any of them is active.

npm run lint and npm run build pass.

Both reuse the existing Clear button, which now resets every filter on the
page instead of just the roaster.
The two brew toggles read from data the page already loads: the current
user for "Mine", and the my-tastings map behind each card's score for
"Not tasted". Origins are derived from the beans in the log, so the
dropdown never offers a value that matches nothing.
@jpizquierdo

Copy link
Copy Markdown
Owner Author

Added the three follow-up filters to this PR.

Brews — Mine and Not tasted, as toggle buttons rather than selects, since both are binary and the bar is already busy. Neither needs a new request: Mine compares against the current user the page loads for its edit/delete permissions, and Not tasted reuses myTastingByBrew, the map already built to print your own score on each card.

Beans — origin. The options are derived from the beans actually in the log rather than a fixed country list, so the dropdown can never offer a value that matches nothing.

Clear resets all of them on both pages.

@jpizquierdo
jpizquierdo merged commit 188582d into main Jul 28, 2026
2 checks passed
@jpizquierdo
jpizquierdo deleted the feat/beans-brews-filters branch July 28, 2026 14:56
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