feat(project-config): simplify plugin and model drawers

This commit is contained in:
inman committed 2026-09-07 14:58:30 +08:00
1 parent 918f8f80dc
commit d278785da8
16 files changed
+583 -709

No files matched your search

+30 -24
View File
@@ -93,17 +93,20 @@ test.describe('Unified plugin workspace', () => {
await expect(page.getByTestId('project-plugins-sheet')).toBeVisible();
await expect(page.getByTestId('plugins-page')).toBeVisible();
await expect(page).toHaveURL(/\/project-config\/plugins\?scope=all/);
await expect(page.getByTestId('plugins-page').getByText('尚未获取')).toBeVisible();
await expect(page.getByText('为你的智能体添加插件,拓展更多能力。')).toBeVisible();
await expect(page.getByRole('button', { name: /刷新/ })).toHaveCount(0);
await expect(page.getByRole('searchbox')).toHaveCount(0);
await expect(page.getByRole('combobox')).toHaveCount(0);
await expect(page.getByRole('button', { name: '添加灵感笔记' })).toBeVisible();
await page.getByRole('button', { name: '查看灵感笔记详情' }).click();
await expect(page.getByRole('dialog', { name: '灵感笔记' })).toContainText('详细介绍');
await page.getByRole('button', { name: '免费获取灵感笔记' }).click();
await expect(page.getByRole('button', { name: '从账号移除灵感笔记' })).toBeVisible();
await expect(page.getByRole('dialog', { name: '灵感笔记' })).not.toContainText('读取项目名称');
await page.getByRole('button', { name: '添加灵感笔记' }).click();
await expect(page.getByRole('button', { name: '从插件库移除灵感笔记' })).toBeVisible();
await page.getByRole('button', { name: '关闭插件详情' }).click();
await page.getByRole('combobox', { name: '状态', exact: true }).selectOption('mine');
await expect(page).toHaveURL(/state=mine/);
await expect(page.getByRole('heading', { name: '灵感笔记' })).toBeVisible();
await expect(page.getByText('不适用项目启用')).toBeVisible();
await expect(page.getByRole('button', { name: '安装灵感笔记' })).toBeVisible();
const requests = await app.evaluate(() => (
(globalThis as typeof globalThis & { __pluginsE2E?: { requests: string[] } }).__pluginsE2E?.requests ?? []
));
@@ -157,17 +160,21 @@ test.describe('Unified plugin workspace', () => {
await expect(page.getByTestId('project-configuration-empty-state')).toBeVisible();
await expect(page.getByTestId('project-plugins-sheet')).toBeVisible();
await expect(page.getByTestId('plugins-page')).toBeVisible();
await expect(page.getByRole('alert')).toContainText('官方目录刷新失败');
await expect(page.getByRole('alert')).toContainText('官方目录加载失败');
await expect(page.getByRole('heading', { name: 'Local Search' })).toBeVisible();
await expect(page.getByText('本机全局已启用')).toBeVisible();
await expect(page.getByText(/仅通过对话安装/)).toBeVisible();
await expect(page.getByRole('button', { name: 'Local Search:已安装' })).toBeDisabled();
await expect(page.getByRole('button', { name: /刷新/ })).toHaveCount(0);
await expect(page.getByRole('searchbox')).toHaveCount(0);
await expect(page.getByRole('combobox')).toHaveCount(0);
await expect(page.getByRole('textbox', { name: /包|路径|source/i })).toHaveCount(0);
await page.getByRole('button', { name: '查看Local Search详情' }).click();
await expect(page.getByText(/完整桌面权限/)).toBeVisible();
await page.getByRole('button', { name: '本机全局停用Local Search' }).click();
await expect(page.getByRole('button', { name: '本机全局启用Local Search' })).toBeVisible();
await page.getByRole('button', { name: '本机全局启用Local Search' }).click();
await expect(page.getByRole('button', { name: '本机全局停用Local Search' })).toBeVisible();
await expect(page.getByText('为智能体提供可在本机使用的扩展能力。')).toBeVisible();
await expect(page.getByText(/完整桌面权限/)).toHaveCount(0);
await expect(page.getByText(/Pi extension|Skill 脚本/)).toHaveCount(0);
await page.getByRole('button', { name: '停用Local Search' }).click();
await expect(page.getByRole('button', { name: '启用Local Search' })).toBeVisible();
await page.getByRole('button', { name: '启用Local Search' }).click();
await expect(page.getByRole('button', { name: '停用Local Search' })).toBeVisible();
const requests = await app.evaluate(() => (
(globalThis as typeof globalThis & { __pluginsE2E?: { requests: string[] } }).__pluginsE2E?.requests ?? []
@@ -291,24 +298,23 @@ test.describe('Unified plugin workspace', () => {
await expect.poll(async () => app.evaluate(() => (
(globalThis as typeof globalThis & { __pluginsE2E?: { requests: string[] } }).__pluginsE2E?.requests ?? []
))).toContain('GET /api/coding/plugin-marketplace/library');
const bundledCard = page.getByRole('heading', { name: '游戏资源生成' }).locator('..');
await expect(bundledCard).toContainText('账号已获取');
await expect(page.getByRole('button', { name: '游戏资源生成:随应用提供' })).toBeDisabled();
await page.getByRole('button', { name: '查看开发数据服务详情' }).click();
await expect(page.getByText('当前状态没有可执行操作。')).toBeVisible();
await expect(page.getByText('当前无需进行其他操作。')).toBeVisible();
await page.getByRole('button', { name: '关闭插件详情' }).click();
await page.getByRole('button', { name: '查看游戏资源生成详情' }).click();
await expect(page.getByRole('button', { name: '从账号移除游戏资源生成' })).toBeVisible();
await expect(page.getByRole('button', { name: /下载.*游戏资源生成|删除.*游戏资源生成.*官方设备包/ })).toHaveCount(0);
await page.getByRole('button', { name: '从账号移除游戏资源生成' }).click();
await page.getByRole('button', { name: '确认从账号移除' }).click();
await expect(page.getByRole('button', { name: '从插件库移除游戏资源生成' })).toBeVisible();
await expect(page.getByRole('button', { name: /安装.*游戏资源生成|从本机卸载.*游戏资源生成/ })).toHaveCount(0);
await page.getByRole('button', { name: '从插件库移除游戏资源生成' }).click();
await page.getByRole('button', { name: '确认移除' }).click();
await page.getByRole('button', { name: '关闭插件详情' }).click();
await page.getByRole('button', { name: '查看Local Tool详情' }).click();
await expect(page.getByRole('button', { name: '本机全局停用Local Tool' })).toBeVisible();
await expect(page.getByRole('button', { name: /账号.*Local Tool|下载.*Local Tool/ })).toHaveCount(0);
await page.getByRole('button', { name: '本机全局停用Local Tool' }).click();
await expect(page.getByRole('button', { name: '停用Local Tool' })).toBeVisible();
await expect(page.getByRole('button', { name: /插件库.*Local Tool|安装.*Local Tool/ })).toHaveCount(0);
await page.getByRole('button', { name: '停用Local Tool' }).click();
const requests = await app.evaluate(() => (
(globalThis as typeof globalThis & { __pluginsE2E?: { requests: string[] } }).__pluginsE2E?.requests ?? []