Skip to content

feat: ignore non-letters in specs list filter #17346

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

papermana
Copy link
Contributor

@papermana papermana commented Jul 15, 2021

User facing changelog

When filtering specs in the desktop client, characters that are not letters will be ignored and don't have to be typed.

Additional details

The logic for filtering the specs list is very strict currently, and you have to type in the name of the desired spec(s) exactly. Ideally, filtering would use fuzzy logic, but I can see that at least one PR included that, and the fuzzy search feature was removed because of some issues.

A low hanging fruit type of solution is simply ignoring certain characters. Having to type every "_" has been the biggest problem in my experience, so this should already make things more convenient.

I used a nifty newish regexp feature to detect all letter characters, including non-Latin ones. (I don't think it would be OK to break the search function for people using different writing systems.) You can see an explanation here.

Note that this change will also ignore any digits. Of course, that can be changed. I decided numbers should also be kept.

Small warning: I can't get dependencies to install on my M1 Macbook (Electron doesn't want to build), so I haven't tested this code myself. I'm hoping the E2E tests will pass.

How has the user experience changed?

Before: to find user_profile.spec, I have to type "user_prof".
After: I can type "userprof".

PR Tasks

  • Have tests been added/updated?

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
papermana Dominik Rowicki
@papermana papermana requested a review from a team as a code owner July 15, 2021 10:53
@papermana papermana requested review from flotwig and chrisbreiding and removed request for a team July 15, 2021 10:53
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 15, 2021

Thanks for taking the time to open a PR!

@papermana papermana changed the title Ignore non-letters in specs list filter feat: Ignore non-letters in specs list filter Jul 15, 2021
@papermana papermana marked this pull request as draft July 15, 2021 10:57
@papermana
Copy link
Contributor Author

Seems like the tests are not passing after all. Will resolve it and open the PR again.

Verified

This commit was signed with the committer’s verified signature.
papermana Dominik Rowicki

Verified

This commit was signed with the committer’s verified signature.
papermana Dominik Rowicki
@papermana papermana changed the title feat: Ignore non-letters in specs list filter feat: ignore non-letters in specs list filter Jul 15, 2021

Verified

This commit was signed with the committer’s verified signature.
papermana Dominik Rowicki

Verified

This commit was signed with the committer’s verified signature.
papermana Dominik Rowicki
@papermana papermana marked this pull request as ready for review July 15, 2021 21:27
@papermana
Copy link
Contributor Author

Some tests are still failing, but they seem to be different every time I make a change. Are they just naturally flaky, or does it mean that something's wrong? I don't think my changes are related to Electron etc.

Anyway, I'm opening the PR again. Not sure if I should re-request review. @jennifer-shehane?

@jennifer-shehane
Copy link
Member

Hey @papermana, thanks for the work. We'll review as soon as we can. We're a little tied up today getting our release out. Thanks!

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

Nice. I personally like this feature because I can't ever remember if we use snakecase or camelcase either. This is great because it also considers our users with non-English characters in their specfile.

Tried it out manually and it's also tested.

Screen Shot 2021-07-21 at 8 53 21 AM

@jennifer-shehane jennifer-shehane merged commit ba1c85b into cypress-io:develop Jul 21, 2021
@papermana papermana deleted the ignore-non-letters-in-spec-filter branch July 21, 2021 15:44
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 29, 2021

Released in 8.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v8.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants