From 8201c9c27e5f4489a2ff63e03e5b2bdca4608df4 Mon Sep 17 00:00:00 2001 From: mesalogo Date: Thu, 1 Oct 2026 00:48:35 +0800 Subject: [PATCH] test: wait for theme transitions before comparing glass styles The Linux full suite sampled a window-control color during its transition. Wait for CSS transitions to finish while retaining exact style, contrast, geometry, and native interaction assertions. --- docs/development/release-preparation-0.15.6.md | 9 +++++++++ docs/quality/recurring-defects.md | 2 ++ tests/support/frosted-glass-driver.mjs | 5 ++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/development/release-preparation-0.15.6.md b/docs/development/release-preparation-0.15.6.md index 8cdd43fa..85026ed2 100644 --- a/docs/development/release-preparation-0.15.6.md +++ b/docs/development/release-preparation-0.15.6.md @@ -31,3 +31,12 @@ Agent 保持 0.15.1:相对其发布标签,daemon 与锁文件无变化。 Electron 磨砂、笔记布局、工作栏设置布局。 - `npm run typecheck`、`npm run lint` 通过;本轮新增付费模型调用 0 次。 - 完整测试和生产构建等待精确候选 CI,不运行本地生产构建、打包或安装包探针。 + +## 首轮 CI + +候选 `cc451f6` 已含用户未提交样式修正并同步两个远端。Agent `36743915140` +通过,Desktop `36743915207` 为 5573 通过、57 跳过、1 失败,生产构建未执行。 +磨砂测试切换主题后立即读取样式,窗口按钮 color 正在过渡,导致深色关闭态与 +先前基线不同。测试改为等待当前 CSS Transition 完成,保留完整样式、几何、 +拖拽、对比度及原生交互断言,不修改产品外观或全局超时。 +修正后完整磨砂 Electron 回归、类型检查及 lint 通过;双语说明与产品源码不变。 diff --git a/docs/quality/recurring-defects.md b/docs/quality/recurring-defects.md index aa879dce..d6ec33c2 100644 --- a/docs/quality/recurring-defects.md +++ b/docs/quality/recurring-defects.md @@ -67,6 +67,8 @@ Runtime 状态尚未匹配当前选择时按钮仍禁用,点击不会发出请 同日 CI 再现快速笔记打开完整记录后未滚动:数据请求完成后的动画帧仍可能早于 React 提交目标 DOM。定位操作应在目标记录提交后的布局 Effect 中执行, 而不是在请求 Promise 完成时猜测渲染时机;立即执行动画帧的回归可稳定暴露旧问题。 +2026-10-01 磨砂外观 CI 在主题切换后读到窗口按钮颜色过渡的中间值。比较稳定样式前, +等待当前 CSS Transition 的 `finished`,不要固定睡眠、删除颜色断言或等待无限循环动画。 ## 整窗遮罩与原生拖动区域 diff --git a/tests/support/frosted-glass-driver.mjs b/tests/support/frosted-glass-driver.mjs index 8c5b160c..d938f441 100644 --- a/tests/support/frosted-glass-driver.mjs +++ b/tests/support/frosted-glass-driver.mjs @@ -33,7 +33,7 @@ app.whenReady().then(async () => { let off for (const state of [null, 'true', null, 'false']) { const label = `${theme}/${state ?? 'absent'}` - const result = await win.webContents.executeJavaScript(`(() => { + const result = await win.webContents.executeJavaScript(`(async () => { document.documentElement.dataset.theme = ${JSON.stringify(theme)}; const shell = document.querySelector('.app-shell'); const state = ${JSON.stringify(state)}; @@ -41,6 +41,9 @@ app.whenReady().then(async () => { if (state === null) node.removeAttribute('data-frosted-glass'); else node.dataset.frostedGlass = state; } + await Promise.all(document.getAnimations() + .filter(animation => animation instanceof CSSTransition) + .map(animation => animation.finished)); const panel = document.querySelector('.runtime-checklist__content'); if (shell.contains(panel) || !panel.closest('.floating-portal').matches(':popover-open')) throw new Error('Checklist must render outside app-shell in the top layer');