feat: accent-insensitive meeting-name search (closes #30) - #50
Merged
Conversation
Search now treats accented letters and their base letter as equivalent in both directions, so "ret" matches "Rétablissement" and "rét" matches "Retablissement". Closes #30. Each query letter expands to a character class of its diacritic variants in makeFlexibleRegex (renamed from makeQuoteFlexibleRegex), alongside the existing quote flexibility. The match stays a Mongo $regex on `name`, so there is no schema change or backfill — Mongo $regex can't honor an accent-insensitive collation, hence folding into the pattern instead. pipelineFromQuery name-match tests now assert stage shape with expect.any(String) rather than the literal pattern; the regex internals are covered behaviorally in stringUtils.spec.ts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates server-side meeting-name search to be accent-insensitive (and keeps quote-flexibility), so queries match names regardless of diacritics (e.g., ret ↔ Rétablissement) without a schema change.
Changes:
- Introduces
makeFlexibleRegexto expand query letters into diacritic-aware character classes (while still handling straight/curly quotes). - Updates the query pipeline builder to use the new flexible regex builder for
nameQuery. - Adds/updates unit tests to cover accent-insensitive matching and adjusts pipeline tests to assert stage shape rather than regex internals.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/utils/stringUtils.ts | Adds diacritic groups + mapping logic and renames/expands regex builder to handle accents and quotes. |
| src/utils/stringUtils.spec.ts | Updates existing quote/escape tests to use makeFlexibleRegex and adds accent-insensitivity cases. |
| src/utils/pipelineFromQuery.ts | Switches meeting-name $regex pattern generation to makeFlexibleRegex. |
| src/utils/pipelineFromQuery.spec.ts | Makes pipeline assertions resilient to regex-internal changes and adds a functional regex check. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+11
to
+12
| // Base letter is leading ASCII; accented variants are written as \u escapes so | ||
| // the source bytes are unambiguous (see central-query #31). |
Collaborator
There was a problem hiding this comment.
@sblack4 Do you agree with this proposal? I admit I don't have experience here.
tim-rohrer
approved these changes
Jun 28, 2026
tim-rohrer
left a comment
Collaborator
There was a problem hiding this comment.
@sblack4 I'm approving this because the comment I made is quite minor, and you can make the change if necessary.
Thanks for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses oiaa-direct#30. The fix is server-side here — oiaa-direct just forwards the search box as
nameQuery. Search now treats accented letters and their base form as equivalent in both directions:ret→Rétablissement, andrét→Retablissement.How: each query letter expands to a character class of its diacritic variants in
makeFlexibleRegex(renamed frommakeQuoteFlexibleRegex), reusing the quote-flexibility approach from #31. The match stays a Mongo$regexonname— no schema change or backfill. ($regexcan't honor an accent-insensitive collation, so the folding lives in the pattern.)Tests: added accent cases to
stringUtils.spec.ts— base→accented, the reverse direction, an over-match guard, and a no-diacritic-group literal-match guard.pipelineFromQueryname-match tests now assert stage shape (expect.any(String)) instead of the literal pattern, since the regex behavior is covered instringUtils.spec.ts. Full suite green (89/89).