Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): spellcheck keeps English when the OS lists only other languages #48217

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/48217/headopened View on GitHub

juliusmarmingecommented

On Windows and Linux, the desktop app replaced its English spellcheck dictionary with the OS languages alone. On a computer set only to Swedish, for example, every English word in the composer was underlined. The app also never changed that list again, even after English was added to the OS languages. Spellcheck now always keeps an English dictionary next to the OS languages, and the list is recomputed on each launch, so OS language changes take effect and lists saved by the old behaviour are fixed on the next start.

Fixes pingdotgg/t3code#48207

Reproduction on main

Commit origin/main 7b7ca65f9a. Ran the real desktop app on Linux (same non-darwin code path as Windows: DesktopWindow.ts calls resolveSpellCheckerLanguages with app.getPreferredSystemLanguages()). Command: T3CODE_DEV_SEED=0 T3CODE_HOME=<scratch> XDG_CONFIG_HOME=<scratch>/xdg LANGUAGE=sv_SE LANG=sv_SE.UTF-8 LC_ALL=sv_SE.UTF-8 headless-desktop vp run dev:desktop (fresh profile, OS language Swedish only). The app UI loaded in English (). 1) After first launch, /xdg/t3code-dev/Preferences had "spellcheck": {"dictionaries": ["sv"], "dictionary": ""}, so English is gone, exactly as reported. 2) Stopped the app, edited Preferences to "dictionaries": ["en-US"], relaunched with the same env: Preferences went back to ["sv"]. A hand-set English-only list does not last. Not run on Windows 11 itself; the logic is OS-independent apart from where the language list comes from. The third claim (adding English to the OS list afterwards does nothing) follows from the code: once the saved list is ["sv"], resolveSpellCheckerLanguages returns undefined for any list other than exactly ["en-US"]. Failing unit test on branch factory/repro-48207: resolveSpellCheckerLanguages(["en-US"], ["sv-SE"], ["en-US","sv"]) returns ["sv"] and the test expects it to contain "en-US".

Evidence

Being captured: before and after in the real app. This section is filled in before the pull request can merge.

Tests

  • vp test run src/window/SpellCheckerLanguages.test.ts src/window/DesktopWindow.test.ts (apps/desktop): 51 passed
  • The same spellcheck test file with the source change reverted: 3 failed (including the repro test), as expected
  • vp run check:changed: format, lint, knip, typecheck (2 packages) and test all pass
  • Real desktop app via headless-desktop vp run dev:desktop with T3CODE_DEV_SEED=0 and a Swedish-only locale on a fresh profile: Preferences dictionaries ["sv","en-US"]; after hand-setting ["sv"] and relaunching: back to ["sv","en-US"]

Not in this change

  • A hand-edited dictionary list in Chromium's Preferences file is now replaced on every launch; T3 Code has no dictionary picker, so supporting a lasting user choice would mean adding a setting.
  • The spellcheck dictionary does not follow the app's own UI language (e.g. a German UI on an English-only OS gets no German dictionary).

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Needs Human Approval

      Macroscope's review found this PR requires human approval — This changes automatic spellchecker defaults on non-macOS desktop and preview sessions: English stays enabled, and existing dictionary lists follow OS preferences. Human confirmation is needed for that default behavior change.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The spellchecker resolver now recomputes dictionaries from preferred system languages on each launch. It retains English coverage and updates the current list when the resolved dictionaries differ.

      Changes: Spellchecker language resolution

      Layer / File(s)Summary
      Resolve dictionaries and validate fallback
      apps/desktop/src/window/SpellCheckerLanguages.ts, apps/desktop/src/window/SpellCheckerLanguages.test.ts
      The resolver processes non-default current lists, adds en-US when no English dictionary is covered, and returns undefined when the computed list matches the current list. Tests cover fallback, changed OS languages, and unchanged lists.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix · Severity of issue fixed: Low

      Suggested reviewers: ajcurated

      Merge Risk: Minimal · up to 04548

      The change keeps English spellcheck available alongside the OS languages and recomputes the dictionary list on each launch. No merge-blocking risk was identified.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the main change: spellcheck keeps English when the OS lists only other languages. It is a conventional commit title in plain language. The change matches the raw summary, which says en…
      Description checkPassedThe description follows the template sections (Problem, Change, Scope, Verification, and the agent attribution line). Problem and Change are clear and specific. Scope links issue #48207 as the bug rep…
      Linked Issues checkPassed[#48207] The issue requires that English text is not flagged when the app is in English and the OS language is Swedish only. At minimum, English must be restorable. At head, resolveSpellCheckerLanguag…
      Out of Scope Changes checkPassedThe changes stay in apps/desktop/src/window/SpellCheckerLanguages.ts (resolution logic and doc comment) and SpellCheckerLanguages.test.ts (tests for the new behaviour). Each change supports the spellc…
      Full details: Title check

      Explanation

      The title names the main change: spellcheck keeps English when the OS lists only other languages. It is a conventional commit title in plain language. The change matches the raw summary, which says en-US is always included alongside OS languages, and the PR objectives, which describe retaining English and recomputing the list on launch.

      Full details: Description check

      Explanation

      The description follows the template sections (Problem, Change, Scope, Verification, and the agent attribution line). Problem and Change are clear and specific. Scope links issue #48207 as the bug report. Verification gives focused test commands, results, and a real-app check. The Evidence section says before and after captures are still being collected and will be filled in before merge, so that part of the template is incomplete. The template also asks for a note on untested areas, and the description covers this under 'Not in this change' and by stating Windows 11 was not tested.

      Resolution

      Complete the Evidence section with the before and after captures before merge. The template asks for these for behavior changes that affect visible state. The description otherwise meets the template.

      Full details: Linked Issues check

      Explanation

      [#48207] The issue requires that English text is not flagged when the app is in English and the OS language is Swedish only. At minimum, English must be restorable. At head, resolveSpellCheckerLanguages (SpellCheckerLanguages.ts) always appends en-US when no English base language is covered by the OS languages. For the reported case (['sv-SE'], available ['en-US','sv']), it returns ['sv','en-US']. The unit test 'keeps English spellcheck when the OS lists only a non-English language' covers this case. The list is recomputed on each launch rather than kept when it differs from the packaged default. The test 'follows the OS languages when they change after an earlier launch' covers OS language changes, which the issue asks for. A hand-set ['en-US'] list is also replaced, but English stays in the list, so the issue's minimum requirement is met. The issue's suggested workaround (a hand-edited list) is not a required implementation. No manual picker or UI-language following is required by the issue. The reported behaviour was verified by the author in a Linux run. Windows was not tested, but the code path is OS-independent apart from the language source (inferred from the code, not run here).

      Full details: Out of Scope Changes check

      Explanation

      The changes stay in apps/desktop/src/window/SpellCheckerLanguages.ts (resolution logic and doc comment) and SpellCheckerLanguages.test.ts (tests for the new behaviour). Each change supports the spellcheck objective in [#48207]. The PR description's 'Not in this change' items (no dictionary picker, no UI-language following) are not implemented, and no unrelated code was found in the reviewed summary. The Evidence placeholder in the PR description is documentation, not a code change.

      Finishing Touches

      Generate unit tests (beta)

      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 7eba80e43120c8533738e7b5149f5b08b7ab0b14 and 04548a08a9f0f08cb76b27ef3b77e131625e6377.

      Files selected for processing: 2

      • apps/desktop/src/window/SpellCheckerLanguages.test.ts
      • apps/desktop/src/window/SpellCheckerLanguages.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Sign in to join this conversation.