Skip to content

refactor(settings): 供应商模型列表用表头总开关取代批量选择模式 - #733

Open
AlphaCatMeow wants to merge 1 commit into
Stack-Cairn:mainfrom
AlphaCatMeow:refactor/provider-model-master-toggle
Open

refactor(settings): 供应商模型列表用表头总开关取代批量选择模式#733
AlphaCatMeow wants to merge 1 commit into
Stack-Cairn:mainfrom
AlphaCatMeow:refactor/provider-model-master-toggle

Conversation

@AlphaCatMeow

@AlphaCatMeow AlphaCatMeow commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Closes #732

Summary

供应商模型列表原来要一次启用全部模型,需要「进入批量选择 → 全选 → 滚到底部点启用 → 点完成」四步;本 PR 把批量选择模式整个删掉,改为列表表头常驻一个总开关:一次点击启用/禁用当前可见(含搜索过滤结果)的全部模型,旁边显示已启用数量。逐个启用仍用每行原有开关。拖拽排序不再受批量模式限制,仅在搜索过滤时禁用。

实现上删除了批量选择模式的独立状态、全选/清空行和底部操作条,移除 getModelBulkActionCounts / applyModelBulkActiveState,新增更简单的 applyModelsActiveState;i18n 新增 enable/disableAllModels 与启用计数文案,删除 modelReorderDisabledBulk。净变化 +70 / -260 行。

Change scope

  • Modules: agent-ui / agent-gui (React 前端)
  • Key paths:
    • crates/agent-ui/src/pages/settings/ProviderModal.tsx
    • crates/agent-ui/src/pages/settings/ProviderModalView.tsx
    • crates/agent-ui/src/pages/settings/providerUtils.ts
    • crates/agent-ui/src/i18n/translations/enUSSettings.tszhCNSettings.ts
    • crates/agent-gui/test/settings/provider-models-fetch.test.mjs

Screenshots / preview

6a52a92776b198f892bb5e2aa04a6f5e

Verification

  • node --test test/settings/provider-models-fetch.test.mjs:23 个用例全部通过(断言已随新交互更新)。
  • 本地 Tauri 调试客户端(pnpm tauri dev)人工验证:表头总开关一次启用/禁用全部模型、搜索过滤时只作用于过滤结果、每行开关行为不变、拖拽排序仅在搜索过滤时禁用。
  • 已知无关失败:test/settings/provider-usage-query-form.test.mjs 的「preset 脚本与 Rust 内置逐字节一致」在 upstream/main(7d6e95e8)上同样失败,非本 PR 引入。
  • 与 upstream/main 无合并冲突(git merge-tree 检查通过)。
  • 仓库现有文档中的「批量选择」均指 Skills Hub 与会话侧栏,不涉及本交互,无需文档更新。

Pre-submit checklist

  • A requirement issue is linked (or this is a trivial fix that needs no issue, as explained in the summary).
  • Synced with the target branch; no merge conflicts.
  • The change is focused, with no unrelated modifications.
  • No secrets, tokens, or personal data included.
  • Docs are updated for changes affecting user behavior, deployment, or configuration.

原交互需要 进入批量选择 -> 全部选中 -> 移到底部点启用 -> 点完成 四步。
现在列表头常驻一个总开关,一次点击即可启用/禁用当前可见(含搜索过滤)
的全部模型,同时显示已启用数量;逐个启用仍用每行原有开关。

- 删除批量选择模式及其全选/清空行、底部操作条
- 移除 getModelBulkActionCounts/applyModelBulkActiveState,
  新增更简单的 applyModelsActiveState
- 拖拽排序不再受批量模式限制,仅搜索过滤时禁用
- i18n 新增 enable/disableAllModels 与启用计数文案,
  删除 modelReorderDisabledBulk
@StackCairn
StackCairn marked this pull request as draft September 2, 2026 12:00
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR governance checks passed. Awaiting human review.

@AlphaCatMeow
AlphaCatMeow marked this pull request as ready for review September 2, 2026 12:01
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.

[Feature] 供应商模型列表用表头总开关取代批量选择模式

1 participant