refactor(detail): 退役遗留 DetailHero,换 DetailPageHero(P5)
遗留 `detail-hero.tsx` 只剩 2 个调用点(products/erp-upgrade-v3、products/standalone/[id]),
但它身上有四处与 DESIGN.md / ADR-0008 直接冲突的做法:
· min-h-[700px]:DESIGN 明写叶子详情页是紧凑引言(无 min-h、py-16 sm:py-20 lg:py-28),
旧实现按首页宣言档在做;
· rounded-full 胶囊徽章 / bg-brand-section 满幅红面;
· Sparkles 图标 + blur(8px)→0 装饰模糊 + delay 1.5 的滚动提示;
· staggerChildren 的 0.05/0.25/0.4/0.55 四段级联。
新的 DetailPageHero 借用 v17 首页已验收的语法:白底、左对齐、字重 700、实心+描边两轨 CTA、
无模糊无延迟。产品线色相(7 个受控例外)的落点从"胶囊底纹"改为 **eyebrow 3px 短线** ——
身份保留,可见面积从视口 0.538% 降到发丝级,不再需要 6.3% alpha 去"不刺眼"。
同时清理
- 删 detail-hero.tsx、barrel 导出、detail.test.tsx 里 11 条 DetailHero 用例(−10 例)。
- 新增 detail-page-hero.test.tsx 5 例,其中 1 例是**旧实现的回归防线**:
断言不回到满幅红面 / 700px 宣言档 / blur 入场 / 1.x 秒延迟(只删文件不写防线,
下一个"重构"就会把它抄回来)。
- hero-themes.ts 退役 6 个死字段(texture / layout / gradientFrom / gradientTo /
gradientAngle / accentBg)+ HeroTexture / HeroLayout 两个类型:全仓零消费。
`HeroTheme` 现在只剩 { id, name, accentColor, badge } —— 与它实际被读的字段一致。
- check:accents 判据 B 的透传点从旧 hero 迁到 detail-page-hero(同批改登记,
否则旧条目命中 0 会判"豁免腐化"红)。
顺带修掉一处**静默死类名**:旧 hero 用的 `container-wide` 在全仓从未定义
(privacy / terms / not-found 也在用),所以首屏内容实际上贴左边缘。
新组件改用真实存在的 `container-x`。那三处遗留的不在本片范围,已登记不擅改。
补上一个真实覆盖缺口
- `/products/erp-upgrade-v3` 是遗留 hero 的调用点之一,但视觉表里从来没有它;
磁盘上 5 张 `product-erp-upgrade-v3-*` 基线是**孤儿**(有文件、无用例)。
本片把它接进 VISUAL_TEST_PAGES,用 changed 复用同名文件重生成,孤儿基线复活成有效基线。
**不可观测且不假装有**:`/products/standalone/[id]` 在 seed 库里没有行,
generateStaticParams 产出为空 ⇒ 该路由 404。它的迁移只有类型检查 + 组件单测覆盖。
验证
- type-check EXIT=0;jest 156 套件 / 1844 例(净 −10 旧用例 +5 新用例)全通过
- check:grammar 19/19、check:accents(含腐化守卫)、check:a11y、check:motion 全 EXIT=0
- e2e(prod) @smoke|@critical chromium:21 passed
- 视觉:--workers=2 只读复跑 125 passed / 0 failed;新增的 v3 用例 5/5 通过
一条会咬人的运维事实(写进 docs/acceptance/)
- 只读复跑时 /news 在 5 个 project 一致判红,查明不是回归:E2E 写库用例建的
「E2E 测试新闻」行在 build 那一刻还在,被烤进了 news 的预渲染 HTML
(grep 产物 = 2 命中,而库里只有 2 条真实新闻)。重建后产物 0 命中、5/5 通过。
**没有重采那 5 张** —— 重采等于把测试数据写进基线。
纪律:先跑写库型 E2E 再 build,反过来就会污染产物。
This commit is contained in:
1 parent
7bb701d55f
commit
b31b428e88
18 files changed
+235
-441
No files matched your search
@@ -1,21 +1,7 @@
|
||||
export type HeroLayout = 'left' | 'center' | 'wide' | 'icon-left';
|
||||
|
||||
export interface HeroTexture {
|
||||
type: 'grid' | 'data-flow' | 'layers' | 'shield-hex' | 'circuit' | 'none';
|
||||
opacity: number;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
export interface HeroTheme {
|
||||
id: string;
|
||||
name: string;
|
||||
gradientFrom: string;
|
||||
gradientTo: string;
|
||||
gradientAngle: number;
|
||||
accentColor: string;
|
||||
accentBg: string;
|
||||
texture: HeroTexture;
|
||||
layout: HeroLayout;
|
||||
badge?: string;
|
||||
}
|
||||
|
||||
@@ -23,131 +9,65 @@ export const HERO_THEMES: Record<string, HeroTheme> = {
|
||||
erp: {
|
||||
id: 'erp',
|
||||
name: 'ERP',
|
||||
gradientFrom: '#f8f6f3',
|
||||
gradientTo: '#f0ebe4',
|
||||
gradientAngle: 135,
|
||||
accentColor: '#1e3a5f',
|
||||
accentBg: 'rgba(30, 58, 95, 0.06)',
|
||||
texture: { type: 'grid', opacity: 0.03 },
|
||||
layout: 'left',
|
||||
badge: '企业套装',
|
||||
},
|
||||
crm: {
|
||||
id: 'crm',
|
||||
name: 'CRM',
|
||||
gradientFrom: '#f7f5f2',
|
||||
gradientTo: '#eee9e2',
|
||||
gradientAngle: 120,
|
||||
accentColor: '#1e40af',
|
||||
accentBg: 'rgba(30, 64, 175, 0.06)',
|
||||
texture: { type: 'layers', opacity: 0.03 },
|
||||
layout: 'left',
|
||||
badge: '企业套装',
|
||||
},
|
||||
bi: {
|
||||
id: 'bi',
|
||||
name: 'BI',
|
||||
gradientFrom: '#FAF8F4',
|
||||
gradientTo: '#EFEAE1',
|
||||
gradientAngle: 145,
|
||||
accentColor: '#0c4a6e',
|
||||
accentBg: 'rgba(12, 74, 110, 0.06)',
|
||||
texture: { type: 'data-flow', opacity: 0.03 },
|
||||
layout: 'left',
|
||||
badge: '企业套装',
|
||||
},
|
||||
cms: {
|
||||
id: 'cms',
|
||||
name: 'CMS',
|
||||
gradientFrom: '#f5f8f5',
|
||||
gradientTo: '#eaf0ea',
|
||||
gradientAngle: 130,
|
||||
accentColor: '#14532d',
|
||||
accentBg: 'rgba(20, 83, 45, 0.06)',
|
||||
texture: { type: 'layers', opacity: 0.03 },
|
||||
layout: 'left',
|
||||
badge: '企业套装',
|
||||
},
|
||||
sds: {
|
||||
id: 'sds',
|
||||
name: 'SDS',
|
||||
gradientFrom: '#faf7f4',
|
||||
gradientTo: '#f3ede5',
|
||||
gradientAngle: 140,
|
||||
accentColor: '#78350f',
|
||||
accentBg: 'rgba(120, 53, 15, 0.06)',
|
||||
texture: { type: 'data-flow', opacity: 0.03 },
|
||||
layout: 'left',
|
||||
badge: '企业套装',
|
||||
},
|
||||
oa: {
|
||||
id: 'oa',
|
||||
name: 'OA',
|
||||
gradientFrom: '#f7f5fa',
|
||||
gradientTo: '#efeaf5',
|
||||
gradientAngle: 125,
|
||||
accentColor: '#4c1d95',
|
||||
accentBg: 'rgba(76, 29, 149, 0.06)',
|
||||
texture: { type: 'grid', opacity: 0.03 },
|
||||
layout: 'left',
|
||||
badge: '企业套装',
|
||||
},
|
||||
novavis: {
|
||||
id: 'novavis',
|
||||
name: 'NovaVis',
|
||||
gradientFrom: '#f4fafa',
|
||||
gradientTo: '#e8f3f3',
|
||||
gradientAngle: 150,
|
||||
accentColor: '#0f3d3e',
|
||||
accentBg: 'rgba(15, 61, 62, 0.06)',
|
||||
texture: { type: 'data-flow', opacity: 0.04 },
|
||||
layout: 'wide',
|
||||
badge: '专业产品',
|
||||
},
|
||||
solution: {
|
||||
id: 'solution',
|
||||
name: '解决方案',
|
||||
gradientFrom: '#f8f6f3',
|
||||
gradientTo: '#f0ebe4',
|
||||
gradientAngle: 150,
|
||||
accentColor: '#C41E3A',
|
||||
accentBg: 'rgba(196, 30, 58, 0.06)',
|
||||
texture: { type: 'circuit', opacity: 0.02 },
|
||||
layout: 'center',
|
||||
},
|
||||
service: {
|
||||
id: 'service',
|
||||
name: '服务',
|
||||
gradientFrom: '#f7f5f2',
|
||||
gradientTo: '#eee9e2',
|
||||
gradientAngle: 135,
|
||||
accentColor: '#C41E3A',
|
||||
accentBg: 'rgba(196, 30, 58, 0.06)',
|
||||
texture: { type: 'none', opacity: 0 },
|
||||
layout: 'icon-left',
|
||||
},
|
||||
security: {
|
||||
id: 'security',
|
||||
name: '安全产品',
|
||||
gradientFrom: '#faf5f5',
|
||||
gradientTo: '#f5eded',
|
||||
gradientAngle: 135,
|
||||
accentColor: '#991b1b',
|
||||
accentBg: 'rgba(153, 27, 27, 0.06)',
|
||||
texture: { type: 'shield-hex', opacity: 0.03 },
|
||||
layout: 'wide',
|
||||
badge: '安全合规',
|
||||
},
|
||||
default: {
|
||||
id: 'default',
|
||||
name: '默认',
|
||||
gradientFrom: '#f8f6f3',
|
||||
gradientTo: '#f0ebe4',
|
||||
gradientAngle: 140,
|
||||
accentColor: '#C41E3A',
|
||||
accentBg: 'rgba(196, 30, 58, 0.06)',
|
||||
texture: { type: 'none', opacity: 0 },
|
||||
layout: 'left',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export type { TeamMember } from './team';
|
||||
export { METHODOLOGY, type MethodologyPhase } from './methodology';
|
||||
export { SOLUTIONS, type Solution } from './solutions';
|
||||
export { CASE_INDUSTRIES, type CaseStudy, type CaseMetric, type CaseTimelinePhase, type CaseService, type CaseTestimonial } from './cases';
|
||||
export { HERO_THEMES, getHeroTheme, type HeroTheme, type HeroLayout, type HeroTexture } from './hero-themes';
|
||||
export { HERO_THEMES, getHeroTheme, type HeroTheme } from './hero-themes';
|
||||
export { IMAGE_RATIOS, aspectStyle, aspectWidthStyle, type ImageRatio } from './image-ratios';
|
||||
export { getProductCrossRefs, getSolutionCrossRefs, getServiceCrossRefs, type CrossReference } from './cross-references';
|
||||
export {
|
||||
|
||||
Reference in new issue
Block a user