Skip to content

fix: preserve tag segments when normalizing search for ignore-accents#20411

Closed
Giyutomioka-SS wants to merge 1 commit intoankidroid:mainfrom
Giyutomioka-SS:tag-search-accented-20409
Closed

fix: preserve tag segments when normalizing search for ignore-accents#20411
Giyutomioka-SS wants to merge 1 commit intoankidroid:mainfrom
Giyutomioka-SS:tag-search-accented-20409

Conversation

@Giyutomioka-SS
Copy link
Contributor

@Giyutomioka-SS Giyutomioka-SS commented Mar 6, 2026

Purpose / Description

With Ignore accents in search on, the whole query was normalized, so tag:être became tag:etre and tag search failed. We now only normalize the parts of the query outside tag:... segments so tag search still works.

Fixes

Approach

Added normalizeForSearchPreservingTags(): it finds every tag:... segment (quoted or not), leaves those unchanged, and runs normalizeForSearch() on the rest. The browser uses this instead of normalizeForSearch() when the option is on.

How Has This Been Tested?

Unit tests for the new helper; integration test (note with tag "être", option on, filter by "être" → 1 row).

Manually: same steps; note appears with the fix, no results without it.

Screen Recording

Screen_recording_20260307_020248.webm

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@david-allison
Copy link
Member

I'm currently in the area with a huge backlog of PRs/commits we can do this much more simply with buildSearchString and SearchNode, and

With apologies, I'll close this one as it's a lot of code which will conflict, didn't expect anyone to be taking it up so fast. Please do include it as positive proof of work contributions for GSoC and I'll vouch for you

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.

Tag search fails if "Ignore accents in search (slower)" is enabled

2 participants