Skip to content

i18n: localize visual input file label in agent form - #16594

Merged
wangq8 merged 2 commits into
infiniflow:mainfrom
euvre:fix/visual-input-file-i18n
Jul 3, 2026
Merged

wangq8 merged 2 commits into
infiniflow:mainfrom
euvre:fix/visual-input-file-i18n

Conversation

@euvre

@euvre euvre commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Localized the "Visual Input File" label in the agent form by replacing the hardcoded English string with a translatable i18n key (flow.visualInputFile). Added the corresponding English and Chinese translations.

Also fixed the label styling so that a custom label passed to QueryVariable is wrapped in the same FormLabel component as other form fields, ensuring consistent font/appearance with surrounding labels.

Screenshot_20260703_152509

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added a new visualInputFile translation key to English and Chinese locale files, updated the agent form to use the localized label, and changed QueryVariable so provided labels render while the fallback query label and tooltip remain conditional.

Changes

Visual input file localization

Layer / File(s) Summary
Add translation keys and apply localized label
web/src/locales/en.ts, web/src/locales/zh.ts, web/src/pages/agent/form/agent-form/index.tsx
New visualInputFile translation entries are added in English and Chinese, and the agent form now uses t('flow.visualInputFile') instead of the hardcoded label.
Render provided form labels
web/src/pages/agent/form/components/query-variable.tsx
QueryVariable now renders FormLabel when labels are not hidden, uses the provided label or t('flow.query'), and only sets the tooltip when no label is supplied.

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

Poem

I nibbled a string, then typed it twice,
English and 中文 both feel nice.
Labels now bloom where the form can see,
Tiny text hops for UI harmony. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 summarizes the main change: localizing the visual input file label in the agent form.
Description check ✅ Passed The description matches the required Summary section and explains both the i18n change and the QueryVariable styling fix.

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.

@euvre euvre added the ci Continue Integration label Jul 3, 2026
@euvre
euvre force-pushed the fix/visual-input-file-i18n branch from 8425930 to 574a432 Compare July 3, 2026 07:15
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jul 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
web/src/pages/agent/form/components/query-variable.tsx (1)

79-83: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a clearer conditional than hideLabel || (...).

Relying on React discarding the boolean true when hideLabel is truthy works, but !hideLabel && (...) reads more clearly and is the idiomatic pattern for conditional JSX rendering.

♻️ Suggested tweak
-          {hideLabel || (
+          {!hideLabel && (
             <FormLabel tooltip={label ? undefined : t('flow.queryTip')}>
               {label || t('flow.query')}
             </FormLabel>
           )}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/components/query-variable.tsx` around lines 79 - 83,
The JSX in QueryVariable’s label rendering uses `hideLabel || (...)`, which is
less clear than the idiomatic conditional pattern. Update the conditional in
`QueryVariable` to use `!hideLabel && (...)` so the `FormLabel` rendering reads
directly as “render only when the label is not hidden,” while preserving the
existing `label` and `t('flow.queryTip')` behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@web/src/pages/agent/form/components/query-variable.tsx`:
- Around line 79-83: The JSX in QueryVariable’s label rendering uses `hideLabel
|| (...)`, which is less clear than the idiomatic conditional pattern. Update
the conditional in `QueryVariable` to use `!hideLabel && (...)` so the
`FormLabel` rendering reads directly as “render only when the label is not
hidden,” while preserving the existing `label` and `t('flow.queryTip')`
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1ed275c5-213e-4282-81bf-0079c1b865fd

📥 Commits

Reviewing files that changed from the base of the PR and between 8425930 and 574a432.

📒 Files selected for processing (4)
  • web/src/locales/en.ts
  • web/src/locales/zh.ts
  • web/src/pages/agent/form/agent-form/index.tsx
  • web/src/pages/agent/form/components/query-variable.tsx
✅ Files skipped from review due to trivial changes (3)
  • web/src/locales/zh.ts
  • web/src/locales/en.ts
  • web/src/pages/agent/form/agent-form/index.tsx

@wangq8
wangq8 merged commit 4effd05 into infiniflow:main Jul 3, 2026
3 checks passed
xugangqiang pushed a commit to xugangqiang/ragflow that referenced this pull request Jul 3, 2026
xugangqiang pushed a commit to xugangqiang/ragflow that referenced this pull request Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants