Skip to content

perf(web): streamline table actions and destructive dialogs - #5645

Merged
Calcium-Ion merged 8 commits into
mainfrom
perf/data-table-action-autosize
Jun 25, 2026
Merged

perf(web): streamline table actions and destructive dialogs#5645
Calcium-Ion merged 8 commits into
mainfrom
perf/data-table-action-autosize

Conversation

@QuentinHsu

@QuentinHsu QuentinHsu commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

Important

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

📝 变更描述 / Description

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

概述

  • 优化 web/default 中表格操作列、行操作菜单、删除确认弹窗和相关 i18n 文案的一致性。

改动说明

  • 操作列不再参与表格总宽度分配,改为按内容自适应宽度。
  • 新增共享的 DataTableRowActionMenu 和 StaticRowActions,统一多处列表的操作入口。
  • 将多个低频行操作收拢到二级菜单,保留编辑等常用操作的可见入口。
  • 删除、移除、清理类确认按钮统一使用 destructive variant,避免不同弹窗视觉不一致。
  • 补齐删除弹窗、用户操作成功提示等多语言文案。
  • 将 import/no-cycle 从 warn 调整为 error,并在前端 AGENTS 文档中补充 touched files lint error 需解决的要求。

效果

  • 表格操作列更紧凑,主体列可获得更多可读空间。
  • 破坏性操作的确认按钮视觉语义更统一,降低误读成本。
  • i18n 和 lint 规则更严格,减少后续新增文案和循环依赖问题。

🚀 变更类型 / Type of change

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

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

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

📸 运行证明 / Proof of Work

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a shared row action menu and a static row actions control to standardize edit/delete interactions across tables.
  • UI/UX Improvements

    • Improved data table sizing by treating “content-sized” columns differently for width calculations, updating header/colgroup behavior and actions column sizing.
    • Refined row action layouts (tooltips/menus) and switched destructive dialogs to consistent styling.
  • Internationalization

    • Expanded localized delete/removed-from-list confirmations and “Deleted/Failed” messages across multiple locales, including name-based and bulk actions.
  • Chores

    • Tightened lint enforcement and updated front-end standards to require lint checks after changes.

- exclude actions columns from shared table width calculations so action cells size to their content.
- remove fixed size and w-* width overrides from feature action columns to preserve content-based layout.
- expose common edit and status actions directly while moving secondary actions into overflow menus.
- add shared row action menu helpers so static and table rows use consistent action controls.
- let action columns size to their content instead of relying on fixed widths.
- route delete, reset, and batch update confirmation text through i18n.
- add locale entries for affected channel, model, system settings, and user dialogs.
- align delete and cleanup confirmation buttons with the shared destructive variant.
- replace custom destructive color overrides with semantic button variants.
- clean up lint errors in touched dialog files before committing.
- add localized success messages for user delete, status, and role changes.
- keep user management toast copy available across all frontend locales.
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 246262c7-712a-4e16-9d20-8233a0b0c2d2

📥 Commits

Reviewing files that changed from the base of the PR and between 31ea7fb and 378b934.

📒 Files selected for processing (7)
  • web/default/src/components/data-table/index.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
✅ Files skipped from review due to trivial changes (4)
  • web/default/src/components/data-table/index.ts
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
  • web/default/src/i18n/locales/ja.json

Walkthrough

Adds shared row-action components and updates table sizing so action columns can be treated as content-sized. Refactors row actions and destructive dialogs across multiple features, and adds matching localized confirmation and status strings.

Changes

Shared row actions, sizing, and localized confirmations

Layer / File(s) Summary
Lint policy and contributor checklist update
web/default/.oxlintrc.json, web/default/AGENTS.md
Raises import/no-cycle to error and adds the lint-check requirement and changelog note in AGENTS.md.
Core data-table primitives and content-sized width logic
web/default/src/components/data-table/core/content-sized-columns.ts, web/default/src/components/data-table/core/row-action-menu.tsx, web/default/src/components/data-table/static/static-row-actions.tsx, web/default/src/components/data-table/core/data-table-colgroup.tsx, web/default/src/components/data-table/core/data-table-header.tsx, web/default/src/components/data-table/core/table-sizing.ts, web/default/src/components/data-table/static/static-data-table-classnames.ts, web/default/src/components/data-table/core/data-table-view.tsx, web/default/src/components/data-table/index.ts, web/default/src/components/data-table/layout/data-table-page.tsx, web/default/src/components/truncated-text.tsx
Adds isContentSizedColumn, DataTableRowActionMenu, and StaticRowActions, and updates data-table sizing, exports, and related imports.
Channels row actions and action-column sizing migration
web/default/src/features/channels/components/channels-columns.tsx, web/default/src/features/channels/components/channels-primary-buttons.tsx, web/default/src/features/channels/components/data-table-row-actions.tsx, web/default/src/features/channels/components/data-table-tag-row-actions.tsx, web/default/src/features/channels/components/dialogs/channel-test-dialog.tsx, web/default/src/features/channels/components/dialogs/multi-key-manage-dialog.tsx, web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
Localizes confirmation text, refactors row actions, and removes fixed action widths from columns, pinned layouts, and colgroups.
Keys, models, subscriptions, redemption, and profile action refactors
web/default/src/features/keys/components/api-keys-columns.tsx, web/default/src/features/keys/components/api-keys-delete-dialog.tsx, web/default/src/features/keys/components/data-table-row-actions.tsx, web/default/src/features/models/components/data-table-row-actions.tsx, web/default/src/features/models/components/deployments-columns.tsx, web/default/src/features/models/components/deployments-table.tsx, web/default/src/features/models/components/models-columns.tsx, web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx, web/default/src/features/subscriptions/components/data-table-row-actions.tsx, web/default/src/features/subscriptions/components/subscriptions-columns.tsx, web/default/src/features/redemption-codes/components/data-table-row-actions.tsx, web/default/src/features/redemption-codes/components/redemptions-columns.tsx, web/default/src/features/redemption-codes/components/redemptions-delete-dialog.tsx, web/default/src/features/profile/components/passkey-card.tsx
Moves row actions to shared primitives, removes fixed sizes, standardizes destructive variants, localizes confirmations, and adjusts related render/parsing helpers.
System-settings static table action standardization
web/default/src/features/system-settings/auth/custom-oauth/components/provider-table.tsx, web/default/src/features/system-settings/content/announcements-section.tsx, web/default/src/features/system-settings/content/api-info-section.tsx, web/default/src/features/system-settings/content/chat-settings-visual-editor.tsx, web/default/src/features/system-settings/content/faq-section.tsx, web/default/src/features/system-settings/content/uptime-kuma-section.tsx, web/default/src/features/system-settings/integrations/amount-discount-visual-editor.tsx, web/default/src/features/system-settings/integrations/creem-products-visual-editor.tsx, web/default/src/features/system-settings/integrations/payment-methods-visual-editor.tsx, web/default/src/features/system-settings/integrations/waffo-settings-section.tsx, web/default/src/features/system-settings/maintenance/log-settings-section.tsx, web/default/src/features/system-settings/maintenance/performance-section.tsx, web/default/src/features/system-settings/models/group-ratio-visual-editor.tsx, web/default/src/features/system-settings/models/model-ratio-table-columns.tsx, web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx, web/default/src/features/system-settings/models/tool-price-settings.tsx, web/default/src/features/system-settings/request-limits/rate-limit-visual-editor.tsx
Replaces inline edit/delete buttons with StaticRowActions, switches to static table modules, removes fixed widths, and applies parsing/keying/confirmation consistency updates.
Users action menu and delete confirm dialog migration
web/default/src/features/users/components/data-table-row-actions.tsx, web/default/src/features/users/components/users-delete-dialog.tsx
Refactors user row actions to DataTableRowActionMenu, simplifies catches, localizes reset dialogs, and replaces the delete modal with ConfirmDialog.
Locale keys added for confirmations and status toasts
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
Adds bulk-removal, delete, reset, edit, failure, updating, and user-lifecycle strings across six locales.
Badge cell and card-row-content selector unification
web/default/src/components/data-table/core/badge-cell.tsx, web/default/src/components/data-table/layout/card-row-content.tsx
Adds a badge-cell slot attribute and unifies badge selectors with :is(...).
Log settings polling and confirmation dialog updates
web/default/src/features/system-settings/maintenance/log-settings-section.tsx
Derives a stable cleanup task id for polling and sets destructive variants explicitly on confirmation actions.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • QuantumNous/new-api#5405: Changes the same data-table core sizing and header/colgroup pipeline that this PR extends for content-sized columns.
  • QuantumNous/new-api#5536: Updates getTableSizeStyle in the same table-sizing module that this PR filters for content-sized columns.
  • QuantumNous/new-api#5460: Also changes data-table width computation in data-table-colgroup.tsx.

Suggested reviewers

  • creamlike1024
  • Calcium-Ion
  • seefs001

Poem

🐇 Hop, hop—new menus bloom with care,
The action columns now can breathe fresh air.
One little slot for badges, neat and true,
And many tongues now speak the same thing too.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main UI refactor around table actions and destructive dialogs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/data-table-action-autosize

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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (3)
web/default/src/features/keys/components/data-table-row-actions.tsx (1)

311-317: ⚡ Quick win

Use the destructive menu-item variant instead of manual text color classes.

DropdownMenuItem already supports variant='destructive'; using it keeps focus/hover destructive semantics consistent across tables.

Suggested patch
-        <DropdownMenuItem
+        <DropdownMenuItem
+          variant='destructive'
           onClick={() => {
             setCurrentRow(apiKey)
             setOpen('delete')
           }}
-          className='text-destructive focus:text-destructive'
         >
🤖 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/keys/components/data-table-row-actions.tsx` around
lines 311 - 317, The DropdownMenuItem component in the delete action handler is
using manual className styling (text-destructive focus:text-destructive) instead
of leveraging the built-in variant prop. Replace the className attribute with
variant='destructive' on the DropdownMenuItem that contains the setCurrentRow
and setOpen calls. This will ensure consistent destructive styling semantics
including focus and hover states across the component.
web/default/src/features/models/components/deployments-columns.tsx (1)

294-297: ⚡ Quick win

Use DropdownMenuItem destructive variant for the delete action.

This keeps destructive action styling centralized and consistent with the shared dropdown contract.

Suggested patch
               <DropdownMenuItem
+                variant='destructive'
                 onClick={() => opts.onDelete(row.original)}
-                className='text-destructive focus:text-destructive'
               >
🤖 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/deployments-columns.tsx` around
lines 294 - 297, The DropdownMenuItem component for the delete action in the
deployments-columns file is manually applying destructive styling through
className instead of using the component's built-in destructive variant. Replace
the manual className attribute with the appropriate destructive variant prop on
the DropdownMenuItem component to ensure consistent styling with the shared
dropdown contract and centralize destructive action styling.
web/default/src/features/models/components/data-table-row-actions.tsx (1)

108-114: ⚡ Quick win

Switch delete item to variant='destructive' for consistent destructive semantics.

Using the component variant avoids per-file class overrides and preserves shared destructive focus/hover behavior.

Suggested patch
         <DropdownMenuItem
+          variant='destructive'
           onSelect={(e) => {
             e.preventDefault()
             setDeleteConfirmOpen(true)
           }}
-          className='text-destructive focus:text-destructive'
         >
🤖 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/data-table-row-actions.tsx` around
lines 108 - 114, Replace the className prop on the DropdownMenuItem component
(the one with the onSelect handler that calls setDeleteConfirmOpen) that
contains text-destructive and focus:text-destructive styles with a
variant='destructive' prop instead. This will use the component's built-in
destructive variant rather than applying class overrides, ensuring consistent
destructive focus and hover behavior across the application.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/default/src/features/channels/components/data-table-tag-row-actions.tsx`:
- Around line 74-79: The onClick handler on the Button component with
handleEditTag is not preventing event propagation, allowing clicks to bubble to
parent row-level handlers and cause unintended row interactions. Modify the
onClick prop on this Button (which has aria-label={t('Edit Tag')}) to stop event
propagation by wrapping handleEditTag in an arrow function that calls
stopPropagation on the event before invoking the handler, preventing the click
event from bubbling to parent row handlers.

In
`@web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx`:
- Around line 215-216: The hardcoded English strings in the groupsContent object
throughout the prefill-group-management-dialog component violate i18n guidelines
and will display in English for non-English locales. Import the useTranslation
hook from react-i18next at the top of the component if not already imported,
call useTranslation() within the component to get the t function, and wrap all
user-facing hardcoded string literals (such as "No description provided" and
other strings in the CardDescription and other text elements across the
specified line ranges) with the t() function, using appropriate translation keys
that describe the text content.

In
`@web/default/src/features/system-settings/integrations/payment-methods-visual-editor.tsx`:
- Around line 382-395: The methodKey in the filteredMethods.map function is
built only from mutable method fields (type, name, icon, min_topup, color),
which means duplicate entries with identical field values will receive the same
key, causing React reconciliation errors. Fix this by modifying the map function
to accept the index parameter and include it in the methodKey construction to
ensure uniqueness regardless of field values. Append the index to the existing
methodKey joined string to guarantee each mapped item has a distinct key.

In `@web/default/src/i18n/locales/en.json`:
- Around line 27-28: The count-based confirmation messages in the en.json file
do not handle singular and plural forms correctly, causing grammatically
incorrect text when count equals one (e.g., "1 announcements" instead of "1
announcement"). Update all affected messages throughout the file (including the
messages at lines 27-28, 37, 50, 4200-4201, 4211, 4230, and 4246-4247) by adding
singular variants of each message or by switching to pluralization-aware key
structures that your i18n system supports. This ensures messages display
grammatically correct copy for both singular and plural counts.

In `@web/default/src/i18n/locales/ru.json`:
- Around line 27-28: The Russian removal messages at the specified lines use
fixed translation strings that become grammatically incorrect for different
count values. In Russian, items require different grammatical forms depending on
the count (e.g., "1 объявление" vs "2 объявления" vs "5 объявлений"). Replace
the single fixed translations for the announcements removal message, API
shortcuts removal message, and the other affected removal messages (at lines 27,
28, 37, and 50) with proper i18n plural forms that provide count-dependent
Russian grammar. Use the standard i18n pluralization format for your translation
system to specify different text variants for singular, paucal (2-4 items), and
plural (5+ items) forms, ensuring each variant uses grammatically correct
Russian declension.

---

Nitpick comments:
In `@web/default/src/features/keys/components/data-table-row-actions.tsx`:
- Around line 311-317: The DropdownMenuItem component in the delete action
handler is using manual className styling (text-destructive
focus:text-destructive) instead of leveraging the built-in variant prop. Replace
the className attribute with variant='destructive' on the DropdownMenuItem that
contains the setCurrentRow and setOpen calls. This will ensure consistent
destructive styling semantics including focus and hover states across the
component.

In `@web/default/src/features/models/components/data-table-row-actions.tsx`:
- Around line 108-114: Replace the className prop on the DropdownMenuItem
component (the one with the onSelect handler that calls setDeleteConfirmOpen)
that contains text-destructive and focus:text-destructive styles with a
variant='destructive' prop instead. This will use the component's built-in
destructive variant rather than applying class overrides, ensuring consistent
destructive focus and hover behavior across the application.

In `@web/default/src/features/models/components/deployments-columns.tsx`:
- Around line 294-297: The DropdownMenuItem component for the delete action in
the deployments-columns file is manually applying destructive styling through
className instead of using the component's built-in destructive variant. Replace
the manual className attribute with the appropriate destructive variant prop on
the DropdownMenuItem component to ensure consistent styling with the shared
dropdown contract and centralize destructive action styling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c509b9d0-d2e6-4e5f-9e08-5028adeb078e

📥 Commits

Reviewing files that changed from the base of the PR and between 0b7ae4e and c0c8786.

📒 Files selected for processing (59)
  • web/default/.oxlintrc.json
  • web/default/AGENTS.md
  • web/default/src/components/data-table/core/content-sized-columns.ts
  • web/default/src/components/data-table/core/data-table-colgroup.tsx
  • web/default/src/components/data-table/core/data-table-header.tsx
  • web/default/src/components/data-table/core/data-table-view.tsx
  • web/default/src/components/data-table/core/row-action-menu.tsx
  • web/default/src/components/data-table/core/table-sizing.ts
  • web/default/src/components/data-table/index.ts
  • web/default/src/components/data-table/layout/data-table-page.tsx
  • web/default/src/components/data-table/static/static-data-table-classnames.ts
  • web/default/src/components/data-table/static/static-row-actions.tsx
  • web/default/src/components/truncated-text.tsx
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/features/channels/components/channels-primary-buttons.tsx
  • web/default/src/features/channels/components/data-table-row-actions.tsx
  • web/default/src/features/channels/components/data-table-tag-row-actions.tsx
  • web/default/src/features/channels/components/dialogs/channel-test-dialog.tsx
  • web/default/src/features/channels/components/dialogs/multi-key-manage-dialog.tsx
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/features/keys/components/api-keys-columns.tsx
  • web/default/src/features/keys/components/api-keys-delete-dialog.tsx
  • web/default/src/features/keys/components/data-table-row-actions.tsx
  • web/default/src/features/models/components/data-table-row-actions.tsx
  • web/default/src/features/models/components/deployments-columns.tsx
  • web/default/src/features/models/components/deployments-table.tsx
  • web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/features/profile/components/passkey-card.tsx
  • web/default/src/features/redemption-codes/components/data-table-row-actions.tsx
  • web/default/src/features/redemption-codes/components/redemptions-columns.tsx
  • web/default/src/features/redemption-codes/components/redemptions-delete-dialog.tsx
  • web/default/src/features/subscriptions/components/data-table-row-actions.tsx
  • web/default/src/features/subscriptions/components/subscriptions-columns.tsx
  • web/default/src/features/system-settings/auth/custom-oauth/components/provider-table.tsx
  • web/default/src/features/system-settings/content/announcements-section.tsx
  • web/default/src/features/system-settings/content/api-info-section.tsx
  • web/default/src/features/system-settings/content/chat-settings-visual-editor.tsx
  • web/default/src/features/system-settings/content/faq-section.tsx
  • web/default/src/features/system-settings/content/uptime-kuma-section.tsx
  • web/default/src/features/system-settings/integrations/amount-discount-visual-editor.tsx
  • web/default/src/features/system-settings/integrations/creem-products-visual-editor.tsx
  • web/default/src/features/system-settings/integrations/payment-methods-visual-editor.tsx
  • web/default/src/features/system-settings/integrations/waffo-settings-section.tsx
  • web/default/src/features/system-settings/maintenance/log-settings-section.tsx
  • web/default/src/features/system-settings/maintenance/performance-section.tsx
  • web/default/src/features/system-settings/models/group-ratio-visual-editor.tsx
  • web/default/src/features/system-settings/models/model-ratio-table-columns.tsx
  • web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx
  • web/default/src/features/system-settings/models/tool-price-settings.tsx
  • web/default/src/features/system-settings/request-limits/rate-limit-visual-editor.tsx
  • web/default/src/features/users/components/data-table-row-actions.tsx
  • web/default/src/features/users/components/users-delete-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
💤 Files with no reviewable changes (4)
  • web/default/src/features/keys/components/api-keys-columns.tsx
  • web/default/src/features/redemption-codes/components/redemptions-columns.tsx
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/features/subscriptions/components/subscriptions-columns.tsx

Comment on lines +74 to +79
<Button
variant='ghost'
size='icon-sm'
onClick={handleEditTag}
aria-label={t('Edit Tag')}
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stop row-click propagation on the new inline edit action.

At Line 77, onClick={handleEditTag} can bubble to row-level handlers; this can trigger unintended row interactions while opening the edit dialog.

Suggested fix
             <Button
               variant='ghost'
               size='icon-sm'
-              onClick={handleEditTag}
+              onClick={(e) => {
+                e.stopPropagation()
+                handleEditTag()
+              }}
               aria-label={t('Edit Tag')}
             />
📝 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
<Button
variant='ghost'
size='icon-sm'
onClick={handleEditTag}
aria-label={t('Edit Tag')}
/>
<Button
variant='ghost'
size='icon-sm'
onClick={(e) => {
e.stopPropagation()
handleEditTag()
}}
aria-label={t('Edit Tag')}
/>
🤖 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/data-table-tag-row-actions.tsx`
around lines 74 - 79, The onClick handler on the Button component with
handleEditTag is not preventing event propagation, allowing clicks to bubble to
parent row-level handlers and cause unintended row interactions. Modify the
onClick prop on this Button (which has aria-label={t('Edit Tag')}) to stop event
propagation by wrapping handleEditTag in an arrow function that calls
stopPropagation on the event before invoking the handler, preventing the click
event from bubbling to parent row handlers.

Comment on lines +215 to +216
No description provided
</CardDescription>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Localize the remaining hardcoded strings in groupsContent.

Line 215, Line 242, Line 262, Line 271, Line 304, and Line 343 still render English literals directly, so non-English locales will get mixed-language UI.

Suggested patch
-                    No description provided
+                    {t('No description provided')}
...
-                <span>Items</span>
+                <span>{t('Items')}</span>
...
-                  label={`${parsedItems.length} item${parsedItems.length === 1 ? '' : 's'}`}
+                  label={t('{{count}} items', { count: parsedItems.length })}
...
-                      label={`+${parsedItems.length - 6} more`}
+                      label={t('+{{count}} more', {
+                        count: parsedItems.length - 6,
+                      })}
...
-                    ? 'No endpoint mappings configured.'
-                    : 'No items configured yet.'}
+                    ? t('No endpoint mappings configured.')
+                    : t('No items configured yet.')}
...
-                    No description provided
+                    {t('No description provided')}
...
-                          label={`+${parsedItems.length - 6} more`}
+                          label={t('+{{count}} more', {
+                            count: parsedItems.length - 6,
+                          })}
...
-                        ? 'No endpoint mappings configured.'
-                        : 'No items configured yet.'}
+                        ? t('No endpoint mappings configured.')
+                        : t('No items configured yet.')}
...
-                  {parsedItems.length} item
-                  {parsedItems.length === 1 ? '' : 's'}
+                  {t('{{count}} items', { count: parsedItems.length })}

As per coding guidelines, “All user-facing text must support i18n using useTranslation() hook and t() function” and “Frontend UI text must support i18n … use t('English key') for user-facing text.”

Also applies to: 242-245, 262-263, 271-274, 304-305, 343-360

🤖 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 215 - 216, The hardcoded English strings in the groupsContent
object throughout the prefill-group-management-dialog component violate i18n
guidelines and will display in English for non-English locales. Import the
useTranslation hook from react-i18next at the top of the component if not
already imported, call useTranslation() within the component to get the t
function, and wrap all user-facing hardcoded string literals (such as "No
description provided" and other strings in the CardDescription and other text
elements across the specified line ranges) with the t() function, using
appropriate translation keys that describe the text content.

Source: Coding guidelines

Comment on lines +382 to +395
{filteredMethods.map((method) => {
const iconName = getEffectiveIconName(method)
const methodKey = [
method.type,
method.name,
method.icon,
method.min_topup,
method.color,
]
.filter(Boolean)
.join('-')

return (
<div key={`${method.type}-${index}`} className='p-4'>
<div key={methodKey} className='p-4'>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Ensure mobile row keys stay unique for duplicate entries.

Line 384 builds methodKey from mutable method fields only. If two entries share the same values, React gets duplicate keys and may reconcile/edit the wrong row in the mobile list.

Suggested fix
-            {filteredMethods.map((method) => {
+            {filteredMethods.map((method, index) => {
               const iconName = getEffectiveIconName(method)
               const methodKey = [
                 method.type,
                 method.name,
                 method.icon,
                 method.min_topup,
                 method.color,
               ]
                 .filter(Boolean)
                 .join('-')
 
               return (
-                <div key={methodKey} className='p-4'>
+                <div key={`${methodKey}-${index}`} className='p-4'>
📝 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
{filteredMethods.map((method) => {
const iconName = getEffectiveIconName(method)
const methodKey = [
method.type,
method.name,
method.icon,
method.min_topup,
method.color,
]
.filter(Boolean)
.join('-')
return (
<div key={`${method.type}-${index}`} className='p-4'>
<div key={methodKey} className='p-4'>
{filteredMethods.map((method, index) => {
const iconName = getEffectiveIconName(method)
const methodKey = [
method.type,
method.name,
method.icon,
method.min_topup,
method.color,
]
.filter(Boolean)
.join('-')
return (
<div key={`${methodKey}-${index}`} className='p-4'>
🤖 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/integrations/payment-methods-visual-editor.tsx`
around lines 382 - 395, The methodKey in the filteredMethods.map function is
built only from mutable method fields (type, name, icon, min_topup, color),
which means duplicate entries with identical field values will receive the same
key, causing React reconciliation errors. Fix this by modifying the map function
to accept the index parameter and include it in the methodKey construction to
ensure uniqueness regardless of field values. Append the index to the existing
methodKey joined string to guarantee each mapped item has a distinct key.

Comment on lines +27 to +28
"{{count}} announcements will be removed from the list.": "{{count}} announcements will be removed from the list.",
"{{count}} API shortcuts will be removed from the list.": "{{count}} API shortcuts will be removed from the list.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use singular/plural-aware copy for count-based confirmations.

These new messages will read awkwardly for count = 1 (1 announcements, 1 FAQ entries, 1 channel(s), etc.). Please add singular variants or switch these dialogs to pluralization-aware keys so the copy stays grammatical.

Also applies to: 37-37, 50-50, 4200-4201, 4211-4211, 4230-4230, 4246-4247

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/i18n/locales/en.json` around lines 27 - 28, The count-based
confirmation messages in the en.json file do not handle singular and plural
forms correctly, causing grammatically incorrect text when count equals one
(e.g., "1 announcements" instead of "1 announcement"). Update all affected
messages throughout the file (including the messages at lines 27-28, 37, 50,
4200-4201, 4211, 4230, and 4246-4247) by adding singular variants of each
message or by switching to pluralization-aware key structures that your i18n
system supports. This ensures messages display grammatically correct copy for
both singular and plural counts.

Comment on lines +27 to +28
"{{count}} announcements will be removed from the list.": "{{count}} объявлений будут удалены из списка.",
"{{count}} API shortcuts will be removed from the list.": "{{count}} ярлыков API будут удалены из списка.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix count-dependent Russian grammar in removal messages.

At Line 27, Line 28, Line 37, and Line 50, the current wording becomes ungrammatical for values like 1 (and some other counts). Please switch to count-safe phrasing (or proper i18n plural forms) to avoid awkward UI text.

💡 Suggested patch
-    "{{count}} announcements will be removed from the list.": "{{count}} объявлений будут удалены из списка.",
-    "{{count}} API shortcuts will be removed from the list.": "{{count}} ярлыков API будут удалены из списка.",
+    "{{count}} announcements will be removed from the list.": "Будет удалено объявлений из списка: {{count}}.",
+    "{{count}} API shortcuts will be removed from the list.": "Будет удалено ярлыков API из списка: {{count}}.",
@@
-    "{{count}} FAQ entries will be removed from the list.": "{{count}} записей FAQ будут удалены из списка.",
+    "{{count}} FAQ entries will be removed from the list.": "Будет удалено записей FAQ из списка: {{count}}.",
@@
-    "{{count}} Uptime Kuma groups will be removed from the list.": "{{count}} групп Uptime Kuma будут удалены из списка.",
+    "{{count}} Uptime Kuma groups will be removed from the list.": "Будет удалено групп Uptime Kuma из списка: {{count}}.",

Also applies to: 37-37, 50-50

🤖 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 27 - 28, The Russian
removal messages at the specified lines use fixed translation strings that
become grammatically incorrect for different count values. In Russian, items
require different grammatical forms depending on the count (e.g., "1 объявление"
vs "2 объявления" vs "5 объявлений"). Replace the single fixed translations for
the announcements removal message, API shortcuts removal message, and the other
affected removal messages (at lines 27, 28, 37, and 50) with proper i18n plural
forms that provide count-dependent Russian grammar. Use the standard i18n
pluralization format for your translation system to specify different text
variants for singular, paucal (2-4 items), and plural (5+ items) forms, ensuring
each variant uses grammatically correct Russian declension.

- expose badge cell slots so mobile card styles can target nested badge wrappers.
- reset badge margins in card rows to keep provider icons fully visible on small screens.
…n-autosize

# Conflicts:
#	web/default/src/features/system-settings/maintenance/log-settings-section.tsx
…n-autosize

# Conflicts:
#	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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 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/i18n/locales/fr.json`:
- Line 3710: The French locale entry for Runtime is mistranslated and should
preserve the execution/runtime meaning instead of “Environnement”. Update the
Runtime key in the fr.json locale so it uses an accurate French translation for
runtime/context in the UI, and verify any related status/task labels that rely
on this locale entry remain semantically correct.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 246262c7-712a-4e16-9d20-8233a0b0c2d2

📥 Commits

Reviewing files that changed from the base of the PR and between 31ea7fb and 378b934.

📒 Files selected for processing (7)
  • web/default/src/components/data-table/index.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
✅ Files skipped from review due to trivial changes (4)
  • web/default/src/components/data-table/index.ts
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
  • web/default/src/i18n/locales/ja.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

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/i18n/locales/fr.json`:
- Line 3710: The French locale entry for Runtime is mistranslated and should
preserve the execution/runtime meaning instead of “Environnement”. Update the
Runtime key in the fr.json locale so it uses an accurate French translation for
runtime/context in the UI, and verify any related status/task labels that rely
on this locale entry remain semantically correct.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 246262c7-712a-4e16-9d20-8233a0b0c2d2

📥 Commits

Reviewing files that changed from the base of the PR and between 31ea7fb and 378b934.

📒 Files selected for processing (7)
  • web/default/src/components/data-table/index.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
✅ Files skipped from review due to trivial changes (4)
  • web/default/src/components/data-table/index.ts
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
  • web/default/src/i18n/locales/ja.json
🛑 Comments failed to post (1)
web/default/src/i18n/locales/fr.json (1)

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

Runtime is mistranslated and changes meaning.

Line 3710 maps Runtime to Environnement, which means environment, not execution time. This will mislabel the task/status UI.

💡 Suggested fix
-    "Runtime": "Environnement",
+    "Runtime": "Durée d'exécution",
📝 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.

    "Runtime": "Durée d'exécution",
🤖 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 3710, The French locale entry
for Runtime is mistranslated and should preserve the execution/runtime meaning
instead of “Environnement”. Update the Runtime key in the fr.json locale so it
uses an accurate French translation for runtime/context in the UI, and verify
any related status/task labels that rely on this locale entry remain
semantically correct.

@Calcium-Ion
Calcium-Ion merged commit 9ba251c into main Jun 25, 2026
1 check passed
@QuentinHsu
QuentinHsu deleted the perf/data-table-action-autosize branch June 25, 2026 13:47
jahnli added a commit to jahnli/new-api that referenced this pull request Jun 26, 2026
Merge upstream commits:
- 7939674 fix: add Waffo goods info and webhook SDK update (QuantumNous#5704)
- 9ba251c perf(web): streamline table actions and destructive dialogs (QuantumNous#5645)

Conflict resolution:
- AGENTS.md: accepted upstream (adds lint check rule)
- redemption-codes/*: kept local deletion (feature removed in fork)
- subscriptions/data-table-row-actions.tsx: manual merge (adopted upstream
  inline button style, preserved local Subscribe-all-users feature)
- i18n locale files (6): manual merge (kept keys from both sides)

Co-Authored-By: Claude <noreply@anthropic.com>
jahnli added a commit to jahnli/new-api that referenced this pull request Jun 26, 2026
Upstream commits:
- 7939674 fix: add Waffo goods info and webhook SDK update (QuantumNous#5704)
- 9ba251c perf(web): streamline table actions and destructive dialogs (QuantumNous#5645)

Co-Authored-By: Claude <noreply@anthropic.com>
JacksonsY added a commit to JacksonsY/new-api that referenced this pull request Jun 26, 2026
…mNous#5645, model-pricing fix QuantumNous#5752, waffo topup QuantumNous#5704, dompurify 3.4.11 QuantumNous#5738)

Resolved:
- web/default/src/** changes auto-followed flatten rename into web/src/**
- kept fork-only deletions of fr/ja/ru/vi locale packs (zh/en only)
- accepted upstream new data-table files (content-sized-columns/row-action-menu/static-row-actions)
- bun.lock regenerated via bun install after bumping dompurify 3.4.5->3.4.11
- fork customizations intact: usage-logs channel_ratio, dashboard ChannelQuota, token代管(role>=Root)
verified: tsc -b + go build ./... both green
shudonglin added a commit to rayward-external/new-api that referenced this pull request Jun 27, 2026
* chore: avoid duplicate shadcn skill exposure

* fix: support SMTP STARTTLS mode and NTLM auth (QuantumNous#5426)

* fix: support SMTP STARTTLS mode and NTLM auth

Add explicit SMTP STARTTLS configuration for 587-style connections and keep SSL/TLS as the implicit TLS mode.

Prefer PLAIN when advertised, keep LOGIN compatibility, and add NTLM as a fallback for Exchange SMTP servers that require it after STARTTLS.

* fix: respect explicit SMTP encryption mode

* fix: preserve SMTP TLS compatibility

* fix: preserve SMTP PLAIN auth TLS guard

* chore(deps): bump github.com/ClickHouse/ch-go from 0.58.2 to 0.65.0 (QuantumNous#5664)

Bumps [github.com/ClickHouse/ch-go](https://github.com/ClickHouse/ch-go) from 0.58.2 to 0.65.0.
- [Release notes](https://github.com/ClickHouse/ch-go/releases)
- [Commits](ClickHouse/ch-go@v0.58.2...v0.65.0)

---
updated-dependencies:
- dependency-name: github.com/ClickHouse/ch-go
  dependency-version: 0.65.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update agent skills and project config

- add vercel-react-best-practices skill (SKILL.md + full-guide.md)
- slim CLAUDE.md to import shared AGENTS.md conventions
- promote go-ntlmssp to a direct dependency in go.mod

* fix: date-fns-tz classic theme build error (QuantumNous#5676)

* chore(deps): update clickhouse-go and orb dependencies

* feat: add system task runner (QuantumNous#5680)

* feat: add system instance info panel (QuantumNous#5716)

* feat: add system instance reporting

* feat: show system instance resources

* fix: update translations for heartbeat messages in Russian and Vietnamese

* fix(web): replace default markdown renderer and expand syntax support (QuantumNous#5689)

* fix(markdown): render default markdown with marked

- switch default frontend markdown rendering from react-markdown/remark-gfm to marked to avoid old WebKit parse failures from lookbehind regex literals
- sanitize marked HTML output with DOMPurify and preserve external link target and rel behavior
- remove default direct dependencies on react-markdown, remark-gfm, and rehype-raw while leaving classic unchanged

* fix(markdown): expand default markdown rendering support

- render default markdown with marked extensions for KaTeX formulas, page breaks, and common emoji shortcodes.
- sanitize KaTeX output with an explicit DOMPurify allowlist while preserving external link behavior.
- avoid overriding marked text rendering so lists and inline parsing keep their internal parser context.

* fix(markdown): render diagram code blocks in default UI

- add sanitized SVG rendering for flow and sequence diagram code blocks.
- size flow nodes from their labels and route edges from node anchors to prevent clipping.
- style diagram nodes, arrows, labels, and notes with theme-aware classes.

* fix(web): sync channel card selection state (QuantumNous#5700)

* fix(web): hide wallet entry in profile dropdown when wallet module disabled (QuantumNous#5708)

The profile dropdown rendered the wallet item unconditionally, so it
still showed after an admin disabled the personal/topup (wallet) sidebar
module. Reuse the sidebar module visibility check so the dropdown honours
the same toggle as the sidebar.

Fixes QuantumNous#5696

* feat(system-settings): add user token limit configuration section (QuantumNous#5678)

* feat: add channel async polling delay toggle

Fixes QuantumNous#5717
Fixes QuantumNous#4244

* fix: add token limit save label translations

* feat: enhance i18n-translate skill

* feat: add date-fns and date-fns-tz dependencies

* feat: add date-fns and date-fns-tz paths to build configuration

* chore(deps): bump dompurify from 3.4.5 to 3.4.11 in /web/default (QuantumNous#5718)

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.5 to 3.4.11.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.4.5...3.4.11)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.11
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(ci): install classic workspace dependencies for releases (QuantumNous#5719)

* fix: use neutral drawing task labels

* perf(web): streamline table actions and destructive dialogs (QuantumNous#5645)

* perf(data-table): autosize action columns

- exclude actions columns from shared table width calculations so action cells size to their content.
- remove fixed size and w-* width overrides from feature action columns to preserve content-based layout.

* perf(data-table): streamline row action controls

- expose common edit and status actions directly while moving secondary actions into overflow menus.
- add shared row action menu helpers so static and table rows use consistent action controls.
- let action columns size to their content instead of relying on fixed widths.

* fix(web): localize destructive dialog copy

- route delete, reset, and batch update confirmation text through i18n.
- add locale entries for affected channel, model, system settings, and user dialogs.

* perf(web): unify destructive dialog actions

- align delete and cleanup confirmation buttons with the shared destructive variant.
- replace custom destructive color overrides with semantic button variants.
- clean up lint errors in touched dialog files before committing.

* fix(web): add user action success translations

- add localized success messages for user delete, status, and role changes.
- keep user management toast copy available across all frontend locales.

* fix(data-table): prevent mobile badge clipping

- expose badge cell slots so mobile card styles can target nested badge wrappers.
- reset badge margins in card rows to keep provider icons fully visible on small screens.

* fix: add Waffo goods info and webhook SDK update (QuantumNous#5704)

* fix: add Waffo goods info and webhook SDK update

* chore: remove Waffo test code from PR

* fix(model-pricing): refresh tiered expression editor when switching models (QuantumNous#5752)

Switching models in the pricing editor kept the previous model's tiers and prices in the expression panel: TieredPricingEditor seeds its internal visual/raw state only on mount, and the initRef guard never re-ran on prop changes, so only the model name updated.

Bump a reload token in the same effect that seeds billingExpr and use it as the editor's key, so a freshly loaded model remounts the editor and re-parses its expression. The token changes in lockstep with billingExpr, and user edits (which only touch state) do not trigger it.

Closes QuantumNous#5750

* chore(deps): sync bun.lock for dompurify 3.4.11 (QuantumNous#5738)

* fix(theme): 切换前端主题后重置到首页,避免路由 404 (QuantumNous#5612)

* fix(theme): 切换前端主题后重置到首页,避免路由 404
经典前端与新版前端的路由路径不同,切换主题后停留在原路径会导致 404:
- 经典前端切换到新版前端时跳转首页,不再原地刷新当前路径
- 新版前端保存时若前端主题发生变化,保存成功后跳转首页

Fixes QuantumNous#4947

* fix: 更新前端切换提示信息,修正页面跳转逻辑

* fix(task): attribute async task usage log to the initiating node (QuantumNous#5684)

Async task usage logs (LogQuotaData node dimension) were recorded
under whichever node happened to poll the task to completion, not the
node that submitted it. For token/adaptor-billed video tasks the
pre-deduction is often 0, so the entire quota landed on the last
polling node.

Snapshot common.NodeName into TaskPrivateData at submit time and use
it when writing the settlement consume log; fall back to the current
node when empty so existing tasks stay compatible.

* chore: update i18n skill

* feat: better admin permissions (QuantumNous#5755)

* feat: add casbin admin permissions

* feat: improve audit logging to associate logs with actual operators and target users

* feat: enhance admin permissions and UI interactions for sensitive actions

* Refactor authz RBAC and tighten channel permissions

* Split channel authz field policy

* Address channel authz review findings

* fix: adapt ClickHouse log LIKE filters

* feat(playground): improve Playground chat experience and Markdown rendering (QuantumNous#5217)

* refactor(playground): streamline chat request state

- extract conversation actions from the page component to keep message flow logic reusable.
- unify streaming and non-streaming generation state, including abort support for non-stream requests.
- simplify message rendering and payload construction while localizing Playground prompts.

* fix(playground): validate persisted chat state

- wrap saved Playground state with a storage version while still reading legacy values.

- validate config, parameter toggles, and messages before restoring them from localStorage.

- cap stored chat history to the latest messages to avoid oversized or stale state.

* refactor(playground): centralize message content access

- route chat rendering, copy actions, and error display through shared message helpers.

- reuse the current-version update helper for non-streaming assistant responses.

- keep message version details behind utility functions to reduce future model churn.

* refactor(playground): split storage schemas

- move Playground storage validation schemas into a dedicated module.

- keep storage read and write logic focused on migration, trimming, and persistence.

- preserve the existing storage envelope and validation behavior.

* refactor(playground): extract options loading hook

- move model and group queries into a dedicated hook so the page component stays focused on layout wiring.
- preserve existing fallback selection and error toast behavior while reusing the hook through the playground barrel export.

* refactor(playground): extract prompt suggestions

- move static prompt suggestion rendering into a focused component so the input stays centered on compose controls.
- preserve translated suggestion submission behavior while isolating icon metadata from the input form.

* refactor(playground): extract input tools

- move attachment and search controls into a dedicated component so the prompt input stays focused on compose state.
- keep existing development toast behavior and disabled handling while centralizing tool metadata.

* refactor(playground): extract input controls

- move model, group, send, and stop controls into a focused component so the input only manages compose state.
- preserve existing disabled states and generation button behavior while isolating control rendering.

* refactor(playground): extract message content display

- move sources, reasoning, loading, error, and response rendering into a dedicated message content component.
- keep the chat list focused on message iteration, edit state, and action wiring without changing display behavior.

* refactor(playground): extract message editor

- move inline message editing controls into a dedicated editor component so the chat list stays focused on rendering flow.
- preserve save, save-and-submit, cancel, and disabled-state behavior for edited messages.

* refactor(playground): extract stream error parsing

- move SSE error payload parsing into a reusable stream utility so the request hook stays focused on lifecycle handling.
- preserve existing error message, error code, and fallback behavior for raw or empty stream errors.

* refactor(playground): extract request error parsing

- move non-stream request error extraction into a shared utility so the chat handler stays focused on request flow.
- preserve the existing response message, error code, and fallback priority for failed chat completions.

* refactor(playground): extract streaming chunk updates

- move reasoning and content chunk application into a message utility so the chat handler only wires stream events.
- preserve error-state skipping, reasoning accumulation, and content streaming behavior for assistant messages.

* refactor(playground): extract message reasoning parser

- move think tag parsing into a dedicated playground message utility.
- export the parser through the shared playground lib barrel for consistent imports.

* refactor(playground): extract message streaming utilities

- move stream chunk application and message finalization into a dedicated utility.
- keep stored message sanitization with the streaming lifecycle helpers.

* refactor(playground): extract message update utilities

- move assistant message update helpers into a focused playground utility.
- keep error-state message updates separate from core message construction helpers.

* refactor(playground): extract completion choice handling

- move non-streaming choice application into the message streaming utilities.
- keep the chat handler focused on request orchestration and message updates.

* refactor(playground): centralize assistant completion state

- add a helper for finalizing assistant messages with complete status.
- reuse the helper in stream completion and stop-generation paths.

* refactor(playground): extract stream message parsing

- move SSE delta parsing into a shared stream utility.
- keep the stream request hook focused on lifecycle handling and update dispatch.

* refactor(playground): extract stream ready state checks

- move SSE ready-state status handling into stream utilities.
- keep weak source status typing outside the stream request hook.

* refactor(playground): extract conversation message helpers

- move send, regenerate, and edit message list construction into focused utilities.
- keep the conversation hook focused on edit state and update dispatch.

* refactor(playground): extract state initialization helpers

- move playground initial state loading into focused utility helpers.
- centralize message state updater resolution outside the React state hook.

* refactor(playground): extract option fallback helpers

- move model and group fallback selection into focused playground utilities.
- keep the options hook focused on query results, toasts, and config updates.

* refactor(playground): extract message action helpers

- move message action state derivation into focused utilities.

- keep the action component focused on guarded handlers and rendering.

* refactor(playground): extract input control state

- move submit, stop, and selector state derivation into a pure helper.

- keep input controls focused on rendering model selectors and action buttons.

* refactor(playground): extract message content state

- move source, reasoning, loader, and body visibility checks into a pure helper.

- use a discriminated state shape so rendered reasoning content stays type-safe.

* refactor(playground): extract message editor state

- move save eligibility and submit visibility checks into a pure helper.

- keep the editor component focused on textarea and button rendering.

* refactor(playground): extract message error state

- move error kind, fallback content, and admin visibility checks into a pure helper.

- centralize the model pricing settings path used by the error action.

* refactor(playground): extract chat render state

- move editing content lookup and per-message render flags into conversation helpers.

- keep the chat component focused on mapping messages to editor and content views.

* refactor(playground): extract suggestion display state

- move suggestion class selection into a pure helper.

- keep the suggestions component focused on translation and rendering.

* refactor(playground): extract assistant message state checks

- move final and pending assistant status checks into streaming utilities.

- keep the chat handler focused on request lifecycle updates.

* refactor(playground): extract input tool state

- move attachment action metadata and development notices into input tool utilities.

- keep the input tools component focused on menu and button rendering.

* refactor(playground): extract stream protocol checks

- move SSE done-message and closed-ready-state checks into stream utilities.

- keep the stream request hook focused on event handling flow.

* refactor(playground): extract message removal helper

- move delete-message filtering into conversation message utilities.

- keep the conversation hook focused on action orchestration.

* refactor(playground): extract option error messages

- move option load error message selection into playground option utilities
- keep the options hook focused on query effects and fallback updates

* refactor(playground): extract input submit text helper

- move prompt submit text validation into input control utilities
- let the input component submit only when a concrete text value is available

* refactor(playground): centralize error message checks

- add a shared helper for identifying error messages
- remove direct status string checks from message content rendering

* refactor(playground): extract message content display checks

- move loader and content visibility decisions into local helper functions
- keep message content state assembly focused on composing render state

* refactor(playground): replace raw message role checks

- use shared message role constants in conversation edit handling
- avoid raw assistant role literals when validating API messages

* refactor(playground): extract non-stream response handling

- move chat completion response choice handling into message streaming utilities
- keep the chat handler focused on request lifecycle and error routing

* refactor(playground): centralize stream cleanup

- reuse one stream cleanup path for completion, errors, startup failures, and manual stops
- preserve the current-source guard when closing SSE streams

* refactor(playground): extract pending assistant check

- centralize pending assistant message detection in streaming utilities
- reuse the helper when sanitizing stored playground messages

* perf(playground): improve mobile input controls

- split mobile input controls into selector and action rows
- keep the desktop input footer compact while reducing mobile control crowding

* perf(playground): add starter empty state

- show starter prompts in the empty playground chat area
- wire empty-state prompt selection into the existing send flow
- add localized copy for the new empty state

* perf(playground): improve mobile message actions

- collapse mobile message actions into a touch-friendly dropdown menu
- keep the desktop hover action strip unchanged for pointer workflows
- share one action list between desktop buttons and the mobile menu

* perf(playground): add error recovery actions

- show retry, edit, and delete actions inside error message alerts
- route edit recovery to the previous user prompt when available
- keep recovery controls touch-friendly on mobile layouts

* perf(playground): refine message editing experience

- present message edits in a focused bordered editor panel
- add unsaved-change state, reset, and cancel confirmation flows
- improve mobile touch targets and keyboard shortcuts for editing

* perf(playground): improve markdown code blocks

- render fenced markdown code with syntax highlighting, line numbers, and fallback plain text
- add copy, download, and collapse controls for playground AI responses
- tighten code block layout and theme token styles for responsive markdown rendering

* fix(playground): constrain markdown code block height

- collapse long playground code blocks after a short preview instead of waiting for very large snippets
- cap expanded code blocks so long responses scroll inside the code block
- keep generic code block usage unconstrained unless a caller opts in

* feat(playground): add chat history clearing

- add a toolbar action that is enabled only when saved playground messages exist.
- confirm destructive clears before removing browser-stored conversation state.
- add localized strings for the action, dialog, and completion toast.

* perf(playground): improve chat markdown rendering

- refine assistant and user message surfaces so chat content matches the app UI.
- normalize markdown typography, tables, images, lists, blockquotes, and details rendering.
- add indentation cues for collapsible reasoning and source sections.

* style: format code block component

* style: format playground frontend files

* feat(playground): render markdown with stream parser

- replace Streamdown with stream-markdown-parser for project-owned markdown rendering and styling.
- split response rendering into focused block, inline, table, alert, details, and footnote modules.
- pass message final state into response parsing so streaming content can be parsed incrementally.

* fix(playground): localize reasoning and chat feedback

- translate reasoning status, message actions, playground errors, and response renderer fallbacks across supported locales.
- keep reasoning duration numeric and tighten the collapsible layout to prevent trigger jitter.
- register dynamic keys so i18n sync keeps runtime labels covered.

* refactor(playground): group files by functional area

- move chat, input, and message components into focused subdirectories to make the UI structure easier to scan.
- split playground helpers into input, message, streaming, storage, options, state, and suggestions modules.
- update barrel exports and imports so existing feature entry points continue to work.

* fix(playground): prevent history replay from freezing page

- defer saved conversation loading so route entry no longer blocks on localStorage parsing and markdown rendering.
- limit initial history rendering and skip expensive markdown parsing for oversized responses.
- normalize corrupted streaming snapshots and cumulative chunks to keep saved playground history bounded.
- add message timing metadata and layout alignment groundwork without introducing live timers.

* feat(playground): allow regenerating from user messages

- show regenerate actions on user messages with saved content.
- truncate following conversation state before starting a fresh assistant response.

* feat(playground): add raw response source view

- add a per-message source toggle for assistant responses.
- render raw response content with the existing code block viewer.
- localize the new source and preview action labels.

* feat(playground): render code with unified editor

- replace Shiki HTML rendering with a read-only CodeMirror view for code blocks and raw responses.
- reuse the same CodeMirror frame for message editing so source and edit modes stay visually aligned.
- add lightweight CodeMirror dependencies while keeping language support scoped to Markdown.

* perf(playground): streamline chat input controls

- combine model and group selection into one compact picker for faster context switching.
- switch playground action buttons to icon-first controls with tooltips to reduce toolbar width.
- refresh input footer styling and submit states so active and destructive actions are clearer.
- bump dompurify lockfile entry to keep the frontend dependency current.

* fix(playground): filter models by selected group

- query user models by the selected playground group instead of reusing the cross-group model union.
- clear unavailable model selections and block sending when the active group has no models.
- align model selector and error action controls with the existing playground interaction style.

* perf(playground): remove input suggestion chips

- remove the prompt suggestion row below the playground input to reduce visual noise.
- delete the now-unused suggestion component and display helper.

* perf(playground): stabilize reasoning trigger layout

- use fixed icon slots around the reasoning label so the left content stays still when toggling.
- limit the open state animation to the chevron rotation for a smoother collapse interaction.

* perf(playground): smooth reasoning expansion

- use the collapsible panel height animation for vertical reasoning reveals.
- sync inner content opacity and position with the panel state.

* fix(auth): align password validation copy (QuantumNous#5759)

* fix(i18n): add missing frontend translations

- add missing locale entries for API key loading, channel model empty states, auth, playground, and model configuration copy.
- correct inaccurate Russian and Vietnamese model empty-state translations to avoid fallback or misleading copy.

* fix(auth): align password validation copy

- remove the login password length gate so existing shorter passwords are not blocked before reaching the server.
- reuse distinct minimum-length and 8-20 character messages based on the actual validation rule.
- drop unused duplicate password locale keys and align the user creation placeholder with the 8-20 character constraint.

* fix(i18n): add auth validation message translations

- cover schema-driven auth form errors that are translated through FormMessage.
- keep password, username, confirmation, and OTP validation messages available in every locale.

* fix(web): render custom HTML and Markdown content consistently (QuantumNous#5760)

* fix(markdown): render announcement markdown consistently

- support soft line breaks for announcement markdown without changing the default parser behavior.
- add explicit markdown element styles so lists, tables, code blocks, and quotes render correctly when typography styles are unavailable.
- apply the announcement markdown mode in both the popover and detail dialog for consistent display.

* refactor(markdown): simplify fallback markdown styles

- remove duplicate typography utility classes now covered by explicit markdown element fallbacks.
- keep the markdown renderer behavior unchanged while reducing class noise.
- modernize small helper expressions to satisfy targeted lint checks.

* fix(content): render custom HTML consistently

- add shared rich content rendering so custom HTML and Markdown use the same path across public pages and announcements.
- reuse common URL and HTML detection instead of duplicating content format checks per page.
- keep custom home content inside the standard public layout while preserving full-page iframe rendering for external URLs.

* fix(security): pin patched frontend transitive dependencies

* fix(web): secure rich content rendering

* fix(web): harden iframe sandboxing

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: CaIon <i@caion.me>
Co-authored-by: Benson Yan <fuxin04@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Seefs <40468931+seefs001@users.noreply.github.com>
Co-authored-by: QuentinHsu <xuquentinyang@gmail.com>
Co-authored-by: yyhhyyyyyy <yyhhyyyyyy8@gmail.com>
Co-authored-by: feitianbubu <feitianbubu@qq.com>
Co-authored-by: RedwindA <128586631+RedwindA@users.noreply.github.com>
Co-authored-by: zhongyuanzhao-alt <zhongyuan.zhao@waffo.com>
Co-authored-by: peakchao <zhangzhichaolove@vip.qq.com>
ruanhangjian pushed a commit to ruanhangjian/new-api that referenced this pull request Jul 11, 2026
…ous#5645)

* perf(data-table): autosize action columns

- exclude actions columns from shared table width calculations so action cells size to their content.
- remove fixed size and w-* width overrides from feature action columns to preserve content-based layout.

* perf(data-table): streamline row action controls

- expose common edit and status actions directly while moving secondary actions into overflow menus.
- add shared row action menu helpers so static and table rows use consistent action controls.
- let action columns size to their content instead of relying on fixed widths.

* fix(web): localize destructive dialog copy

- route delete, reset, and batch update confirmation text through i18n.
- add locale entries for affected channel, model, system settings, and user dialogs.

* perf(web): unify destructive dialog actions

- align delete and cleanup confirmation buttons with the shared destructive variant.
- replace custom destructive color overrides with semantic button variants.
- clean up lint errors in touched dialog files before committing.

* fix(web): add user action success translations

- add localized success messages for user delete, status, and role changes.
- keep user management toast copy available across all frontend locales.

* fix(data-table): prevent mobile badge clipping

- expose badge cell slots so mobile card styles can target nested badge wrappers.
- reset badge margins in card rows to keep provider icons fully visible on small screens.
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
…ous#5645)

* perf(data-table): autosize action columns

- exclude actions columns from shared table width calculations so action cells size to their content.
- remove fixed size and w-* width overrides from feature action columns to preserve content-based layout.

* perf(data-table): streamline row action controls

- expose common edit and status actions directly while moving secondary actions into overflow menus.
- add shared row action menu helpers so static and table rows use consistent action controls.
- let action columns size to their content instead of relying on fixed widths.

* fix(web): localize destructive dialog copy

- route delete, reset, and batch update confirmation text through i18n.
- add locale entries for affected channel, model, system settings, and user dialogs.

* perf(web): unify destructive dialog actions

- align delete and cleanup confirmation buttons with the shared destructive variant.
- replace custom destructive color overrides with semantic button variants.
- clean up lint errors in touched dialog files before committing.

* fix(web): add user action success translations

- add localized success messages for user delete, status, and role changes.
- keep user management toast copy available across all frontend locales.

* fix(data-table): prevent mobile badge clipping

- expose badge cell slots so mobile card styles can target nested badge wrappers.
- reset badge margins in card rows to keep provider icons fully visible on small screens.
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
…ous#5645)

* perf(data-table): autosize action columns

- exclude actions columns from shared table width calculations so action cells size to their content.
- remove fixed size and w-* width overrides from feature action columns to preserve content-based layout.

* perf(data-table): streamline row action controls

- expose common edit and status actions directly while moving secondary actions into overflow menus.
- add shared row action menu helpers so static and table rows use consistent action controls.
- let action columns size to their content instead of relying on fixed widths.

* fix(web): localize destructive dialog copy

- route delete, reset, and batch update confirmation text through i18n.
- add locale entries for affected channel, model, system settings, and user dialogs.

* perf(web): unify destructive dialog actions

- align delete and cleanup confirmation buttons with the shared destructive variant.
- replace custom destructive color overrides with semantic button variants.
- clean up lint errors in touched dialog files before committing.

* fix(web): add user action success translations

- add localized success messages for user delete, status, and role changes.
- keep user management toast copy available across all frontend locales.

* fix(data-table): prevent mobile badge clipping

- expose badge cell slots so mobile card styles can target nested badge wrappers.
- reset badge margins in card rows to keep provider icons fully visible on small screens.
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.

2 participants