fix(filters): pin filter sort to a stable locale#2844
Merged
setchy merged 1 commit intogitify-app:mainfrom May 6, 2026
Merged
Conversation
`localeCompare()` and `toLocaleLowerCase()` use the host locale by default, which makes the resulting filter checkbox order machine-dependent. Under `cs_CZ.UTF-8`, for example, "Check Suite" sorts after "Co...", "De..." entries because Czech treats "ch" as a digraph that collates after "h", causing the `SubjectTypeFilter` and `Filters` snapshot tests to fail for non-English contributors while passing in CI. Pin the comparator to `'en'` and use `toLowerCase()` so the order is stable across machines. The filter type labels are hardcoded English strings (no i18n in this app), so sorting them in English is semantically correct. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
FilterSectionis sorted vialocaleCompare()+toLocaleLowerCase(), both of which fall back to the host locale. This makes the resulting order machine-dependent.cs_CZ.UTF-8(Czech), for example,"Check Suite"sorts after"Co..."and"De..."entries because Czech treats"ch"as a digraph that collates after"h". This causes theSubjectTypeFilterandFilterssnapshot tests to fail locally for non-English contributors while CI (which runs in English) keeps passing — the snapshot was effectively captured against a host-locale-specific order.'en'and switchtoLocaleLowerCase()→toLowerCase()so the order is stable across machines. Filter type labels are hardcoded English strings (no i18n in this app), so sorting them in English is also semantically correct.Test plan
pnpm testpasses locally under a non-English locale (e.g.LANG=cs_CZ.UTF-8 pnpm test) — previously fails onSubjectTypeFilter.test.tsxandFilters.test.tsxsnapshots.🤖 Generated with Claude Code