fix(desktop): spellcheck follows your OS languages on Windows and Linux #44857
Mergedajcurated(GitHub profile, opens in a new tab)merged 5 commits into
main fromrefs/pull/44857/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
tanstack-source added labelsbug
- @@ -0,0 +15,21 @@15+ return (16+ available.find((language) => language.toLowerCase() === base) ??17+ available.find((language) => language.toLowerCase().startsWith(`${base}-`))18+ );19+};20+21+/**22+ * The dictionaries to use instead of the packaged en-US default, or undefined to leave the23+ * session alone. A list other than the seeded default is the user's own choice and is kept.24+ */25+export const resolveSpellCheckerLanguages = (26+ current: ReadonlyArray<string>,27+ preferredSystemLanguages: ReadonlyArray<string>,28+ available: ReadonlyArray<string>,29+): string[] | undefined => {30+ if (current.length > 1 || (current[0] ?? PACKAGED_DEFAULT_LANGUAGE) !== PACKAGED_DEFAULT_LANGUAGE)31+ return undefined;32+ const languages = [33+ ...new Set(34+ preferredSystemLanguages.flatMap((preferred) => {35+ const match = matchAvailableLanguage(preferred, available);
juliusmarminge added labelstakeover:in-progress
Sign in to join this conversation.




No actionable comments were generated in the recent review.
Walkthrough
On non-macOS platforms, DesktopWindow resolves preferred system languages against available spell-checker languages. It updates the session when the resolver returns a list. The resolver preserves other language selections and returns no update when no suitable alternative exists.
Changes: Spell-Checker Language Selection
apps/desktop/src/window/SpellCheckerLanguages.ts,apps/desktop/src/window/SpellCheckerLanguages.test.tsapps/desktop/src/window/DesktopWindow.ts,apps/desktop/src/window/DesktopWindow.test.tsEstimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Sequence Diagram(s)#
Possibly related PRs
Suggested labels:
bugfixSuggested reviewers:
juliusmarmingeMerge Risk:
Minimal · up to
cd41eThis change makes spellchecking on Windows and Linux follow the OS language instead of defaulting to US English. It preserves any dictionary list the user has already changed and leaves macOS unchanged. I found no merge-blocking risk.
Pre-merge checks:
4
#7742), describes the resolver behavior and the macOS exclusion, and s…Full details: Title check
Explanation
The title names the main change: spellcheck now follows the OS languages on Windows and Linux. It matches the changeset, which resolves preferred system languages to spellchecker dictionaries for non-macOS platforms. It uses the conventional commit format and is 71 characters, within a typical length limit.
Full details: Description check
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. It explains the bug with a linked issue (
#7742), describes the resolver behavior and the macOS exclusion, and states the scope as a bug fix with no setting or UI change. Verification lists focused tests and the check command, and it states that packaged Windows and Linux builds were not tested. It also includes the agent/model attribution line that the template requests.Finishing Touches
Generate unit tests (beta)
0d2b1dc7-ef78-473b-8442-1459bcc5f01aReviewing files that changed from the base of the PR and between c47b7bb122c40f6855fad0ece326f096576bde8e and cd41e0c119670d903e04ac5989904a920c40e59a.
apps/desktop/src/window/SpellCheckerLanguages.test.tsapps/desktop/src/window/SpellCheckerLanguages.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.