Skip to content

Match Devanagari names in the member directory search - #14

Open
burakeyler wants to merge 1 commit into
voidash:mainfrom
burakeyler:fix/5-devanagari-member-search
Open

burakeyler wants to merge 1 commit into
voidash:mainfrom
burakeyler:fix/5-devanagari-member-search

Conversation

@burakeyler

Copy link
Copy Markdown

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 plain toLowerCase().includes treated those as different strings.

The filter moved out of members/page.tsx into src/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

  • No changes to packages/shared
  • packages/shared changed — needs a reviewer from the frontend and the backend

Checks

  • bun run lint — ran Biome 2.5.13 on the changed files; clean
  • bun run typecheck — not run locally (see notes)
  • bun run test — new tests/unit/member-search.test.ts passes (6 tests) with Vitest 5
  • bun run build and/or bun run build:web

Notes for reviewers

  • I don't have bun/Postgres set up on this Windows machine, so I ran the new unit test with a DB-less Vitest config and did not run typecheck, the integration suite, or the build. CI should cover those; happy to fix anything it flags.
  • Tests cover a Devanagari display-name match, decomposed query vs precomposed name and the reverse, a non-match, Latin case-insensitivity/trimming, and a null headline.

🤖 Generated with Claude Code

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>
@burakeyler
burakeyler requested a review from voidash as a code owner September 13, 2026 11:18
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.

Directory search should match Devanagari names

1 participant