8000 [MBL-2303] Subcategory support for search by stevestreza-ksr · Pull Request #2403 · kickstarter/ios-oss · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Merged
merged 6 commits into from
Apr 25, 2025

Conversation

stevestreza-ksr
Copy link
Contributor

📲 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.

Copy link
Contributor
@amy-at-kickstarter amy-at-kickstarter left a 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))
Copy link
Contributor

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 }
Copy link
Contributor

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 }
Copy link
Contributor

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.
Copy link
Contributor

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

@amy-at-kickstarter amy-at-kickstarter force-pushed the stevestreza/search/subcats2 branch from 9d3a94d to 92c34eb Compare April 25, 2025 15:48
@amy-at-kickstarter amy-at-kickstarter changed the base branch from main to feat/adyer/mbl-2220/split-vm April 25, 2025 15:48
Base automatically changed from feat/adyer/mbl-2220/split-vm to main April 25, 2025 17:25
@stevestreza-ksr stevestreza-ksr merged commit 0adeea4 into main Apr 25, 2025
5 checks passed
@stevestreza-ksr stevestreza-ksr deleted the stevestreza/search/subcats2 branch April 25, 2025 17:55
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.

4 participants
0