Match Devanagari names in the member directory search - #14
Open
burakeyler wants to merge 1 commit into
Open
burakeyler wants to merge 1 commit into
burakeyler wants to merge 1 commit into
Conversation
The members page compared the query and member fields with a plain `toLowerCase().includes`, so a Nepali name stored in one Unicode form (e.g. a letter with nukta precomposed) did not match the same name typed in the other form. Both sides are now normalized to NFC before matching. The filter moves into `server/members/search.ts` so it can be unit tested without a database. Fixes voidash#5 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What changed
Fixes #5. The member directory search now normalizes both the query and the member fields to Unicode NFC before matching, so a Nepali (Devanagari) name matches whether it was stored or typed in precomposed or decomposed form (e.g.
ऩU+0929 vsन+ nukta U+0928 U+093C). Previously the plaintoLowerCase().includestreated those as different strings.The filter moved out of
members/page.tsxintosrc/server/members/search.ts(memberMatchesQuery) so it can be unit tested without a database; the page behaviour is otherwise unchanged (same fields, trimmed, case-insensitive, empty query matches all).Contract impact
packages/sharedpackages/sharedchanged — needs a reviewer from the frontend and the backendChecks
bun run lint— ran Biome 2.5.13 on the changed files; cleanbun run typecheck— not run locally (see notes)bun run test— newtests/unit/member-search.test.tspasses (6 tests) with Vitest 5bun run buildand/orbun run build:webNotes for reviewers
🤖 Generated with Claude Code