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

Syntax highlighting of search input #9728

Closed
2 tasks done
maBarabas opened this issue Aug 11, 2023 · 6 comments · Fixed by #10794
Closed
2 tasks done

Syntax highlighting of search input #9728

maBarabas opened this issue Aug 11, 2023 · 6 comments · Fixed by #10794
Assignees
Labels
enhancement Adding or requesting a new feature. good first issue Opportunity for newcoming contributors. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed. ux Issues related to user experience.
Milestone

Comments

@maBarabas
Copy link

Describe the issue

  1. Go to a screenshot
  2. Enter "not found" as the search term
  3. A lot of strings appear as search results, most of them not containing anything related to "not found"

If I enter "not" or "found" then fewer results are found compared to "not found".

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Go to a screenshot
  2. Enter "not found" as the search term
  3. A lot of strings appear as search results, most of them not containing anything related to "not found"

Expected behavior

Search only lists strings containing "not found"

Screenshots

image

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Aug 11, 2023

Use "not found" in this case. Search supports boolean operators, so you search for all strings not containing string found. See https://docs.weblate.org/en/latest/user/search.html#boolean-operators

@maBarabas
Copy link
Author

maBarabas commented Aug 11, 2023

I see, I'll keep the issue open as a UI bug, as this is not obvious.

Maybe there should be an English representation of what I have searched for, for example: Strings not containing "found", or a mention of the search syntax next to the text box, or a graphical representation of how my query was parsed.

Just looking at the box, I think most users would assume it's a plain text search.

@nijel nijel changed the title Searching for the string "not found" seems to return every string in the project Syntax highlighting of search input Aug 16, 2023
@nijel nijel added enhancement Adding or requesting a new feature. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed. good first issue Opportunity for newcoming contributors. ux Issues related to user experience. labels Aug 16, 2023
@github-actions
Copy link

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

@nijel
Copy link
Member

nijel commented Aug 16, 2023

I don't think English representation would be useful for possibly long queries. Instead, doing syntax highlighting on the search input would show how it is interpreted.

What I'd like to see:

  • Uppercase logical operators upon typing/pasting, so this query would become NOT found
  • Highlight syntax using PrismJS (which we already use)

@nijel nijel self-assigned this Jan 16, 2024
@nijel nijel added this to the 5.4 milestone Jan 16, 2024
nijel added a commit to nijel/weblate that referenced this issue Jan 16, 2024
This makes it easier to realize how the search will be interpreted.

Fixes WeblateOrg#9728
@buhtz
Copy link

buhtz commented Jan 16, 2024

IMHO the current search behavior is a bug because it do not fit the users expectations (#10793). Keep in mind the "the user" especially in translation context is (for me) a non technical person knowing nearly nothing about computers.
But having syntax enlightening is a good workaround to be more explicit about the fact that the search might behave different then the user expect.

nijel added a commit that referenced this issue Jan 16, 2024
This makes it easier to realize how the search will be interpreted.

Fixes #9728
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. good first issue Opportunity for newcoming contributors. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed. ux Issues related to user experience.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants