feat(ui): 保时捷语法复刻收尾(ADR-0008/0009/0011/0012/0013) #65
No files matched your search
@@ -255,11 +255,18 @@ test.describe('L2: 组件视觉状态测试', () => {
|
||||
// 固定头部压在卡片上的像素位置就跟着挪 —— 元素截图不再稳定(webkit 捕获高 1636→1638,
|
||||
// chromium 831 像素差)。这类「截什么取决于前面有多高」的捕获不叫守卫,叫脆。
|
||||
// 修法是把落点钉死:卡片顶边滚到「固定头部下沿 + 8px」,与页面总高解耦。
|
||||
//
|
||||
// 2026-12-01 二次修正:原来取的是 `header.height + 8`,但头部是**内缩浮条**
|
||||
// (top 48 / 高 64,见 ADR-0012),它的下沿在 112 而不是 72 —— 卡片顶边因此被压在
|
||||
// 半透明模糊条底下,截图会拍到条子后面**透出来的页面内容**。本轮 products 页改了内容,
|
||||
// 这层透出的像素就变了(831 px / 0.01),红在「截到了背景」而不是「卡片变了」。
|
||||
// 改取 `rect.bottom + 8`,卡片整体落在浮条下方,截图与页面背景彻底解耦。
|
||||
await card.evaluate((el) => {
|
||||
const header = document.querySelector('header');
|
||||
const offset = (header?.getBoundingClientRect().height ?? 0) + 8;
|
||||
const rect = header?.getBoundingClientRect();
|
||||
const offset = (rect ? rect.bottom : 0) + 8;
|
||||
const top = el.getBoundingClientRect().top + window.scrollY - offset;
|
||||
window.scrollTo(0, Math.max(0, top));
|
||||
window.scrollTo(0, Math.max(0, Math.round(top)));
|
||||
});
|
||||
await page.waitForTimeout(250);
|
||||
await expect(card).toHaveScreenshot('product-card.png');
|
||||
|
||||
|
Before Width: | Height: | Size: 972 KiB After Width: | Height: | Size: 551 KiB |
|
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 346 KiB |
|
Before Width: | Height: | Size: 705 KiB After Width: | Height: | Size: 336 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 692 KiB After Width: | Height: | Size: 326 KiB |
|
Before Width: | Height: | Size: 858 KiB After Width: | Height: | Size: 494 KiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 912 KiB After Width: | Height: | Size: 575 KiB |
|
Before Width: | Height: | Size: 1017 KiB After Width: | Height: | Size: 586 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 599 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 623 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 617 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 729 KiB |
|
Before Width: | Height: | Size: 955 KiB After Width: | Height: | Size: 543 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 679 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 689 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 753 KiB |
|
Before Width: | Height: | Size: 1004 KiB After Width: | Height: | Size: 661 KiB |
|
Before Width: | Height: | Size: 989 KiB After Width: | Height: | Size: 643 KiB |
|
Before Width: | Height: | Size: 990 KiB After Width: | Height: | Size: 647 KiB |
|
Before Width: | Height: | Size: 983 KiB After Width: | Height: | Size: 639 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 650 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 825 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 843 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 830 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 841 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 844 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 845 KiB |
|
Before Width: | Height: | Size: 890 KiB After Width: | Height: | Size: 579 KiB |
|
Before Width: | Height: | Size: 1018 KiB After Width: | Height: | Size: 624 KiB |
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 3.0 MiB |
|
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 2.6 MiB |
|
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 3.0 MiB After Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 935 KiB |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 942 KiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 852 KiB |
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 4.2 MiB After Width: | Height: | Size: 3.2 MiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 2.6 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 744 KiB |
|
Before Width: | Height: | Size: 939 KiB After Width: | Height: | Size: 471 KiB |
|
Before Width: | Height: | Size: 1018 KiB After Width: | Height: | Size: 460 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 971 KiB After Width: | Height: | Size: 417 KiB |