Fix packaged settings smoke navigation

This commit is contained in:
coso
2026-10-02 19:20:22 +08:00
parent 82437275e1
commit 2adeff44f2
3 changed files with 50 additions and 24 deletions
@@ -24,3 +24,12 @@
## 架构确认
主链保持 `Product Surface -> App Server JSON-RPC -> RuntimeCore -> canonical Thread/Turn/Item -> GUI/terminal projection`。本候选的 TUI ChatWidget owner 收敛与 GUI 侧栏拆分未新增平行 runtime、协议后端或兼容层;责任开发者 root,2026-10-02。
## 发布后 CI 修复
首轮 GitHub Actions release run `36951843849` 在 macOS arm64/x64 的 packaged Gate B
因共享 `openSettings()` 仍等待已移除的 `[data-testid="app-sidebar-account-button"]`
失败;Windows 构建通过。修复提交 `5e11b1788` 让该入口优先使用当前
`[data-testid="app-sidebar-nav-settings"]`,并保留旧账号菜单回退,定向 fixture、Electron
entrypoint 与 release workflow guard 已通过。待修复提交推送后重跑同一版本的 release workflow,
确认两种 macOS 架构、Electron 资产发布和 GitHub Release 均成功。
+32 -24
View File
@@ -289,31 +289,39 @@ export async function openMcpConfigSettings(page, options) {
}
export async function openSettings(page, options) {
await page.locator('[data-testid="app-sidebar-account-button"]').click();
await page.locator('[data-testid="app-sidebar-account-menu"]').waitFor({
state: "visible",
timeout: Math.min(30_000, options.timeoutMs),
});
const clicked = await page.evaluate(() => {
const menu = document.querySelector(
'[data-testid="app-sidebar-account-menu"]',
);
const buttons = Array.from(menu?.querySelectorAll("button") ?? []);
const target = buttons.find((button) => {
const text = button.textContent || "";
const aria = button.getAttribute("aria-label") || "";
return /模型设置|AI 服务商|AI Providers|Model Settings/.test(
`${text}\n${aria}`,
);
const settingsNav = page.locator('[data-testid="app-sidebar-nav-settings"]');
if (
(await settingsNav.count()) > 0 &&
(await settingsNav.first().isVisible())
) {
await settingsNav.first().click();
} else {
await page.locator('[data-testid="app-sidebar-account-button"]').click();
await page.locator('[data-testid="app-sidebar-account-menu"]').waitFor({
state: "visible",
timeout: Math.min(30_000, options.timeoutMs),
});
if (!(target instanceof HTMLButtonElement)) {
return false;
}
target.click();
return true;
});
assert(clicked, "未找到账号菜单里的模型设置入口");
const clicked = await page.evaluate(() => {
const menu = document.querySelector(
'[data-testid="app-sidebar-account-menu"]',
);
const buttons = Array.from(menu?.querySelectorAll("button") ?? []);
const target = buttons.find((button) => {
const text = button.textContent || "";
const aria = button.getAttribute("aria-label") || "";
return /模型设置|AI 服务商|AI Providers|Model Settings/.test(
`${text}\n${aria}`,
);
});
if (!(target instanceof HTMLButtonElement)) {
return false;
}
target.click();
return true;
});
assert(clicked, "未找到账号菜单里的模型设置入口");
}
await page.locator('[data-testid="settings-top-header"]').waitFor({
state: "visible",
@@ -68,6 +68,15 @@ describe("MCP config Electron fixture smoke guard", () => {
expect(content).not.toContain("invokeMockOnly");
});
it("opens settings through the current sidebar rail before the legacy account fallback", () => {
const content = readSmokeScript();
expect(content).toContain('[data-testid="app-sidebar-nav-settings"]');
expect(content).toContain("settingsNav.first().isVisible()");
expect(content).toContain('[data-testid="app-sidebar-account-button"]');
expect(content).toContain('[data-testid="app-sidebar-account-menu"]');
});
it("writes same-run SETTINGS scenario evidence without relabeling", () => {
const content = readSmokeScript();
const evidenceCore = readEvidenceCore();