You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Settings follow-ups: System language, quota warnings export, cost switches, thresholds, no email under HPI - #834
Settings follow-ups for Mac parity. Each change is a separate commit.
Language: System (Q9). The Language picker gets a "System" option, listed first, as on the Mac. While it is selected, the app follows the Windows display language. New installs default to System. Settings files written before this change keep the language they had.
New setting ui_language_follows_system: true for new installs, false when an older settings.json doesn't have it.
The display language is read from HKCU, in this order:
Control Panel\DesktopPreferredUILanguages;
Control Panel\International\User ProfileLanguages;
Control Panel\Desktop\MuiCachedMachinePreferredUILanguages.
The first tag the app has a translation for wins. If none has one, the language is English, as on the Mac.
It is resolved at load, when System is picked, and after a preferences import. Choosing a specific language, from Settings or the tray menu, stops following the system.
The preferences export carries ui_language_follows_system. A file exported before this change has a ui_language but no follow flag. Importing it keeps its language.
Thresholds stay visible (Settings: Mac layout for General, Notifications, Advanced and About #816). The "Warning at % used" and "Critical at % used" fields stay visible while Threshold warnings is off. They also set the usage-bar and float-bar colours. The Mac hides them; this one difference is kept on purpose.
Hide Personal Info shows no email anywhere (HPI). With HPI on, no surface shows an email, a placeholder or a partial mask. This matches the Mac, whose email placeholder is "".
Tray panel card: the account email is removed from the header, and emails are removed from the error line.
Settings provider detail: the identity row is removed; this includes an organization label that contains the email. Emails are also removed from issue notices.
Grok accounts list in Settings: shows "Account N".
Claude and Grok tray account menus: show "Account N".
Tray tooltip: emails are removed from error text.
Usage item titles: emails are removed.
Redaction helper:hide_emails_in_text removes emails, then tidies the spacing before punctuation, as on the Mac.
Logs: still use the "Hidden" placeholder.
Bridge snapshot: the email is not removed from the snapshot, because chart history is keyed on it. It is removed at display time, which keeps each provider's data separate.
Q10a (adaptive refresh on by default) is already on main, at rust/src/settings.rs:650 with the test at settings/tests.rs:1806. No change needed.
Mac reference (upstream 0.70.0 Sources/CodexBar)
PreferencesGeneralPane.swift:5-66: AppLanguage.system is the first case, labelled "System".
PreferencesSpendDashboardPane.swift:495-512: the OpenCodex and Hide native Codex toggles and SpendDashboardSourceFilter only render inside if self.settings.costUsageEnabled.
PersonalInfoRedactor.swift:
:5-15: AccountOrdinal.label is "Account %@";
:18: emailPlaceholder = "";
:24-38: redactEmail and redactAccountLabel;
:40-55: redactEmails(in:) and the spacing tidy-up.
HPI updates in MenuCard.test.tsx, MenuCard.headerAccount.test.ts, IdentitySection.test.tsx, GrokAccountsSection.test.tsx and ProviderIssueNotice.test.tsx.
Real-window proof
The proof used a debug build of this head (57200c6), built with the proof-kit dirs/reqwest shim. The shim is not committed.
Home: each run used a fresh isolated home. The real %APPDATA%\CodexBar was never touched.
Seed:CODEXBAR_SEED_USAGE_JSON seeded synthetic Codex and Claude snapshots, with the emails proof@example.com and proof.claude@example.com.
Tools: CDP drove the clicks and reads. cua-driver took the real-window screenshots, on the secondary monitor.
On a fresh home, Language reads "System" and it is the first option. uiLanguageFollowsSystem is true, and the language resolves to English, because this PC's Windows display language is en-US.
Picking English gives ui_language_follows_system=false in the DPAPI-decrypted settings.json.
With Track costs on, "Include OpenCodex usage logs" and the Sources filter (Claude, Codex) are shown. Shot: shots/03-track-costs-on.png.
After switching it off (cost_usage_enabled=false in the file), the OpenCodex switch, the Hide native Codex switch and Sources are all gone. Shot: shots/04-track-costs-off.png.
Hide Personal Info. The no-email check fails if the page's text or HTML attributes contain example.com or anything shaped like an email. With HPI off, the check fires on both surfaces below, which shows it can detect the email.
no Account row and no email; Plus is still shown (shot 08-provider-detail-hpi-on.png)
Float bar
no email; it never renders one (shot 05b-float-bar-hpi-off.png)
no email (shot 10-float-bar-hpi-on.png)
HPI was switched on with the real Settings > Advanced toggle (hide_personal_info=true in the file). Shot: shots/07-advanced-hpi-on.png.
The float bar was switched on through the update_settings bridge command, not the Menu toggle.
The tray tooltip and the Claude and Grok tray account menus are native, so CDP can't read them. The Rust tests hidden_personal_info_removes_emails_from_tooltip_errors and hidden_claude_and_grok_tray_labels_show_no_email cover them.
I looked at every screenshot. The only emails in them are the two synthetic seed addresses, and they appear only in the HPI-off shots. The screenshots contain no credentials and no local paths.
Open questions (default chosen)
The follow flag in the preferences export.ui_language_follows_system is exported, so importing on another PC follows that PC's language. Default: export it.
Where the display language comes from. It is read from the HKCU registry values listed above. It is not read through the GetUserPreferredUILanguages API. The registry read uses winreg, which is already a dependency, so the PR adds none. Default: the registry.
The "System" label. It is "System" in every locale, the English label from the Mac language_system string. It isn't translated yet. Default: English.
Logs under HPI. They keep the "Hidden" placeholder, so a log line still shows that an email was there. Default: keep "Hidden" in logs.
Stored hidden-row IDs. Usage detail-section IDs still use the "Hidden" placeholder internally, so hidden-row IDs that users already saved stay valid. Default: keep the IDs stable.
Organization labels that contain an email. Under HPI, the provider identity row drops the whole organization label, because the label minus the email can read oddly. Default: drop it.
Choose System in language settings to follow your computer’s display language; imported preferences also support this option.
Export and import provider-specific quota warning settings.
Privacy
When Hide Personal Info is enabled, account emails are omitted or replaced with generic account labels, and emails are removed from error messages and tray tooltips.
Settings
Warning and critical usage thresholds remain available when notifications are off.
OpenCodex cost controls and source filters appear when cost tracking is enabled.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough
The changes add system-language following, update personal-information redaction across desktop and tray surfaces, add provider quota warnings to portable preferences, and adjust when settings controls appear.
Changes
System language selection
Layer / File(s)
Summary
Persist and resolve system language rust/src/settings.rs, rust/src/settings/raw.rs, rust/src/settings/system_language.rs, rust/src/settings/tests.rs
Settings persist a follow-system flag and resolve supported system language preferences. Tests cover defaults, legacy settings, and persistence.
Apply language settings through backend commands apps/desktop-tauri/src-tauri/src/commands/settings.rs, apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src-tauri/src/commands/locale_cmd.rs, apps/desktop-tauri/src-tauri/src/commands/preferences_transfer.rs
Backend updates apply explicit-language and follow-system changes, update the settings snapshot, and resolve system language during preference import.
Expose system language in the UI apps/desktop-tauri/src/types/bridge.ts, apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.tsx, apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.test.tsx, apps/desktop-tauri/src/App.test.tsx, apps/desktop-tauri/src/floatbar/FloatBar.test.tsx, apps/desktop-tauri/src/surfaces/TrayPanel*.test.tsx, apps/desktop-tauri/src/surfaces/settings/tabs/*Tab.test.tsx
The bridge includes the follow-system setting. The language selector includes a System option, and settings fixtures include the new field.
sequenceDiagram
participant GeneralTab
participant apply_general_settings
participant Language_system
participant SettingsSnapshot
GeneralTab->>apply_general_settings: Send uiLanguageFollowsSystem patch
apply_general_settings->>Language_system: Resolve system language when following is enabled
Language_system-->>apply_general_settings: Return resolved language
apply_general_settings->>SettingsSnapshot: Include resolved language and follow-system flag
Loading
Suggested reviewers:xuelongmu
Merge Risk:⚪ Minimal · up to 252ba
The settings changes add language, privacy, and preference controls; no actionable user-facing regression is established, so there is no identified merge-blocking risk.
Pre-merge checks | 7 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Title check
The title accurately describes the changes, but it is a long list rather than a short imperative summary.
Rewrite the title as a concise imperative summary, such as "Add system language and privacy settings support".
✅ Passed checks (7 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed
No provider or account data crosses its silo in the changed code. Provider quota warnings export and import use the same provider ID keys, and tests verify that Claude credentials remain local while C…
Secrets Handled Safely
No changed code exposes a real credential. The preference export keeps provider_configs excluded and exports only validated quota-warning fields; tests also verify that API-token fixture values do n…
No Unapproved Dependencies
The pull-request diff changes no Cargo.toml, package.json, npm/yarn lockfile, or pnpm configuration file. Therefore, it adds no unapproved dependency or package-manager change under this check.
Ui Changes Include Windows Proof
The PR changes visible UI and tray behavior, including settings controls, account labels, email display, and system-language selection. The supplied PR context reports real-window proof on the Windows…
Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 React Doctor (0.9.14)
Project "apps/desktop-tauri" is not a workspace project or a directory. Available projects: desktop-tauri
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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
Settings follow-ups for Mac parity. Each change is a separate commit.
Language: System (Q9). The Language picker gets a "System" option, listed first, as on the Mac. While it is selected, the app follows the Windows display language. New installs default to System. Settings files written before this change keep the language they had.
New setting
ui_language_follows_system:truefor new installs,falsewhen an oldersettings.jsondoesn't have it.The display language is read from HKCU, in this order:
Control Panel\DesktopPreferredUILanguages;Control Panel\International\User ProfileLanguages;Control Panel\Desktop\MuiCachedMachinePreferredUILanguages.The first tag the app has a translation for wins. If none has one, the language is English, as on the Mac.
It is resolved at load, when System is picked, and after a preferences import. Choosing a specific language, from Settings or the tray menu, stops following the system.
The preferences export carries
ui_language_follows_system. A file exported before this change has aui_languagebut no follow flag. Importing it keeps its language.Quota warnings in the preferences export (Rebuild the provider detail pane in the macOS layout with per-provider quota warnings #827). New portable key
provider_quota_warnings, mapping provider id to{session, weekly}. The validator rejects:nullresets the warnings and takes precedence over the legacy key.Track costs off hides the cost-source switches (Port Mac Usage & Spend settings pane #825). While Track costs is off, Usage & Spend > Data controls hides:
Thresholds stay visible (Settings: Mac layout for General, Notifications, Advanced and About #816). The "Warning at % used" and "Critical at % used" fields stay visible while Threshold warnings is off. They also set the usage-bar and float-bar colours. The Mac hides them; this one difference is kept on purpose.
Hide Personal Info shows no email anywhere (HPI). With HPI on, no surface shows an email, a placeholder or a partial mask. This matches the Mac, whose email placeholder is
"".hide_emails_in_textremoves emails, then tidies the spacing before punctuation, as on the Mac.Q10a (adaptive refresh on by default) is already on
main, atrust/src/settings.rs:650with the test atsettings/tests.rs:1806. No change needed.Mac reference (upstream 0.70.0
Sources/CodexBar)PreferencesGeneralPane.swift:5-66:AppLanguage.systemis the first case, labelled "System".PreferencesSpendDashboardPane.swift:495-512: the OpenCodex and Hide native Codex toggles andSpendDashboardSourceFilteronly render insideif self.settings.costUsageEnabled.PersonalInfoRedactor.swift:AccountOrdinal.labelis "Account %@";emailPlaceholder = "";redactEmailandredactAccountLabel;redactEmails(in:)and the spacing tidy-up.Commands run on the head (57200c6)
CARGO_TARGET_DIR=W:\cargo-target\settings-followups. Heavy steps ran under the E-core wrapper. CI was not set.cargo fmt --all -- --checkcargo test --manifest-path rust/Cargo.tomlcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warningscargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.tomlcargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warningspnpm --config.verify-deps-before-run=false testpnpm exec tsc --noEmitpnpm run buildpnpm run lintNotes on the output:
warning:line in either log is cargo's existing "profiles for the non root package will be ignored".usageSpendSharing.test.tsandAgentSessions.test.tsx. Both files predate this PR and it doesn't touch them.Tests added or changed:
settings/system_language.rs: 3 tests (tag mapping, fallback, follow logic).settings/tests.rs: 3 tests (new install follows, legacy file keeps its language, file round trip).preferences_document/tests.rs: quota-warning round trip, null reset, rejection cases, and the legacy export keeping its language.core/redactor.rs:hide_emails_in_text_removes_emails_without_a_placeholder.commands/settings.rs:choosing_system_language_follows_the_systemandchoosing_a_specific_language_stops_following_the_system.tray_accounts.rs:hidden_claude_and_grok_tray_labels_show_no_email.tray_bridge.rs:hidden_personal_info_removes_emails_from_tooltip_errors.commands/tests.rs: expectations updated for titles with emails removed.GeneralTab.test.tsx: System first and selected, System and specific language picks, thresholds kept (Settings: Mac layout for General, Notifications, Advanced and About #816).UsageSpendTab.test.tsx: Track costs off and on (Port Mac Usage & Spend settings pane #825).personalInfo.test.ts: new.MenuCard.test.tsx,MenuCard.headerAccount.test.ts,IdentitySection.test.tsx,GrokAccountsSection.test.tsxandProviderIssueNotice.test.tsx.Real-window proof
The proof used a debug build of this head (57200c6), built with the proof-kit dirs/reqwest shim. The shim is not committed.
%APPDATA%\CodexBarwas never touched.CODEXBAR_SEED_USAGE_JSONseeded synthetic Codex and Claude snapshots, with the emailsproof@example.comandproof.claude@example.com.lane-s-pr2-20261012-041636, 0 failures.W:/mac-parity/report/lane-s/pr2/steps.jsonl.W:/mac-parity/report/lane-s/pr2/checks-summary.txt.What the log shows:
Language: System (Q9).
uiLanguageFollowsSystemistrue, and the language resolves to English, because this PC's Windows display language is en-US.ui_language_follows_system=falsein the DPAPI-decryptedsettings.json.true.shots/01-language-system.png.Thresholds (Settings: Mac layout for General, Notifications, Advanced and About #816). With Threshold warnings off (
show_notifications=falsein the file), "Warning at % used" (70) and "Critical at % used" (90) are still shown. Shot:shots/02-thresholds-visible-warnings-off.png.Track costs (Port Mac Usage & Spend settings pane #825).
shots/03-track-costs-on.png.cost_usage_enabled=falsein the file), the OpenCodex switch, the Hide native Codex switch and Sources are all gone. Shot:shots/04-track-costs-off.png.Hide Personal Info. The no-email check fails if the page's text or HTML attributes contain
example.comor anything shaped like an email. With HPI off, the check fires on both surfaces below, which shows it can detect the email.proof@example.comshown (shot05-tray-panel-hpi-off.png)09-tray-panel-hpi-on.png)proof@example.com(shot06-provider-detail-hpi-off.png)08-provider-detail-hpi-on.png)05b-float-bar-hpi-off.png)10-float-bar-hpi-on.png)hide_personal_info=truein the file). Shot:shots/07-advanced-hpi-on.png.update_settingsbridge command, not the Menu toggle.hidden_personal_info_removes_emails_from_tooltip_errorsandhidden_claude_and_grok_tray_labels_show_no_emailcover them.I looked at every screenshot. The only emails in them are the two synthetic seed addresses, and they appear only in the HPI-off shots. The screenshots contain no credentials and no local paths.
Open questions (default chosen)
ui_language_follows_systemis exported, so importing on another PC follows that PC's language. Default: export it.GetUserPreferredUILanguagesAPI. The registry read useswinreg, which is already a dependency, so the PR adds none. Default: the registry.language_systemstring. It isn't translated yet. Default: English.Summary by CodeRabbit