优化页面交互并增强 Provider 配置能力
- 表单下拉框不再用 label 包裹,改为 div + aria-label,避免点击后 下拉面板瞬间关闭 - Provider 卡片新增「从上游获取模型」和「修改」入口,支持编辑 base URL、API Key 与 api_mode,凭据写入对应的环境变量 - 服务端抽出 provider-model-discovery 统一不同 api_mode 的模型发现, 旧的 custom_providers 与新的 providers 字典结构都能正确更新 - Agent Bridge 改为后台启动,HTTP 接口在 Python 运行时就绪前即可用; worker 连接被拒时按类型重试,不重放可能已产生副作用的请求 - 断线重连后恢复 profiles、models 与会话列表,健康检查改为自调度 的 setTimeout,离线时 2 秒后重试 - 批量删除确认文案改用 Popconfirm content,避免变成侧栏触发器文本
This commit is contained in:
@@ -63,3 +63,40 @@ test('session context menu renders flat items and its export submenu', async ({
|
||||
await popup.locator('.arco-dropdown-option', { hasText: 'Export' }).click()
|
||||
await expect(page.locator('.arco-trigger-popup').filter({ hasText: 'Compressed' })).toBeVisible()
|
||||
})
|
||||
|
||||
test('new chat selectors stay open after clicking their field and allow selection', async ({ page }) => {
|
||||
await authenticate(page, TEST_ACCESS_KEY, 'research')
|
||||
await mockHermesApi(page)
|
||||
await page.route('**/api/hermes/available-models**', async route => {
|
||||
const group = { provider: 'test-provider', label: 'Test Provider', models: ['test-model', 'other-model'] }
|
||||
await route.fulfill({ json: {
|
||||
default: 'test-model', default_provider: 'test-provider', groups: [group], allProviders: [group],
|
||||
profiles: ['default', 'research'].map(profile => ({
|
||||
profile, default: 'test-model', default_provider: 'test-provider', groups: [group],
|
||||
})),
|
||||
} })
|
||||
})
|
||||
await mockChatSocket(page)
|
||||
await page.goto('/#/hermes/chat')
|
||||
await page.getByRole('button', { name: 'New Chat', exact: true }).click()
|
||||
const drawer = page.locator('.new-chat-drawer')
|
||||
const selects = drawer.locator('.new-chat-field > .arco-select')
|
||||
await expect(selects).toHaveCount(3)
|
||||
await expect(selects.nth(1)).not.toHaveClass(/arco-select-disabled/)
|
||||
|
||||
for (const index of [0, 1, 2]) {
|
||||
// Click the field chrome, not the internal input: a wrapping HTML label
|
||||
// forwards this click to its input and can toggle the popup a second time.
|
||||
await selects.nth(index).click({ position: { x: 8, y: 16 } })
|
||||
const popup = page.locator('.arco-select-dropdown:visible')
|
||||
await expect(popup).toBeVisible()
|
||||
await page.waitForTimeout(300)
|
||||
await expect(popup).toBeVisible()
|
||||
const option = index === 0
|
||||
? popup.locator('.arco-select-option', { hasText: 'research' })
|
||||
: popup.locator('.arco-select-option').first()
|
||||
await option.click()
|
||||
await expect(popup).toHaveCount(0)
|
||||
await expect(drawer).toBeVisible()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user