-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[MBL-2303] Subcategory support for search #2403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
.id(subcategory.id) | ||
} | ||
} | ||
.padding(EdgeInsets(top: 4, leading: 24, bottom: 16, trailing: 24)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe not super useful since this is all contained in this ViewBuilder, but a constant to keep track of these values (as well as the FlowLayout spacing values above) might be helpful in the future.
@@ -46,18 +51,24 @@ class FilterCategoryViewModel<T: FilterCategory>: FilterCategoryViewModelType { | |||
.assign(to: &self.$canReset) | |||
|
|||
self.selectedCategorySubject | |||
.map { $0?.0 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: naming these instead of going with the short hand could make this easier to review in the future.
.receive(on: RunLoop.main) | ||
.assign(to: &self.$currentCategory) | ||
|
||
self.selectedCategorySubject | ||
.map { $0?.1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same shorthand suggestion as above
// FIXME: https://kickstarter.atlassian.net/browse/MBL-2384 | ||
// This snapshot test looks wrong, the UI in the app does not have the lines | ||
// along the left and right sides of the button. This is consistent with | ||
// other uses of SearchFiltersPillStyle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is so interesting
9d3a94d
to
92c34eb
Compare
📲 What
Screen.Recording.2025-04-23.at.14.05.19.mov
This PR adds subcategories to the search filters view, and updating the the search results page with the results of that filter.
🤔 Why
People wanna filter stuff!
🛠 How
The model for determining selection was updated to include both the selected category and an optional subcategory. This drives the filter selection UI, and determines which pieces to show and highlight.
This is then returned as a category to the existing search API and root level filter view. This handles updating all of the UI correctly.