Skip to content

fix(agent): make begin form mode options reactive to language switch - #20128

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/begin-form-mode-i18n
Sep 23, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/begin-form-mode-i18n

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

Summary

The mode select options in the Begin form were built at module scope with i18next's t, so their labels were resolved only once at module load and remained in the previous language until a manual page refresh. Move the options inside the component using useTranslation and memoize them on t, so they re-translate immediately when the language changes.

The mode select options in the Begin form were built at module scope
with i18next's `t`, so their labels were resolved only once at module
load and remained in the previous language until a manual page refresh.
Move the options inside the component using `useTranslation` and memoize
them on `t`, so they re-translate immediately when the language changes.
@dcc123456
dcc123456 requested a review from wangq8 September 23, 2026 11:19
@dcc123456 dcc123456 added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Sep 23, 2026
@dcc123456
dcc123456 marked this pull request as draft September 23, 2026 11:20
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a85de570-15a3-4ec9-bf81-7624529991ed

📥 Commits

Reviewing files that changed from the base of the PR and between 109dcdb and d15bec6.

📒 Files selected for processing (1)
  • web/src/pages/agent/form/begin-form/index.tsx

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


📝 Walkthrough

Walkthrough

BeginForm now builds ModeOptions in a useMemo using the t function from useTranslation(). The three mode option values and labels are unchanged.

Changes

Begin form mode options

Layer / File(s) Summary
Build translated mode options
web/src/pages/agent/form/begin-form/index.tsx
ModeOptions is now created inside BeginForm with useMemo and the translation hook’s t function. The module-level i18next import is removed. The three option values and labels are unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: cike8899

Merge Risk: ⚪ Minimal · up to d15be

Changing the UI language refreshes the mode labels, and no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the fix and states that Begin form mode options now react to language changes.
Description check ✅ Passed The description includes the required Summary section and explains the cause, implementation, and intended behavior of the change.
  • Fix all pre-merge checks with AI

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

A rabbit checks the options’ names
The translation hook now supplies the strings
Three modes remain just as they were
The form remembers each translated word
Then hops away with tidy code

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

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

@dcc123456
dcc123456 marked this pull request as ready for review September 23, 2026 11:22
@wangq8
wangq8 merged commit c7e2f63 into infiniflow:main Sep 23, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants