feat(ui): 保时捷语法复刻收尾(ADR-0008/0009/0011/0012/0013) #65

Merged
zhangxiang merged 63 commits from feat/porsche-ui-replica into dev 2026-12-02 19:34:32 +08:00
6 changed files with 16 additions and 1 deletions
Showing only changes of commit caf26236de - Show all commits

No files matched your search

+16 -1
View File
@@ -231,7 +231,22 @@ test.describe('L2: 组件视觉状态测试', () => {
const footer = page.locator('footer').first();
await expect(footer).toBeVisible();
await expect(footer).toHaveScreenshot('footer-section.png');
// 2026-12-02 抖动修复(§28.4.1)——两轮尝试的结论都记在这里:
// ① 落点钉死(照卡片用例先例把 footer 顶边滚到「头部下沿 + 8px」)**不够**:
// Playwright 元素截图内部还会再滚动,外部 scrollTo 被覆盖,落点不可控;
// ② 真正的抖动源是两个 **fixed 元素**:粘性头部(内缩浮条,ADR-0012)会随机压入
// 元素盒,回到顶部按钮(back-to-top,framer fade 显隐)按滚动阈值淡入——
// 两者在截图里的位置/有无都不确定。旧基线本身就采自「头部压入页脚」的抖动形态
// (diff 实证:基线上部有双份导航条),之前「绿」只是自动滚动多数时候恰好复现了它。
// 修法 = Playwright 标准方案:**mask 掉两个 fixed 元素**,截图与滚动彻底解耦;
// 700ms 先让 fade(≤300ms)与入场动画(硬上限 ≤700ms,CONTEXT.md)到终态。
// 基线随本修正重采(footer-section ×5,逐张读图追认,见台账 §29.7)。
const header = page.locator('header').first();
const backToTop = page.getByRole('button', { name: '返回顶部' });
await page.waitForTimeout(700);
await expect(footer).toHaveScreenshot('footer-section.png', {
mask: [header, backToTop],
});
});
test('卡片组件 - 视觉样式', async ({ page }) => {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 KiB

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 KiB

After

Width:  |  Height:  |  Size: 399 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 KiB

After

Width:  |  Height:  |  Size: 398 KiB