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

support for diacritics in the basic search query and field names in quotes #4398

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

AndyKilmory
Copy link
Collaborator

@AndyKilmory AndyKilmory commented Jan 14, 2025

What does this change?

Currently diacritics are not supported correctly in the search bar - if a user enters diacritics or unicode characters they are removed on page refresh (or entering image view followed by 'back to search'). This makes it hard for users to work with the search bar.

This PR modifies the syntax.js file - specifically the regEx parser used to analyse/breakdown the query content to display correctly as chips etc. - to provide Unicode support

It has also been extended to handle field names that are contained within quotation marks

How should a reviewer test this change?

Ensure that any diacritics entered into search bar are retained on page refresh

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

Sorry, something went wrong.

AndyKilmory and others added 2 commits January 14, 2025 12:17

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…uotes
@AndyKilmory AndyKilmory marked this pull request as ready for review January 15, 2025 10:35
@AndyKilmory AndyKilmory requested review from a team as code owners January 15, 2025 10:35
@paperboyo
Copy link
Contributor

Thanks! It makes things better for Unicode. Fixes #1900).

The quotes part is better, but not perfect.

  1. [preexisting] "quoted" searches when reloaded lose quotes
  2. [better] reloading "fileMetadata.icc.Profile Description":"sRGB IEC61966-2.1"nicely turns it into a chip
  3. [preexisting] but, because of previous point, if, after reloading, you start typing normal text next such a new shiny chip, it breaks

No idea how easly/likely would be to fix pt. 1. I can’t see any regressions here and it makes Unicode situation better, so we may decide to follow up in future PRs if the fix isn’t trivial. cc @andrew-nowak

@AndyKilmory
Copy link
Collaborator Author

thanks for approval etc

@prout-bot
Copy link

Seen on auth, usage, metadata-editor, leases, cropper, media-api (created by @AndyKilmory and merged by @andrew-nowak 8 minutes and 44 seconds ago) Please check your changes!

@prout-bot
Copy link

Seen on collections, thrall (created by @AndyKilmory and merged by @andrew-nowak 8 minutes and 51 seconds ago) Please check your changes!

@prout-bot
Copy link

Seen on image-loader (created by @AndyKilmory and merged by @andrew-nowak 8 minutes and 59 seconds ago) Please check your changes!

@prout-bot
Copy link

Seen on kahuna (created by @AndyKilmory and merged by @andrew-nowak 9 minutes and 8 seconds ago) Please check your changes!

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.

None yet

4 participants