Skip to content

feat(settings): 模型选择器中增加直接编辑供应商的入口 - #330

Open
hopingmiao wants to merge 2 commits into
Stack-Cairn:mainfrom
hopingmiao:main
Open

feat(settings): 模型选择器中增加直接编辑供应商的入口#330
hopingmiao wants to merge 2 commits into
Stack-Cairn:mainfrom
hopingmiao:main

Conversation

@hopingmiao

Copy link
Copy Markdown

功能概述

在模型选择器中增加直接编辑供应商的入口,并同步支持桌面 GUI 和 Gateway WebUI。

现在每个供应商分组右侧都会显示一个铅笔编辑按钮。点击后将会:

  1. 关闭当前模型选择菜单。
  2. 打开“设置 → 供应商”。
  3. 自动切换到该供应商对应的类型。
  4. 直接打开所选供应商的编辑弹窗。

主要改动

  • 在模型选择器的每个供应商分组右侧增加编辑按钮。
  • 打开设置页面时传递需要编辑的供应商 ID。
  • 在设置页面中增加供应商深链处理。
  • 打开编辑弹窗前,自动切换到供应商对应的类型页签。
  • 桌面 GUI 与 Gateway WebUI 的交互保持一致。
  • 使用 pendingProviderId 一次性消费供应商编辑请求:
    • 避免关闭编辑弹窗后再次自动打开。
    • 避免切换设置页签后再次自动打开。
  • 新增并更新相关自动化测试。

桌面 GUI 修改文件

  • crates/agent-gui/src/App.tsx

    • 将需要编辑的供应商 ID 传入设置页面。
  • crates/agent-gui/src/pages/ChatPage.tsx

    • 转发来自聊天页面顶部模型选择器的供应商编辑请求。
  • crates/agent-gui/src/pages/SettingsPage.tsx

    • 保存并一次性消费 pendingProviderId
  • crates/agent-gui/src/pages/chat/components/ChatHeader.tsx

    • 在供应商分组右侧增加铅笔编辑按钮。
    • 点击后关闭模型菜单并打开供应商设置。
  • crates/agent-gui/src/pages/settings/ProvidersSection.tsx

    • 根据供应商 ID 查找对应供应商。
    • 自动切换到对应的供应商类型。
    • 直接打开该供应商的编辑弹窗。
  • crates/agent-gui/src/pages/settings/types.ts

    • 增加供应商深链相关的属性类型。

Gateway WebUI 修改文件

  • crates/agent-gateway/web/src/app/GatewayApp.tsx

    • 将需要编辑的供应商 ID 传入设置页面。
  • crates/agent-gateway/web/src/pages/SettingsPage.tsx

    • 保存并一次性消费 pendingProviderId
  • crates/agent-gateway/web/src/pages/chat/ChatHeader.tsx

    • 在供应商分组右侧增加铅笔编辑按钮。
    • 增加打开供应商设置及编辑弹窗的跳转逻辑。
  • crates/agent-gateway/web/src/pages/settings/ProvidersSection.tsx

    • 自动切换供应商类型并打开指定供应商的编辑弹窗。
  • crates/agent-gateway/web/src/pages/settings/types.ts

    • 增加供应商深链相关的属性类型。

测试

更新测试:

  • crates/agent-gui/test/chat/execution-mode-model-picker.test.mjs

新增测试:

  • crates/agent-gui/test/settings/provider-edit-deeplink.test.mjs

测试命令:

node --test test/chat/execution-mode-model-picker.test.mjs test/settings/provider-edit-deeplink.test.mjs

Add provider-group edit actions that open the matching provider editor in Settings for both desktop and Gateway WebUI. Consume pending provider IDs once to prevent the editor from reopening after navigation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant