Skip to content

fix:修复创建渠道,分类选择不显示label的问题、API地址增加“完整URL”支持 - #4756

Open
yutons wants to merge 2 commits into
QuantumNous:mainfrom
yutons:yutons
Open

fix:修复创建渠道,分类选择不显示label的问题、API地址增加“完整URL”支持#4756
yutons wants to merge 2 commits into
QuantumNous:mainfrom
yutons:yutons

Conversation

@yutons

@yutons yutons commented May 11, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

修复创建渠道,分类选择不显示label的问题、API地址增加“完整URL”支持

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

修复创建渠道,分类选择不显示label的问题、API地址增加“完整URL”支持

🚀 变更类型 / Type of change

  • [√] 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

new-api

Summary by CodeRabbit

  • New Features

    • Added "Use Full URL" toggle option for channel configuration, allowing users to specify whether to use complete request URLs instead of appending paths.
    • Enhanced channel configuration interface to dynamically switch between "Base URL" and "Full Request URL" input modes.
    • Improved combobox input component with dedicated editing mode for better user experience.
  • Localization

    • Added multi-language support for new URL configuration prompts and helper text across English, French, Japanese, Russian, Vietnamese, and Chinese locales.

Review Change Stack

yutons added 2 commits May 11, 2026 00:07
- 修复选择渠道类型后输入框显示数字编号而非名称的问题
- 修复选中后再次打开下拉框只显示已选项、不显示全部选项的问题
- 修复选中选项后输入框未自动失去焦点的问题
- 引入 isEditing/editValue 双状态机制,非编辑态显示 label,编辑态显示用户输入
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds a new use_full_url configuration toggle that allows channels to accept complete request URLs without path concatenation. The feature integrates across the backend request routing, frontend form handling, UI component logic, and localization infrastructure to provide a flexible URL configuration option for multiple channel types.

Changes

Full Request URL Toggle Implementation

Layer / File(s) Summary
Data Model Definition
dto/channel_settings.go, web/default/src/features/channels/types.ts
Backend DTO and frontend TypeScript interface both add use_full_url boolean field to represent the new channel setting.
Form Schema and Transformations
web/default/src/features/channels/lib/channel-form.ts
Form schema includes optional use_full_url field with false default, parses the setting from API channel JSON, and serializes it back into the settings payload.
Backend Request URL Routing
relay/channel/api_request.go
Three request methods (DoApiRequest, DoFormRequest, DoWssRequest) conditionally select upstream URL: when UseFullURL is true, use info.ChannelBaseUrl directly; otherwise call a.GetRequestURL(info).
ComboboxInput Editing Mode
web/default/src/components/ui/combobox-input.tsx
Component now supports internal editing state separate from controlled value, enabling typed text filtering and commit-on-Enter behavior for better URL input experience.
Channel Configuration UI
web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
Channel mutate drawer conditionally renders base-URL inputs with dynamic labels/placeholders/descriptions for Azure, FastGPT, SunoAPI, VolcEngine (locked/unlocked), and generic channel types based on use_full_url toggle.
Multi-Language Support
web/default/src/i18n/locales/*.json
Seven locale files (English, French, Japanese, Russian, Vietnamese, Chinese) updated with translations for new UI labels, helper text, example endpoint formats, and usage guidance; footer key normalized to footer.newapi.projectAttributionSuffix.
Localization Sync
web/default/src/i18n/locales/_reports/*
Sync report updated to reflect new untranslated count for Chinese locale; untranslated JSON includes new example URL string entry.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • QuantumNous/new-api#2971: Also modifies ChannelOtherSettings struct in dto/channel_settings.go by adding a different boolean field.

Suggested reviewers

  • seefs001
  • Calcium-Ion

Poem

🐰 A toggle to use URLs so complete,
No path-chasing games, just endpoints neat,
From backend to form with a single switch,
Locales light up—a feature-rich pitch! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main changes: fixing the channel type selection label display issue and adding full URL support for API addresses. Both are real, significant aspects of the changeset.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@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.

Actionable comments posted: 7

🧹 Nitpick comments (6)
web/default/src/components/ui/combobox-input.tsx (1)

45-46: ⚡ Quick win

Consider using i18n for default prop values.

The default values for placeholder and emptyText are English strings. While parent components can override these with translated text, applying t() to the defaults would ensure they're translated even when not explicitly overridden by the parent.

♻️ Proposed refactor to add i18n to defaults
 export function ComboboxInput({
   options,
   value = '',
   onValueChange,
-  placeholder = 'Select or type...',
-  emptyText = 'No option found.',
+  placeholder,
+  emptyText,
   className,
   id,
 }: ComboboxInputProps) {
   const { t } = useTranslation()
+  const defaultPlaceholder = placeholder ?? t('Select or type...')
+  const defaultEmptyText = emptyText ?? t('No option found.')
   const [open, setOpen] = React.useState(false)

Then use defaultPlaceholder and defaultEmptyText throughout the component where these values are referenced.

As per coding guidelines: "All user-facing text content must support i18n using the t() function from useTranslation() in React components".

🤖 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/default/src/components/ui/combobox-input.tsx` around lines 45 - 46, The
default English strings for the props placeholder and emptyText should be
wrapped with the i18n t() function; import and call useTranslation() in the
component to get t, create defaultPlaceholder and defaultEmptyText (e.g. const
defaultPlaceholder = t('combobox.placeholder', 'Select or type...') and const
defaultEmptyText = t('combobox.empty', 'No option found.')), then use those
defaults wherever placeholder and emptyText are referenced (or assign them as
default values for the component props) so the ComboboxInput component uses
translated defaults when parents don’t override them.
web/default/src/i18n/locales/zh.json (1)

1463-1464: ⚖️ Poor tradeoff

Translations look good; consider hierarchical keys for future work.

The Chinese translations for the new "Full URL" feature are accurate and appropriate. The entries correctly follow the existing pattern used throughout this file.

However, the coding guideline recommends using hierarchical and semantically clear translation key names (e.g., dashboard.overview.title) rather than English phrases as keys. While the current approach is consistent with the majority of entries in this file, consider migrating to hierarchical keys in future work for better maintainability and alignment with the guideline. For example:

  • "Full Request URL""channel.api.fullRequestUrl"
  • "Use a complete request URL...""channel.api.fullRequestUrl.hint"

This would be a project-wide refactoring effort and shouldn't block this PR. As per coding guidelines, i18n files should use hierarchical and semantically clear translation key names such as dashboard.overview.title and maintain naming consistency.

Also applies to: 1798-1799, 4162-4162

🤖 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/default/src/i18n/locales/zh.json` around lines 1463 - 1464, The i18n
entries currently use English-phrase keys ("Enter the complete API request URL.
The system will use this URL directly without appending any path." and "Enter
the complete request URL. The system will use this URL directly without
appending any path.") — convert these to hierarchical semantic keys (e.g.,
channel.api.fullRequestUrl and channel.api.fullRequestUrl.hint), update the JSON
keys accordingly, and then update all places in the codebase that reference the
original English keys to use the new hierarchical keys; also apply the same
renaming pattern to the other occurrences noted in the review so all
translations remain consistent.
web/default/src/i18n/locales/en.json (1)

1463-1464: ⚡ Quick win

Unify duplicated “complete URL” helper copy

These two entries are near-duplicates with only “API” differing, which will drift over time and create inconsistent UX wording. Prefer one canonical string (or one key with interpolation) and reuse it.

🤖 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/default/src/i18n/locales/en.json` around lines 1463 - 1464, Unify the
near-duplicate localization entries by keeping one canonical key/value and
removing the duplicate: replace the two strings "Enter the complete API request
URL. The system will use this URL directly without appending any path." and
"Enter the complete request URL. The system will use this URL directly without
appending any path." with a single shared key (or a key with an interpolated
token like "Enter the complete {type} request URL...") and update callers to use
that single key (or pass type="API" where needed) so the wording is consistent
and not duplicated.
web/default/src/i18n/locales/vi.json (1)

1463-1464: 🏗️ Heavy lift

Use hierarchical i18n keys for new full-URL strings

The new keys are source-text keys (for example at Line 1798 and Line 4167) instead of semantic hierarchical keys. Please migrate these additions to structured keys (e.g., channels.form.fullUrl.label, channels.form.fullUrl.placeholder) and update call sites accordingly.

As per coding guidelines, web/default/src/i18n/**/*.{ts,tsx,json} must "Use hierarchical and semantically clear translation key names such as dashboard.overview.title and maintain naming consistency".

Also applies to: 1798-1799, 4162-4167

🤖 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/default/src/i18n/locales/vi.json` around lines 1463 - 1464, The new
Vietnamese translations use source-text keys instead of hierarchical keys;
replace the two string keys "Enter the complete API request URL. The system will
use this URL directly without appending any path." and "Enter the complete
request URL. The system will use this URL directly without appending any path."
with semantically hierarchical keys (for example channels.form.fullUrl.label and
channels.form.fullUrl.placeholder) in vi.json, move the empty values under those
keys, and then update all call sites that reference the original source-text
keys to use the new keys (e.g., channels.form.fullUrl.label /
channels.form.fullUrl.placeholder) — do the same migration for the other
occurrences of these source-text keys elsewhere in i18n files so naming is
consistent across web/default/src/i18n.
web/default/src/features/channels/lib/channel-form.ts (1)

394-395: ⚡ Quick win

Consider optimizing settings JSON size by omitting false values.

The current implementation always sets use_full_url in the settings object, even when it's false. This could bloat the JSON payload. Consider following the pattern used for other optional settings:

 // Use full URL setting — applies to all channel types
-settingsObj.use_full_url = formData.use_full_url === true
+if (formData.use_full_url === true) {
+  settingsObj.use_full_url = true
+} else if ('use_full_url' in settingsObj) {
+  delete settingsObj.use_full_url
+}

This ensures the field is only present when explicitly enabled, making the stored JSON more compact and readable. The backend already uses omitempty (dto/channel_settings.go:44), so omitting false values aligns with the backend's intent.

🤖 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/default/src/features/channels/lib/channel-form.ts` around lines 394 -
395, The settings object always assigns settingsObj.use_full_url =
formData.use_full_url === true which writes false into the JSON; change this to
only set the property when the form value is true (mirror other optional
settings) so the key is omitted when false—update the logic in channel-form.ts
where settingsObj is built (referencing settingsObj, formData.use_full_url) to
conditionally add settingsObj.use_full_url only if formData.use_full_url ===
true.
relay/channel/api_request.go (1)

291-300: ⚡ Quick win

Consider validating ChannelBaseUrl when UseFullURL is enabled to provide clearer error messages.

When UseFullURL is true, ChannelBaseUrl is used directly without validation. Since GetBaseURL() can return an empty string, an invalid URL could reach http.NewRequest (line 304) and produce a generic parse error. Add a check for non-empty and valid URL format before using it, or enhance the error message from http.NewRequest to clarify the root cause when it fails on an empty or malformed URL.

🤖 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 `@relay/channel/api_request.go` around lines 291 - 300, When
info.ChannelMeta.ChannelOtherSettings.UseFullURL is true the code uses
info.ChannelBaseUrl directly which can be empty or malformed and later causes a
generic error in http.NewRequest; validate the value first by checking it's
non-empty and parseable (e.g., call url.Parse on info.ChannelBaseUrl) and return
a clear error like "invalid ChannelBaseUrl: empty or malformed" if parsing
fails, or alternatively call GetRequestURL when parsing fails to produce a
better message; update the branch handling UseFullURL and ensure any error
returned references ChannelBaseUrl and UseFullURL so callers understand the root
cause instead of the generic http.NewRequest parse error.
🤖 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.

Inline comments:
In
`@web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx`:
- Around line 1805-1860: The toggle between Input and Select (useFullURL) can
lose/override user input because Select uses a hard fallback value and the
components unmount/mount; update the rendering so both controls bind directly to
the same field without a fallback (use value={field.value} and
onChange={field.onChange} for both Input and Select) and remove the "||
'https://ark.cn-beijing.volces.com'" default; if you need to preserve distinct
"custom" vs "preset" values, persist the custom URL in a separate local state
(e.g., customUrl) and sync it with the form field when toggling (read/write via
field.onChange) and ensure both Input and Select share a stable key/name so
validation (errors) and form state remain intact and no console errors occur
during the swap.

In `@web/default/src/i18n/locales/en.json`:
- Around line 1798-1799: The new phrase-based i18n keys ("Use Full URL", "Full
Request URL", "Full Request URL *") must be replaced with hierarchical semantic
keys to match project conventions: add keys like
channels.form.api.useFullUrl.label, channels.form.api.fullRequestUrl.label, and
channels.form.api.fullRequestUrl.requiredLabel in
web/default/src/i18n/locales/en.json (and mirror them in other locale files),
move the existing English strings under these keys, and update any code
references that use the old phrase keys to the new hierarchical keys (also check
the other occurrence noted around line 4167 and adjust similarly).

In `@web/default/src/i18n/locales/fr.json`:
- Around line 1287-1295: The FR locale JSON has multiple empty translations for
new "full URL" UI strings (keys like "e.g.,
https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
"e.g., https://fastgpt.run/api/openapi/v1/chat/completions" and the other
repeated keys at lines noted) — fill each empty value with an appropriate French
example string (e.g., "p. ex., https://...") to avoid blank UI labels/help text;
update the values in fr.json for the exact keys mentioned so they mirror the
existing translated patterns like "par ex., https://..." or "p. ex.,
https://..." and run a quick search for any remaining "" values for similar keys
to ensure none are left untranslated.
- Around line 1287-1295: The current fr.json entries use raw example
sentences/URLs as translation keys (e.g., "e.g.,
https://api.example.com/suno/submit", "e.g.,
https://api.openai.com/v1/chat/completions") which violates the i18n naming
convention; replace each raw-string key with a hierarchical semantic key (for
example channel.examples.suno, channel.examples.openai,
channel.examples.azure.docs, etc.), move the English example URL into the value
for fr.json (translated form only if needed), and ensure the new keys follow the
project's dot-separated pattern (e.g., channel.fullUrl.label,
channel.fullUrl.help, channel.fullUrl.examples.openai); update the corresponding
keys in other locale files and any components using the old keys so lookups use
the new semantic keys (also fix the other occurrences noted in the review).

In `@web/default/src/i18n/locales/ja.json`:
- Around line 1287-1295: Fill the empty Japanese translations for the newly
added full-URL keys in the ja.json locale by replacing each "" value with a
concise Japanese example string matching the pattern used elsewhere (e.g., "例:
https://..."); specifically update the keys "e.g.,
https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
and "e.g., https://fastgpt.run/api/openapi/v1/chat/completions" with appropriate
Japanese example text (e.g., "例: https://api.example.com/v1/chat/completions");
apply the same pattern to the other occurrences noted (around lines 1463-1464,
1798-1799, 4162, 4167) so no keys remain empty.

In `@web/default/src/i18n/locales/ru.json`:
- Around line 1287-1295: The new Russian locale entries for several Full URL
helper strings (for example the keys "e.g.,
https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
and "e.g., https://fastgpt.run/api/openapi/v1/chat/completions") are empty and
will render blank UI; fill each empty value with the appropriate Russian
translation (or a sensible fallback like the English example string) matching
the other nearby translated entries (e.g., use "например, <url>") so
placeholders/help text are visible in the ru.json file and consistent across the
Full URL fields.

In `@web/default/src/i18n/locales/vi.json`:
- Around line 1287-1295: Populate the empty Vietnamese translation values in
vi.json for the newly added keys so the UI placeholders don't render blank;
specifically provide appropriate Vietnamese strings for "e.g.,
https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
and "e.g., https://fastgpt.run/api/openapi/v1/chat/completions" (and the other
empty entries noted in the review), matching the existing style used for entries
like "e.g., https://api.openai.com/v1/chat/completions" and "ví dụ:
https://fastgpt.run/api/openapi" and keeping punctuation/format consistent.

---

Nitpick comments:
In `@relay/channel/api_request.go`:
- Around line 291-300: When info.ChannelMeta.ChannelOtherSettings.UseFullURL is
true the code uses info.ChannelBaseUrl directly which can be empty or malformed
and later causes a generic error in http.NewRequest; validate the value first by
checking it's non-empty and parseable (e.g., call url.Parse on
info.ChannelBaseUrl) and return a clear error like "invalid ChannelBaseUrl:
empty or malformed" if parsing fails, or alternatively call GetRequestURL when
parsing fails to produce a better message; update the branch handling UseFullURL
and ensure any error returned references ChannelBaseUrl and UseFullURL so
callers understand the root cause instead of the generic http.NewRequest parse
error.

In `@web/default/src/components/ui/combobox-input.tsx`:
- Around line 45-46: The default English strings for the props placeholder and
emptyText should be wrapped with the i18n t() function; import and call
useTranslation() in the component to get t, create defaultPlaceholder and
defaultEmptyText (e.g. const defaultPlaceholder = t('combobox.placeholder',
'Select or type...') and const defaultEmptyText = t('combobox.empty', 'No option
found.')), then use those defaults wherever placeholder and emptyText are
referenced (or assign them as default values for the component props) so the
ComboboxInput component uses translated defaults when parents don’t override
them.

In `@web/default/src/features/channels/lib/channel-form.ts`:
- Around line 394-395: The settings object always assigns
settingsObj.use_full_url = formData.use_full_url === true which writes false
into the JSON; change this to only set the property when the form value is true
(mirror other optional settings) so the key is omitted when false—update the
logic in channel-form.ts where settingsObj is built (referencing settingsObj,
formData.use_full_url) to conditionally add settingsObj.use_full_url only if
formData.use_full_url === true.

In `@web/default/src/i18n/locales/en.json`:
- Around line 1463-1464: Unify the near-duplicate localization entries by
keeping one canonical key/value and removing the duplicate: replace the two
strings "Enter the complete API request URL. The system will use this URL
directly without appending any path." and "Enter the complete request URL. The
system will use this URL directly without appending any path." with a single
shared key (or a key with an interpolated token like "Enter the complete {type}
request URL...") and update callers to use that single key (or pass type="API"
where needed) so the wording is consistent and not duplicated.

In `@web/default/src/i18n/locales/vi.json`:
- Around line 1463-1464: The new Vietnamese translations use source-text keys
instead of hierarchical keys; replace the two string keys "Enter the complete
API request URL. The system will use this URL directly without appending any
path." and "Enter the complete request URL. The system will use this URL
directly without appending any path." with semantically hierarchical keys (for
example channels.form.fullUrl.label and channels.form.fullUrl.placeholder) in
vi.json, move the empty values under those keys, and then update all call sites
that reference the original source-text keys to use the new keys (e.g.,
channels.form.fullUrl.label / channels.form.fullUrl.placeholder) — do the same
migration for the other occurrences of these source-text keys elsewhere in i18n
files so naming is consistent across web/default/src/i18n.

In `@web/default/src/i18n/locales/zh.json`:
- Around line 1463-1464: The i18n entries currently use English-phrase keys
("Enter the complete API request URL. The system will use this URL directly
without appending any path." and "Enter the complete request URL. The system
will use this URL directly without appending any path.") — convert these to
hierarchical semantic keys (e.g., channel.api.fullRequestUrl and
channel.api.fullRequestUrl.hint), update the JSON keys accordingly, and then
update all places in the codebase that reference the original English keys to
use the new hierarchical keys; also apply the same renaming pattern to the other
occurrences noted in the review so all translations remain consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3964f486-b3aa-4e85-8907-e048dd132ebf

📥 Commits

Reviewing files that changed from the base of the PR and between 543cc64 and 8e54817.

📒 Files selected for processing (14)
  • dto/channel_settings.go
  • relay/channel/api_request.go
  • web/default/src/components/ui/combobox-input.tsx
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/default/src/features/channels/lib/channel-form.ts
  • web/default/src/features/channels/types.ts
  • web/default/src/i18n/locales/_reports/_sync-report.json
  • web/default/src/i18n/locales/_reports/zh.untranslated.json
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json

Comment on lines +1805 to +1860
{useFullURL ? (
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<Input
placeholder={t(
'e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions'
)}
{...field}
/>
</FormControl>
<SelectContent alignItemWithTrigger={false}>
<SelectGroup>
<SelectItem value='https://ark.cn-beijing.volces.com'>
{t('https://ark.cn-beijing.volces.com')}
</SelectItem>
<SelectItem value='https://ark.ap-southeast.bytepluses.com'>
{t('https://ark.ap-southeast.bytepluses.com')}
</SelectItem>
<SelectItem value='doubao-coding-plan'>
{t('Doubao Coding Plan')}
</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
) : (
<Select
items={[
{
value: 'https://ark.cn-beijing.volces.com',
label: t('https://ark.cn-beijing.volces.com'),
},
{
value:
'https://ark.ap-southeast.bytepluses.com',
label: t(
'https://ark.ap-southeast.bytepluses.com'
),
},
{
value: 'doubao-coding-plan',
label: t('Doubao Coding Plan'),
},
]}
onValueChange={field.onChange}
value={
field.value ||
'https://ark.cn-beijing.volces.com'
}
>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent alignItemWithTrigger={false}>
<SelectGroup>
<SelectItem value='https://ark.cn-beijing.volces.com'>
{t('https://ark.cn-beijing.volces.com')}
</SelectItem>
<SelectItem value='https://ark.ap-southeast.bytepluses.com'>
{t(
'https://ark.ap-southeast.bytepluses.com'
)}
</SelectItem>
<SelectItem value='doubao-coding-plan'>
{t('Doubao Coding Plan')}
</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
)}

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if similar component-switching patterns exist elsewhere in the codebase

# Search for other instances where form fields conditionally render different component types
rg -n -A5 -B5 'FormControl.*\?' --type=tsx --glob 'web/default/**/*.tsx' | rg -C3 'Select.*Input|Input.*Select'

Repository: QuantumNous/new-api

Length of output: 91


🏁 Script executed:

#!/bin/bash
# Fixed search for conditional component rendering in form fields
# Use ts type which includes tsx files, or search more broadly

# Search for ternary operators that switch component types in form contexts
rg -n 'useFullURL\s*\?' --type ts web/default/src/features/channels/components/drawers/

# Also check for FormField usage around the area in question
echo "=== Checking FormField setup ==="
grep -n "base_url\|useFullURL" web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx | head -20

Repository: QuantumNous/new-api

Length of output: 1203


🏁 Script executed:

#!/bin/bash
# Search for other conditional component rendering patterns in tsx files using fd and cat
echo "=== Looking for similar Select/Input switching patterns ==="
fd -e tsx web/default/src/features/channels/components/drawers/ --exec grep -l "Select\|Input" {} \; | head -5

# Check the specific file for the FormField structure
echo "=== Checking FormField controller for base_url ==="
sed -n '1790,1870p' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx

Repository: QuantumNous/new-api

Length of output: 4648


🏁 Script executed:

#!/bin/bash
# Check for other conditional component rendering patterns in FormField controllers
# Search for similar ternary patterns inside FormField render functions

echo "=== Searching for other FormField with conditional component rendering ==="
rg -n 'render=\(\{.*field' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx | wc -l
echo "Total FormField controls in this file"

# Look for any other Select/Input switching patterns
echo ""
echo "=== Checking if other form fields use conditional components ==="
rg -B20 'Select\|Input' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx | rg -B5 'name=' | grep -E 'name=|Select|Input' | head -30

Repository: QuantumNous/new-api

Length of output: 244


🏁 Script executed:

#!/bin/bash
# Check the actual structure of other base_url fields in different channel types
# to compare with VolcEngine

echo "=== Azure (type 3) base_url structure ==="
sed -n '1249,1295p' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx | head -20

echo ""
echo "=== FastGPT (type 22) base_url structure ==="
sed -n '1489,1535p' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx | head -20

Repository: QuantumNous/new-api

Length of output: 2338


🏁 Script executed:

#!/bin/bash
# Verify the actual field binding completeness for VolcEngine
# Check lines around the VolcEngine conditional to see full context

echo "=== VolcEngine FormField controller full structure ==="
sed -n '1776,1810p' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx

echo ""
echo "=== Check if Input is missing any required field bindings ==="
sed -n '1805,1820p' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx

echo ""
echo "=== Check if there are any other component-type switches in the entire file ==="
rg -c 'useFullURL\s*\?\s*\(' web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx

Repository: QuantumNous/new-api

Length of output: 2701


Test the toggle interaction to ensure acceptable UX when switching between Input and Select modes.

The form binding is correct—both Input and Select components properly bind to the field controller, and form state should be preserved when switching modes. However, this pattern is unique in the file; other channel types (Azure, FastGPT, SunoAPI) keep the same Input component and only change label/placeholder text.

When toggling between modes, ensure:

  1. Custom URLs entered in Input mode can be manually re-entered or cleared if switching to Select
  2. Values selected in Select mode persist appropriately when switching to Input mode
  3. No console errors occur during the component swap
  4. Form validation state is maintained across mode switches

The Select component's fallback value (|| 'https://ark.cn-beijing.volces.com') prevents breakage, but the user experience should be validated to confirm switching modes feels intuitive.

🤖 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/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx`
around lines 1805 - 1860, The toggle between Input and Select (useFullURL) can
lose/override user input because Select uses a hard fallback value and the
components unmount/mount; update the rendering so both controls bind directly to
the same field without a fallback (use value={field.value} and
onChange={field.onChange} for both Input and Select) and remove the "||
'https://ark.cn-beijing.volces.com'" default; if you need to preserve distinct
"custom" vs "preset" values, persist the custom URL in a separate local state
(e.g., customUrl) and sync it with the form field when toggling (read/write via
field.onChange) and ensure both Input and Select share a stable key/name so
validation (errors) and form state remain intact and no console errors occur
during the swap.

Comment on lines +1798 to +1799
"Full Request URL": "Full Request URL",
"Full Request URL *": "Full Request URL *",

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.

🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Use hierarchical i18n keys for new Full URL labels

The new keys are phrase-based ("Use Full URL", "Full Request URL", "Full Request URL *"). Please migrate these new additions to semantic hierarchical keys (for example: channels.form.api.useFullUrl.label, channels.form.api.fullRequestUrl.label, channels.form.api.fullRequestUrl.requiredLabel) to keep key naming consistent and maintainable.

As per coding guidelines, web/default/src/i18n/**/*.{ts,tsx,json} should “Use hierarchical and semantically clear translation key names such as dashboard.overview.title and maintain naming consistency”.

Also applies to: 4167-4167

🤖 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/default/src/i18n/locales/en.json` around lines 1798 - 1799, The new
phrase-based i18n keys ("Use Full URL", "Full Request URL", "Full Request URL
*") must be replaced with hierarchical semantic keys to match project
conventions: add keys like channels.form.api.useFullUrl.label,
channels.form.api.fullRequestUrl.label, and
channels.form.api.fullRequestUrl.requiredLabel in
web/default/src/i18n/locales/en.json (and mirror them in other locale files),
move the existing English strings under these keys, and update any code
references that use the old phrase keys to the new hierarchical keys (also check
the other occurrence noted around line 4167 and adjust similarly).

Comment on lines +1287 to +1295
"e.g., https://api.example.com/suno/submit": "",
"e.g., https://api.example.com/v1/chat/completions": "",
"e.g., https://api.openai.com/v1/chat/completions": "par ex., https://api.openai.com/v1/chat/completions",
"e.g., https://ark.cn-beijing.volces.com": "p. ex., https://ark.cn-beijing.volces.com",
"e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
"e.g., https://docs-test-001.openai.azure.com": "par ex., https://docs-test-001.openai.azure.com",
"e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
"e.g., https://fastgpt.run/api/openapi": "par ex., https://fastgpt.run/api/openapi",
"e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

French locale entries are empty for newly added “full URL” UI strings.

Line 1287, Line 1288, Line 1291, Line 1293, Line 1295, Line 1463, Line 1464, Line 1798, Line 1799, Line 4162, and Line 4167 currently resolve to "". In FR locale this can render blank labels/help text or fallback behavior in critical form fields.

💡 Proposed fix (fill FR translations now, refine wording later if needed)
-    "e.g., https://api.example.com/suno/submit": "",
-    "e.g., https://api.example.com/v1/chat/completions": "",
+    "e.g., https://api.example.com/suno/submit": "par ex., https://api.example.com/suno/submit",
+    "e.g., https://api.example.com/v1/chat/completions": "par ex., https://api.example.com/v1/chat/completions",
@@
-    "e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
+    "e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "par ex., https://ark.cn-beijing.volces.com/api/v3/chat/completions",
@@
-    "e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
+    "e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "par ex., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
@@
-    "e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",
+    "e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "par ex., https://fastgpt.run/api/openapi/v1/chat/completions",
@@
-    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "",
-    "Enter the complete request URL. The system will use this URL directly without appending any path.": "",
+    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "Saisissez l’URL complète de requête API. Le système utilisera directement cette URL sans ajouter de chemin.",
+    "Enter the complete request URL. The system will use this URL directly without appending any path.": "Saisissez l’URL complète de requête. Le système utilisera directement cette URL sans ajouter de chemin.",
@@
-    "Full Request URL": "",
-    "Full Request URL *": "",
+    "Full Request URL": "URL complète de requête",
+    "Full Request URL *": "URL complète de requête *",
@@
-    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "",
+    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "Utiliser une URL complète de requête sans concaténation de chemin, par ex. https://api.example.com/v1/chat/completions",
@@
-    "Use Full URL": "",
+    "Use Full URL": "Utiliser l’URL complète",

Also applies to: 1463-1464, 1798-1799, 4162-4167

🤖 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/default/src/i18n/locales/fr.json` around lines 1287 - 1295, The FR locale
JSON has multiple empty translations for new "full URL" UI strings (keys like
"e.g., https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
"e.g., https://fastgpt.run/api/openapi/v1/chat/completions" and the other
repeated keys at lines noted) — fill each empty value with an appropriate French
example string (e.g., "p. ex., https://...") to avoid blank UI labels/help text;
update the values in fr.json for the exact keys mentioned so they mirror the
existing translated patterns like "par ex., https://..." or "p. ex.,
https://..." and run a quick search for any remaining "" values for similar keys
to ensure none are left untranslated.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

New i18n keys are not hierarchical/semantic as required by project rules.

The new additions use full English sentences and raw example URLs as keys, which conflicts with the i18n key convention and makes reuse/maintenance harder. Prefer semantic keys (e.g. channel.fullUrl.label, channel.fullUrl.help, channel.fullUrl.examples.openai), with localized strings as values.

As per coding guidelines, "Use hierarchical and semantically clear translation key names such as dashboard.overview.title and maintain naming consistency".

Also applies to: 1463-1464, 1798-1799, 4162-4167

🤖 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/default/src/i18n/locales/fr.json` around lines 1287 - 1295, The current
fr.json entries use raw example sentences/URLs as translation keys (e.g., "e.g.,
https://api.example.com/suno/submit", "e.g.,
https://api.openai.com/v1/chat/completions") which violates the i18n naming
convention; replace each raw-string key with a hierarchical semantic key (for
example channel.examples.suno, channel.examples.openai,
channel.examples.azure.docs, etc.), move the English example URL into the value
for fr.json (translated form only if needed), and ensure the new keys follow the
project's dot-separated pattern (e.g., channel.fullUrl.label,
channel.fullUrl.help, channel.fullUrl.examples.openai); update the corresponding
keys in other locale files and any components using the old keys so lookups use
the new semantic keys (also fix the other occurrences noted in the review).

Comment on lines +1287 to +1295
"e.g., https://api.example.com/suno/submit": "",
"e.g., https://api.example.com/v1/chat/completions": "",
"e.g., https://api.openai.com/v1/chat/completions": "例: https://api.openai.com/v1/chat/completions",
"e.g., https://ark.cn-beijing.volces.com": "例: https://ark.cn-beijing.volces.com",
"e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
"e.g., https://docs-test-001.openai.azure.com": "例: https://docs-test-001.openai.azure.com",
"e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
"e.g., https://fastgpt.run/api/openapi": "例: https://fastgpt.run/api/openapi",
"e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fill newly added Japanese translations (currently blank)

Several new keys for the full-URL flow are empty (""), which will render blank labels/help text in JA and degrade the channel-create UX.

💡 Suggested patch
-    "e.g., https://api.example.com/suno/submit": "",
-    "e.g., https://api.example.com/v1/chat/completions": "",
+    "e.g., https://api.example.com/suno/submit": "例: https://api.example.com/suno/submit",
+    "e.g., https://api.example.com/v1/chat/completions": "例: https://api.example.com/v1/chat/completions",
-    "e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
+    "e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "例: https://ark.cn-beijing.volces.com/api/v3/chat/completions",
-    "e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
+    "e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "例: https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
-    "e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",
+    "e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "例: https://fastgpt.run/api/openapi/v1/chat/completions",

-    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "",
-    "Enter the complete request URL. The system will use this URL directly without appending any path.": "",
+    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "完全な API リクエスト URL を入力してください。システムはこの URL をそのまま使用し、パスを追加しません。",
+    "Enter the complete request URL. The system will use this URL directly without appending any path.": "完全なリクエスト URL を入力してください。システムはこの URL をそのまま使用し、パスを追加しません。",

-    "Full Request URL": "",
-    "Full Request URL *": "",
+    "Full Request URL": "完全なリクエスト URL",
+    "Full Request URL *": "完全なリクエスト URL *",

-    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "",
+    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "パス結合を行わず、完全なリクエスト URL を使用します(例: https://api.example.com/v1/chat/completions)",

-    "Use Full URL": "",
+    "Use Full URL": "完全な URL を使用"

Also applies to: 1463-1464, 1798-1799, 4162-4162, 4167-4167

🤖 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/default/src/i18n/locales/ja.json` around lines 1287 - 1295, Fill the
empty Japanese translations for the newly added full-URL keys in the ja.json
locale by replacing each "" value with a concise Japanese example string
matching the pattern used elsewhere (e.g., "例: https://..."); specifically
update the keys "e.g., https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
and "e.g., https://fastgpt.run/api/openapi/v1/chat/completions" with appropriate
Japanese example text (e.g., "例: https://api.example.com/v1/chat/completions");
apply the same pattern to the other occurrences noted (around lines 1463-1464,
1798-1799, 4162, 4167) so no keys remain empty.

Comment on lines +1287 to +1295
"e.g., https://api.example.com/suno/submit": "",
"e.g., https://api.example.com/v1/chat/completions": "",
"e.g., https://api.openai.com/v1/chat/completions": "например, https://api.openai.com/v1/chat/completions",
"e.g., https://ark.cn-beijing.volces.com": "например, https://ark.cn-beijing.volces.com",
"e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
"e.g., https://docs-test-001.openai.azure.com": "например, https://docs-test-001.openai.azure.com",
"e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
"e.g., https://fastgpt.run/api/openapi": "например, https://fastgpt.run/api/openapi",
"e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

New RU i18n keys are empty and will render blank UI text

Several newly added strings for the Full URL feature are set to "" (e.g., Line 1798, Line 1799, Line 4167). In RU locale this will show blank labels/placeholders/help text instead of fallback content, making the new form options hard to use.

Suggested fix
-    "e.g., https://api.example.com/suno/submit": "",
-    "e.g., https://api.example.com/v1/chat/completions": "",
+    "e.g., https://api.example.com/suno/submit": "например, https://api.example.com/suno/submit",
+    "e.g., https://api.example.com/v1/chat/completions": "например, https://api.example.com/v1/chat/completions",
...
-    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "",
-    "Enter the complete request URL. The system will use this URL directly without appending any path.": "",
+    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "Введите полный URL запроса API. Система будет использовать этот URL напрямую без добавления пути.",
+    "Enter the complete request URL. The system will use this URL directly without appending any path.": "Введите полный URL запроса. Система будет использовать этот URL напрямую без добавления пути.",
...
-    "Full Request URL": "",
-    "Full Request URL *": "",
+    "Full Request URL": "Полный URL запроса",
+    "Full Request URL *": "Полный URL запроса *",
...
-    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "",
-    "Use Full URL": "",
+    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "Используйте полный URL запроса без конкатенации пути, например: https://api.example.com/v1/chat/completions",
+    "Use Full URL": "Использовать полный URL",

Also applies to: 1463-1464, 1798-1799, 4162-4167

🤖 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/default/src/i18n/locales/ru.json` around lines 1287 - 1295, The new
Russian locale entries for several Full URL helper strings (for example the keys
"e.g., https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
and "e.g., https://fastgpt.run/api/openapi/v1/chat/completions") are empty and
will render blank UI; fill each empty value with the appropriate Russian
translation (or a sensible fallback like the English example string) matching
the other nearby translated entries (e.g., use "например, <url>") so
placeholders/help text are visible in the ru.json file and consistent across the
Full URL fields.

Comment on lines +1287 to +1295
"e.g., https://api.example.com/suno/submit": "",
"e.g., https://api.example.com/v1/chat/completions": "",
"e.g., https://api.openai.com/v1/chat/completions": "ví dụ: https://api.openai.com/v1/chat/completions",
"e.g., https://ark.cn-beijing.volces.com": "ví dụ, https://ark.cn-beijing.volces.com",
"e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
"e.g., https://docs-test-001.openai.azure.com": "ví dụ: https://docs-test-001.openai.azure.com",
"e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
"e.g., https://fastgpt.run/api/openapi": "ví dụ: https://fastgpt.run/api/openapi",
"e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Empty translation values will render blank UI text

Several newly added Vietnamese entries are empty ("") (e.g., Line 1287, Line 1463, Line 1798, Line 4167). This can make placeholders/labels/switch text disappear in the channel form for vi users.

💡 Proposed fix
-    "e.g., https://api.example.com/suno/submit": "",
-    "e.g., https://api.example.com/v1/chat/completions": "",
+    "e.g., https://api.example.com/suno/submit": "ví dụ: https://api.example.com/suno/submit",
+    "e.g., https://api.example.com/v1/chat/completions": "ví dụ: https://api.example.com/v1/chat/completions",
@@
-    "e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "",
+    "e.g., https://ark.cn-beijing.volces.com/api/v3/chat/completions": "ví dụ: https://ark.cn-beijing.volces.com/api/v3/chat/completions",
@@
-    "e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "",
+    "e.g., https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview": "ví dụ: https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
@@
-    "e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "",
+    "e.g., https://fastgpt.run/api/openapi/v1/chat/completions": "ví dụ: https://fastgpt.run/api/openapi/v1/chat/completions",
@@
-    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "",
-    "Enter the complete request URL. The system will use this URL directly without appending any path.": "",
+    "Enter the complete API request URL. The system will use this URL directly without appending any path.": "Nhập URL yêu cầu API đầy đủ. Hệ thống sẽ dùng trực tiếp URL này mà không nối thêm đường dẫn.",
+    "Enter the complete request URL. The system will use this URL directly without appending any path.": "Nhập URL yêu cầu đầy đủ. Hệ thống sẽ dùng trực tiếp URL này mà không nối thêm đường dẫn.",
@@
-    "Full Request URL": "",
-    "Full Request URL *": "",
+    "Full Request URL": "URL yêu cầu đầy đủ",
+    "Full Request URL *": "URL yêu cầu đầy đủ *",
@@
-    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "",
+    "Use a complete request URL without path concatenation, e.g. https://api.example.com/v1/chat/completions": "Sử dụng URL yêu cầu đầy đủ không nối đường dẫn, ví dụ: https://api.example.com/v1/chat/completions",
@@
-    "Use Full URL": "",
+    "Use Full URL": "Sử dụng URL đầy đủ",

Also applies to: 1463-1464, 1798-1799, 4162-4167

🤖 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/default/src/i18n/locales/vi.json` around lines 1287 - 1295, Populate the
empty Vietnamese translation values in vi.json for the newly added keys so the
UI placeholders don't render blank; specifically provide appropriate Vietnamese
strings for "e.g., https://api.example.com/suno/submit", "e.g.,
https://api.example.com/v1/chat/completions", "e.g.,
https://ark.cn-beijing.volces.com/api/v3/chat/completions", "e.g.,
https://docs-test-001.openai.azure.com/openai/deployments/model/chat/completions?api-version=2025-04-01-preview",
and "e.g., https://fastgpt.run/api/openapi/v1/chat/completions" (and the other
empty entries noted in the review), matching the existing style used for entries
like "e.g., https://api.openai.com/v1/chat/completions" and "ví dụ:
https://fastgpt.run/api/openapi" and keeping punctuation/format consistent.

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