feat(web): align the model catalog with the pi-ai provider form

Both editors live in `ui-models` and list the same thing, so they now share
one row shape rather than diverging when #1368 lands: a bordered entry per
model, id and display name on the row, and the capacities behind the row's
own disclosure. The context window is joined there by the per-model output
cap the adapter just gained; both read a decimal K/M suffix.

The shared class names carry this file's token spellings, not that branch's.
`--dsw-alias-border-subtle`, `--dsw-alias-text-tertiary`, and
`--dsw-alias-text-primary` are undeclared, so they resolve to the light-mode
literals in their fallback slots — the defect this section was moved off. A
styles test now rejects any `--dsw-*` name the token sheet does not declare,
so the next editor to name one fails instead of shipping a light-only
surface.

The keystroke buffer is now per capacity field rather than per row, since a
row holds two of them.
This commit is contained in:
Yichen Jiang
2026-08-04 14:53:17 +08:00
parent 1d2ea70e9b
commit 17b480de51
14 changed files with 400 additions and 204 deletions

View File

@@ -173,12 +173,15 @@ describe.skipIf(MODE === 'record')('web e2e: first-run DeepSeek credential setup
await deepSeek.waitFor({ timeout: 10_000 })
await deepSeek.locator('xpath=ancestor::li').getByRole('button', { name: '编辑' }).click()
await settings.getByText('自定义设置').click()
await settings.getByRole('button', { name: '删除模型' }).first().click()
await settings.getByRole('button', { name: /删除模型/ }).first().click()
await settings.getByRole('button', { name: '添加模型' }).click()
const customModelId = settings.getByLabel('模型 ID 2')
await customModelId.fill('private-preview')
await settings.getByLabel('显示名称 2').fill('Private Preview')
// Capacities live behind the row's own disclosure, as in the pi-ai form.
await settings.getByRole('button', { name: '容量 2' }).click()
await settings.getByLabel('上下文窗口 2').fill('131072')
await settings.getByLabel('最大输出 token 数 2').fill('64K')
const modelEditor = await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd)
await compareOrRefreshGolden(MODELS_EXPECTED, modelEditor, MODE)
@@ -190,6 +193,7 @@ describe.skipIf(MODE === 'record')('web e2e: first-run DeepSeek credential setup
expect(document).toContain('id: private-preview')
expect(document).toContain('name: Private Preview')
expect(document).toContain('contextWindow: 131072')
expect(document).toContain('maxTokens: 64000')
expect(document).not.toContain('id: deepseek-v4-flash')
await page.keyboard.press('Escape')

View File

@@ -32,26 +32,34 @@
- region "模型目录":
- text: 模型目录 已自定义模型目录
- button "恢复默认模型"
- textbox "模型 ID 1": deepseek-v4-pro
- textbox "模型 ID 1":
- /placeholder: 模型 ID
- text: deepseek-v4-pro
- textbox "显示名称 1":
- /placeholder: 留空时使用模型 ID
- /placeholder: 显示名称
- text: DeepSeek-V4-Pro
- textbox "上下文窗口 1":
- /placeholder: 1M
- text: 1M
- button "删除模型":
- button "容量 1":
- img
- text: 删除模型
- textbox "模型 ID 2": private-preview
- button "删除模型 1":
- img
- textbox "模型 ID 2":
- /placeholder: 模型 ID
- text: private-preview
- textbox "显示名称 2":
- /placeholder: 留空时使用模型 ID
- /placeholder: 显示名称
- text: Private Preview
- button "容量 2" [expanded]:
- img
- button "删除模型 2":
- img
- text: 上下文窗口
- textbox "上下文窗口 2":
- /placeholder: 1M
- text: "131072"
- button "删除模型":
- img
- text: 删除模型
- text: 最大输出 token 数
- textbox "最大输出 token 数 2":
- /placeholder: 256K
- text: 64K
- button "添加模型":
- img
- text: 添加模型