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
refactor(i18n): reactive translate in task page and automations - #39406
This is a batch of the reactive-translate rollout from #39353. It applies pnpm i18n:reactive-translate --helpers to task page and automations:
components/task-page
components/automations
Codemod result: Rewrote 725 call(s), threaded 86 helper(s) into 77 render call site(s), in 142 file(s); left 26 for manual review. Total diff: 148 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:
Skipped by the codemod (26 call sites, still counted by the ratchet):
components/automations/AutomationRunHistory.tsx:75 translate: useMemo without a language dependency (adding one changes when it recomputes)
components/automations/use-automations-page-list-state.ts:84 components/automations/automation-list-view.ts#filterAutomationListRows: useMemo without a language dependency (adding one changes when it recomputes)
components/automations/use-automations-page-list-state.ts:88 components/automations/automation-list-view.ts#filterExternalAutomationListEntries: useMemo without a language dependency (adding one changes when it recomputes)
components/automations/use-automations-page-list-state.ts:189 components/automations/external-automation-unchecked-hosts.ts#externalAutomationUncheckedNotice: useMemo without a language dependency (adding one changes when it recomputes)
components/automations/use-automations-page-list-state.ts:197 components/automations/automation-list-view.ts#buildAutomationListViewItems: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/linear/IssueDialog.tsx:52 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:64 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:73 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:116 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:124 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:135 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:147 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:160 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/IssueDialog.tsx:163 translate: t is already bound here (catalog extraction needs that name)
components/task-page/linear/use-task-page-linear-board.ts:43 components/task-page/linear/task-page-linear-jira-list-model.tsx#groupLinearIssues: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/linear/use-task-page-linear-list-presentation.ts:56 components/task-page/linear/task-page-linear-jira-list-model.tsx#groupLinearIssues: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-provider-state.ts:81 components/task-page/task-page-empty-state.ts#getRepoBackedTaskEmptyState: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-display.ts:47 components/task-page/task-page-source-context.tsx#getGitHubProjectSourceSummary: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-display.ts:55 components/task-source-context-summary.ts#getTaskSourceContextSummary: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-display.ts:65 components/task-source-context-summary.ts#getTaskSourceContextSummary: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-summary.ts:62 components/task-source-context-summary.ts#getTaskSourceAvailabilityNotice: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-summary.ts:74 components/task-source-context-summary.ts#getTaskSourceAvailabilityNotice: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-summary.ts:86 components/task-source-context-summary.ts#getTaskSourceAvailabilityNotice: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-summary.ts:93 components/task-source-context-summary.ts#getTaskSourceAvailabilityNotice: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-summary.ts:115 components/task-source-context-summary.ts#getTaskSourceAvailabilityNotice: useMemo without a language dependency (adding one changes when it recomputes)
components/task-page/use-task-page-source-summary.ts:137 components/task-page/task-page-empty-state.ts#getRepoBackedTaskEmptyState: useMemo without a language dependency (adding one changes when it recomputes)
The render-path-translate ratchet baseline drops to 3332.
Testing
pnpm tc
ORCA_CODE_QUALITY_BASE=origin/main pnpm check:changed (lint, ratchets, related unit tests)
…sk page and automations
Applies pnpm i18n:reactive-translate --helpers. Output is unchanged: t delegates
to translate() and helpers default the threaded parameter.
Automation and task-page components now obtain translations through hooks. Formatting and display helpers accept optional translators or locales, and callers pass active values for translated messages and locale-sensitive output. Existing translation keys, fallback text, status selection, and component actions remain unchanged. The render-path translation baseline records fewer calls for the listed automation and task-page components.
Merge Risk: Low · up to 797a8
Some automation messages may remain in the previous language after a language change. This is bounded localization risk that can be addressed before merge or accepted with follow-up.
Pre-merge checks: 3 · 2
Failed checks: 2 inconclusive
Check name
Status
Explanation
Resolution
Description check
The description covers the scope, the codemod result, the behavior-preservation reasoning, the skipped call sites, and the testing commands. It follows the required template only in part. The ELI5, Vi…
Fill in the template sections that are missing or empty: an ELI5 summary, a What Changed and Why section, the linked issue (or an explanation for the internal maintainer case), a Visual Proof entry (N/A with a reason is acceptable because t…
Docstring Coverage
Docstring coverage is 5.17% 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. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the main change: the codemod moves render-path translation calls in the task page and automations components to the reactive useTranslate hook. It is specific and matches the changeset…
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.
Full details: Title check
Explanation
The title names the main change: the codemod moves render-path translation calls in the task page and automations components to the reactive useTranslate hook. It is specific and matches the changeset. It uses the conventional refactor(i18n) prefix. The description notes that the change is mechanical and keeps behavior unchanged.
Full details: Description check
Explanation
The description covers the scope, the codemod result, the behavior-preservation reasoning, the skipped call sites, and the testing commands. It follows the required template only in part. The ELI5, Visual Proof, Risk level, Linked Issue, and checklist sections are missing or unfilled. The Testing section also has no manual test steps or platform list. The 'Fixes #' issue link is absent, and the baseline count is stated as 3332 in the description but 3389 in the objectives, which needs reconciling.
Resolution
Fill in the template sections that are missing or empty: an ELI5 summary, a What Changed and Why section, the linked issue (or an explanation for the internal maintainer case), a Visual Proof entry (N/A with a reason is acceptable because the change is behavior-neutral), the Risk level and rollback note, and the Testing checkboxes with the platforms tested. Also confirm the render-path-translate ratchet baseline count, since the description says 3332 and the PR objectives say 3389.
Full details: Docstring Coverage
Explanation
Docstring coverage is 5.17% 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 58 functions across 50 files. (93 skipped: 1 unsupported, 92 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.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (3)
Minor · Use the scoped translator for the announced fallback… · AutomationHostFilterNotice.tsx:116-119
src/renderer/src/components/automations/AutomationHostFilterNotice.tsx:116-119 Minor · Functional Correctness · Quick win
Use the scoped translator for the announced fallback message.
The useEffect still calls the module-level translate, while the rest of this component now uses t. Under a TranslationScopeContext that supplies a different t, the screen-reader announcement can differ from the visible message. Use t here and add it to the dependency array.
This line is unchanged, but it is a missed conversion in this file.
Proposed fix
- ? translate(+ ? t(
'auto.components.automations.hostNotice.removed',
'The selected host is no longer available. Showing all hosts.'
)
: ''
)
- }, [resolution.announceFallback])+ }, [resolution.announceFallback, t])
Minor · Convert runCountLabel to the scoped translator. · AutomationRunHistory.tsx:78-83
src/renderer/src/components/automations/AutomationRunHistory.tsx:78-83 Minor · Functional Correctness · Quick win
Convert runCountLabel to the scoped translator.
This useMemo still calls the module-level translate. Every other label in the component now uses t. Under a TranslationScopeContext with a different t, the run-count summary uses the wrong translator. The memo also lacks t and the language revision in its dependencies. The baseline entry for this file (1 call) confirms this call was not converted.
Minor · Convert the remaining translate calls to t. · use-automation-run-page-state.ts:154-158
src/renderer/src/components/automations/use-automation-run-page-state.ts:154-158 Minor · Functional Correctness · Quick win
Convert the remaining translate calls to t.
Both toast.message(translate(...)) calls still use the module-level translate. This hook now uses t for the workspace display. Convert these calls for consistency under a scoped translator. Because this is inside an effect, add t to the dependency array.
96-96: Trivial · Maintainability & Code Quality · Low value
Incomplete migration: translate still used inside the effect.
Line 138 and Line 159 now use the hook t. Line 96 still calls module-level translate. When a translation scope supplies a scoped t, this fallback message ignores it. The fallback also uses the global translator in the load-failure path. Use t here and add t to the effect dependencies, or keep the global translate on purpose and document that choice. The same pattern exists in use-task-page-jira-quick-filters.ts (Line 65) and use-task-page-jira-saved-filters.ts (Line 104).
126-126: Trivial · Maintainability & Code Quality · Low value
Hook translator is not used in the callback.
LinearStateCell now has t from useTranslate(). The toast fallback messages at Line 126 and Line 140 still call module-level translate. A scoped translator is ignored for these messages. Use t and add it to the useCallback dependencies (Line 149).
118-118: Trivial · Maintainability & Code Quality · Low value
formatHostStatus still uses the global translate.
All other labels in getTaskSourceAvailabilityNotice and getAvailabilityLabel use the injected t. formatHostStatus (in task-source-host-status-labels.ts, Line 91) ignores t. The {{host}} {{status}} text is not locale-sensitive, so the output is the same today. If a scoped translator ever differs from the global one, these labels mix translators. Add an optional t parameter to formatHostStatus and pass it here and in availabilityTitlePart.
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: 6dec18c3-63a9-4fd5-ab08-b493c9f32497
Commits
Reviewing files that changed from the base of the PR and between d2506d0 and 797a847.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Update the notice when the translation scope changes.
If the language or active resources change while the host inputs stay the same, the memo can keep the previous notice text. Pass useTranslate() to the helper and include it in the memo dependencies.
Suggested fix
-import { useIntlLocale } from '@/i18n/use-translate'+import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
const intlLocale = useIntlLocale()
+ const t = useTranslate()
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
This is a batch of the reactive-translate rollout from #39353. It applies
pnpm i18n:reactive-translate --helpersto task page and automations:components/task-pagecomponents/automationsCodemod result: Rewrote 725 call(s), threaded 86 helper(s) into 77 render call site(s), in 142 file(s); left 26 for manual review. Total diff: 148 files, including helper files outside the directory that gain a defaulted
t/intlLocaleparameter.This is a mechanical rewrite and behavior is unchanged with React Compiler off:
tfromuseTranslate()delegates totranslate(), so every string is identical. Only its identity changes, and only on a language or resource change, when the tree already re-renders.t: Translate = translate), so callers that don't pass it are unchanged.useMemodeps gaintonly where they already include auseUiLanguageRevision()value.Left for manual work because the rewrite would push these files over the
max-linesbudget. They stay untouched until someone splits them:src/renderer/src/components/automations/use-external-automation-actions.tsSkipped by the codemod (26 call sites, still counted by the ratchet):
tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)tis already bound here (catalog extraction needs that name)The render-path-translate ratchet baseline drops to 3332.
Testing
pnpm tcORCA_CODE_QUALITY_BASE=origin/main pnpm check:changed(lint, ratchets, related unit tests)