feat(ui): filter beans by roast type and brews by method - #35
Merged
Conversation
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.
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: 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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two new filters on the list pages, both client-side like the existing ones.
Beans — roast type. Reuses
ROAST_TYPESfromlib/domain.tsrather 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
brewMethodsListBrewMethodsquery 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 lintandnpm run buildpass.