Repository navigation
i18n: localize visual input file label in agent form - #16594
Conversation
📝 WalkthroughWalkthroughAdded a new ChangesVisual input file localization
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
8425930 to
574a432
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/src/pages/agent/form/components/query-variable.tsx (1)
79-83: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a clearer conditional than
hideLabel || (...).Relying on React discarding the boolean
truewhenhideLabelis 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
📒 Files selected for processing (4)
web/src/locales/en.tsweb/src/locales/zh.tsweb/src/pages/agent/form/agent-form/index.tsxweb/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
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
labelpassed toQueryVariableis wrapped in the sameFormLabelcomponent as other form fields, ensuring consistent font/appearance with surrounding labels.