Skip to content

feat: accent-insensitive meeting-name search (closes #30) - #50

Merged
sblack4 merged 1 commit into
mainfrom
30-accent-insensitive-search
Jul 1, 2026
Merged

feat: accent-insensitive meeting-name search (closes #30)#50
sblack4 merged 1 commit into
mainfrom
30-accent-insensitive-search

Conversation

@sblack4

@sblack4 sblack4 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

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: retRétablissement, and rétRetablissement.

How: each query letter expands to a character class of its diacritic variants in makeFlexibleRegex (renamed from makeQuoteFlexibleRegex), reusing the quote-flexibility approach from #31. The match stays a Mongo $regex on name — no schema change or backfill. ($regex can'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. pipelineFromQuery name-match tests now assert stage shape (expect.any(String)) instead of the literal pattern, since the regex behavior is covered in stringUtils.spec.ts. Full suite green (89/89).

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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., retRétablissement) without a schema change.

Changes:

  • Introduces makeFlexibleRegex to 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 thread src/utils/stringUtils.ts
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).

@tim-rohrer tim-rohrer Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@sblack4 Do you agree with this proposal? I admit I don't have experience here.

@tim-rohrer tim-rohrer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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!

@sblack4
sblack4 merged commit eaed0cd into main Jul 1, 2026
1 check passed
@sblack4
sblack4 deleted the 30-accent-insensitive-search branch July 1, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants