8000 MBL-2220: (Part one) Update search filters and search view models to support phase 2 search features by amy-at-kickstarter · Pull Request #2402 · kickstarter/ios-oss · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MBL-2220: (Part one) Update search filters and search view models to support phase 2 search features #2402

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 4 commits into from
Apr 24, 2025

Conversation

amy-at-kickstarter
Copy link
Contributor

📲 What

Make some updates to SearchViewModel and SearchFiltersUseCase for the new parent filter page:

  • Support resetting individual pages of the filter modal
  • Rename SearchFilterModalType case .all to .allFilters for clarity
  • Rename clearOptions to clearedQueryText to differentiate clearing the search query from clearing filters
  • Update SearchFiltersUseCaseTests to test all of this (and make some updates for clarity, too)

🤔 Why

The parent filter page has complex behavior for the "Reset" button. The "Reset" button changes title and behavior based on which page its on top of. All of these changes support that.

Copy link
Contributor
@jovaniks jovaniks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!!

Copy link
Contributor
@stevestreza-ksr stevestreza-ksr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm aside from one note

let hasCategory = category != nil
let hasState = state != SearchFiltersUseCase.defaultStateOption
private func updatePills() {
let filterCount = [self.hasCategory, self.hasProjectState].reduce(0) { filterCount, hasFilter in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little hard to scan this quickly to understand what it's doing. I think this is just counting how many conditions are active, so maybe replace this with [self.hasCategory, self.hasProjectState].count(where: { $0 == true })

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Good suggestion.

amy-at-kickstarter added a commit that referenced this pull request Apr 24, 2025
@amy-at-kickstarter amy-at-kickstarter merged commit ac4afc2 into main Apr 24, 2025
5 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the feat/adyer/mbl-2220/vms branch April 24, 2025 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0