fix(web): use locale-independent lowercase in search matching#80
Merged
wolfiesch merged 1 commit intoJul 19, 2026
Merged
Conversation
wolfiesch
force-pushed
the
fix/locale-insensitive-search
branch
2 times, most recently
from
July 19, 2026 22:38
315a7de to
c147b00
Compare
Case-insensitive search used String.prototype.toLocaleLowerCase(). Under Turkish/Azeri locales, 'IMAGE'.toLocaleLowerCase() yields 'ımage' (dotless ı), so uppercase ASCII queries silently fail to match lowercase text. Switch the seven search-matching call sites to toLowerCase(), which is locale-independent: - transcript search highlight segments (model.ts) - transcript search fixture matching (fixtures.ts) - rail session search (session-tree.ts) - settings workspace search (SettingsWorkspace.tsx) Add regression tests that stub toLocaleLowerCase to simulate a Turkish locale and assert uppercase queries still match; both fail without this change. Update the provenance checksum for the reference-only tracked session-tree.ts.
wolfiesch
force-pushed
the
fix/locale-insensitive-search
branch
from
July 19, 2026 22:45
c147b00 to
06e125b
Compare
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 this changes
Case-insensitive search in the web app used
String.prototype.toLocaleLowerCase(), which is locale-sensitive. Under Turkish/Azeri locales,'IMAGE'.toLocaleLowerCase()produces'ımage'(dotless ı), so an uppercase ASCII query silently fails to match lowercase text.This replaces
toLocaleLowerCase()with the locale-independenttoLowerCase()at all seven search-matching call sites:apps/web/src/features/transcript-search/model.ts(plainTextHighlightSegments)apps/web/src/features/transcript-search/fixtures.ts(fixture search matching)apps/web/src/lib/session-tree.ts(rail session search)apps/web/src/features/settings/SettingsWorkspace.tsx(settings search)A repo-wide grep confirms these are the only
toLocaleLowerCase()occurrences, so none were left behind. Also updates thereference-onlyprovenance checksum forapps/web/src/lib/session-tree.ts(required bycheck-provenance).Regression tests in
apps/web/test/transcript-search.test.tsxandapps/web/test/session-tree.test.tsstubString.prototype.toLocaleLowerCaseto simulate a Turkish locale (I→ı, restored inafterEach) and assert that uppercase queries (IMAGE,PAGINATION) still match lowercase text.Verification
pnpm --filter @t4-code/web test— 71 files, 997 tests, all pass.transcript search model > matches uppercase ASCII queries under a Turkish localeandbuildProjectGroups > matches uppercase ASCII queries under a Turkish locale); restored the fix and both pass.pnpm checkpasses (release consistency, provenance 0 failures,lint --deny-warnings, typecheck).pnpm test: the only failure is the pre-existingpackages/clienttest/transcript-retention.test.ts("keeps the newest contiguous suffix under count, entry, and cumulative bytes"), which also fails on unmodifiedmainand is unrelated to this PR.Checklist
pnpm checkpasses (release contract, provenance, lint, typecheck)pnpm testpasses; new behavior has a test that fails without this changeTHIRD_PARTY_NOTICES.md