Skip to content

[0.60.4] Keep Claude account labels private - #555

Merged
Finesssee merged 1 commit into
mainfrom
codex/port-0.60.4-claude-privacy
Sep 20, 2026
Merged

Finesssee merged 1 commit into
mainfrom
codex/port-0.60.4-claude-privacy

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Port the privacy behavior from upstream f696a1dc89599cf91110b0bec0a8906f4439c2c3.
  • Use stable localized Account N labels for saved Claude account rows when Hide Personal Info is enabled.
  • Keep matching tooltips redacted and keep labels attached to the same account when the source list reorders.
  • Keep organization details hidden with the account identity and preserve the existing visible-mode behavior.

Validation

  • pnpm exec tsc --noEmit --pretty false
  • pnpm test --run src/components/ClaudeAccountsMenu.test.tsx src/surfaces/settings/providers/sections/credentials/ClaudeSwapAccountsSection.test.tsx (13 passed)
  • pnpm exec oxlint src/components/ClaudeAccountsMenu.tsx src/components/claudeAccountDisplay.ts src/components/ClaudeAccountsMenu.test.tsx
  • git diff --check

This PR is intentionally scoped to the Windows tray account switcher and is ready for review. It is not merged.

Summary by CodeRabbit

  • Bug Fixes
    • Improved privacy mode in the Claude account menu by displaying stable, localized account labels instead of masked email addresses.
    • Added matching redacted tooltips for private account entries.
    • Account labels now remain consistent when the account list is reordered.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c85a4e26-b7df-4481-9ebb-cd74e9c296f7

📥 Commits

Reviewing files that changed from the base of the PR and between 10e3b09 and 7af30ed.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • apps/desktop-tauri/src/components/ClaudeAccountsMenu.test.tsx
  • apps/desktop-tauri/src/components/ClaudeAccountsMenu.tsx
  • apps/desktop-tauri/src/components/claudeAccountDisplay.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Claude account rows now use stable, localized Account N labels and matching tooltips when Hide Personal Info is enabled. Ordinals derive from sorted account IDs, and tests verify stability after account-list reordering.

Changes

Claude account labels

Layer / File(s) Summary
Account display helpers
apps/desktop-tauri/src/components/claudeAccountDisplay.ts
Adds helpers that assign stable ordinals from unique sorted account IDs and return redacted or email-based labels and tooltips.
Menu integration and validation
apps/desktop-tauri/src/components/ClaudeAccountsMenu.tsx, apps/desktop-tauri/src/components/ClaudeAccountsMenu.test.tsx, CHANGELOG.md
The menu uses the new helpers. Tests verify localized masked labels, matching tooltips, and stability after account reordering. The changelog records the fix.

Priority: ⬇️ Low

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

Change: Bug fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: keeping Claude account labels private. It is concise and directly related to the privacy behavior described in the pull request.
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: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Thermo-Nuclear Review: PR #555 — [0.60.4] Keep Claude account labels private

Verdict: APPROVE

Structural regressions

none found.

The extraction is shaped correctly for the codebase's existing conventions: this repo already has a per-provider account-display module pattern (codexAccountDisplay.ts feeding buildPrivateCodexAccountLabel in CodexAccountsMenu.tsx), so a sibling claudeAccountDisplay.ts for the Claude switcher is the canonical home, not a new stray concept. maskEmail (still used by GrokAccountsMenu and MenuCard) is untouched — no cutover pressure on surfaces the PR doesn't own, and no dead code left behind.

The privacy posture is strictly stronger than the masked-email version it replaces: Account N labels expose nothing, the tooltip is redacted with the same label (previously title={email} was set even when hideEmail masked the body — masked emails still leak partial identity in tooltips), the organization row is now fully suppressed under hideEmail (the test asserts textContent contains neither "Personal" nor "Organization"), and visible-mode behavior is unchanged.

Missed simplification opportunities (code-judo)

One modest consolidation available — not a blocker:

  • buildPrivateClaudeAccountLabel duplicates the shape of CodexAccountsMenu.tsx's private buildPrivateCodexAccountLabel (same {label, tooltip} pair, same hidePersonalInfo ? "Account N" : derived branch, same accountWord parameter threading). The PrivateClaudeAccountLabel interface is a rename of the PrivateCodexAccountLabel interface declared locally in CodexAccountsMenu.tsx. A shared buildPrivateAccountLabel(accountWord, ordinal, privateName, hide) in a common module would delete both copies and the duplicated interface. However: the Codex variant takes a display name while the Claude variant derives from account.email, so unifying requires one more parameter and touches a file this PR deliberately avoids; the upstream port scope argues for leaving it. Flag for a follow-up consolidation, not this PR.
  • buildClaudeAccountOrdinals sorts Set-derived ids with a hand-written 3-way comparator; [...ids].sort() (default lexicographic) is identical for strings and one line shorter. Cosmetic.

Spaghetti / branching complexity

none found. The only new control flow is hidePersonalInfo ? inside the dedicated label builder, plus the ordinal === undefined → "••••" fallback in the same place. No branching was added to the menu's render flow beyond a precomputed accountOrdinals map (once per render, outside the .map). The stability guarantee (ordinals assigned by sorted stable id, not array position) is exactly what makes the reorder test meaningful — this is a model fix, not a patch-over.

Boundary / abstraction / type problems

One real, small observation — accepted as-is:

  • The repo already has a backend-owned ordinals contract for Codex: getCodexAccountsState ships accountOrdinals: Record<string, number> from commands/codex_accounts.rs::ordinals_by_id, and ClaudeAccount list rows come from claudeAccountsList. This PR computes Claude ordinals client-side in a TS helper instead. That's a boundary choice, not a leak: there is no existing Claude-accounts-state bridge payload to hang the field on, and adding backend plumbing for one menu would be more machinery than the feature warrants. Client-side derivation from the source-owned stable id is the boring, correct call here. No change requested.
  • Types are clean: readonly ClaudeAccount[] input, Record<string, number> output, number | undefined only for the genuinely-absent-ordinal case, no any/casts.

File-size / decomposition concerns

none. New file is 34 lines; ClaudeAccountsMenu.tsx is 108 lines. Nothing near thresholds.

Lower-priority notes

  • "••••" for an ordinal-less account is a reasonable degraded state (can only occur if an id somehow isn't in the map built from the same list in the same render — practically unreachable); it degrades safe rather than leaking.
  • The reorder-stability test (dispatch focus, swap list order, assert labels follow ids) is the highest-value test in the PR — it pins the invariant that motivated the helper extraction.
  • Test asserts on .firstChild?.textContent / title attribute rather than visible text queries; slightly brittle to DOM shape, but acceptable for verifying tooltip redaction which query-by-text can't reach.

@Finesssee
Finesssee merged commit 8ccd1b2 into main Sep 20, 2026
4 checks passed
@Finesssee
Finesssee deleted the codex/port-0.60.4-claude-privacy branch September 20, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant