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

Redesign search filtering experience to be consistent with mobile #908

Merged
merged 10 commits into from
Mar 8, 2022

Conversation

myreli
Copy link
Contributor

@myreli myreli commented Mar 5, 2022

Hi! I hope you are doing well today. 😁

This PR provides a redesign for the filtering options. The goal is to provide a more consistent experience cross platform, bringing the search options as bubbles instead of switches on a modal.

screencast_sn_search_options.mp4

Summary

Redesigned the SearchOptions component to create a similar experience to the one we have on mobile when filtering:

  • Removed the search options modal and previous options
  • Changed the search trigger to OnFocus instead of modal
  • Created the new headless Bubble component
  • Removed the previous onBlur effect from Search to ensure a more consistent flow with the new experience

Approach

I inspected the experience provided on mobile and did my best to replicate on web, given the difference in usability.

Probably the biggest difference is that I've renamed "Include protected [Option]" to simply "[Option]" to improve readability and avoid horizontal scroll (when possible). Do you think that could mislead users?

Thoughts

  • ⚠️ I don't have Front End experience so I would appreciate an extra look on CSS and React specifics.
  • 💭 I realized this components aren't tested, except for NoteView that contains heavy logic. Is there any other place I should consider for e2e or perhaps am I missing something?
  • 🧪 I created a small collection of notes to test it, if you wish to try it out importing simulated-data.txt

Thank you for your review!

@amanharwara
Copy link
Member

Hi @myreli, thanks for the contribution! 🚀 You're not missing anything regarding the tests, btw. For the React and CSS, there are a few things that need to be adjusted, but looks good overall 🙂👍

- animate the bubles on search
- decouple the Bubbles styling using utility classes
- improve styling of the new search options
@myreli
Copy link
Contributor Author

myreli commented Mar 6, 2022

Hi @amanharwara! Thank you for the review.

I have just updated the PR with fdecd9c, that improves the code and result with yours and @moughxyz's suggestions. Could you check again when you have the time?

Here's a summary of the changes:

  • Animated the search options appearance and improved the existing transition
  • Increased the padding of each bubble
  • Improved the spacing of the search options
  • Fixed a regression on the input search borders
  • Refactored the CSS to use utility classes instead of component specifics ¹

¹ I tried to keep the new utility classes next to the similar existing. However I was unsure when choosing sn.scss instead of ui.scss.

@amanharwara
Copy link
Member

However I was unsure when choosing sn.scss instead of ui.scss.

sn.scss is where the utility classes should go.

@myreli myreli marked this pull request as draft March 6, 2022 14:16
@myreli myreli force-pushed the feature/bubble-search-options branch from 585f710 to 1055928 Compare March 6, 2022 14:29
@myreli myreli force-pushed the feature/bubble-search-options branch from c991296 to 1aa5695 Compare March 6, 2022 14:38
@myreli
Copy link
Contributor Author

myreli commented Mar 6, 2022

Hey @amanharwara! Thank you again.

Since the video is failing, here's how it looks so far:
image

@myreli myreli marked this pull request as ready for review March 6, 2022 14:57
@amanharwara
Copy link
Member

amanharwara commented Mar 6, 2022

Looks good! One small issue with this is that since this is using justify-between, if the user increases the size of the notes column, the bubbles would be spread too far apart. I would suggest using regular margins or the gap property instead so that they don't get too far apart or too close to each other.

@myreli
Copy link
Contributor Author

myreli commented Mar 6, 2022

Got it @amanharwara. I increased gap and justified on center.
image

Copy link
Member

@amanharwara amanharwara left a comment

Choose a reason for hiding this comment

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

Looks good!

myreli added 3 commits March 6, 2022 15:10
- increase animation timing to match mobile
- properly center cancel button
- only show cancel on text input
- prevent search options from disappearing when clicking with no text
@amanharwara
Copy link
Member

Probably the biggest difference is that I've renamed "Include protected [Option]" to simply "[Option]" to improve readability and avoid horizontal scroll (when possible). Do you think that could mislead users?

I was giving this a go locally and I think this might actually end up being a bit confusing, as I found out myself. Having just "Protected" conveys that you are filtering based on whether the note is protected or not (like the Archived/Trashed options), instead of conveying that the user will be toggling whether to search contents of protected files or not. It might be better to have the whole "Include Protected Contents" label, which might make sizing tricky, but will be better in terms of clarity.

@moughxyz moughxyz merged commit 5d49352 into standardnotes:develop Mar 8, 2022
@myreli myreli deleted the feature/bubble-search-options branch March 8, 2022 17:48
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.

3 participants