Skip to content
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

Ability to filter posts containing keyword in title/body #974

Merged
merged 9 commits into from
Dec 13, 2023

Conversation

hjiangsu
Copy link
Member

@hjiangsu hjiangsu commented Dec 12, 2023

Pull Request Description

Review with whitespace off

This PR enables the ability to add and remove keywords. When adding keywords, any post that contains the keyword in the title or body will be filtered out from the feed page (and any widget that uses the feed page).

Some additional notes:

  • Added width: min(MediaQuery.of(context).size.width, 700) to showThunderDialog's AlertDialog. This allows alert dialogs to take up more of the width of the screen similar to the input dialogs (community, user, instance, etc)
  • Applied some small UI tweaks to UserSettingsPage since it now appears on the Settings page, I've adjusted some of the UI for blocking users/communities/instances to match the other UIs present in the Settings page.

Issue Being Fixed

Issue Number: #513

Screenshots / Recordings

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-12-12.at.11.41.12.mp4

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@hjiangsu hjiangsu marked this pull request as ready for review December 12, 2023 19:43
@hjiangsu
Copy link
Member Author

@micahmo ready for review!

@hjiangsu hjiangsu mentioned this pull request Dec 12, 2023
Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Awesome feature!

One thing I noticed while testing... This might be a problem I introduced with my dialog refactor, but I was able to add an empty string as a filter by pressing enter on the keyboard. (I think this is a problem with the comment search too.)

lib/feed/utils/post.dart Show resolved Hide resolved
lib/settings/pages/filter_settings_page.dart Show resolved Hide resolved
lib/settings/pages/filter_settings_page.dart Outdated Show resolved Hide resolved
lib/user/pages/user_settings_page.dart Show resolved Hide resolved
@hjiangsu
Copy link
Member Author

I was able to add an empty string as a filter by pressing enter on the keyboard

Ahh, I missed that edge case while testing it. I can add in an additional check to make sure we can't add in empty strings (and also trim whitespaces while I'm at it)

@hjiangsu
Copy link
Member Author

Added trimming to showInputDialog to disable the button when there's empty strings, and added trimming to keywords in eff689a!

@micahmo
Copy link
Member

micahmo commented Dec 13, 2023

Added trimming to showInputDialog to disable the button when there's empty strings, and added trimming to keywords in eff689a!

Nice! We can try to add something similar to comment search at some point.

@hjiangsu hjiangsu merged commit 9e75282 into develop Dec 13, 2023
1 check passed
@hjiangsu hjiangsu deleted the feature/keyword-filters branch December 13, 2023 17:17
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.

2 participants