Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change internationalizes accessibility text, updates responsive tables and header menus, extracts channel and pricing editor modules, adds dashboard and settings states, adjusts typography and layout styles, and expands locale translations. ChangesShared UI, localization, and responsive layout
Channel and pricing editors
Dashboard and settings behavior
Relay usage accounting
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 14
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/models/components/dialogs/prefill-group-management-dialog.tsx (1)
332-345: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTranslate the desktop action labels as well.
Lines 332-345 localize only the mobile buttons; the desktop buttons at Lines 480-493 still render hardcoded
Edit groupandDelete group. Screen-reader labels therefore remain English on desktop.Proposed fix
- <span className='sr-only'> - Edit group - </span> + <span className='sr-only'> + {t('Edit group')} + </span> ... - <span className='sr-only'> - Delete group - </span> + <span className='sr-only'> + {t('Delete group')} + </span>As per coding guidelines, React 组件中应使用
useTranslation()取得t,并通过t()渲染用户可见文本;子组件也应自行使用useTranslation()保持独立性。🤖 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/models/components/dialogs/prefill-group-management-dialog.tsx` around lines 332 - 345, Update the desktop action buttons in the group management dialog to use translated screen-reader labels for both edit and delete actions, matching the existing mobile buttons. Use the component’s useTranslation() t function and replace the hardcoded English text near the desktop edit/delete handlers without changing the button behavior.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/components/data-table/data-table-page.tsx`:
- Around line 254-279: Update useNarrowTableContainer so isNarrow is not
initialized from window.innerWidth; initialize it to false and retain the
existing container measurement in the effect, ensuring the first render does not
infer layout from viewport width.
In `@web/default/src/components/layout/components/public-header.tsx`:
- Line 371: Update the public header’s mobile menu state/effect so mobileOpen is
cleared when the viewport crosses into the lg breakpoint, or ensure body scroll
locking is gated by the current viewport width. Preserve mobile menu behavior
below lg while preventing a hidden desktop overlay from keeping page scrolling
locked.
In `@web/default/src/components/ui/command.tsx`:
- Line 201: Update the class string in the command item styling to replace the
invalid Tailwind utility “text-xsst” with “text-xs”, preserving all other
classes unchanged.
In `@web/default/src/components/ui/context-menu.tsx`:
- Around line 267-273: Replace the invalid text-xsst class with the valid
text-xs utility in ContextMenuShortcut, and apply the same correction to the
corresponding shortcut styles in command.tsx, dropdown-menu.tsx, and
menubar.tsx.
In `@web/default/src/components/ui/dropdown-menu.tsx`:
- Line 283: Replace the invalid text-xsst utility with text-xs tracking-widest
in DropdownMenuShortcut’s base className in
web/default/src/components/ui/dropdown-menu.tsx:283-283 and in the
MenubarShortcut className override in
web/default/src/components/ui/menubar.tsx:235-235.
In
`@web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx`:
- Around line 106-115: Update resetDialogState to also reset deleteOpen,
deleteTarget, and isDeleting when the dialog closes. Ensure the close path
clears the prior delete confirmation and target before reopening, while
preserving the existing model, search, pull, and abort cleanup.
- Around line 177-189: Update the useEffect flow around fetchOllamaModels so
each model-fetch run is invalidated when the dialog closes, channelId/currentRow
changes, or the effect cleans up. Abort the underlying request when supported,
and ensure stale responses cannot commit models or selected state; only the
latest active run may update the UI.
In
`@web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx`:
- Around line 142-158: Associate every label in the specialized editor
components with its corresponding form control, including the visible Error
Message field and the other referenced editor fields. Add matching unique
id/htmlFor pairs or wrap each control inside its label, ensuring all input,
textarea, and select controls have an accessible label without changing their
existing behavior.
- Around line 644-687: The sync target editor currently loses the selected type
when the key is empty because both handlers immediately rebuild the spec through
buildSyncTargetSpec. Preserve the selected type separately in the editor state,
update it in the type Select handler, and only call buildSyncTargetSpec from the
key handler once the key is non-empty, so choosing a type before entering a key
remains intact.
In
`@web/default/src/features/dashboard/components/overview/overview-dashboard.tsx`:
- Around line 294-298: Replace the nested ternary branches in the overview
dashboard, including StatusIcon and the listed status-item computations, with
if-else logic or a shared helper that evaluates unavailable before completed
before the default state. Reuse the helper for paired value/state outputs such
as operationsStatusItems to avoid duplicating the same three-way condition,
while preserving each branch’s existing results.
In
`@web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts`:
- Line 19: Add Bun type support for the test build used by
overview-query-utils.test.ts, updating the relevant web/default TypeScript
configuration and dependency declarations so the bun:test import resolves during
tsc -b; alternatively, migrate the test to the repository’s configured runner
while preserving its existing behavior.
In `@web/default/src/features/system-settings/models/tiered-pricing-utils.ts`:
- Around line 28-42: Update formatTokenHint to accept the established
translation function t and use it for the rendered token hint text, including
the singular text and M/K suffix labels. Update every call site to pass t while
preserving the existing empty-value and numeric formatting behavior.
In `@web/default/src/i18n/locales/ja.json`:
- Line 49: Replace the English value for "{{count}} tiered billing models
enabled" with a proper Japanese translation in
web/default/src/i18n/locales/ja.json at lines 49-49 and a proper Russian
translation in web/default/src/i18n/locales/ru.json at lines 49-49, preserving
the {{count}} interpolation placeholder.
- Line 2742: Update the Japanese translation for the “Model pull failed:
{{msg}}” key to preserve the `{{msg}}` interpolation placeholder instead of the
literal `__ PH_0 __` token, matching the expected i18next interpolation
behavior.
---
Outside diff comments:
In
`@web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx`:
- Around line 332-345: Update the desktop action buttons in the group management
dialog to use translated screen-reader labels for both edit and delete actions,
matching the existing mobile buttons. Use the component’s useTranslation() t
function and replace the hardcoded English text near the desktop edit/delete
handlers without changing the button behavior.
🪄 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: fd5f2da5-f904-48ef-b409-a5e186db615e
📒 Files selected for processing (84)
web/default/src/components/ai-elements/conversation.tsxweb/default/src/components/ai-elements/tool.tsxweb/default/src/components/config-drawer.tsxweb/default/src/components/data-table/bulk-actions.tsxweb/default/src/components/data-table/data-table-page.tsxweb/default/src/components/data-table/mobile-card-list.tsxweb/default/src/components/data-table/pagination.tsxweb/default/src/components/datetime-picker.tsxweb/default/src/components/json-editor.tsxweb/default/src/components/language-switcher.tsxweb/default/src/components/layout/components/app-header.tsxweb/default/src/components/layout/components/footer.tsxweb/default/src/components/layout/components/header-tools-menu.tsxweb/default/src/components/layout/components/nav-group.tsxweb/default/src/components/layout/components/public-header.tsxweb/default/src/components/layout/components/section-page-layout.tsxweb/default/src/components/layout/components/top-nav.tsxweb/default/src/components/password-input.tsxweb/default/src/components/tag-input.tsxweb/default/src/components/theme-switch.tsxweb/default/src/components/ui/breadcrumb.tsxweb/default/src/components/ui/carousel.tsxweb/default/src/components/ui/command.tsxweb/default/src/components/ui/context-menu.tsxweb/default/src/components/ui/dialog.tsxweb/default/src/components/ui/dropdown-menu.tsxweb/default/src/components/ui/empty.tsxweb/default/src/components/ui/markdown.tsxweb/default/src/components/ui/menubar.tsxweb/default/src/components/ui/pagination.tsxweb/default/src/components/ui/sheet.tsxweb/default/src/components/ui/sidebar.tsxweb/default/src/components/ui/spinner.tsxweb/default/src/components/ui/titled-card.tsxweb/default/src/features/channels/components/channels-columns.tsxweb/default/src/features/channels/components/dialogs/codex-usage-dialog.tsxweb/default/src/features/channels/components/dialogs/ollama-models-dialog.tsxweb/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsxweb/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsxweb/default/src/features/channels/components/drawers/channel-editor-navigation.tsxweb/default/src/features/channels/components/drawers/channel-editor-state.tsweb/default/src/features/channels/components/drawers/channel-mutate-drawer.tsxweb/default/src/features/channels/components/numeric-spinner-input.tsxweb/default/src/features/dashboard/components/models/log-stat-cards.tsxweb/default/src/features/dashboard/components/overview/overview-dashboard.tsxweb/default/src/features/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/dashboard/components/overview/overview-query-utils.tsweb/default/src/features/dashboard/components/overview/summary-cards.tsxweb/default/src/features/dashboard/components/overview/uptime-panel.tsxweb/default/src/features/dashboard/components/ui/stat-card.tsxweb/default/src/features/dashboard/index.tsxweb/default/src/features/home/components/sections/hero.tsxweb/default/src/features/keys/components/api-keys-columns.tsxweb/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsxweb/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsxweb/default/src/features/models/components/models-columns.tsxweb/default/src/features/playground/api.tsweb/default/src/features/playground/lib/playground-option-utils.test.tsweb/default/src/features/playground/lib/playground-option-utils.tsweb/default/src/features/pricing/components/model-details-uptime-sparkline.tsxweb/default/src/features/system-settings/components/settings-form-layout.tsxweb/default/src/features/system-settings/components/settings-page.tsxweb/default/src/features/system-settings/models/channel-selector-dialog.tsxweb/default/src/features/system-settings/models/model-pricing-sheet.tsxweb/default/src/features/system-settings/models/tiered-pricing-editor.tsxweb/default/src/features/system-settings/models/tiered-pricing-fields.tsxweb/default/src/features/system-settings/models/tiered-pricing-support.tsxweb/default/src/features/system-settings/models/tiered-pricing-utils.tsweb/default/src/features/users/components/users-columns.tsxweb/default/src/i18n/locales/_reports/_sync-report.jsonweb/default/src/i18n/locales/_reports/fr.untranslated.jsonweb/default/src/i18n/locales/_reports/ja.untranslated.jsonweb/default/src/i18n/locales/_reports/ru.untranslated.jsonweb/default/src/i18n/locales/_reports/vi.untranslated.jsonweb/default/src/i18n/locales/en.jsonweb/default/src/i18n/locales/fr.jsonweb/default/src/i18n/locales/ja.jsonweb/default/src/i18n/locales/ru.jsonweb/default/src/i18n/locales/vi.jsonweb/default/src/i18n/locales/zh.jsonweb/default/src/main.tsxweb/default/src/styles/index.cssweb/default/src/styles/theme-presets.cssweb/default/src/tanstack-table.d.ts
💤 Files with no reviewable changes (5)
- web/default/src/i18n/locales/_reports/ru.untranslated.json
- web/default/src/i18n/locales/_reports/ja.untranslated.json
- web/default/src/i18n/locales/_reports/vi.untranslated.json
- web/default/src/i18n/locales/_reports/fr.untranslated.json
- web/default/src/main.tsx
📜 Review details
⚠️ CI failures not shown inline (2)
GitHub Actions: CI / 1_Frontend checks.txt: v1.0.5-preview.1
Conclusion: failure
##[group]Run bun run typecheck
�[36;1mbun run typecheck�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]
$ tsc -b
src/features/dashboard/components/overview/overview-query-utils.test.ts(19,40): error TS2307: Cannot find module 'bun:test' or its corresponding type declarations.
##[error]Process completed with exit code 2.
GitHub Actions: CI / Frontend checks: v1.0.5-preview.1
Conclusion: failure
##[group]Run bun run typecheck
�[36;1mbun run typecheck�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]
$ tsc -b
src/features/dashboard/components/overview/overview-query-utils.test.ts(19,40): error TS2307: Cannot find module 'bun:test' or its corresponding type declarations.
##[error]Process completed with exit code 2.
🧰 Additional context used
📓 Path-based instructions (5)
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/data-table/pagination.tsxweb/default/src/features/home/components/sections/hero.tsxweb/default/src/features/dashboard/components/overview/overview-query-utils.tsweb/default/src/features/system-settings/models/channel-selector-dialog.tsxweb/default/src/features/dashboard/components/overview/uptime-panel.tsxweb/default/src/features/playground/lib/playground-option-utils.test.tsweb/default/src/components/ui/dropdown-menu.tsxweb/default/src/components/ui/empty.tsxweb/default/src/tanstack-table.d.tsweb/default/src/components/password-input.tsxweb/default/src/components/ui/spinner.tsxweb/default/src/features/playground/lib/playground-option-utils.tsweb/default/src/features/users/components/users-columns.tsxweb/default/src/components/ui/titled-card.tsxweb/default/src/components/layout/components/section-page-layout.tsxweb/default/src/features/playground/api.tsweb/default/src/components/ui/context-menu.tsxweb/default/src/components/ui/menubar.tsxweb/default/src/features/channels/components/dialogs/codex-usage-dialog.tsxweb/default/src/components/json-editor.tsxweb/default/src/components/ai-elements/conversation.tsxweb/default/src/components/layout/components/header-tools-menu.tsxweb/default/src/features/dashboard/components/ui/stat-card.tsxweb/default/src/components/ui/dialog.tsxweb/default/src/components/layout/components/nav-group.tsxweb/default/src/features/system-settings/models/tiered-pricing-fields.tsxweb/default/src/features/channels/components/numeric-spinner-input.tsxweb/default/src/components/datetime-picker.tsxweb/default/src/components/data-table/bulk-actions.tsxweb/default/src/features/dashboard/components/overview/summary-cards.tsxweb/default/src/components/ui/sheet.tsxweb/default/src/components/layout/components/footer.tsxweb/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsxweb/default/src/features/dashboard/components/models/log-stat-cards.tsxweb/default/src/features/channels/components/channels-columns.tsxweb/default/src/components/theme-switch.tsxweb/default/src/components/ui/carousel.tsxweb/default/src/components/ui/command.tsxweb/default/src/components/ui/breadcrumb.tsxweb/default/src/components/ai-elements/tool.tsxweb/default/src/features/keys/components/api-keys-columns.tsxweb/default/src/components/layout/components/app-header.tsxweb/default/src/features/channels/components/drawers/channel-editor-navigation.tsxweb/default/src/components/layout/components/public-header.tsxweb/default/src/features/system-settings/models/tiered-pricing-utils.tsweb/default/src/components/layout/components/top-nav.tsxweb/default/src/features/models/components/models-columns.tsxweb/default/src/components/language-switcher.tsxweb/default/src/features/system-settings/models/model-pricing-sheet.tsxweb/default/src/features/system-settings/components/settings-page.tsxweb/default/src/components/ui/sidebar.tsxweb/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsxweb/default/src/features/pricing/components/model-details-uptime-sparkline.tsxweb/default/src/features/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/system-settings/models/tiered-pricing-support.tsxweb/default/src/components/config-drawer.tsxweb/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsxweb/default/src/features/dashboard/index.tsxweb/default/src/components/ui/pagination.tsxweb/default/src/components/data-table/mobile-card-list.tsxweb/default/src/features/channels/components/dialogs/ollama-models-dialog.tsxweb/default/src/components/data-table/data-table-page.tsxweb/default/src/features/channels/components/drawers/channel-editor-state.tsweb/default/src/features/system-settings/components/settings-form-layout.tsxweb/default/src/components/ui/markdown.tsxweb/default/src/features/channels/components/drawers/channel-mutate-drawer.tsxweb/default/src/features/system-settings/models/tiered-pricing-editor.tsxweb/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsxweb/default/src/features/dashboard/components/overview/overview-dashboard.tsxweb/default/src/components/tag-input.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/home/components/sections/hero.tsxweb/default/src/features/dashboard/components/overview/overview-query-utils.tsweb/default/src/features/system-settings/models/channel-selector-dialog.tsxweb/default/src/features/dashboard/components/overview/uptime-panel.tsxweb/default/src/features/playground/lib/playground-option-utils.test.tsweb/default/src/features/playground/lib/playground-option-utils.tsweb/default/src/features/users/components/users-columns.tsxweb/default/src/features/playground/api.tsweb/default/src/features/channels/components/dialogs/codex-usage-dialog.tsxweb/default/src/features/dashboard/components/ui/stat-card.tsxweb/default/src/features/system-settings/models/tiered-pricing-fields.tsxweb/default/src/features/channels/components/numeric-spinner-input.tsxweb/default/src/features/dashboard/components/overview/summary-cards.tsxweb/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsxweb/default/src/features/dashboard/components/models/log-stat-cards.tsxweb/default/src/features/channels/components/channels-columns.tsxweb/default/src/features/keys/components/api-keys-columns.tsxweb/default/src/features/channels/components/drawers/channel-editor-navigation.tsxweb/default/src/features/system-settings/models/tiered-pricing-utils.tsweb/default/src/features/models/components/models-columns.tsxweb/default/src/features/system-settings/models/model-pricing-sheet.tsxweb/default/src/features/system-settings/components/settings-page.tsxweb/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsxweb/default/src/features/pricing/components/model-details-uptime-sparkline.tsxweb/default/src/features/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/system-settings/models/tiered-pricing-support.tsxweb/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsxweb/default/src/features/dashboard/index.tsxweb/default/src/features/channels/components/dialogs/ollama-models-dialog.tsxweb/default/src/features/channels/components/drawers/channel-editor-state.tsweb/default/src/features/system-settings/components/settings-form-layout.tsxweb/default/src/features/channels/components/drawers/channel-mutate-drawer.tsxweb/default/src/features/system-settings/models/tiered-pricing-editor.tsxweb/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsxweb/default/src/features/dashboard/components/overview/overview-dashboard.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/playground-option-utils.test.tsweb/default/src/features/playground/lib/playground-option-utils.ts
web/default/src/**/*.test.ts
📄 CodeRabbit inference engine (web/default/AGENTS.md)
工具函数与纯逻辑应优先编写单元测试;测试文件应命名为
*.test.ts。
Files:
web/default/src/features/playground/lib/playground-option-utils.test.tsweb/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
web/default/src/styles/**/*
📄 CodeRabbit inference engine (web/default/AGENTS.md)
自定义样式应集中在
src/styles/,组件内尽量少写自定义 CSS。
Files:
web/default/src/styles/theme-presets.cssweb/default/src/styles/index.css
🪛 GitHub Actions: CI / 1_Frontend checks.txt
web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
[error] 19-19: tsc build failed (TS2307): Cannot find module 'bun:test' or its corresponding type declarations.
🪛 GitHub Actions: CI / Frontend checks
web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
[error] 19-19: TypeScript (tsc -b) failed with TS2307: Cannot find module 'bun:test' or its corresponding type declarations.
🪛 OpenGrep (1.25.0)
web/default/src/components/ui/markdown.tsx
[ERROR] 178-179: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
[ERROR] 387-389: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
[ERROR] 390-392: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
[ERROR] 521-523: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
🔇 Additional comments (79)
web/default/src/components/data-table/pagination.tsx (1)
135-137: LGTM!web/default/src/features/home/components/sections/hero.tsx (1)
231-231: LGTM!web/default/src/features/models/components/models-columns.tsx (1)
80-94: LGTM!Also applies to: 134-141, 153-153
web/default/src/components/language-switcher.tsx (1)
33-91: LGTM!web/default/src/features/system-settings/components/settings-page.tsx (1)
22-23: LGTM!Also applies to: 93-115, 135-135, 154-166
web/default/src/styles/index.css (1)
503-503: LGTM!Also applies to: 801-801, 956-957, 1539-1539, 1597-1597, 1631-1631, 1699-1699, 1738-1738, 1948-1951
web/default/src/features/pricing/components/model-details-uptime-sparkline.tsx (2)
98-100: LGTM!
54-56: 🎯 Functional Correctness
bg-success/bg-warningare defined in the theme —web/default/src/styles/theme.cssexposes--color-successand--color-warning, so these utilities are available.> Likely an incorrect or invalid review comment.web/default/src/features/dashboard/components/overview/overview-query-utils.ts (1)
26-33: LGTM!web/default/src/features/dashboard/components/overview/uptime-panel.tsx (1)
129-129: LGTM!web/default/src/i18n/locales/en.json (1)
26-26: LGTM!Also applies to: 42-55, 67-67, 111-111, 668-668, 710-710, 730-730, 1298-1298, 1356-1356, 1558-1558, 1596-1596, 1723-1723, 2129-2129, 2328-2328, 2796-2796, 2885-2885, 3246-3246, 3417-3417, 3625-3631, 3773-3773, 4039-4039, 4079-4079, 4650-4652
web/default/src/features/dashboard/components/overview/overview-dashboard.tsx (2)
126-188: LGTM!
560-829: LGTM!Also applies to: 880-885, 893-896
web/default/src/i18n/locales/vi.json (1)
26-123: LGTM!Also applies to: 123-320, 321-730, 731-2130, 2130-3049, 3049-4039, 4039-4952, 4952-5050
web/default/src/i18n/locales/zh.json (1)
26-26: LGTM!Also applies to: 42-55, 67-67, 111-111, 668-668, 710-710, 730-730, 1298-1298, 1356-1356, 1558-1558, 1596-1596, 1708-1723, 2128-2129, 2328-2328, 2796-2796, 2885-2885, 3246-3246, 3395-3417, 3501-3501, 3625-3631, 3773-3773, 4039-4039, 4079-4079, 4650-4652
web/default/src/i18n/locales/fr.json (2)
49-49: 🎯 Functional Correctness | ⚡ Quick winUntranslated strings left in English within
fr.json.Several changed entries keep the English source text as the French value instead of translating it, while the equivalent Chinese entries in
zh.jsonare properly localized:
- Line 49:
"{{count}} tiered billing models enabled"→"{{count}} tiered billing models enabled".- Lines 311-313, 318:
"AI model asset governance","AI model governance · AgentOps","AI model governance · AgentOps · Application infrastructure","AI Models · Agents governance"— all copied verbatim from English, unlike neighboring keys that are translated.- Line 2438:
"Keep governance ready"→"Keep governance ready".These will render raw English in the French UI.
🌐 Suggested translations
- "{{count}} tiered billing models enabled": "{{count}} tiered billing models enabled", + "{{count}} tiered billing models enabled": "{{count}} modèles de facturation par paliers activés",- "AI model asset governance": "AI model asset governance", - "AI model governance · AgentOps": "AI model governance · AgentOps", - "AI model governance · AgentOps · Application infrastructure": "AI model governance · AgentOps · Application infrastructure", + "AI model asset governance": "Gouvernance des actifs de modèles d'IA", + "AI model governance · AgentOps": "Gouvernance des modèles d'IA · AgentOps", + "AI model governance · AgentOps · Application infrastructure": "Gouvernance des modèles d'IA · AgentOps · Infrastructure applicative",- "AI Models · Agents governance": "AI Models · Agents governance", + "AI Models · Agents governance": "Gouvernance des modèles d'IA · Agents",- "Keep governance ready": "Keep governance ready", + "Keep governance ready": "Maintenir la gouvernance prête",Also applies to: 311-313, 318-318, 2438-2438
42-48: LGTM!Also applies to: 55-55, 67-67, 111-111, 122-122, 182-182, 280-281, 309-310, 314-317, 319-320, 600-600, 668-668, 710-710, 720-730, 821-821, 1165-1165, 1183-1183, 1209-1209, 1298-1298, 1356-1356, 1390-1390, 1558-1558, 1596-1596, 1708-1723, 1789-1793, 1903-1903, 2068-2069, 2129-2129, 2138-2141, 2328-2328, 2346-2346, 2405-2406, 2437-2437, 2439-2442, 2579-2579, 2592-2592, 2625-2625, 2697-2703, 2739-2741, 2796-2796, 2885-2885, 3049-3049, 3086-3086, 3182-3182, 3246-3246, 3417-3417, 3501-3501, 3529-3529, 3625-3631, 3668-3668, 3773-3773, 3914-3914, 3930-3930, 3943-3943, 4034-4039, 4079-4079, 4307-4312, 4483-4483, 4650-4652, 4662-4662, 4681-4681, 4824-4825, 4858-4858, 4897-4901, 4943-4952, 5034-5034, 5048-5049
web/default/src/features/system-settings/models/channel-selector-dialog.tsx (1)
146-153: LGTM!web/default/src/features/channels/components/dialogs/codex-usage-dialog.tsx (1)
242-245: LGTM!web/default/src/components/ui/dialog.tsx (1)
23-23: LGTM!Also applies to: 67-68, 93-93
web/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsx (1)
217-226: LGTM!Also applies to: 301-314, 349-349
web/default/src/components/layout/components/public-header.tsx (1)
45-45: LGTM!Also applies to: 195-203, 225-231, 312-330, 382-382
web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx (1)
349-350: LGTM!Also applies to: 467-470
web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx (1)
532-534: LGTM!web/default/src/features/playground/lib/playground-option-utils.test.ts (1)
24-24: LGTM!Also applies to: 76-81
web/default/src/features/playground/lib/playground-option-utils.ts (1)
21-23: LGTM!web/default/src/components/layout/components/section-page-layout.tsx (1)
86-86: LGTM!web/default/src/features/dashboard/components/ui/stat-card.tsx (1)
230-230: LGTM!Also applies to: 239-239
web/default/src/features/dashboard/components/overview/summary-cards.tsx (1)
244-248: LGTM!Also applies to: 294-294
web/default/src/features/dashboard/components/models/log-stat-cards.tsx (1)
125-125: LGTM!Also applies to: 137-137, 146-146
web/default/src/features/dashboard/index.tsx (1)
20-21: LGTM!Also applies to: 248-248, 306-306
web/default/src/features/playground/api.ts (1)
44-49: 🩺 Stability & AvailabilityIncorrect target for the undefined-group crash
overview-dashboard.tsxcallsweb/default/src/lib/api.ts#getUserModels, not this helper.getModelQueryGroup()is only reached fromusePlaygroundOptions()with a stringcurrentGroup, so the undefined path here doesn’t apply.> Likely an incorrect or invalid review comment.web/default/src/components/ui/empty.tsx (1)
79-79: LGTM!web/default/src/tanstack-table.d.ts (1)
32-35: LGTM!web/default/src/components/password-input.tsx (1)
21-21: LGTM!Also applies to: 39-39, 57-57
web/default/src/components/ui/spinner.tsx (1)
21-21: LGTM!Also applies to: 32-39
web/default/src/components/data-table/mobile-card-list.tsx (3)
127-129: LGTM!Also applies to: 147-163, 186-187
196-198: LGTM!Also applies to: 207-216, 242-243
314-314: LGTM!web/default/src/components/data-table/data-table-page.tsx (2)
107-108: LGTM!Also applies to: 228-238
347-347: LGTM!Also applies to: 413-416
web/default/src/features/users/components/users-columns.tsx (1)
61-69: LGTM!web/default/src/components/ui/titled-card.tsx (1)
74-74: LGTM!web/default/src/components/ai-elements/conversation.tsx (1)
101-119: LGTM!web/default/src/components/layout/components/header-tools-menu.tsx (1)
1-157: LGTM!web/default/src/components/theme-switch.tsx (1)
28-67: LGTM!Also applies to: 86-86
web/default/src/styles/theme-presets.css (1)
660-668: LGTM!web/default/src/components/tag-input.tsx (1)
89-89: LGTM!web/default/src/components/json-editor.tsx (2)
90-98: LGTM!
256-266: LGTM!web/default/src/features/channels/components/drawers/channel-editor-navigation.tsx (1)
92-217: LGTM!web/default/src/components/ui/pagination.tsx (1)
30-42: LGTM!Also applies to: 90-155
web/default/src/features/channels/components/drawers/channel-editor-state.ts (1)
115-201: LGTM!web/default/src/components/ui/markdown.tsx (1)
175-190: LGTM!Also applies to: 769-805
web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx (1)
19-19: LGTM!Also applies to: 170-197, 2923-2923
web/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsx (1)
66-73: LGTM!Also applies to: 1091-1128
web/default/src/components/layout/components/nav-group.tsx (1)
67-67: LGTM!web/default/src/components/data-table/bulk-actions.tsx (2)
172-183: LGTM!
67-78: 🎯 Functional Correctness | ⚡ Quick winVerify locale files supply plural forms for the new
count-interpolated strings. All four new/changedt()calls passcountas an interpolation value; i18next's plural resolution requires_one/_other(and additional CLDR forms like_few/_manyfor Russian) suffixed keys per locale, or every count will render the same string.
web/default/src/components/data-table/bulk-actions.tsx#L67-L78: confirmen.json/ru.json/etc. define plural-suffixed keys for'{{count}} {{entity}} selected. Bulk actions toolbar is available.'.web/default/src/components/data-table/bulk-actions.tsx#L165-L169: confirm plural forms exist for'Bulk actions for {{count}} selected {{entity}}'.web/default/src/components/data-table/bulk-actions.tsx#L220-L220: confirm plural forms exist for'{{count}} selected'.web/default/src/features/system-settings/models/model-pricing-sheet.tsx#L970-L976: confirm plural forms exist for'{{count}} selected targets available for bulk copy.'.Source: Coding guidelines
web/default/src/components/ui/sheet.tsx (1)
25-25: LGTM!Also applies to: 68-69, 108-108
web/default/src/components/layout/components/footer.tsx (1)
263-269: LGTM!Also applies to: 283-283
web/default/src/features/system-settings/models/model-pricing-sheet.tsx (1)
845-851: LGTM!Also applies to: 1019-1036
web/default/src/components/ui/sidebar.tsx (1)
27-27: LGTM!Also applies to: 185-185, 220-223, 282-282, 299-316
web/default/src/components/config-drawer.tsx (1)
67-77: LGTM!Also applies to: 94-109, 148-164, 181-198
web/default/src/features/system-settings/components/settings-form-layout.tsx (1)
19-27: LGTM!Also applies to: 44-52, 112-176
web/default/src/i18n/locales/_reports/_sync-report.json (1)
14-32: LGTM!web/default/src/features/system-settings/models/tiered-pricing-fields.tsx (1)
55-116: LGTM!web/default/src/features/channels/components/numeric-spinner-input.tsx (1)
46-46: LGTM!Also applies to: 139-139, 181-181
web/default/src/components/datetime-picker.tsx (1)
66-67: LGTM!Also applies to: 156-156
web/default/src/features/channels/components/channels-columns.tsx (1)
435-435: LGTM!Also applies to: 450-450, 850-852
web/default/src/features/system-settings/models/tiered-pricing-support.tsx (1)
252-567: LGTM!web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (1)
81-92: LGTM!Also applies to: 193-193, 291-294
web/default/src/features/system-settings/models/tiered-pricing-utils.ts (1)
20-26: 🎯 Functional CorrectnessRemove the conversion concern
Both helpers are plain numeric normalization, and the tiered-pricing flow uses the same unit-cost values directly; no scaling factor is involved here.> Likely an incorrect or invalid review comment.web/default/src/components/ui/carousel.tsx (1)
27-27: LGTM!Also applies to: 196-221, 227-252
web/default/src/components/ui/breadcrumb.tsx (1)
27-41: LGTM!Also applies to: 121-136
web/default/src/components/ai-elements/tool.tsx (1)
138-138: LGTM!Also applies to: 175-175
web/default/src/features/keys/components/api-keys-columns.tsx (1)
77-93: LGTM!web/default/src/components/layout/components/app-header.tsx (1)
29-29: LGTM!Also applies to: 124-128, 143-149
web/default/src/components/layout/components/top-nav.tsx (1)
22-28: LGTM!Also applies to: 42-43, 62-104
| <span | ||
| data-slot='context-menu-shortcut' | ||
| className={cn( | ||
| 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest', | ||
| 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground text-xsst ml-auto', | ||
| className | ||
| )} | ||
| {...props} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for any custom `@utility` definition matching text-xsst
rg -n 'text-xsst' --type css
rg -n '`@utility`\s+text-xsst' web/default/src/styles/Repository: MAX-API-Next/MAX-API
Length of output: 213
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the affected component and search for any custom utility or matching Tailwind config/theme definitions.
sed -n '250,285p' web/default/src/components/ui/context-menu.tsx
printf '\n--- search: text-xsst ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' 'text-xsst' .
printf '\n--- search: `@utility` text-xsst ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '`@utility`\s+text-xsst' web/default/src
printf '\n--- search: text-xs / tracking-widest around context-menu ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' 'tracking-widest|text-xs' web/default/src/components/ui/context-menu.tsx web/default/srcRepository: MAX-API-Next/MAX-API
Length of output: 1571
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check whether the apparent token "xsst" is defined anywhere in Tailwind/theme config.
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '\bxsst\b|fontSize|theme\s*:\s*\{' web/default .Repository: MAX-API-Next/MAX-API
Length of output: 5000
Fix the invalid text-xsst utility in menu shortcut styles — text-xsst isn’t a Tailwind utility, so ContextMenuShortcut falls back to inherited sizing. Use text-xs here; the same typo also appears in command.tsx, dropdown-menu.tsx, and menubar.tsx.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/default/src/components/ui/context-menu.tsx` around lines 267 - 273,
Replace the invalid text-xsst class with the valid text-xs utility in
ContextMenuShortcut, and apply the same correction to the corresponding shortcut
styles in command.tsx, dropdown-menu.tsx, and menubar.tsx.
Source: Linters/SAST tools
| data-slot='dropdown-menu-shortcut' | ||
| className={cn( | ||
| 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest', | ||
| 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xsst ml-auto', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
text-xsst typo breaks shortcut styling in both DropdownMenuShortcut and MenubarShortcut.
Both files replaced text-xs tracking-widest with text-xsst, which is not a valid Tailwind v4 utility. Tailwind silently ignores unknown classes, so the shortcut span loses both its text-xs font-size and tracking-widest letter-spacing. The st suffix appears to be a remnant of tracking-widest from an editing accident.
web/default/src/components/ui/dropdown-menu.tsx#L283-L283: Restoretext-xs tracking-widestin theDropdownMenuShortcutbase className.web/default/src/components/ui/menubar.tsx#L235-L235: Restoretext-xs tracking-widestin theMenubarShortcutclassName override.
🔧 Proposed fix for both files
dropdown-menu.tsx:
- 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xsst ml-auto',
+ 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xs tracking-widest ml-auto',menubar.tsx:
- 'text-muted-foreground group-focus/menubar-item:text-accent-foreground text-xsst ml-auto',
+ 'text-muted-foreground group-focus/menubar-item:text-accent-foreground text-xs tracking-widest ml-auto',📝 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.
| 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xsst ml-auto', | |
| 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xs tracking-widest ml-auto', |
📍 Affects 2 files
web/default/src/components/ui/dropdown-menu.tsx#L283-L283(this comment)web/default/src/components/ui/menubar.tsx#L235-L235
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/default/src/components/ui/dropdown-menu.tsx` at line 283, Replace the
invalid text-xsst utility with text-xs tracking-widest in DropdownMenuShortcut’s
base className in web/default/src/components/ui/dropdown-menu.tsx:283-283 and in
the MenubarShortcut className override in
web/default/src/components/ui/menubar.tsx:235-235.
| export function formatTokenHint( | ||
| value: number | string | null | undefined | ||
| ): string { | ||
| if (value == null || value === '' || Number.isNaN(Number(value))) return '' | ||
|
|
||
| const tokenCount = Number(value) | ||
| if (tokenCount === 0) return '= 0' | ||
| if (tokenCount >= 1_000_000) { | ||
| return `= ${(tokenCount / 1_000_000).toLocaleString()}M tokens` | ||
| } | ||
| if (tokenCount >= 1_000) { | ||
| return `= ${(tokenCount / 1_000).toLocaleString()}K tokens` | ||
| } | ||
| return `= ${tokenCount.toLocaleString()} tokens` | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Localize the hint text.
formatTokenHint returns user-visible strings ("= … tokens", M/K suffixes) rendered in the editor, but they are hardcoded English. Accept a t function so the copy is translatable.
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/features/system-settings/models/tiered-pricing-utils.ts`
around lines 28 - 42, Update formatTokenHint to accept the established
translation function t and use it for the rendered token hint text, including
the singular text and M/K suffix labels. Update every call site to pass t while
preserving the existing empty-value and numeric formatting behavior.
Source: Coding guidelines
| "{{count}} override": "{{count}} 個のオーバーライド", | ||
| "{{count}} selected": "{{count}}件選択", | ||
| "{{count}} selected targets available for bulk copy.": "一括コピーに使用できる対象が {{count}} 個選択されています。", | ||
| "{{count}} tiered billing models enabled": "{{count}} tiered billing models enabled", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Untranslated string: "{{count}} tiered billing models enabled" left in English in both locales.
Both files add this key but reuse the raw English text as the translated value instead of localizing it, so Japanese and Russian users will see English text in the middle of an otherwise localized UI. Same root cause (missing translation), needs a real translation supplied in each file.
web/default/src/i18n/locales/ja.json#L49: replace the value with an actual Japanese translation of "{{count}} tiered billing models enabled".web/default/src/i18n/locales/ru.json#L49: replace the value with an actual Russian translation of "{{count}} tiered billing models enabled".
📍 Affects 2 files
web/default/src/i18n/locales/ja.json#L49-L49(this comment)web/default/src/i18n/locales/ru.json#L49-L49
🤖 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 49, Replace the English value
for "{{count}} tiered billing models enabled" with a proper Japanese translation
in web/default/src/i18n/locales/ja.json at lines 49-49 and a proper Russian
translation in web/default/src/i18n/locales/ru.json at lines 49-49, preserving
the {{count}} interpolation placeholder.
There was a problem hiding this comment.
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/vi.json (1)
4021-4021: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUntranslated strings left in English for new tiered-billing keys.
Several newly added Vietnamese entries copy the English source verbatim instead of translating it:
"Save tiered billing": "Save tiered billing","Tiered Billing": "Tiered Billing","Tiered billing configuration saved": "Tiered billing configuration saved","Tiered billing JSON": "Tiered billing JSON". Since these are part of this PR's changed lines, they should be properly localized rather than left as English fallbacks.Also applies to: 4624-4626
🤖 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 4021, Translate the new tiered-billing Vietnamese locale values instead of leaving the English source text unchanged. Update the entries for “Save tiered billing,” “Tiered Billing,” “Tiered billing configuration saved,” and “Tiered billing JSON” in the locale data, preserving their existing keys and valid JSON structure.
🤖 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/vi.json`:
- Line 4021: Translate the new tiered-billing Vietnamese locale values instead
of leaving the English source text unchanged. Update the entries for “Save
tiered billing,” “Tiered Billing,” “Tiered billing configuration saved,” and
“Tiered billing JSON” in the locale data, preserving their existing keys and
valid JSON structure.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ebc456e2-d8b9-467a-84d7-4a4be57e6ad6
📒 Files selected for processing (22)
web/default/src/components/data-table/data-table-page.tsxweb/default/src/components/layout/components/public-header.tsxweb/default/src/components/ui/command.tsxweb/default/src/components/ui/context-menu.tsxweb/default/src/components/ui/dropdown-menu.tsxweb/default/src/components/ui/menubar.tsxweb/default/src/features/channels/api.tsweb/default/src/features/channels/components/dialogs/ollama-models-dialog.tsxweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsxweb/default/src/features/dashboard/components/overview/overview-dashboard.tsxweb/default/src/features/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/system-settings/models/tiered-pricing-editor.tsxweb/default/src/features/system-settings/models/tiered-pricing-utils.test.tsweb/default/src/features/system-settings/models/tiered-pricing-utils.tsweb/default/src/i18n/locales/en.jsonweb/default/src/i18n/locales/fr.jsonweb/default/src/i18n/locales/ja.jsonweb/default/src/i18n/locales/ru.jsonweb/default/src/i18n/locales/vi.jsonweb/default/src/i18n/locales/zh.json
📜 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/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.tsweb/default/src/components/ui/menubar.tsxweb/default/src/features/system-settings/models/tiered-pricing-utils.test.tsweb/default/src/components/ui/dropdown-menu.tsxweb/default/src/components/ui/command.tsxweb/default/src/components/ui/context-menu.tsxweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.tsweb/default/src/features/system-settings/models/tiered-pricing-utils.tsweb/default/src/features/channels/api.tsweb/default/src/components/layout/components/public-header.tsxweb/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsxweb/default/src/features/channels/components/dialogs/ollama-models-dialog.tsxweb/default/src/components/data-table/data-table-page.tsxweb/default/src/features/dashboard/components/overview/overview-dashboard.tsxweb/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/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.tsweb/default/src/features/system-settings/models/tiered-pricing-utils.test.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.tsweb/default/src/features/system-settings/models/tiered-pricing-utils.tsweb/default/src/features/channels/api.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsxweb/default/src/features/channels/components/dialogs/ollama-models-dialog.tsxweb/default/src/features/dashboard/components/overview/overview-dashboard.tsxweb/default/src/features/system-settings/models/tiered-pricing-editor.tsx
web/default/src/**/*.test.ts
📄 CodeRabbit inference engine (web/default/AGENTS.md)
工具函数与纯逻辑应优先编写单元测试;测试文件应命名为
*.test.ts。
Files:
web/default/src/features/dashboard/components/overview/overview-query-utils.test.tsweb/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.tsweb/default/src/features/system-settings/models/tiered-pricing-utils.test.ts
🔇 Additional comments (31)
web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts (1)
1-49: LGTM!web/default/src/components/ui/menubar.tsx (1)
227-241: LGTM!web/default/src/components/ui/dropdown-menu.tsx (1)
275-289: LGTM!web/default/src/components/ui/command.tsx (1)
193-207: LGTM!web/default/src/components/ui/context-menu.tsx (1)
262-276: LGTM!web/default/src/i18n/locales/fr.json (1)
2-5238: LGTM!web/default/src/i18n/locales/ja.json (2)
15-17: LGTM! Both previously-flagged issues (untranslated tiered-billing string, broken{{msg}}placeholder) are resolved in this diff.Also applies to: 52-52, 2745-2745
1892-1892: 🎯 Functional Correctness | ⚡ Quick winPre-existing broken interpolation placeholders (
__ PH_0 __) remain, but out of scope for this diff.Lines 1892 (
Failed to parse JSON file: {{name}}), 2624 (MAX API <noreply@example.com>), and 2892 (Parsed {{count}} service account file(s)) still contain the literal placeholder artifact__ PH_0 __instead of the real interpolation token. These are not marked as changed in this PR, so likely pre-existing from an earlier migration, but they will keep rendering literal garbage text to Japanese users.Also applies to: 2624-2624, 2892-2892
web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.ts (1)
26-50: LGTM!web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.ts (1)
31-65: LGTM!web/default/src/features/channels/api.ts (1)
216-225: LGTM!Also applies to: 504-518
web/default/src/components/layout/components/public-header.tsx (2)
124-133: LGTM!
324-342: LGTM!web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx (2)
512-663: LGTM!
687-867: LGTM!web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx (2)
108-138: LGTM!
149-234: LGTM!web/default/src/components/data-table/data-table-page.tsx (1)
254-277: LGTM!web/default/src/features/dashboard/components/overview/overview-dashboard.tsx (5)
126-148: LGTM!
309-319: LGTM!
420-458: LGTM!
710-753: LGTM!Also applies to: 790-842
600-635: 🩺 Stability & AvailabilityServer-side failures already surface as query errors.
getDashboardQueryData()throws whenresponse.successis false, so these queries enterisErrorand the retry UI still engages; no change needed.> Likely an incorrect or invalid review comment.web/default/src/features/system-settings/models/tiered-pricing-utils.ts (1)
29-48: Localization fix applied — resolves prior review comment.
formatTokenHintnow acceptst: TFunctionand routes all rendered strings through it, addressing the previously flagged hardcoded-English issue.web/default/src/features/system-settings/models/tiered-pricing-utils.test.ts (1)
1-52: LGTM!web/default/src/i18n/locales/en.json (1)
15-17: LGTM!web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (2)
122-200: LGTM!
1005-1247: LGTM!web/default/src/i18n/locales/zh.json (1)
15-17: LGTM!web/default/src/i18n/locales/ru.json (1)
15-17: LGTM!Also applies to: 29-29, 45-58, 70-70, 114-114, 125-125, 185-185, 277-292, 308-323, 332-332, 603-603, 671-713, 723-733, 783-783, 824-824, 1103-1104, 1168-1186, 1212-1212, 1301-1301, 1359-1359, 1393-1393, 1561-1561, 1599-1599, 1711-1726, 1792-1796, 1906-1906, 2071-2072, 2132-2132, 2141-2144, 2331-2331, 2349-2349, 2360-2364, 2408-2409, 2440-2445, 2537-2537, 2582-2582, 2595-2595, 2628-2628, 2700-2706, 2717-2717, 2742-2751, 2797-2799, 2888-2888, 3052-3052, 3089-3089, 3122-3123, 3185-3186, 3249-3249, 3398-3420, 3504-3504, 3532-3532, 3572-3572, 3581-3587, 3623-3634, 3670-3671, 3776-3776, 3848-3848, 3917-3917, 3933-3933, 3946-3949, 4021-4021, 4037-4042, 4080-4082, 4310-4315, 4486-4486, 4624-4626, 4653-4665, 4684-4684, 4827-4828, 4861-4861, 4900-4904, 4946-4955, 5037-5037, 5051-5052
web/default/src/i18n/locales/vi.json (1)
15-17: LGTM!Also applies to: 29-58, 70-70, 114-114, 125-185, 283-323, 603-603, 671-733, 824-824, 1168-1212, 1393-1393, 1561-1599, 1712-1796, 1906-1906, 2071-2144, 2331-2409, 2440-2595, 2628-2751, 2799-2799, 2888-2888, 3052-3089, 3185-3249, 3396-3532, 3628-3671, 3776-3776, 3917-3933, 3946-3946, 4037-4082, 4310-4315, 4486-4486, 4653-4665, 4684-4684, 4827-4904, 4946-5052
There was a problem hiding this comment.
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/vi.json (1)
312-323: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTranslate the remaining English entries in these updated groups.
AI Models · Agents governanceat Line 321 andKeep governance readyat Line 2441 remain in English while neighboring entries were localized. Translate both strings to avoid mixed-language UI.Also applies to: 2440-2445
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/default/src/i18n/locales/vi.json` around lines 312 - 323, Translate the remaining English locale values for the keys “AI Models · Agents governance” and “Keep governance ready” in vi.json, using natural Vietnamese consistent with the surrounding governance-related entries. Leave already localized neighboring entries unchanged.
🤖 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/vi.json`:
- Around line 312-323: Translate the remaining English locale values for the
keys “AI Models · Agents governance” and “Keep governance ready” in vi.json,
using natural Vietnamese consistent with the surrounding governance-related
entries. Leave already localized neighboring entries unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e60f7eca-0089-485c-bebe-df6e8d97a0e1
📒 Files selected for processing (7)
README.en.mdREADME.fr.mdREADME.ja.mdREADME.mdREADME.zh_CN.mdREADME.zh_TW.mdweb/default/src/i18n/locales/vi.json
📜 Review details
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~742-~742: 您的意思是“关"于"”吗?
Context: ... 开发。现阶段,MAX API 主要在上述项目基础上持续增强 AI API 网关与治理能力、扩展功能并修复问题。商业使用本项目时,还须分别遵守 One API 的...
(YU7_YU8)
README.zh_CN.md
[uncategorized] ~735-~735: 您的意思是“关"于"”吗?
Context: ... 开发。现阶段,MAX API 主要在上述项目基础上持续增强 AI API 网关与治理能力、扩展功能并修复问题。商业使用本项目时,还须分别遵守 One API 的...
(YU7_YU8)
🔇 Additional comments (2)
web/default/src/i18n/locales/vi.json (1)
15-17: LGTM!Also applies to: 29-29, 45-58, 70-70, 114-114, 125-125, 185-185, 283-284, 603-603, 671-671, 713-713, 723-733, 824-824, 1168-1168, 1186-1186, 1212-1212, 1301-1301, 1359-1359, 1393-1393, 1561-1561, 1599-1599, 1726-1726, 1792-1796, 1906-1906, 2071-2072, 2132-2132, 2141-2144, 2331-2331, 2349-2349, 2582-2582, 2595-2595, 2628-2628, 2700-2706, 2742-2744, 2799-2799, 2888-2888, 3052-3052, 3089-3089, 3185-3185, 3249-3249, 3420-3420, 3504-3504, 3532-3532, 3628-3634, 3671-3671, 3776-3776, 3917-3917, 3933-3933, 3946-3946, 4021-4021, 4037-4042, 4082-4082, 4310-4315, 4486-4486, 4624-4626, 4653-4655, 4665-4665, 4684-4684, 4827-4828, 4861-4861, 4900-4904, 4946-4955, 5037-5037, 5051-5052
README.en.md (1)
735-735: 🔒 Security & PrivacyThe fallback line only covers the project’s temporary commercial license; the preceding paragraph already preserves both upstream license obligations, so the MIT obligation is not dropped here.
> Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/claude/message_delta_usage_patch_test.go`:
- Line 110: Add a separate subtest in the existing usage patch tests covering a
zero-valued OutputTokens field, using CompletionTokens as the source and
asserting the patched OutputTokens value. Keep the existing non-zero
preservation test unchanged and exercise buildMessageDeltaPatchUsage directly.
In `@relay/channel/claude/relay-claude.go`:
- Around line 698-700: Update patchClaudeMessageDeltaUsageData to serialize the
populated usage.OutputTokens value into data at usage.output_tokens, ensuring
clients receive the patched output token count when the provider omitted it.
🪄 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: d429b80c-38fd-468c-a18f-2f80e75d521a
📒 Files selected for processing (3)
relay/channel/claude/message_delta_usage_patch_test.gorelay/channel/claude/relay-claude.gorelay/channel/claude/relay_claude_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.go: In Go business code, all JSON marshal/unmarshal operations must use the wrapper functions incommon/json.go(common.Marshal,common.Unmarshal,common.UnmarshalJsonStr,common.DecodeJson,common.GetJsonType) and must not directly callencoding/jsonfor 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 directAUTO_INCREMENT/SERIAL, usecommonGroupCol/commonKeyColandcommonTrueVal/commonFalseValfor DB-specific SQL, branch withcommon.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 supportsStreamOptions; if it does, add that channel tostreamSupportedChannels.
For request structs parsed from client JSON and re-marshaled to upstream providers, optional scalar fields must use pointer types withomitemptyso explicit zero/false values are preserved instead of dropped.
When working on tiered/dynamic billing expression code, readpkg/billingexpr/expr.mdfirst 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 incommon/json.go(common.Marshal,common.Unmarshal,common.UnmarshalJsonStr,common.DecodeJson,common.GetJsonType) instead of directly importing or callingencoding/jsonfor 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 thecommon.UsingPostgreSQL/common.UsingSQLite/common.UsingMySQLflags when need...
Files:
relay/channel/claude/relay-claude.gorelay/channel/claude/message_delta_usage_patch_test.gorelay/channel/claude/relay_claude_test.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 tostreamSupportedChannels.
Files:
relay/channel/claude/relay-claude.gorelay/channel/claude/message_delta_usage_patch_test.gorelay/channel/claude/relay_claude_test.go
🔇 Additional comments (1)
relay/channel/claude/relay_claude_test.go (1)
158-191: LGTM!
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)