From b8b6007b51d1dc8a5907c60b63153eb9047d0b69 Mon Sep 17 00:00:00 2001 From: mesalogo Date: Mon, 28 Sep 2026 00:49:24 +0800 Subject: [PATCH] test: synchronize narrow notes keyboard acceptance on Linux The real Linux Host reproduced Escape being sent to the collapsed workbar trigger after resize. Wait for the narrow viewport, open the workbar through its existing control, and confirm the append field owns focus before input. Keep the migration fixture and all IO assertions, with a 15-second allowance for its 10000-record scenario. Product behavior and approved notes are unchanged. Validation: real Linux Host full suite 5345 passed, 51 skipped; Windows focused 3 passed; complete typecheck, lint, and release-note verification passed. --- .../development/release-preparation-0.15.0.md | 30 +++++++++++++++++++ docs/quality/recurring-defects.md | 3 ++ .../assistant/activity-history-io.test.ts | 2 +- tests/support/magic-notes-capture-main.ts | 8 ++++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/docs/development/release-preparation-0.15.0.md b/docs/development/release-preparation-0.15.0.md index be6343a1..fcb84478 100644 --- a/docs/development/release-preparation-0.15.0.md +++ b/docs/development/release-preparation-0.15.0.md @@ -83,6 +83,36 @@ Host Key、加密凭据连接。重新捆绑当前源码的 Agent CLI、daemon 沿用上方当前源码 Host 验证,不新增真实模型请求。 - 新提交必须重新取得准确 SHA 批准,原发布说明正文保持不变。 +## Linux 实机复现与最终同步修正 + +2026-09-28:第二次批准候选 `12594961fe1e814e89f55de1fbfe245310505115` +的 [Desktop CI 36331853137](https://github.com/mesalogo/goodbuddy/actions/runs/36331853137) +为 5,343 通过、51 跳过、2 失败。两个 App 长历史场景已通过; +Escape 返回列表仍失败,活动历史迁移这次超过默认 5 秒时限,生产构建仍未执行。 + +按用户要求直接在共享 Linux x64 Host 测试准确候选源码。使用独立磁盘测试目录、 +锁定 Node 24.19.0 和 `npm ci`,补齐 Xvfb 与匹配的 X server 系统依赖; +没有创建新账号,使用既有非 root 账号运行测试,保留 Electron 沙箱及其标准 helper 权限。 +不替换既有 Agent,不修改其安装或工作区,不执行生产构建或打包。 + +原测试在 Host 上稳定复现:缩窄窗口会按产品既有行为收起工作栏,隐藏面板仍有非零宽度。 +诊断显示 Escape 实际发给 `aria-expanded=false` 的工作栏开关,而不是笔记输入框。 +因此仅获取窗口焦点不够;测试改为等待窄视口及响应式渲染完成,按真实按钮打开工作栏, +确认展开状态和目标输入框焦点后再发送键盘输入。临时诊断代码已移除。 + +迁移测试在 Host 上以原默认时限通过,保留 10,000 条记录、完整迁移、WAL 字节比、 +扫描次数与无变化写入断言;仅为这一个大数据场景采用已有的 15 秒单用例时限, +不改数据库实现或全局时限。 + +- 最终 Linux Host 完整 `npm test`:**5,345 通过、51 跳过、0 失败**, + 449 个文件通过、15 个跳过,耗时 751.09 秒。 +- Windows 聚焦回归:3 项通过,包含真实 Electron 和迁移。 +- Windows 完整类型检查、lint、发布说明校验:全部通过。 +- Linux Electron 实测覆盖 502 条历史、218px 窄栏、Escape/Tab/Enter、 + 浅深主题确认按钮、真实 IPC/SQLite 与重开保留;Windows 对应窄栏为约 214px。 +- 本阶段不新增真实模型请求,不改变产品代码或双语说明。 + 新候选仍须重新批准 SHA 并通过自己的主分支 CI/生产构建,两个标签仍未创建。 + ## 数据、兼容与验收边界 Desktop schema 48 新增魔法笔记会话来源元数据。升级前应备份完整用户数据, diff --git a/docs/quality/recurring-defects.md b/docs/quality/recurring-defects.md index 223124a3..3e9ebbe2 100644 --- a/docs/quality/recurring-defects.md +++ b/docs/quality/recurring-defects.md @@ -46,6 +46,9 @@ AI 列 280。测试同步原生输入与实际状态后独立复跑通过,保 2026-09-27 的 0.15.0 主分支 CI 中,会话采集测试向隐藏 Electron 窗口发送 Escape, 未返回笔记列表。原生键盘辅助函数同样必须显示窗口、取得焦点并等待 `document.hasFocus()`,再发送输入;不靠跳过 Linux 或关闭沙箱处理。 +随后 Linux CI 与共享 Host 的实测表明窗口焦点并不足够:缩窄窗口会收起工作栏, +隐藏面板仍有非零宽度,Escape 实际发给工作栏开关。测试须等待响应式状态完成, +按真实入口重新打开工作栏,并确认目标输入框取得焦点,再测试键盘返回和导航。 ## 整窗遮罩与原生拖动区域 diff --git a/src/main/assistant/activity-history-io.test.ts b/src/main/assistant/activity-history-io.test.ts index 4843106c..f5421f77 100644 --- a/src/main/assistant/activity-history-io.test.ts +++ b/src/main/assistant/activity-history-io.test.ts @@ -73,7 +73,7 @@ it('migrates activity history and writes only changed records during streaming', database.close() rmSync(directory, { recursive: true, force: true }) } -}) +}, 15_000) it('keeps activity comparisons correct after rollback, external writes and clearing', () => { const directory = mkdtempSync(join(tmpdir(), 'goodbuddy-save-io-')) diff --git a/tests/support/magic-notes-capture-main.ts b/tests/support/magic-notes-capture-main.ts index d2acb551..8b8c644a 100644 --- a/tests/support/magic-notes-capture-main.ts +++ b/tests/support/magic-notes-capture-main.ts @@ -124,8 +124,14 @@ app.whenReady().then(async () => { evidence.newSaved = true // Electron resize and the production sidebar transition settle asynchronously. win.setSize(760, 800) - await wait(`${panel}.getBoundingClientRect().width > 100`, 'narrow panel layout after resize') + await wait('window.innerWidth < 900', 'narrow viewport after resize') + await run('new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))') + if (await run('document.querySelector(".assistant-sidebar-toggle").getAttribute("aria-expanded") === "false"')) { + await click('Toggle assistant workspace') + } + await wait(`document.querySelector(".assistant-sidebar-toggle").getAttribute("aria-expanded") === "true" && ${panel}.getBoundingClientRect().width > 100`, 'visible narrow panel after resize') await run(`document.querySelector('#compact-note-append').focus()`) + await wait('document.activeElement?.id === "compact-note-append"', 'narrow append focus') await key('Escape') await wait('document.activeElement?.id === "compact-note-search"', 'Escape returns to list and search') await key('Tab')