Skip to content

refactor(i18n): reactive translate in status bar - #39401

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/i18n-reactive-translate-status-bar
Nov 8, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/i18n-reactive-translate-status-bar

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This is a batch of the reactive-translate rollout from #39353. It applies pnpm i18n:reactive-translate --helpers to status bar:

  • components/status-bar

Codemod result: Rewrote 366 call(s), threaded 80 helper(s) into 100 render call site(s), in 85 file(s); left 7 for manual review. Total diff: 92 files, including helper files outside the directory that gain a defaulted t / intlLocale parameter.

This is a mechanical rewrite and behavior is unchanged with React Compiler off:

  • t from useTranslate() delegates to translate(), so every string is identical. Only its identity changes, and only on a language or resource change, when the tree already re-renders.
  • A threaded helper defaults its new parameter (t: Translate = translate), so callers that don't pass it are unchanged.
  • useMemo deps gain t only where they already include a useUiLanguageRevision() value.

Left for manual work because the rewrite would push these files over the max-lines budget. They stay untouched until someone splits them:

  • src/renderer/src/components/automations/use-external-automation-actions.ts

Skipped by the codemod (7 call sites, still counted by the ratchet):

  • components/status-bar/SshStatusSegment.tsx:210 translate: t is already bound here (catalog extraction needs that name)
  • components/status-bar/SshStatusSegment.tsx:251 translate: t is already bound here (catalog extraction needs that name)
  • components/status-bar/SshStatusSegment.tsx:299 translate: t is already bound here (catalog extraction needs that name)
  • components/status-bar/use-owner-usage-rate-limits.ts:196 components/status-bar/owner-usage-rate-limits.ts#resolveOwnerUsageRateLimits: useMemo without a language dependency (adding one changes when it recomputes)
  • components/status-bar/use-resource-usage-derived-model.ts:110 components/status-bar/mergeSnapshotAndSessions.ts#mergeSnapshotAndSessions: useMemo without a language dependency (adding one changes when it recomputes)
  • components/status-bar/use-resource-usage-status-controller.ts:142 components/status-bar/runtime-host-resources.ts#getRuntimeHostResourceNotices: useMemo without a language dependency (adding one changes when it recomputes)
  • components/status-bar/use-workspace-space-decision-projection.ts:77 components/status-bar/workspace-space-decision-details.ts#getWorkspaceDecisionDetails: useMemo without a language dependency (adding one changes when it recomputes)

The render-path-translate ratchet baseline drops to 4536.

Testing

  • pnpm tc
  • ORCA_CODE_QUALITY_BASE=origin/main pnpm check:changed (lint, ratchets, related unit tests)
Files Added Deleted Net
Test 0 0 0 0
Prod 87 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1314 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1420 $\color{#cf222e}{\Huge{\mathbf{−}}}$​106

@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-plugins-skills branch from fe3dbf3 to 359fc64 Compare November 7, 2026 10:17
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-status-bar branch from a082b8b to ceb2644 Compare November 7, 2026 10:18
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-plugins-skills branch from 359fc64 to 8408bf8 Compare November 7, 2026 10:40
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-status-bar branch from ceb2644 to 6d6dc03 Compare November 7, 2026 10:40
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-plugins-skills branch from 8408bf8 to 1114ddc Compare November 7, 2026 11:27
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-status-bar branch from 6d6dc03 to 958e088 Compare November 7, 2026 11:28
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-plugins-skills branch from 1114ddc to 81ec8b5 Compare November 7, 2026 21:04
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-status-bar branch from 958e088 to 998033a Compare November 7, 2026 21:05
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-plugins-skills branch from 81ec8b5 to fbcb7f4 Compare November 8, 2026 02:58
@OrcaWin
OrcaWin changed the base branch from OrcaWin/i18n-reactive-translate-plugins-skills to main November 8, 2026 03:17
…atus bar

Applies pnpm i18n:reactive-translate --helpers. Output is unchanged: t delegates
to translate() and helpers default the threaded parameter.
@OrcaWin
OrcaWin force-pushed the OrcaWin/i18n-reactive-translate-status-bar branch from 998033a to 17aa831 Compare November 8, 2026 03:19
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Status-bar components now obtain translations through useTranslate and pass the translator to copy and formatting helpers. Several helpers accept optional translator parameters, and several time-formatting calls now receive the active locale. Existing translation keys, fallback text, and display conditions are retained.

Merge Risk: Minimal · up to 17aa8

No actionable risk introduced by this change remains after the reviewed translation paths were checked. Merge after normal checks.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 20.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title "refactor(i18n): reactive translate in status bar" matches the main change. The PR applies a codemod that switches status-bar components from the module-level translate to the `useTranslat…
Description check Passed The description covers the summary, the codemod result, the mechanical nature of the change, the seven skipped call sites, and the testing commands. It does not fill the template's ELI5, What Changed,…
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 "refactor(i18n): reactive translate in status bar" matches the main change. The PR applies a codemod that switches status-bar components from the module-level translate to the useTranslate hook, and threads a defaulted Translate parameter through helpers. The title is concise and specific, and a teammate scanning history would understand the primary change. It omits the helper threading, which is expected.

Full details: Description check

Explanation

The description covers the summary, the codemod result, the mechanical nature of the change, the seven skipped call sites, and the testing commands. It does not fill the template's ELI5, What Changed, and Why sections in the template's own terms. The Linked Issue section is missing (it only says the work is part of #39353, which is a rollout reference, not a fix link). Visual Proof is absent and not marked N/A, even though the change is described as behavior-neutral. The Testing checklist and Risk level are also unfilled. The AI Disclosure and Review sections are blank. Because the core content is present and the change is mechanical, the description is mostly complete, but several required template sections need attention.

Resolution

Add the template sections that are missing or blank: ELI5, a Why section explaining the reason for the rollout and why codemod over alternatives, a Linked Issue entry (or explanation that #39353 is the tracking issue), Visual Proof marked N/A with the reason that the rendered output is unchanged, the Risk level (likely Low) with a revert note, and the Testing checkboxes ticked to reflect what was run. Also resolve the mismatch in the ratchet baseline figure: the description says 4536 while the PR objectives say 4114.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 77 functions across 50 files. (35 skipped: 35 over the file limit.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches

Generate docstrings

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

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8acb722b-4009-407a-9acd-420da8e5a94a
Commits

Reviewing files that changed from the base of the PR and between e53d2ec and 17aa831.

Files selected for processing: 87

  • config/memo-translate-subscription-baseline.txt
  • config/render-path-translate-baseline.txt
  • src/renderer/src/components/pet/pet-import-failure-text.ts
  • src/renderer/src/components/settings/agents/behavior/agent-awake-copy.ts
  • src/renderer/src/components/status-bar/AccountSwitchList.tsx
  • src/renderer/src/components/status-bar/AccountSwitchRowItem.tsx
  • src/renderer/src/components/status-bar/AntigravityUsageMenu.tsx
  • src/renderer/src/components/status-bar/CaffeinateStatusSegment.tsx
  • src/renderer/src/components/status-bar/ClaudeSwitcherForOwner.tsx
  • src/renderer/src/components/status-bar/CodexResetCredits.tsx
  • src/renderer/src/components/status-bar/CodexSwitcherMenu.tsx
  • src/renderer/src/components/status-bar/InlineProviderUsage.tsx
  • src/renderer/src/components/status-bar/NativeChatResumeStatusSegment.tsx
  • src/renderer/src/components/status-bar/PetStatusSegment.tsx
  • src/renderer/src/components/status-bar/PluginStatusBarItems.tsx
  • src/renderer/src/components/status-bar/PluginsStatusSegment.tsx
  • src/renderer/src/components/status-bar/PortsStatusSegment.tsx
  • src/renderer/src/components/status-bar/ProviderAccountChatButton.tsx
  • src/renderer/src/components/status-bar/ProviderIdentityCard.tsx
  • src/renderer/src/components/status-bar/RemoteServerUpdateStatusSegment.tsx
  • src/renderer/src/components/status-bar/ResourcePtyDetails.tsx
  • src/renderer/src/components/status-bar/ResourcePtyList.tsx
  • src/renderer/src/components/status-bar/ResourcePtyPanel.tsx
  • src/renderer/src/components/status-bar/ResourcePtyRow.tsx
  • src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx
  • src/renderer/src/components/status-bar/RuntimeHostStatusRow.tsx
  • src/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsx
  • src/renderer/src/components/status-bar/SshHostFindPopover.tsx
  • src/renderer/src/components/status-bar/SshTargetStatusRow.tsx
  • src/renderer/src/components/status-bar/StatusBarAccountControls.tsx
  • src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx
  • src/renderer/src/components/status-bar/StatusBarSurface.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNoticeCard.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx
  • src/renderer/src/components/status-bar/UpdateStatusSegment.tsx
  • src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/WorkspaceSpaceCompactPanel.tsx
  • src/renderer/src/components/status-bar/codex-switcher-projection.ts
  • src/renderer/src/components/status-bar/hosted-review-label.ts
  • src/renderer/src/components/status-bar/mergeSnapshotAndSessions.ts
  • src/renderer/src/components/status-bar/owner-not-set-up-copy.ts
  • src/renderer/src/components/status-bar/owner-usage-rate-limits.ts
  • src/renderer/src/components/status-bar/ports-status-popover-rows.tsx
  • src/renderer/src/components/status-bar/provider-extra-usage-section.tsx
  • src/renderer/src/components/status-bar/remote-host-connection-status.ts
  • src/renderer/src/components/status-bar/resource-manager-terminal-copy.ts
  • src/renderer/src/components/status-bar/resource-memory-metric-copy.ts
  • src/renderer/src/components/status-bar/resource-usage-kill-dialog.tsx
  • src/renderer/src/components/status-bar/resource-usage-metrics.tsx
  • src/renderer/src/components/status-bar/resource-usage-popover-body.tsx
  • src/renderer/src/components/status-bar/resource-usage-popover-summary.tsx
  • src/renderer/src/components/status-bar/resource-usage-resource-tree.tsx
  • src/renderer/src/components/status-bar/resource-usage-session-rows.tsx
  • src/renderer/src/components/status-bar/resource-usage-status-trigger.tsx
  • src/renderer/src/components/status-bar/runtime-host-resources.ts
  • src/renderer/src/components/status-bar/ssh-status-segment-copy.ts
  • src/renderer/src/components/status-bar/status-bar-usage-sections.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-grouped-pools.tsx
  • src/renderer/src/components/status-bar/usage-percentage-label.ts
  • src/renderer/src/components/status-bar/usage-pool-label.ts
  • src/renderer/src/components/status-bar/usage-roster-row-state.ts
  • src/renderer/src/components/status-bar/usage-unit-label.tsx
  • src/renderer/src/components/status-bar/use-codex-switcher-controller.ts
  • src/renderer/src/components/status-bar/use-owner-usage-rate-limits.ts
  • src/renderer/src/components/status-bar/use-resource-pty-actions.ts
  • src/renderer/src/components/status-bar/use-resource-usage-derived-model.ts
  • src/renderer/src/components/status-bar/use-status-bar-controller.ts
  • src/renderer/src/components/status-bar/use-workspace-space-manager-projection.ts
  • src/renderer/src/components/status-bar/workspace-space-breakdown-list.tsx
  • src/renderer/src/components/status-bar/workspace-space-changes.tsx
  • src/renderer/src/components/status-bar/workspace-space-decision-details.ts
  • src/renderer/src/components/status-bar/workspace-space-decision-hover-card.tsx
  • src/renderer/src/components/status-bar/workspace-space-decision-labels.ts
  • src/renderer/src/components/status-bar/workspace-space-format.ts
  • src/renderer/src/components/status-bar/workspace-space-manager-overview.tsx
  • src/renderer/src/components/status-bar/workspace-space-manager-table.tsx
  • src/renderer/src/components/status-bar/workspace-space-manager-toolbar.tsx
  • src/renderer/src/components/status-bar/workspace-space-metrics.tsx
  • src/renderer/src/components/status-bar/workspace-space-status-badge.tsx
  • src/renderer/src/components/status-bar/workspace-space-treemap.tsx
  • src/renderer/src/components/status-bar/workspace-space-worktree-actions.tsx
  • src/renderer/src/components/status-bar/workspace-space-worktree-row.tsx
Files with no reviewable changes: 2

  • config/memo-translate-subscription-baseline.txt
  • config/render-path-translate-baseline.txt

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

@OrcaWin
OrcaWin merged commit 9df0b13 into main Nov 8, 2026
72 of 74 checks passed
@OrcaWin
OrcaWin deleted the OrcaWin/i18n-reactive-translate-status-bar branch November 8, 2026 03:41
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