Skip to content

UI优化 - #21

Merged
CSCITech merged 8 commits into
mainfrom
cscitech
Jul 22, 2026
Merged

CSCITech merged 8 commits into
mainfrom
cscitech

Conversation

@CSCITech

Copy link
Copy Markdown
Contributor

⚠️ 提交说明 / PR Notice

Important

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

📝 变更描述 / Description

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

🚀 变更类型 / Type of change

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

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

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

📸 运行证明 / Proof of Work

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

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added visual and expression-based editors for tiered model pricing, including request-rule conditions.
    • Added configurable playground parameters such as temperature, top-p, penalties, token limits, and seed.
    • Added channel model mapping guardrails and video-task billing settings.
    • Added wrapping support for long status badges and mobile table content.
    • Added accessibility validation props to multi-select inputs.
  • Improvements

    • Expanded channel capability and configuration validation messaging with localization support.
    • Improved table column styling across desktop, mobile, and loading states.
  • Bug Fixes

    • Corrected pricing editor state when switching between models.
    • Improved video-task usage parsing and configurable billing settlement behavior.

Walkthrough

The changes update shared UI metadata and accessibility, channel drawer forms and video-task billing, localized channel validation, tiered pricing editors, playground parameter controls, and Tailwind build verification. New tests cover these behaviors.

Changes

Shared UI and localization

Layer / File(s) Summary
Table metadata and accessibility
web/default/src/components/data-table/*, web/default/src/tanstack-table.d.ts, web/default/src/components/status-badge.*, web/default/src/components/multi-select.tsx
Separate desktop/mobile classes, wrapped badges, ARIA forwarding, and overflow-safe layouts were added.
Channel localization
web/default/src/features/channels/components/channel-capability-matrix.tsx, web/default/src/features/channels/lib/*, web/default/src/i18n/locales/*
Capability labels and validation messages now use localized entries across supported locales.
Build verification
.gitignore, web/default/package.json, web/default/scripts/verify-tailwind-build.mjs, web/default/src/styles/index.css
Builds verify generated CSS, Tailwind scans the home feature, and the root ignore rule is narrowed.

Channel drawer and billing

Layer / File(s) Summary
Form-driven channel sections
web/default/src/features/channels/components/drawers/sections/*, web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
Basic information and model/group controls were extracted into dedicated form sections with mapping guardrails, actions, and tests.
Doubao video billing configuration
web/default/src/features/channels/constants.ts, web/default/src/features/channels/lib/channel-form.ts, web/default/src/features/channels/components/drawers/channel-editor-state.ts, web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx, dto/channel_settings.go, model/task.go
A channel setting controls completion-time delta settlement and is persisted in channel and task billing state.
Settlement and usage parsing
controller/*, service/task_polling.go, service/task_billing_test.go, relay/channel/task/taskcommon/*
Doubao video settlement can be skipped per stored or legacy channel settings, and configured task results now expose usage token counts.

Tiered pricing editor

Layer / File(s) Summary
Pricing state isolation
web/default/src/features/system-settings/models/model-pricing-sheet.tsx, web/default/src/features/system-settings/models/tiered-pricing-editor.tsx, web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
Pricing state is initialized from edit data and reset between model identities, with runtime coverage.
Visual and request-rule editors
web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx, web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
Visual tier, raw expression, request-condition, and rule-group editors were added.

Playground parameter controls

Layer / File(s) Summary
Parameter definitions and normalization
web/default/src/features/playground/lib/*, web/default/src/i18n/static-keys.ts
Parameter metadata, normalization, display formatting, exports, and tests were added.
Responsive parameter controls
web/default/src/features/playground/components/*, web/default/src/features/playground/index.tsx
The playground now renders localized sliders and numeric inputs with enablement state wired to playground state.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ModelPricingEditorPanel
  participant TieredPricingEditor
  participant VisualEditor
  participant RequestRuleEditor
  ModelPricingEditorPanel->>TieredPricingEditor: provide model identity and pricing expressions
  TieredPricingEditor->>VisualEditor: render visual tier configuration
  TieredPricingEditor->>RequestRuleEditor: render request-rule groups
  VisualEditor-->>TieredPricingEditor: return tier updates
  RequestRuleEditor-->>TieredPricingEditor: return rule-group updates
Loading

Possibly related PRs

Poem

I’m a rabbit with badges that wrap,
And tables that stretch without trap.
Channels speak in every tongue,
Pricing tiers hop where they’re sprung.
Playground sliders join the care—
Clean forms and editors everywhere.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.07% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive 标题过于笼统,无法从“UI优化”看出具体改动内容。 改为概括主要变更,例如“优化数据表与表单的移动端布局和状态徽标显示”。
Description check ❓ Inconclusive 描述是提交模板,占位内容居多,未实际说明本次变更。 请用人工撰写的摘要说明改动内容、原因和验证结果,替换模板占位文本。
✅ Passed checks (2 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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cscitech

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
web/default/src/i18n/locales/en.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

web/default/src/i18n/locales/fr.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

web/default/src/i18n/locales/ja.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

  • 3 others

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 12

🤖 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/components/status-badge.test.tsx`:
- Around line 39-58: Refactor the StatusBadge long-content layout tests to use
React Testing Library’s render and DOM queries instead of renderStatusBadge,
react-dom/server, and raw markup regex assertions. Query the rendered label
element by its accessible text and verify the relevant class behavior through
DOM-oriented assertions, preserving coverage for default truncation and
explicitly enabled wrapping.

In
`@web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx`:
- Around line 386-391: Update the remainingMappingCount display in the channel
models section to use a single count-aware t() translation for the complete
“more mapping(s)” label. Remove the hardcoded plural suffix and pass
remainingMappingCount through the translation interpolation/count mechanism
while preserving the existing positive-count condition.

In `@web/default/src/features/system-settings/models/model-pricing-sheet.tsx`:
- Around line 276-280: Update getInitialPricingMode to return any valid explicit
billingMode before inspecting price, including per-token and per-request modes;
use price only as the legacy-record fallback. Update the reset effect near the
referenced usage to call getInitialPricingMode instead of duplicating
mode-selection logic.

In
`@web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx`:
- Around line 19-25: Replace the custom createRoot/JSDOM harness in the tiered
pricing editor tests with React Testing Library rendering and cleanup. Update
textContent-based checks to semantic queries and exercise editor actions through
RTL user interactions, including verifying buttons do not trigger unintended
form submissions. Preserve the existing behavior coverage while focusing
assertions on user-visible outcomes rather than implementation details.

In `@web/default/src/features/system-settings/models/tiered-pricing-editor.tsx`:
- Around line 254-260: Update TieredPricingEditor to include a loaded pricing
revision or source-data signature in its reset key, so externally changed
expression data remounts TieredPricingEditorContent instead of preserving stale
one-time state. In
web/default/src/features/system-settings/models/tiered-pricing-editor.tsx lines
254-260, extend the key contract beyond identity; in
web/default/src/features/system-settings/models/model-pricing-sheet.tsx line
940, pass a stable revision/signature derived from the loaded pricing data
rather than only editData.name.
- Around line 74-85: Update createInitialEditorState so a failed
tryParseRequestRuleExpr result remains distinguishable from an empty rule
instead of being coerced to []. Preserve the original requestRuleExpr when
parsing fails, and make the visual synchronization and mode-switch logic skip
serialization while the rule is incompatible. Continue normal synchronization
for successfully parsed rules and genuinely empty rules.

In
`@web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx`:
- Around line 117-122: Replace the nested ternary used to derive sourceLabel in
the tiered pricing rules component with switch or if/else logic. Preserve the
existing mappings for SOURCE_PARAM, SOURCE_HEADER, and the fallback Time
translation, without changing surrounding behavior.
- Around line 321-329: Add type='button' to every add/remove condition and
rule-group Button in
web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
at lines 321-329, and to every add/remove tier and condition Button in
web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
at lines 152-160, preserving their existing handlers and behavior.

In
`@web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx`:
- Line 57: Localize the user-visible price suffix and placeholder text in the
tiered-pricing visual editor. Update PRICE_SUFFIX and the related strings near
the pricing inputs and display sections to use the existing t() translation
mechanism, preserving the current rendered formatting and values.
- Around line 225-230: Enforce the tier invariants in the mutation handlers
handleConditionRemove, the condition-add flow, and the tier-delete flow before
invoking onChange: always retain exactly one final fallback tier, prevent
conditions from being added to it, and prevent earlier tiers from becoming
unconditional or the fallback from being removed. Normalize invalid mutations or
block them while preserving valid tier ordering and fallback behavior.
- Around line 176-186: Update PriceField in
web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
(lines 176-186) to generate and apply a unique id to each DraftNumberInput, and
associate its Label via the matching htmlFor. In
web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
(lines 250-291), add associated visible labels or localized aria-label values
for every condition path and value input, ensuring all repeated editor inputs
have programmatic names and remain keyboard accessible.

In `@web/default/src/i18n/locales/zh.json`:
- Line 9: Update the “Configuration valid” translation entry in the zh locale
from “配置一致” to “配置有效” so it accurately indicates that the configuration is
valid.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 78149730-a888-4530-94ee-b06657ae6721

📥 Commits

Reviewing files that changed from the base of the PR and between 75ab64a and d6293e8.

📒 Files selected for processing (34)
  • web/default/src/components/data-table/column-header.tsx
  • web/default/src/components/data-table/data-table-page.tsx
  • web/default/src/components/data-table/mobile-card-list.tsx
  • web/default/src/components/data-table/table-skeleton.tsx
  • web/default/src/components/drawer-layout.ts
  • web/default/src/components/multi-select.tsx
  • web/default/src/components/status-badge.test.tsx
  • web/default/src/components/status-badge.tsx
  • web/default/src/features/channels/components/channel-capability-matrix.tsx
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.test.ts
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-auth-section.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-basic-section.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.test.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx
  • web/default/src/features/channels/components/model-mapping-editor.tsx
  • web/default/src/features/channels/lib/channel-capabilities.ts
  • web/default/src/features/channels/lib/channel-config-validation.ts
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
  • web/default/src/features/usage-logs/components/dialogs/fail-reason-dialog.tsx
  • 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
  • web/default/src/tanstack-table.d.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type。
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemo、useCallback、React.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import。
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError。
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"。
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/components/drawer-layout.ts
  • web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-auth-section.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.test.ts
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/components/status-badge.test.tsx
  • web/default/src/components/data-table/column-header.tsx
  • web/default/src/features/usage-logs/components/dialogs/fail-reason-dialog.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.test.tsx
  • web/default/src/components/data-table/table-skeleton.tsx
  • web/default/src/components/data-table/data-table-page.tsx
  • web/default/src/tanstack-table.d.ts
  • web/default/src/features/channels/lib/channel-capabilities.ts
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/components/multi-select.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-basic-section.tsx
  • web/default/src/components/status-badge.tsx
  • web/default/src/components/data-table/mobile-card-list.tsx
  • web/default/src/features/channels/components/channel-capability-matrix.tsx
  • web/default/src/features/channels/components/model-mapping-editor.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/channels/lib/channel-config-validation.ts
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/、lib/、hooks/、api.ts、types.ts、constants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/。

Files:

  • web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-auth-section.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.test.ts
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/features/usage-logs/components/dialogs/fail-reason-dialog.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.test.tsx
  • web/default/src/features/channels/lib/channel-capabilities.ts
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-basic-section.tsx
  • web/default/src/features/channels/components/channel-capability-matrix.tsx
  • web/default/src/features/channels/components/model-mapping-editor.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/channels/lib/channel-config-validation.ts
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
web/default/src/**/*.test.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

工具函数与纯逻辑应优先编写单元测试;测试文件应命名为 *.test.ts。

Files:

  • web/default/src/features/channels/components/drawers/channel-editor-state.test.ts
web/default/src/features/**/lib/**/*.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

表单应使用 React Hook Form + Zod:在功能模块的 lib/ 下定义 schema,并用 z.infer 导出表单类型;useForm 应配合 @hookform/resolvers/zod 进行校验。

Files:

  • web/default/src/features/channels/lib/channel-capabilities.ts
  • web/default/src/features/channels/lib/channel-config-validation.ts
🔇 Additional comments (30)
web/default/src/tanstack-table.d.ts (1)

30-41: LGTM!

web/default/src/components/data-table/data-table-page.tsx (1)

345-348: LGTM!

Also applies to: 416-419

web/default/src/components/data-table/table-skeleton.tsx (1)

69-76: LGTM!

web/default/src/components/data-table/mobile-card-list.tsx (1)

51-51: LGTM!

Also applies to: 154-159, 185-190, 234-240, 254-259, 279-279

web/default/src/features/channels/components/channels-columns.tsx (1)

476-481: LGTM!

web/default/src/features/models/components/models-columns.tsx (1)

137-141: LGTM!

Also applies to: 154-154

web/default/src/components/data-table/column-header.tsx (1)

54-54: LGTM!

Also applies to: 67-71

web/default/src/i18n/locales/ja.json (1)

6-57: LGTM!

web/default/src/i18n/locales/ru.json (1)

6-57: LGTM!

web/default/src/i18n/locales/vi.json (1)

6-57: LGTM!

web/default/src/i18n/locales/zh.json (1)

6-8: LGTM!

Also applies to: 10-57

web/default/src/components/status-badge.tsx (1)

82-87: LGTM!

Also applies to: 103-104, 118-118, 138-160

web/default/src/components/multi-select.tsx (1)

62-64: LGTM!

Also applies to: 266-267

web/default/src/components/drawer-layout.ts (1)

93-93: LGTM!

web/default/src/features/channels/components/drawers/sections/channel-auth-section.tsx (1)

37-37: LGTM!

web/default/src/features/usage-logs/components/dialogs/fail-reason-dialog.tsx (1)

77-77: LGTM!

web/default/src/features/channels/lib/channel-capabilities.ts (1)

29-75: LGTM!

Also applies to: 93-97

web/default/src/features/channels/lib/channel-config-validation.ts (1)

20-27: LGTM!

Also applies to: 90-90, 110-116, 125-125, 135-135, 152-160, 177-177, 196-204, 222-223, 240-240, 250-258, 268-287, 305-305, 314-314, 323-323, 333-333, 342-343, 356-357

web/default/src/features/channels/components/channel-capability-matrix.tsx (1)

28-36: LGTM!

Also applies to: 62-76, 104-137, 153-153, 163-169, 184-194, 217-222

web/default/src/i18n/locales/en.json (1)

6-57: LGTM!

web/default/src/i18n/locales/fr.json (1)

6-57: LGTM!

web/default/src/features/system-settings/models/model-pricing-sheet.tsx (1)

282-296: LGTM!

web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (1)

19-50: LGTM!

web/default/src/features/channels/components/drawers/sections/channel-basic-section.tsx (1)

19-53: LGTM!

Also applies to: 62-118, 120-140, 141-158

web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx (1)

19-153: LGTM!

Also applies to: 162-492

web/default/src/features/channels/components/drawers/sections/channel-models-section.test.tsx (1)

32-94: LGTM!

web/default/src/features/channels/components/drawers/channel-editor-state.ts (1)

37-88: LGTM!

web/default/src/features/channels/components/drawers/channel-editor-state.test.ts (1)

23-48: LGTM!

web/default/src/features/channels/components/model-mapping-editor.tsx (1)

19-19: LGTM!

Also applies to: 73-137, 228-228, 270-299

web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx (1)

1324-1327: LGTM!

Also applies to: 2406-2414, 3805-3808

Comment on lines +39 to +58
describe('StatusBadge long-content layout', () => {
test('keeps the default compact badge on one truncated line', () => {
const markup = renderStatusBadge(<StatusBadge label='model-name' />)

assert.match(markup, /whitespace-nowrap/)
assert.match(markup, /truncate/)
assert.doesNotMatch(markup, /\[overflow-wrap:anywhere\]/)
})

test('allows explicitly wrapped badge labels to use multiple lines', () => {
const markup = renderStatusBadge(
<StatusBadge label={'model-'.repeat(20)} wrap />
)

assert.match(markup, /whitespace-normal/)
assert.match(markup, /\[overflow-wrap:anywhere\]/)
assert.match(markup, /min-h-5/)
assert.doesNotMatch(markup, /truncate/)
})
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use React Testing Library for component tests.

As per coding guidelines, component tests should use React Testing Library, focus on behavior, and avoid testing implementation details (like asserting raw HTML strings via regex). The current test uses react-dom/server's renderToStaticMarkup and node:test to assert exact class names.

Please refactor this test to use @testing-library/react and evaluate the DOM elements.

♻️ Proposed refactor
-import assert from 'node:assert/strict'
-import { describe, test } from 'node:test'
-import { renderToStaticMarkup } from 'react-dom/server'
+import { render } from '`@testing-library/react`'
+import { describe, test } from 'node:test'
+import assert from 'node:assert/strict'
 import { I18nextProvider } from 'react-i18next'
 import { StatusBadge } from './status-badge'
 
@@ -31,27 +31,23 @@ i18n.init({
 })
 
 function renderStatusBadge(element: React.ReactElement) {
-  return renderToStaticMarkup(
+  return render(
     <I18nextProvider i18n={i18n}>{element}</I18nextProvider>
   )
 }
 
 describe('StatusBadge long-content layout', () => {
   test('keeps the default compact badge on one truncated line', () => {
-    const markup = renderStatusBadge(<StatusBadge label='model-name' />)
-
-    assert.match(markup, /whitespace-nowrap/)
-    assert.match(markup, /truncate/)
-    assert.doesNotMatch(markup, /\[overflow-wrap:anywhere\]/)
+    const { container } = renderStatusBadge(<StatusBadge label='model-name' />)
+    assert.ok(container.innerHTML.includes('whitespace-nowrap'))
+    assert.ok(container.innerHTML.includes('truncate'))
+    assert.ok(!container.innerHTML.includes('[overflow-wrap:anywhere]'))
   })
 
   test('allows explicitly wrapped badge labels to use multiple lines', () => {
-    const markup = renderStatusBadge(
-      <StatusBadge label={'model-'.repeat(20)} wrap />
-    )
-
-    assert.match(markup, /whitespace-normal/)
-    assert.match(markup, /\[overflow-wrap:anywhere\]/)
-    assert.match(markup, /min-h-5/)
-    assert.doesNotMatch(markup, /truncate/)
+    const { container } = renderStatusBadge(<StatusBadge label={'model-'.repeat(20)} wrap />)
+    assert.ok(container.innerHTML.includes('whitespace-normal'))
+    assert.ok(container.innerHTML.includes('[overflow-wrap:anywhere]'))
+    assert.ok(!container.innerHTML.includes('truncate'))
   })
 })

(Note: If your test environment supports @testing-library/jest-dom, prefer using expect(screen.getByText(...)).toHaveClass(...) over innerHTML assertions.)

🤖 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/status-badge.test.tsx` around lines 39 - 58,
Refactor the StatusBadge long-content layout tests to use React Testing
Library’s render and DOM queries instead of renderStatusBadge, react-dom/server,
and raw markup regex assertions. Query the rendered label element by its
accessible text and verify the relevant class behavior through DOM-oriented
assertions, preserving coverage for default truncation and explicitly enabled
wrapping.

Source: Coding guidelines

Comment on lines +19 to +25
import { act } from 'react'
import { createRoot, type Root } from 'react-dom/client'
import { createInstance } from 'i18next'
import { JSDOM } from 'jsdom'
import assert from 'node:assert/strict'
import { after, before, describe, test } from 'node:test'
import { I18nextProvider } from 'react-i18next'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use React Testing Library for these component tests.

Replace the custom root/JSDOM harness and textContent assertions with RTL rendering, semantic queries, and user interactions. This will also expose the unintended form submissions from editor action buttons.

As per coding guidelines, “组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节。”

Also applies to: 155-242

🤖 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/system-settings/models/tiered-pricing-editor.runtime.test.tsx`
around lines 19 - 25, Replace the custom createRoot/JSDOM harness in the tiered
pricing editor tests with React Testing Library rendering and cleanup. Update
textContent-based checks to semantic queries and exercise editor actions through
RTL user interactions, including verifying buttons do not trigger unintended
form submissions. Preserve the existing behavior coverage while focusing
assertions on user-visible outcomes rather than implementation details.

Source: Coding guidelines

Comment thread web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx Outdated
Comment thread web/default/src/i18n/locales/zh.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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 platform limitations.

⚠️ Outside diff range comments (8)
web/default/src/i18n/locales/ja.json (1)

8-8: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use a translation for “blocking issues,” not “blocked issues.”

「ブロック中の問題」は interpreted as issues currently being blocked. Use wording such as ブロッキング問題 {{count}} 件 or 設定を妨げる問題 {{count}} 件 to preserve the original meaning.

🤖 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` at line 8, Update the Japanese
translation for "{{count}} blocking issue(s)" to convey issues that block
progress, not issues currently blocked; use wording equivalent to “ブロッキング問題
{{count}} 件” while preserving the count placeholder.
web/default/src/i18n/locales/ru.json (1)

13-13: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the correct Russian term for API completions.

дополнения means “additions” and is misleading in this API context. Use terminology such as завершения or retain Chat Completions.

Proposed fix
-    "Routes OpenAI-compatible chat and completion requests.": "Маршрутизирует OpenAI-совместимые запросы чата и дополнения.",
+    "Routes OpenAI-compatible chat and completion requests.": "Маршрутизирует OpenAI-совместимые запросы чата и завершений.",
-    "chat/completions": "Чат / дополнения API",
+    "chat/completions": "API чата / завершений",

Also applies to: 23-23

🤖 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` at line 13, Update the Russian
translation for “Routes OpenAI-compatible chat and completion requests.” in the
locale entries to use the API term “завершения” or retain “Chat Completions”
instead of “дополнения.” Apply the same correction to both identified
occurrences.
web/default/src/i18n/locales/vi.json (1)

8-8: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a clearer Vietnamese translation for blocking validation issues.

“Vấn đề chặn” is unnatural and may be interpreted as blocking a request rather than preventing the configuration from being valid. Prefer wording such as “lỗi khiến cấu hình không hợp lệ” consistently in both messages.

Also applies to: 12-12

🤖 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` at line 8, Update the Vietnamese
translations for both “{{count}} blocking issue(s)” and the corresponding
message at the referenced second entry to use clear wording such as “{{count}}
lỗi khiến cấu hình không hợp lệ,” replacing “vấn đề chặn” consistently while
preserving the count placeholder.
web/default/src/i18n/locales/zh.json (1)

14-14: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve the “Responses API” product name.

These translations turn the official API name into generic wording and are inconsistent with the existing "Responses APIs": "Responses API" entry at Line 3951. Use the established term in both the description and capability label.

Proposed fix
-    "Routes OpenAI Responses API requests.": "用于 OpenAI Responses 风格接口请求。",
+    "Routes OpenAI Responses API requests.": "用于 OpenAI Responses API 请求。",

-    "responses": "响应 API",
+    "responses": "Responses API",

Also applies to: 24-24

🤖 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` at line 14, Update the Chinese
translation for “Routes OpenAI Responses API requests.” and its corresponding
capability label to preserve the established product name “Responses API,”
matching the existing “Responses APIs” translation instead of using generic
wording.
web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx (3)

90-91: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Consider splitting this component into smaller sub-components.

The ChannelModelsSection component is approximately 400 lines long. As per coding guidelines, components exceeding about 200 lines should be considered for splitting. Extracting the models field, quick actions, model mapping editor, and groups field into separate sub-components would improve readability and maintainability.

🤖 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/sections/channel-models-section.tsx`
around lines 90 - 91, Split ChannelModelsSection into focused sub-components for
the models field, quick actions, model mapping editor, and groups field. Keep
the existing behavior and data flow unchanged, and have ChannelModelsSection
compose these extracted components while retaining shared props or handlers
through explicit interfaces.

Source: Coding guidelines


189-191: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Translate the createLabel text.

The createLabel string is hardcoded and bypasses the translation system. As per coding guidelines, all user-facing text within components must support i18n using t().

🌐 Proposed fix
-                    allowCreate
-                    createLabel='Add custom model "{{value}}"'
-                    maxVisibleChips={6}
+                    allowCreate
+                    createLabel={t('Add custom model "{{value}}"')}
+                    maxVisibleChips={6}
🤖 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/sections/channel-models-section.tsx`
around lines 189 - 191, Translate the createLabel prop in the channel models
section using the component’s existing t() translation function, adding the
interpolation for value so the displayed model name remains unchanged. Use the
established translation key or add the corresponding locale entry rather than
leaving the user-facing string hardcoded.

Source: Coding guidelines


90-90: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add explicit types for parameters and return values.

These functions lack explicit types, which violates the coding guideline requiring explicit type annotations for parameters and return values.

  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx#L90-L90: Add an explicit return type (e.g., : JSX.Element) to ChannelModelsSection.
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx#L122-L124: Add an explicit type for the merge parameter (e.g., merge: boolean = false) and a return type (e.g., : number) to updateModels.
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx#L136-L136: Add an explicit return type (e.g., : void) to handleAddPrefillGroup.
🤖 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/sections/channel-models-section.tsx`
at line 90,
web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx:90
— Add an explicit JSX.Element return type to ChannelModelsSection. At lines
122-124, type updateModels’ merge parameter as boolean with its existing default
and add its number return type. At line 136, add an explicit void return type to
handleAddPrefillGroup.

Source: Coding guidelines

web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (1)

187-234: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Switching to Visual mode silently discards an unparseable billing expression.

When next === 'visual' and tryParseVisualConfig(billingExpr) fails, visualConfig is reset to createDefaultVisualConfig() with no fallback preservation (unlike the rawExprFallback mechanism that now protects requestRuleExpr in this same handler). The effectiveExpr effect (Lines 151-155) then immediately pushes this default expression back via onBillingExprChange, overwriting the original complex/hand-written expression as soon as the user opens the "Visual editor" tab — before any explicit save, and with no warning or recovery path (switching back to raw regenerates from the now-lost visualConfig).

Since raw/LLM-authored expressions are a primary use case (see LlmPromptHelper), this is easily reachable whenever an expression doesn't match the visual grammar.

💡 Suggested direction

Mirror the rawExprFallback approach for the billing side: when tryParseVisualConfig fails, keep a billingExprFallback (or block the switch entirely and surface an alert similar to RequestRuleEditor's "too complex" alert) instead of unconditionally calling createDefaultVisualConfig().

🤖 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/system-settings/models/tiered-pricing-editor.tsx`
around lines 187 - 234, Preserve an unparseable billing expression when
handleModeChange switches to visual mode instead of replacing it with
createDefaultVisualConfig(). Add and maintain a billingExprFallback analogous to
rawExprFallback, ensure the effective-expression flow does not call
onBillingExprChange with the default visual expression while that fallback
exists, and restore the preserved billing expression when returning to raw mode
or otherwise retain an explicit recovery path.
🤖 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/i18n/locales/ru.json`:
- Line 136: Update the “+{{count}} more mapping(s)” Russian locale entry to
avoid hardcoded plural inflection: use the project’s plural-aware i18n form for
singular and plural counts, or a neutral count label that remains grammatically
correct for every value.

---

Outside diff comments:
In
`@web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx`:
- Around line 90-91: Split ChannelModelsSection into focused sub-components for
the models field, quick actions, model mapping editor, and groups field. Keep
the existing behavior and data flow unchanged, and have ChannelModelsSection
compose these extracted components while retaining shared props or handlers
through explicit interfaces.
- Around line 189-191: Translate the createLabel prop in the channel models
section using the component’s existing t() translation function, adding the
interpolation for value so the displayed model name remains unchanged. Use the
established translation key or add the corresponding locale entry rather than
leaving the user-facing string hardcoded.
- Line 90:
web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx:90
— Add an explicit JSX.Element return type to ChannelModelsSection. At lines
122-124, type updateModels’ merge parameter as boolean with its existing default
and add its number return type. At line 136, add an explicit void return type to
handleAddPrefillGroup.

In `@web/default/src/features/system-settings/models/tiered-pricing-editor.tsx`:
- Around line 187-234: Preserve an unparseable billing expression when
handleModeChange switches to visual mode instead of replacing it with
createDefaultVisualConfig(). Add and maintain a billingExprFallback analogous to
rawExprFallback, ensure the effective-expression flow does not call
onBillingExprChange with the default visual expression while that fallback
exists, and restore the preserved billing expression when returning to raw mode
or otherwise retain an explicit recovery path.

In `@web/default/src/i18n/locales/ja.json`:
- Line 8: Update the Japanese translation for "{{count}} blocking issue(s)" to
convey issues that block progress, not issues currently blocked; use wording
equivalent to “ブロッキング問題 {{count}} 件” while preserving the count placeholder.

In `@web/default/src/i18n/locales/ru.json`:
- Line 13: Update the Russian translation for “Routes OpenAI-compatible chat and
completion requests.” in the locale entries to use the API term “завершения” or
retain “Chat Completions” instead of “дополнения.” Apply the same correction to
both identified occurrences.

In `@web/default/src/i18n/locales/vi.json`:
- Line 8: Update the Vietnamese translations for both “{{count}} blocking
issue(s)” and the corresponding message at the referenced second entry to use
clear wording such as “{{count}} lỗi khiến cấu hình không hợp lệ,” replacing
“vấn đề chặn” consistently while preserving the count placeholder.

In `@web/default/src/i18n/locales/zh.json`:
- Line 14: Update the Chinese translation for “Routes OpenAI Responses API
requests.” and its corresponding capability label to preserve the established
product name “Responses API,” matching the existing “Responses APIs” translation
instead of using generic wording.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: a8f9e12b-dc83-48e0-8f88-5eb1c1717fef

📥 Commits

Reviewing files that changed from the base of the PR and between d6293e8 and 0d55161.

📒 Files selected for processing (11)
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
  • 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
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type。
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemo、useCallback、React.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import。
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError。
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"。
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/、lib/、hooks/、api.ts、types.ts、constants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/。

Files:

  • web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx
  • web/default/src/features/channels/components/drawers/sections/channel-models-section.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
🔇 Additional comments (16)
web/default/src/i18n/locales/en.json (1)

6-57: LGTM!

Also applies to: 136-137

web/default/src/i18n/locales/fr.json (2)

6-57: LGTM!


136-137: LGTM!

web/default/src/i18n/locales/ja.json (1)

6-7: LGTM!

Also applies to: 9-57, 136-137

web/default/src/i18n/locales/ru.json (2)

6-12: LGTM!

Also applies to: 14-22, 24-57


137-137: LGTM!

web/default/src/i18n/locales/vi.json (1)

6-7: LGTM!

Also applies to: 9-11, 13-57, 136-137

web/default/src/i18n/locales/zh.json (1)

6-13: LGTM!

Also applies to: 15-23, 25-57, 136-137

web/default/src/features/system-settings/models/model-pricing-sheet.tsx (2)

940-940: 🗄️ Data Integrity & Integration | ⚡ Quick win

Model identity still keyed only on editData?.name; will be covered by the consolidated cross-file comment (see below) rather than repeated here.


276-287: LGTM!

Also applies to: 450-527

web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (3)

306-326: 🗄️ Data Integrity & Integration | ⚡ Quick win

Remount key still derived only from model name/identity; will be covered by the consolidated cross-file comment below.


67-169: LGTM!

Also applies to: 175-185


237-262: LGTM!

web/default/src/features/system-settings/models/tiered-pricing-request-rules.tsx (2)

117-122: 📐 Maintainability & Code Quality | ⚡ Quick win

Nested ternary for sourceLabel still present.

As per coding guidelines, "禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。" This exact sourceLabel expression was flagged previously and remains unchanged.

♻️ Proposed fix
-  const sourceLabel =
-    condition.source === SOURCE_PARAM
-      ? t('Body param')
-      : condition.source === SOURCE_HEADER
-        ? t('Header')
-        : t('Time')
+  const getSourceLabel = () => {
+    if (condition.source === SOURCE_PARAM) return t('Body param')
+    if (condition.source === SOURCE_HEADER) return t('Header')
+    return t('Time')
+  }
+  const sourceLabel = getSourceLabel()

Source: Coding guidelines


72-116: LGTM!

Also applies to: 139-338, 351-455, 463-524

web/default/src/features/system-settings/models/tiered-pricing-visual-editor.tsx (1)

57-57: LGTM!

Also applies to: 79-172, 185-203, 218-349, 453-556

Comment thread web/default/src/i18n/locales/ru.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/default/src/i18n/locales/ru.json (1)

13-13: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the established Russian term for API “completion”.

дополнения means “additions” and misrepresents completion requests/endpoints. Use завершения, consistent with the existing translation at Line 3219.

Proposed fix
-    "Routes OpenAI-compatible chat and completion requests.": "Маршрутизирует OpenAI-совместимые запросы чата и дополнения.",
+    "Routes OpenAI-compatible chat and completion requests.": "Маршрутизирует совместимые с OpenAI запросы чата и завершения.",
-    "chat/completions": "Чат / дополнения API",
+    "chat/completions": "Чат / завершения API",

Also applies to: 23-23

🤖 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` at line 13, Update the Russian
translation for “Routes OpenAI-compatible chat and completion requests.” to use
“завершения” instead of “дополнения”, matching the established terminology used
elsewhere in the locale.
🤖 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.

Outside diff comments:
In `@web/default/src/i18n/locales/ru.json`:
- Line 13: Update the Russian translation for “Routes OpenAI-compatible chat and
completion requests.” to use “завершения” instead of “дополнения”, matching the
established terminology used elsewhere in the locale.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1f0f8dc0-89fd-4daf-8423-6a577761d79c

📥 Commits

Reviewing files that changed from the base of the PR and between 0d55161 and a5c4c68.

📒 Files selected for processing (5)
  • .gitignore
  • web/default/package.json
  • web/default/scripts/verify-tailwind-build.mjs
  • web/default/src/i18n/locales/ru.json
  • web/default/src/styles/index.css
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
web/default/src/styles/**/*

📄 CodeRabbit inference engine (web/default/AGENTS.md)

自定义样式应集中在 src/styles/,组件内尽量少写自定义 CSS。

Files:

  • web/default/src/styles/index.css
web/default/**/package.json

📄 CodeRabbit inference engine (web/default/AGENTS.md)

脚本与包管理以 package.json 为准;发布前应执行 typecheck、lint、format、生产构建,并检查产物体积与环境变量配置。

Files:

  • web/default/package.json
🪛 Biome (2.5.3)
web/default/src/styles/index.css

[error] 20-20: Tailwind-specific syntax is disabled.

(parse)

🪛 Stylelint (17.14.0)
web/default/src/styles/index.css

[error] 20-20: Unexpected unknown at-rule "@source" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)

🔇 Additional comments (5)
web/default/src/i18n/locales/ru.json (1)

136-137: LGTM!

.gitignore (1)

42-42: LGTM!

web/default/package.json (1)

8-9: LGTM!

web/default/scripts/verify-tailwind-build.mjs (1)

19-64: LGTM!

web/default/src/styles/index.css (1)

20-20: LGTM!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
web/default/src/i18n/locales/ru.json (1)

13-23: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use established terminology for “completion”.

“Дополнения” is misleading in an AI/API context. Use “завершения” or retain the official “Chat Completions” terminology, consistently with the existing OpenAI Chat Completions translation.

Proposed fix
-    "Routes OpenAI-compatible chat and completion requests.": "Маршрутизирует OpenAI-совместимые запросы чата и дополнения.",
+    "Routes OpenAI-compatible chat and completion requests.": "Маршрутизирует OpenAI-совместимые запросы чата и завершения.",
-    "chat/completions": "Чат / дополнения API",
+    "chat/completions": "Чат / завершения API",
🤖 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 13 - 23, Update the
Russian translations for completion-related entries in the locale, especially
“Routes OpenAI-compatible chat and completion requests.” and “chat/completions,”
replacing “дополнения” with the established “завершения” terminology or the
existing official “Chat Completions” wording. Keep the surrounding translations
unchanged and ensure the terminology is consistent.
web/default/src/i18n/locales/vi.json (1)

13-13: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify the OpenAI-compatible API wording.

“trò chuyện và hoàn thành tương thích OpenAI” is grammatically ambiguous. Prefer “Định tuyến các yêu cầu chat/completions tương thích với OpenAI.”

🤖 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` at line 13, Update the Vietnamese
translation for the key “Routes OpenAI-compatible chat and completion requests.”
to clearly use “Định tuyến các yêu cầu chat/completions tương thích với OpenAI.”
🤖 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/playground/components/playground-parameter-panel.tsx`:
- Around line 175-186: Update the parameter input change flow around the
control’s onChange handler to retain a raw draft string without calling
normalizeParameterNumberValue on every keystroke. Use the draft as the
controlled value while editing, then normalize and persist it on blur or Enter,
preserving decimal intermediates such as “0.” for keyboard input.
- Around line 72-79: Keep the component props object intact instead of
destructuring the newly added parameter props. In
web/default/src/features/playground/components/playground-parameter-panel.tsx
lines 72-79, update PlaygroundParameterContent to access fields through props;
apply the same change to the newly added parameter props in
web/default/src/features/playground/components/playground-input.tsx lines
119-122.

In `@web/default/src/features/playground/lib/playground-parameters.ts`:
- Around line 19-129: Remove the broad ParameterValue alias and narrow the value
parameter of getParameterControlValueText to number | null, matching the numeric
playground parameter contract while preserving the existing seed null handling
and string conversion.

In `@web/default/src/i18n/locales/en.json`:
- Around line 3325-3338: Update the locale entries for the presence_penalty
control: add “Presence Penalty” to web/default/src/i18n/locales/en.json at lines
3325-3338 and add its French translation, such as “Pénalité de présence,” to
web/default/src/i18n/locales/fr.json at lines 3325-3338, alongside the other
parameter labels. Also check the corresponding ja.json, ru.json, vi.json, and
zh.json locale sections for the same missing key and add appropriate
translations if absent.

In `@web/default/src/i18n/locales/ja.json`:
- Line 3330: Update the Japanese translation for “Keeps compatible responses
more repeatable” so it preserves “repeatable” as response reproducibility, using
wording equivalent to “応答の再現性を高める” rather than “互換性のある応答.”

In `@web/default/src/i18n/locales/ru.json`:
- Line 3330: Update the Russian translation for the “Keeps compatible responses
more repeatable” key to naturally express reproducibility when using compatible
models, rather than describing the responses themselves as compatible.

In `@web/default/src/i18n/locales/vi.json`:
- Line 3331: Update the Vietnamese translation for the “Limits token selection
to a probability mass” locale key, replacing “khối lượng xác suất” with the
clearer “tổng xác suất” while preserving the key and surrounding meaning.

In `@web/default/src/i18n/locales/zh.json`:
- Around line 3325-3338: Update the Chinese translation for “Keeps compatible
responses more repeatable” to use wording meaning reproducible or consistent,
such as “让兼容的响应更具可重复性” or “让兼容的响应更稳定可复现,” while leaving the other locale entries
unchanged.

In `@web/default/src/i18n/static-keys.ts`:
- Around line 332-347: Add the missing static translation keys “Parameters” and
“Enable {{parameter}}” to the playground parameter controls list in
static-keys.ts, alongside the existing labels used by
playground-parameter-panel.tsx.

---

Outside diff comments:
In `@web/default/src/i18n/locales/ru.json`:
- Around line 13-23: Update the Russian translations for completion-related
entries in the locale, especially “Routes OpenAI-compatible chat and completion
requests.” and “chat/completions,” replacing “дополнения” with the established
“завершения” terminology or the existing official “Chat Completions” wording.
Keep the surrounding translations unchanged and ensure the terminology is
consistent.

In `@web/default/src/i18n/locales/vi.json`:
- Line 13: Update the Vietnamese translation for the key “Routes
OpenAI-compatible chat and completion requests.” to clearly use “Định tuyến các
yêu cầu chat/completions tương thích với OpenAI.”
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 72486e38-ecf8-41ea-8cc7-96ae451f4f38

📥 Commits

Reviewing files that changed from the base of the PR and between a5c4c68 and 9bf11a4.

📒 Files selected for processing (14)
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/index.tsx
  • web/default/src/features/playground/lib/index.ts
  • web/default/src/features/playground/lib/payload-builder.test.ts
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/lib/playground-parameters.ts
  • 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
  • web/default/src/i18n/static-keys.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type。
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemo、useCallback、React.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import。
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError。
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"。
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/features/playground/lib/index.ts
  • web/default/src/features/playground/lib/payload-builder.test.ts
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/i18n/static-keys.ts
  • web/default/src/features/playground/index.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
web/default/src/features/**/lib/**/*.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

表单应使用 React Hook Form + Zod:在功能模块的 lib/ 下定义 schema,并用 z.infer 导出表单类型;useForm 应配合 @hookform/resolvers/zod 进行校验。

Files:

  • web/default/src/features/playground/lib/index.ts
  • web/default/src/features/playground/lib/payload-builder.test.ts
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/lib/playground-parameters.ts
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/、lib/、hooks/、api.ts、types.ts、constants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/。

Files:

  • web/default/src/features/playground/lib/index.ts
  • web/default/src/features/playground/lib/payload-builder.test.ts
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/index.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
web/default/src/**/*.test.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

工具函数与纯逻辑应优先编写单元测试;测试文件应命名为 *.test.ts。

Files:

  • web/default/src/features/playground/lib/payload-builder.test.ts
  • web/default/src/features/playground/lib/playground-parameters.test.ts
🔇 Additional comments (16)
web/default/src/features/playground/lib/playground-parameters.ts (1)

95-118: LGTM! The clamping/rounding logic is correct against all test cases (verified temperature/top_p/frequency_penalty/max_tokens/seed boundary and precision handling).

web/default/src/features/playground/lib/index.ts (1)

24-24: LGTM!

web/default/src/features/playground/lib/playground-parameters.test.ts (1)

26-40: LGTM! Test cases correctly exercise clamping, rounding, and the seed empty/null special case. As per coding guidelines, "工具函数与纯逻辑应优先编写单元测试;测试文件应命名为 *.test.ts" is satisfied here.

Source: Coding guidelines

web/default/src/features/playground/lib/payload-builder.test.ts (1)

24-58: LGTM! Assertions align precisely with buildChatCompletionPayload's enable/omit-when-null behavior (verified against the upstream implementation snippet).

web/default/src/i18n/locales/ja.json (3)

6-57: LGTM!


136-137: LGTM!


3325-3329: LGTM!

Also applies to: 3331-3338

web/default/src/i18n/locales/ru.json (3)

6-12: LGTM!

Also applies to: 24-57


136-137: LGTM!


3325-3329: LGTM!

Also applies to: 3331-3338

web/default/src/i18n/locales/vi.json (3)

6-12: LGTM!

Also applies to: 14-57


136-137: LGTM!


3325-3330: LGTM!

Also applies to: 3332-3338

web/default/src/i18n/locales/zh.json (2)

6-57: LGTM!


136-137: LGTM!

web/default/src/features/playground/components/playground-parameter-panel.tsx (1)

54-66: 📐 Maintainability & Code Quality

Provide successful type-check results for this TSX cohort.

  • web/default/src/features/playground/components/playground-parameter-panel.tsx#L54-L66: verify the new generic callback and nullable parameter flow.
  • web/default/src/features/playground/components/playground-input.tsx#L83-L92: verify callback assignability between input and panel props.
  • web/default/src/features/playground/index.tsx#L204-L207: verify state updater compatibility with the controlled input contract.

As per coding guidelines, “修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。”

Source: Coding guidelines

Comment thread web/default/src/features/playground/components/playground-parameter-panel.tsx Outdated
Comment thread web/default/src/features/playground/components/playground-parameter-panel.tsx Outdated
Comment thread web/default/src/features/playground/lib/playground-parameters.ts Outdated
Comment thread web/default/src/i18n/locales/en.json Outdated
Comment thread web/default/src/i18n/locales/ja.json Outdated
Comment thread web/default/src/i18n/locales/ru.json Outdated
Comment thread web/default/src/i18n/locales/vi.json Outdated
"Enable {{parameter}}": "Bật {{parameter}}",
"Frequency Penalty": "Hình phạt tần suất",
"Keeps compatible responses more repeatable": "Giúp các phản hồi tương thích dễ lặp lại hơn",
"Limits token selection to a probability mass": "Giới hạn việc chọn token trong một khối lượng xác suất",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a clearer translation for “probability mass.”

“khối lượng xác suất” is a literal translation and may confuse users configuring Top P. Use “tổng xác suất” instead.

🤖 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` at line 3331, Update the Vietnamese
translation for the “Limits token selection to a probability mass” locale key,
replacing “khối lượng xác suất” with the clearer “tổng xác suất” while
preserving the key and surrounding meaning.

Comment thread web/default/src/i18n/locales/zh.json Outdated
Comment on lines +332 to +347
// Playground parameter controls
'Caps the response length',
'Controls randomness and creativity',
'Encourages new topics',
'Frequency Penalty',
'Keeps compatible responses more repeatable',
'Limits token selection to a probability mass',
'Max Tokens',
'Not Set',
'Only enabled parameters are sent with the request.',
'Parameter settings',
'Reduces repeated wording',
'Seed',
'Temperature',
'Top P',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Register the remaining panel translation keys.

playground-parameter-panel.tsx also uses Parameters and Enable {{parameter}}; add both here so static locale coverage includes every new visible label. As per coding guidelines, “前端页面文本与组件内文案必须支持 i18n”。

🤖 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/static-keys.ts` around lines 332 - 347, Add the missing
static translation keys “Parameters” and “Enable {{parameter}}” to the
playground parameter controls list in static-keys.ts, alongside the existing
labels used by playground-parameter-panel.tsx.

Source: Coding guidelines

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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 platform limitations.

⚠️ Outside diff range comments (4)
web/default/src/features/playground/lib/playground-parameters.ts (1)

93-116: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Empty/invalid input bypasses control.min, can send out-of-range values.

For non-seed keys, both early-return branches (empty string, and invalid/missing control) return a hardcoded 0 instead of clamping to control.min. max_tokens has min: 1, so clearing the Max Tokens input and blurring sends max_tokens: 0 downstream via onConfigChange/payload builder — an invalid value for most APIs.

🐛 Suggested fix
 export function normalizeParameterNumberValue(
   key: PlaygroundParameterKey,
   value: string | number
 ): number | null {
-  if (value === '') {
-    return key === 'seed' ? null : 0
-  }
-
   const control = PLAYGROUND_PARAMETER_CONTROLS.find((item) => item.key === key)
+
+  if (value === '') {
+    return key === 'seed' ? null : control?.min ?? 0
+  }
+
   const parsed = typeof value === 'number' ? value : Number.parseFloat(value)

   if (!control || Number.isNaN(parsed)) {
-    return key === 'seed' ? null : 0
+    return key === 'seed' ? null : control?.min ?? 0
   }
🤖 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/playground/lib/playground-parameters.ts` around
lines 93 - 116, Update normalizeParameterNumberValue so empty or invalid
non-seed values use the matching control’s minimum rather than a hardcoded 0,
preserving seed’s null behavior. Resolve the control before these fallback
branches and apply the same clamping/normalization path used for parsed values,
including max_tokens’ minimum of 1.
web/default/src/i18n/locales/ru.json (1)

13-13: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Translate API “completion” as “завершение”, not “дополнение”.

“Дополнение” means an addition, so these labels misdescribe completion endpoints and may confuse Russian-speaking users. Use the project’s established terminology for model completions, such as “завершение” or “запросы completions”.

Also applies to: 23-23

🤖 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` at line 13, Update the Russian
translation for “Routes OpenAI-compatible chat and completion requests.” and the
additionally referenced completion label to use “завершение” (or the project’s
established completions terminology) instead of “дополнение,” while preserving
the existing meaning and translation structure.
web/default/src/i18n/locales/vi.json (1)

13-13: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Preserve API terminology in capability labels.

Translating completion as “hoàn thành” makes these labels ambiguous. Keep the technical endpoint names so users can identify the supported APIs.

Proposed wording
-    "Routes OpenAI-compatible chat and completion requests.": "Định tuyến yêu cầu trò chuyện và hoàn thành tương thích OpenAI.",
+    "Routes OpenAI-compatible chat and completion requests.": "Định tuyến các yêu cầu chat và completion tương thích OpenAI.",
-    "chat/completions": "Trò chuyện / hoàn thành API",
+    "chat/completions": "API chat/completions",

Also applies to: 23-23

🤖 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` at line 13, Update the Vietnamese
translation for the capability label in the locale entries corresponding to
“Routes OpenAI-compatible chat and completion requests” and its related
occurrence, preserving the technical terms “OpenAI-compatible,” “chat,” and
“completion” rather than translating “completion” as “hoàn thành.”
web/default/src/features/playground/components/playground-parameter-panel.tsx (1)

72-207: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting parameter-row logic into a hook/subcomponent.

PlaygroundParameterContent plus its draft-state management pushes this file well past ~200 lines. Extracting a usePlaygroundParameterDraft hook (or a PlaygroundParameterRow subcomponent for the per-control block at lines 116-204) would improve readability and reuse.

As per coding guidelines, "单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks".

🤖 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/playground/components/playground-parameter-panel.tsx`
around lines 72 - 207, Extract the per-control rendering and draft-state
handling from PlaygroundParameterContent into a focused PlaygroundParameterRow
subcomponent or usePlaygroundParameterDraft hook. Preserve the existing
parameter enablement, slider/input updates, commit-on-blur, Enter-key behavior,
and styling while reducing PlaygroundParameterContent’s size and keeping the
extracted logic reusable.

Source: Coding guidelines

♻️ Duplicate comments (1)
web/default/src/i18n/static-keys.ts (1)

332-348: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Still missing 'Parameters' and 'Enable {{parameter}}' static keys.

playground-parameter-panel.tsx uses t('Parameters') (trigger aria-label + tooltip content) and t('Enable {{parameter}}', {...}) (per-parameter Switch aria-label), but neither string was added to this new block. This was already flagged in a prior review round and remains unaddressed.

🛡️ Proposed fix
   'Only enabled parameters are sent with the request.',
   'Parameter settings',
+  'Parameters',
   'Presence Penalty',
   'Reduces repeated wording',
   'Seed',
   'Temperature',
   'Top P',
+  'Enable {{parameter}}',

As per coding guidelines, "前端页面文本与组件内文案必须支持 i18n".

🤖 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/static-keys.ts` around lines 332 - 348, Add the missing
static i18n keys 'Parameters' and 'Enable {{parameter}}' to the Playground
parameter controls block in static-keys.ts, matching the strings used by
playground-parameter-panel.tsx for the trigger label/tooltip and parameter
switch aria-label.

Source: Coding guidelines

🤖 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/i18n/locales/ja.json`:
- Line 3335: Update the Japanese locale entry for "Presence Penalty" from the
literal translation to the standard technical term "プレゼンスペナルティ", preserving the
existing key and locale structure.

---

Outside diff comments:
In
`@web/default/src/features/playground/components/playground-parameter-panel.tsx`:
- Around line 72-207: Extract the per-control rendering and draft-state handling
from PlaygroundParameterContent into a focused PlaygroundParameterRow
subcomponent or usePlaygroundParameterDraft hook. Preserve the existing
parameter enablement, slider/input updates, commit-on-blur, Enter-key behavior,
and styling while reducing PlaygroundParameterContent’s size and keeping the
extracted logic reusable.

In `@web/default/src/features/playground/lib/playground-parameters.ts`:
- Around line 93-116: Update normalizeParameterNumberValue so empty or invalid
non-seed values use the matching control’s minimum rather than a hardcoded 0,
preserving seed’s null behavior. Resolve the control before these fallback
branches and apply the same clamping/normalization path used for parsed values,
including max_tokens’ minimum of 1.

In `@web/default/src/i18n/locales/ru.json`:
- Line 13: Update the Russian translation for “Routes OpenAI-compatible chat and
completion requests.” and the additionally referenced completion label to use
“завершение” (or the project’s established completions terminology) instead of
“дополнение,” while preserving the existing meaning and translation structure.

In `@web/default/src/i18n/locales/vi.json`:
- Line 13: Update the Vietnamese translation for the capability label in the
locale entries corresponding to “Routes OpenAI-compatible chat and completion
requests” and its related occurrence, preserving the technical terms
“OpenAI-compatible,” “chat,” and “completion” rather than translating
“completion” as “hoàn thành.”

---

Duplicate comments:
In `@web/default/src/i18n/static-keys.ts`:
- Around line 332-348: Add the missing static i18n keys 'Parameters' and 'Enable
{{parameter}}' to the Playground parameter controls block in static-keys.ts,
matching the strings used by playground-parameter-panel.tsx for the trigger
label/tooltip and parameter switch aria-label.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 4e3af9d3-f580-47a0-b127-a3f8cbd98984

📥 Commits

Reviewing files that changed from the base of the PR and between 9bf11a4 and 5a64ecb.

📒 Files selected for processing (10)
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
  • 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
  • web/default/src/i18n/static-keys.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type。
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemo、useCallback、React.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import。
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError。
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"。
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/i18n/static-keys.ts
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/、lib/、hooks/、api.ts、types.ts、constants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/。

Files:

  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
web/default/src/features/**/lib/**/*.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

表单应使用 React Hook Form + Zod:在功能模块的 lib/ 下定义 schema,并用 z.infer 导出表单类型;useForm 应配合 @hookform/resolvers/zod 进行校验。

Files:

  • web/default/src/features/playground/lib/playground-parameters.ts
🔇 Additional comments (16)
web/default/src/i18n/locales/en.json (2)

3325-3339: 🎯 Functional Correctness

Verify ja.json, ru.json, vi.json, zh.json also carry the new parameter keys.

These locale files were listed as touched by this cohort but aren't included in this review batch; same verification gap raised in the prior review round.

#!/bin/bash
rg -n '"Presence Penalty"' 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

3325-3339: LGTM! Presence Penalty label/description key gap from the prior review is resolved.

web/default/src/features/playground/lib/playground-parameters.ts (1)

19-19: LGTM!

Also applies to: 118-127

web/default/src/i18n/locales/fr.json (1)

3325-3339: LGTM!

web/default/src/i18n/locales/ja.json (1)

6-57: LGTM!

Also applies to: 136-137, 3325-3334, 3336-3339

web/default/src/i18n/locales/ru.json (3)

6-12: LGTM!

Also applies to: 14-22, 24-57


136-137: LGTM!


3325-3339: LGTM!

web/default/src/i18n/locales/vi.json (4)

3331-3331: Duplicate: the probability-mass translation remains unclear.

This is the same still-valid issue reported in the previous review; replace “khối lượng xác suất” with “tổng xác suất”.


6-12: LGTM!

Also applies to: 14-22, 24-57


136-137: LGTM!


3325-3330: LGTM!

Also applies to: 3332-3339

web/default/src/i18n/locales/zh.json (1)

3330-3330: LGTM!

Also applies to: 3335-3335

web/default/src/features/playground/components/playground-parameter-panel.tsx (2)

1-71: LGTM!


211-279: LGTM! The previously-flagged destructuring and per-keystroke normalization issues are both resolved.

web/default/src/features/playground/components/playground-input.tsx (1)

60-66: LGTM!

Also applies to: 83-92, 119-119, 214-215

Comment thread web/default/src/i18n/locales/ja.json Outdated
@CSCITech

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/playground/components/playground-parameter-panel.tsx`:
- Around line 67-78: Update PlaygroundParameterContent’s updateParameterConfig
so clearing or entering an invalid numeric value preserves null for every
parameter, rather than coercing non-seed values through value ?? 0. Keep the
existing seed handling and pass the resulting nullable value to
props.onConfigChange, allowing cleared enabled fields to remain unset.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 843bf176-7986-4c0d-b90a-89f469b12285

📥 Commits

Reviewing files that changed from the base of the PR and between 9bf11a4 and 6e62ecd.

📒 Files selected for processing (12)
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/components/playground-parameter-row.tsx
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/lib/playground-parameters.ts
  • 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
  • web/default/src/i18n/static-keys.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type。
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemo、useCallback、React.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import。
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError。
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"。
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/i18n/static-keys.ts
  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-row.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/、lib/、hooks/、api.ts、types.ts、constants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/。

Files:

  • web/default/src/features/playground/components/playground-parameter-panel.tsx
  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/components/playground-input.tsx
  • web/default/src/features/playground/components/playground-parameter-row.tsx
  • web/default/src/features/playground/lib/playground-parameters.ts
web/default/src/features/**/lib/**/*.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

表单应使用 React Hook Form + Zod:在功能模块的 lib/ 下定义 schema,并用 z.infer 导出表单类型;useForm 应配合 @hookform/resolvers/zod 进行校验。

Files:

  • web/default/src/features/playground/lib/playground-parameters.test.ts
  • web/default/src/features/playground/lib/playground-parameters.ts
web/default/src/**/*.test.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

工具函数与纯逻辑应优先编写单元测试;测试文件应命名为 *.test.ts。

Files:

  • web/default/src/features/playground/lib/playground-parameters.test.ts
🔇 Additional comments (16)
web/default/src/i18n/locales/vi.json (3)

3331-3331: Duplicate: clarify the Vietnamese “probability mass” translation.

Line 3331 still uses the literal “khối lượng xác suất”; replace it with “tổng xác suất” for clearer Top P terminology.


6-57: LGTM!

Also applies to: 136-137


3325-3330: LGTM!

Also applies to: 3332-3339

web/default/src/i18n/locales/zh.json (1)

6-57: LGTM!

Also applies to: 136-137, 3325-3339

web/default/src/i18n/locales/ru.json (1)

6-57: LGTM!

Also applies to: 136-137, 3325-3339

web/default/src/features/playground/lib/playground-parameters.ts (1)

1-129: LGTM!

web/default/src/features/playground/lib/playground-parameters.test.ts (1)

40-49: LGTM!

web/default/src/i18n/locales/en.json (2)

3325-3339: LGTM!


3325-3339: 📐 Maintainability & Code Quality

No parity gap in the remaining locale files. The new parameter labels/descriptions are already present in ja/ru/vi/zh, so no follow-up is needed.

			> Likely an incorrect or invalid review comment.
web/default/src/i18n/locales/fr.json (1)

3325-3339: LGTM!

web/default/src/i18n/locales/ja.json (1)

6-57: LGTM!

Also applies to: 136-137, 3330-3330, 3335-3335

web/default/src/i18n/static-keys.ts (1)

332-347: Still missing 'Parameters' and 'Enable {{parameter}}' keys.

playground-parameter-panel.tsx uses t('Parameters') and playground-parameter-row.tsx uses t('Enable {{parameter}}', {...}), but neither key is registered here, so static locale coverage is incomplete for these two visible/aria-label strings.

As per coding guidelines, "前端页面文本与组件内文案必须支持 i18n".

Source: Coding guidelines

web/default/src/features/playground/components/playground-parameter-row.tsx (2)

94-109: 🎯 Functional Correctness

Verify the Slider gets an accessible name.

Unlike the Switch (explicit aria-label), the Slider only receives id={controlId} paired with the <label htmlFor> above. Native <label htmlFor> reliably wires up a real <input>, but many custom ARIA slider primitives expose role="slider" on an internal thumb that isn't the element carrying id — in that case the label wouldn't provide an accessible name for keyboard/screen-reader users.

Please confirm whether @/components/ui/slider forwards id to the thumb (or sets aria-labelledby from it); if not, add an explicit aria-label={t(props.control.labelKey)} on the Slider.


1-92: LGTM!

Also applies to: 110-132

web/default/src/features/playground/components/playground-parameter-panel.tsx (1)

47-47: LGTM!

Also applies to: 80-173

web/default/src/features/playground/components/playground-input.tsx (1)

84-92: LGTM!

Also applies to: 119-119, 214-215

@CSCITech

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@CSCITech

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/default/src/features/channels/components/drawers/channel-editor-state.ts (1)

51-61: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject non-string mapping values instead of coercing them.

String(rawTarget) makes object/number values appear as valid targets (for example, "[object Object]"), but channelFormSchema rejects non-string mapping values on save. Mark these mappings invalid here as well.

🤖 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-editor-state.ts`
around lines 51 - 61, Update the mapping reduction in the channel editor state
to accept only entries whose raw target value is a string; trim it after
validating its type and reject non-string values instead of coercing them with
String(). Preserve the existing source handling and only add entries when both
trimmed values are non-empty.
🤖 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 `@relay/channel/task/taskcommon/path_config_test.go`:
- Around line 90-100: Update the test fixture and assertions around taskInfo
token parsing to use distinct values for completion_tokens and total_tokens,
ensuring the assertions independently verify CompletionTokens and TotalTokens
mapping.

In `@web/default/src/i18n/locales/fr.json`:
- Line 1002: Update the French translation for “Completion delta settlement” to
preserve the technical billing meaning of “completion” and align with the nearby
“Completion” and “Completion price” terminology, rather than translating it as a
generic settlement at the end.

In `@web/default/src/i18n/locales/ja.json`:
- Line 447: Update the Japanese translation for the “API Key is required when
creating a channel.” entry to use the established term “APIキー”, resulting in
“チャネルの作成時には APIキーが必要です。”
- Line 998: Update the “Complete Order” translation in the locale entry to use
order-completion wording, such as 注文を完了, and keep it consistent with the nearby
“Failed to complete order” translation; do not use 手動チャージ.

In `@web/default/src/i18n/locales/ru.json`:
- Line 1618: Update the “embeddings” translation in the Russian locale to use
the established `Встраивания` terminology, matching the existing Embeddings
entry and preserving consistency.
- Line 4139: Update the standalone “Seed” translation in the Russian locale data
to use “Сид”, matching the existing translation used elsewhere in the locale.
- Line 447: Update the Russian locale entry for “API Key is required when
creating a channel.” to use the existing Russian terminology “ключ API”,
resulting in the translation “При создании канала требуется ключ API.”
- Line 996: Update the “Compatible support” translation in ru.json to use
natural Russian wording that expresses support for compatible APIs as a
capability, such as the established equivalent of “Поддержка совместимых API”.

---

Outside diff comments:
In
`@web/default/src/features/channels/components/drawers/channel-editor-state.ts`:
- Around line 51-61: Update the mapping reduction in the channel editor state to
accept only entries whose raw target value is a string; trim it after validating
its type and reject non-string values instead of coercing them with String().
Preserve the existing source handling and only add entries when both trimmed
values are non-empty.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 8b0e9c5f-13ad-4e53-ae4b-56d6a94693cc

📥 Commits

Reviewing files that changed from the base of the PR and between 232b125 and eaec14e.

📒 Files selected for processing (19)
  • controller/relay.go
  • controller/task_video.go
  • dto/channel_settings.go
  • model/task.go
  • relay/channel/task/taskcommon/path_config_test.go
  • relay/channel/task/taskcommon/protocol_config.go
  • service/task_billing_test.go
  • service/task_polling.go
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/default/src/features/channels/constants.ts
  • web/default/src/features/channels/lib/channel-form.ts
  • web/default/src/features/channels/types.ts
  • 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
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type。
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemo、useCallback、React.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import。
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError。
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"。
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/features/channels/constants.ts
  • web/default/src/features/channels/types.ts
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/channels/lib/channel-form.ts
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
web/default/src/features/**/constants.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

各 feature 的 constants.ts 中,成功/错误/提示类消息常量应仅保存 i18n 键,展示时必须通过 t() 渲染;状态/选项的 label 应统一使用 labelKey 或 label(二选一且同一 feature 内保持一致);新增此类常量时应同步登记翻译键。

Files:

  • web/default/src/features/channels/constants.ts
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/、lib/、hooks/、api.ts、types.ts、constants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/。

Files:

  • web/default/src/features/channels/constants.ts
  • web/default/src/features/channels/types.ts
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/channels/lib/channel-form.ts
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: In Go business code, all JSON marshal/unmarshal operations must use the wrapper functions in common/json.go (common.Marshal, common.Unmarshal, common.UnmarshalJsonStr, common.DecodeJson, common.GetJsonType) and must not directly call encoding/json for actual encode/decode work.
All database code must be compatible with SQLite, MySQL 5.7.8+, and PostgreSQL 9.6+; prefer GORM abstractions over raw SQL, avoid direct AUTO_INCREMENT/SERIAL, use commonGroupCol/commonKeyCol and commonTrueVal/commonFalseVal for DB-specific SQL, branch with common.UsingPostgreSQL/common.UsingSQLite/common.UsingMySQL, avoid unsupported DB-specific functions/operators without fallback, and make migrations work across all three databases.
When implementing a new relay channel, confirm whether the provider supports StreamOptions; if it does, add that channel to streamSupportedChannels.
For request structs parsed from client JSON and re-marshaled to upstream providers, optional scalar fields must use pointer types with omitempty so explicit zero/false values are preserved instead of dropped.
When working on tiered/dynamic billing expression code, read pkg/billingexpr/expr.md first and follow its documented expression language, architecture, token normalization, quota conversion, and versioning patterns.

**/*.go: All JSON marshal/unmarshal operations in Go business code must use the wrapper functions in common/json.go (common.Marshal, common.Unmarshal, common.UnmarshalJsonStr, common.DecodeJson, common.GetJsonType) instead of directly importing or calling encoding/json for actual marshal/unmarshal work.
All database code in Go must remain compatible with SQLite, MySQL >= 5.7.8, and PostgreSQL >= 9.6; prefer GORM abstractions, avoid raw SQL unless necessary, use the shared DB helper variables for reserved words and boolean literals, branch with the common.UsingPostgreSQL / common.UsingSQLite / common.UsingMySQL flags when need...

Files:

  • controller/task_video.go
  • dto/channel_settings.go
  • relay/channel/task/taskcommon/path_config_test.go
  • relay/channel/task/taskcommon/protocol_config.go
  • controller/relay.go
  • service/task_polling.go
  • model/task.go
  • service/task_billing_test.go
dto/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

For request structs parsed from client JSON and then re-marshaled to upstream providers, especially in relay/convert paths, optional scalar fields must use pointer types with omitempty so that absent fields stay omitted while explicit zero/false values are preserved.

Files:

  • dto/channel_settings.go
relay/channel/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

When implementing a new channel, confirm whether the provider supports StreamOptions; if it does, add the channel to streamSupportedChannels.

Files:

  • relay/channel/task/taskcommon/path_config_test.go
  • relay/channel/task/taskcommon/protocol_config.go
web/default/src/features/**/lib/**/*.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

表单应使用 React Hook Form + Zod:在功能模块的 lib/ 下定义 schema,并用 z.infer 导出表单类型;useForm 应配合 @hookform/resolvers/zod 进行校验。

Files:

  • web/default/src/features/channels/lib/channel-form.ts
🔇 Additional comments (21)
web/default/src/i18n/locales/ja.json (1)

27-27: LGTM!

Also applies to: 53-53, 69-69, 87-92, 250-250, 515-519, 652-655, 793-793, 855-855, 953-958, 996-996, 1002-1002, 1019-1028, 1134-1134, 1618-1624, 1674-1674, 1992-1992, 2099-2099, 2126-2126, 2345-2345, 2483-2483, 2555-2556, 2676-2676, 2753-2753, 2898-2898, 2950-2950, 3105-3105, 3175-3175, 3307-3307, 3525-3525, 3726-3726, 3768-3768, 3893-3893, 3939-3939, 3994-4002, 4139-4139, 4298-4298, 4393-4393, 4541-4541, 4561-4561, 4648-4648, 4785-4785, 4959-4959, 5112-5130, 5262-5262

web/default/src/i18n/locales/fr.json (1)

27-27: LGTM!

Also applies to: 53-53, 69-69, 87-92, 250-250, 447-447, 515-519, 652-655, 793-793, 855-855, 953-958, 996-1001, 1019-1028, 1134-1134, 1618-1624, 1674-1674, 1992-1992, 2099-2099, 2126-2126, 2345-2345, 2483-2483, 2555-2556, 2676-2676, 2753-2753, 2898-2898, 2950-2950, 3105-3105, 3175-3175, 3307-3307, 3525-3525, 3726-3726, 3768-3768, 3893-3893, 3939-3939, 3994-4002, 4139-4139, 4298-4298, 4393-4393, 4541-4541, 4561-4561, 4648-4648, 4959-4959, 5112-5130, 5262-5262

web/default/src/i18n/locales/zh.json (1)

27-92: LGTM!

Also applies to: 250-250, 447-447, 515-519, 652-655, 793-793, 855-855, 953-958, 996-1002, 1019-1028, 1134-1134, 1618-1624, 1674-1674, 1992-1992, 2099-2099, 2126-2126, 2345-2345, 2483-2483, 2555-2556, 2676-2676, 2753-2753, 2898-2898, 2950-2950, 3105-3105, 3175-3175, 3307-3307, 3525-3525, 3726-3726, 3768-3768, 3893-3893, 3939-3939, 3994-4002, 4139-4139, 4298-4298, 4393-4393, 4541-4541, 4561-4561, 4648-4648, 4785-4785, 4959-4959, 5112-5130, 5262-5262

web/default/src/i18n/locales/ru.json (3)

27-27: LGTM!

Also applies to: 53-53, 69-69, 87-87, 92-92, 250-250, 515-519, 652-652, 655-655, 793-793, 855-855, 953-953, 957-958


1019-1019: LGTM!

Also applies to: 1027-1028, 1134-1134, 1620-1622, 1624-1624, 1674-1674, 1992-1992, 2099-2099, 2126-2126, 2345-2345, 2483-2483, 2555-2556, 2676-2676, 2753-2753, 2898-2898, 2950-2950, 3105-3105, 3175-3175, 3307-3307, 3525-3525


3726-3726: LGTM!

Also applies to: 3768-3768, 3893-3893, 3939-3939, 3994-4002, 4298-4298, 4393-4393, 4541-4541, 4561-4561, 4648-4648, 4785-4785, 4959-4959, 5112-5112, 5115-5117, 5123-5123, 5126-5130, 5262-5262

web/default/src/i18n/locales/vi.json (2)

2556-2556: The probability-mass translation still needs the previous correction.

Line [2556] still uses “khối lượng xác suất”; use “tổng xác suất” for clearer Vietnamese terminology. This is the same unresolved issue raised in the previous review.


27-27: LGTM!

Also applies to: 53-53, 69-69, 87-92, 250-250, 447-447, 515-519, 652-655, 793-793, 855-855, 953-958, 996-1002, 1019-1028, 1134-1134, 1618-1624, 1674-1674, 1992-1992, 2099-2099, 2126-2126, 2345-2345, 2483-2483, 2555-2555, 2676-2676, 2753-2753, 2898-2898, 2950-2950, 3105-3105, 3175-3175, 3307-3307, 3525-3525, 3726-3726, 3768-3768, 3893-3893, 3939-3939, 3994-4002, 4139-4139, 4298-4298, 4393-4393, 4541-4541, 4561-4561, 4648-4648, 4785-4785, 4959-4959, 5112-5130, 5262-5262

web/default/src/i18n/locales/en.json (1)

27-27: LGTM!

Also applies to: 53-53, 69-69, 87-92, 250-250, 447-447, 515-519, 652-655, 793-793, 855-855, 953-958, 996-1002, 1019-1028, 1134-1134, 1618-1624, 1674-1674, 1992-1992, 2099-2099, 2126-2126, 2345-2345, 2483-2483, 2555-2556, 2676-2676, 2753-2753, 2898-2898, 2950-2950, 3105-3105, 3175-3175, 3307-3307, 3525-3525, 3726-3726, 3768-3768, 3893-3893, 3939-4002, 4139-4139, 4298-4298, 4393-4393, 4541-4541, 4561-4561, 4648-4648, 4785-4785, 4959-4959, 5112-5130, 5262-5262

web/default/src/features/channels/components/drawers/channel-editor-state.ts (1)

112-117: LGTM!

Also applies to: 126-152, 193-211

web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx (1)

106-106: LGTM!

Also applies to: 225-225, 304-320, 355-355, 586-659, 768-808, 1135-1143, 1210-1218, 1367-1370, 2449-2457, 3009-3047, 3887-3890

web/default/src/features/channels/constants.ts (1)

84-84: LGTM!

web/default/src/features/channels/lib/channel-form.ts (1)

22-22: LGTM!

Also applies to: 247-250, 441-441, 589-592, 630-631, 748-751, 889-897

controller/task_video.go (1)

163-165: LGTM!

relay/channel/task/taskcommon/protocol_config.go (1)

206-217: LGTM!

web/default/src/features/channels/types.ts (1)

111-111: LGTM!

controller/relay.go (1)

585-603: LGTM!

dto/channel_settings.go (1)

52-52: LGTM!

model/task.go (1)

113-138: LGTM!

service/task_billing_test.go (1)

12-13: LGTM!

Also applies to: 721-721, 748-748, 757-868, 888-888

service/task_polling.go (1)

504-504: LGTM!

Also applies to: 566-575

Comment on lines +90 to +100
"usage": {
"completion_tokens": 40594,
"total_tokens": 40594
}
}`), dto.ChannelOtherSettings{TaskProtocol: TaskProtocolGenericVideo})

require.NoError(t, err)
require.True(t, ok)
require.NotNil(t, taskInfo)
assert.Equal(t, 40594, taskInfo.CompletionTokens)
assert.Equal(t, 40594, taskInfo.TotalTokens)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use distinct token values.

Identical fixtures let an incorrect shared mapping pass; use different completion_tokens and total_tokens values.

Proposed fix
-    "completion_tokens": 40594,
-    "total_tokens": 40594
+    "completion_tokens": 12345,
+    "total_tokens": 40594
...
- assert.Equal(t, 40594, taskInfo.CompletionTokens)
+ assert.Equal(t, 12345, taskInfo.CompletionTokens)
  assert.Equal(t, 40594, taskInfo.TotalTokens)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"usage": {
"completion_tokens": 40594,
"total_tokens": 40594
}
}`), dto.ChannelOtherSettings{TaskProtocol: TaskProtocolGenericVideo})
require.NoError(t, err)
require.True(t, ok)
require.NotNil(t, taskInfo)
assert.Equal(t, 40594, taskInfo.CompletionTokens)
assert.Equal(t, 40594, taskInfo.TotalTokens)
"usage": {
"completion_tokens": 12345,
"total_tokens": 40594
}
}`), dto.ChannelOtherSettings{TaskProtocol: TaskProtocolGenericVideo})
require.NoError(t, err)
require.True(t, ok)
require.NotNil(t, taskInfo)
assert.Equal(t, 12345, taskInfo.CompletionTokens)
assert.Equal(t, 40594, taskInfo.TotalTokens)
🤖 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/task/taskcommon/path_config_test.go` around lines 90 - 100,
Update the test fixture and assertions around taskInfo token parsing to use
distinct values for completion_tokens and total_tokens, ensuring the assertions
independently verify CompletionTokens and TotalTokens mapping.

"Complete these steps to finish the initial installation.": "Suivez ces étapes pour terminer l'installation initiale.",
"Completed": "Terminé",
"Completion": "Achèvement",
"Completion delta settlement": "Règlement du delta à la fin",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Preserve the “completion” billing meaning.

"Completion delta settlement" is translated as "Règlement du delta à la fin", which changes the technical meaning to a generic “settlement at the end.” This is ambiguous and inconsistent with the nearby Completion and Completion price terminology.

-    "Completion delta settlement": "Règlement du delta à la fin",
+    "Completion delta settlement": "Règlement du delta de complétion",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Completion delta settlement": "Règlement du delta à la fin",
"Completion delta settlement": "Règlement du delta de complétion",
🤖 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` at line 1002, Update the French
translation for “Completion delta settlement” to preserve the technical billing
meaning of “completion” and align with the nearby “Completion” and “Completion
price” terminology, rather than translating it as a generic settlement at the
end.

"API key from the provider": "プロバイダからのAPIキー",
"API key is loading, please try again in a moment": "API キーを読み込み中です。しばらくしてから再試行してください",
"API key is required": "APIキーが必要です",
"API Key is required when creating a channel.": "チャネルの作成時には API Key が必要です。",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the established Japanese term for “API Key”.

API Key is inconsistent with the surrounding locale entries, which use APIキー. Translate this as チャネルの作成時には APIキーが必要です。

🤖 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` at line 447, Update the Japanese
translation for the “API Key is required when creating a channel.” entry to use
the established term “APIキー”, resulting in “チャネルの作成時には APIキーが必要です。”

"Compatible API routes for common AI application workflows": "一般的なAIアプリケーションワークフロー向けの互換APIルート",
"Compatible support": "互換対応",
"Complete API documentation with multi-language SDK support": "多言語SDKをサポートする完全なAPIドキュメント",
"Complete Order": "手動チャージ",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Translate “Complete Order” as order completion.

手動チャージ means “manual top-up,” not “complete order,” and conflicts with the nearby Failed to complete order translation. Use wording such as 注文を完了 instead.

🤖 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` at line 998, Update the “Complete
Order” translation in the locale entry to use order-completion wording, such as
注文を完了, and keep it consistent with the nearby “Failed to complete order”
translation; do not use 手動チャージ.

"API key from the provider": "Ключ API от провайдера",
"API key is loading, please try again in a moment": "API-ключ загружается, повторите попытку через несколько секунд",
"API key is required": "Требуется ключ API",
"API Key is required when creating a channel.": "При создании канала требуется API Key.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the existing Russian translation for “API Key”.

Line 447 leaves “API Key” in English, while nearby entries use “Ключ API”. Use При создании канала требуется ключ API. for consistent Russian UI text.

🤖 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` at line 447, Update the Russian locale
entry for “API Key is required when creating a channel.” to use the existing
Russian terminology “ключ API”, resulting in the translation “При создании
канала требуется ключ API.”

"Compatibility field for the default auto route. It is derived from the route config when saving.": "Поле совместимости для автомаршрута по умолчанию. При сохранении оно формируется из конфигурации маршрутов.",
"compatible API routes": "совместимых API-маршрутов",
"Compatible API routes for common AI application workflows": "Совместимые API-маршруты для типовых сценариев ИИ-приложений",
"Compatible support": "Совместимая поддержка",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Translate “Compatible support” as a capability.

Совместимая поддержка is unnatural and does not identify what is supported. Use wording such as Поддержка совместимых API if that matches the capability context.

🤖 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` at line 996, Update the “Compatible
support” translation in ru.json to use natural Russian wording that expresses
support for compatible APIs as a capability, such as the established equivalent
of “Поддержка совместимых API”.

"Email Field": "Поле email",
"Email Verification": "Верификация Email",
"Email, summarisation, knowledge work": "Электронная почта, резюме, knowledge work",
"embeddings": "Векторные представления",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep “embeddings” terminology consistent.

This entry uses Векторные представления, while the existing Embeddings entry uses Встраивания. Use one term consistently, preferably the project’s established terminology.

🤖 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` at line 1618, Update the “embeddings”
translation in the Russian locale to use the established `Встраивания`
terminology, matching the existing Embeddings entry and preserving consistency.

"Security boundary": "Граница безопасности",
"Security Check": "Проверка безопасности",
"Security verification": "Подтверждение безопасности",
"Seed": "Seed",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize “Seed” consistently.

The existing Russian description at Line 1430 uses Сид, but this standalone label remains Seed. Translate it as Сид to avoid mixing English and Russian terminology.

🤖 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` at line 4139, Update the standalone
“Seed” translation in the Russian locale data to use “Сид”, matching the
existing translation used elsewhere in the locale.

@CSCITech
CSCITech merged commit 6dffe87 into main Jul 22, 2026
3 checks passed
This was referenced Jul 29, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Aug 9, 2026
11 tasks
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