Skip to content

fix(mobile): apply Android language changes immediately - #38982

Open
qi-hey wants to merge 5 commits into
pingdotgg:mainfrom
qi-hey:codex/fix-android-language-switch
Open

qi-hey wants to merge 5 commits into
pingdotgg:mainfrom
qi-hey:codex/fix-android-language-switch

Conversation

@qi-hey

@qi-hey qi-hey commented Nov 19, 2026 •

Copy link
Copy Markdown

Problem

On Android 2.3.0 (803), open Settings → General → Language and select Simplified Chinese. The picker shows Chinese as selected while General, Pull requests, and the tab labels still render in English. NativeGTProvider creates a condition store with the selected locale and immediately reads it back. Android queues the void TurboModule write, so that read can return the previously stored locale.

Change

Patch the pinned gt-react-native condition store to use the resolved locale in memory for immediate reads and continue persisting it through the native store. Cover the constructor path the provider uses with the real dependency and a simulated queued Android bridge write.

Scope

Small fix for the Android language selection regression. The app already ships the Chinese catalog and saves the user's selection.

Verification

  • The same regression test failed on upstream main at e0f5acd1 (General) and passed with the patch (通用) when the native write was still pending.
  • vp run check:changed passed. A separate run of preferences.test.ts hit the same Vitest setup error on both branches.
  • Expo Android prebuild and Gradle :app:assembleRelease succeeded locally for an ARM64 preview APK with CMake 3.31.6 and a short native staging path on Windows. apksigner verify passed, and the APK contains the production Hermes bundle with the patched condition store. The package ID is com.t3tools.t3code.preview.
  • On-device verification is pending because no Android test device was available on this workstation.

Implemented with OpenAI GPT-6 in Codex desktop.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. labels Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The native condition store now keeps its resolved locale in instance state across the TypeScript, CommonJS, and module builds. A subprocess test checks locale lookup when mocked Android bridge writes are deferred.

Changes: Native locale handling

Layer / File(s) Summary
Store resolved locale across builds
patches/gt-react-native@11.4.18.patch, pnpm-workspace.yaml
The store initializes and updates an instance locale, and getLocale() returns that value. The workspace pins gt-react-native to 11.4.18 and registers the patch.
Test deferred locale writes
apps/mobile/src/i18n/native-locale.test.ts
A subprocess test defers mocked Android storage writes, applies pending writes, then checks the locale reported by a store initialized with zh.

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

Change: Bug fix

Suggested reviewers: macroscopeapp, juliusmarminge

Merge Risk: Minimal · up to 471c5

This change makes Android language switches take effect immediately by keeping the resolved locale in memory instead of re-reading the queued native store. No concrete defect was found. On-device verification is still pending, but the risk is bounded and the change is easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(mobile): apply Android language changes immediately" matches the main change: the patched gt-react-native condition store now uses the resolved locale in memory, so Android language sel…
Description check Passed The description follows the template's Problem, Change, Scope, and Verification sections. The Problem section gives the reproduction steps and the cause (a queued void TurboModule write that the provi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(mobile): apply Android language changes immediately" matches the main change: the patched gt-react-native condition store now uses the resolved locale in memory, so Android language selection takes effect at once. It follows conventional commit form and names the affected area (mobile) and platform (Android).

Full details: Description check

Explanation

The description follows the template's Problem, Change, Scope, and Verification sections. The Problem section gives the reproduction steps and the cause (a queued void TurboModule write that the provider reads back too early). The Change section explains the patch to the condition store. The Scope section says this is a small fix for a regression, but it does not link an issue, and the template asks for one. The Verification section gives focused test results and notes that on-device verification is pending. The description also omits the template's conventional-commit reminder, which is only a comment and not a required field. The missing issue link is a minor gap, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • 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 6123f1e and 471c5b8.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 1

  • pnpm-workspace.yaml

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 19, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

the proof could not be captured: the agent ran past its 120 minutes

It stays open for a person to finish or close.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

See the conflict window.

@github-actions github-actions Bot added the needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. label Nov 23, 2026
@juliusmarminge juliusmarminge added takeover:in-progress A takeover lead is working on this PR and removed takeover:blocked Takeover blocked; reason in the PR body labels Nov 23, 2026
juliusmarminge and others added 2 commits November 23, 2026 05:53
…guage-switch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lockfile-free release installs could otherwise resolve past the patched version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. size:L 100-499 changed lines (additions + deletions). takeover:in-progress A takeover lead is working on this PR vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants