feat(hub): 首屏改 A 类影像片,覆盖 18/20 条路由(OPEN-01 终版)
第一版按 ADR-0011 §4.2 做的 B 类矢量原语(层叠体块 + 水平线)上线前被用户否决: 「右侧的矩形条是什么设计?有出处吗?不太好看呢」。复盘是语义错位——浅底上的 灰阶堆叠读成骨架屏/条形图,不是建筑;建筑感来自透视与材质,矢量剪影给不了。 这与 ADR-0011 §2.4 记的 brand-visuals 抽象几何被弃是同一个坑。 改判走 A 类本地生成影像,并相应修订 ADR-0011 §4.1(A 类允许进首屏引言区的构图位)。 - 新增 ui/hero-plate.tsx + 四张 4:5 建筑静帧(facade/glass/hall/truss, 1000x1250 webp,97–199KB/张),均为抽象结构、无人物/无文字/无标识/无地标 - 覆盖 16 个文件 / 18 条路由:六 hub、四类详情、关于/团队/方法论/联系、ERP 专题、 详情页共享壳;排除 /privacy /terms(法律文本)与 /cases/[slug](零数据 + 大数字构图) - R22 改为守 <HeroPlate 或 <Image>,仍 22/22 + 四向自证 - 撤除 span-field.tsx / span-field.test.tsx - 基线:受影响 24 页 × 5 project 全量重采(157 张),只读复跑 225 passed / 0 failed 门禁:type-check 0 · lint 0 error/88 warning · jest 160 套件/1887 例 (89.90/88.47/89.57/89.90)· grammar 22/22 · accents 违规 0 · a11y 34 页 0 问题 · security 8/8 · e2e:fast 59 passed(firefox 已恢复)· lighthouse 33 次运行全通过 (a11y 11/11 均 100,perf 97–100,SEO 100)
This commit is contained in:
1 parent
a17fd6f4ab
commit
84ac9b2123
186 files changed
+337
-311
No files matched your search
@@ -53,20 +53,38 @@ const HOVER_LIFT_CEILING = 28;
|
||||
const EXTERNAL_OWNED = ["--radix-accordion-content-height"];
|
||||
|
||||
/**
|
||||
* R22 的六个落点:ADR-0011 §4.2 指定的「hub 六页引言区各一处原语」。
|
||||
* R22 的落点:ADR-0011 §4.2 的「六页 hub × 一组参数」在 2026-12-01 扩到**全部营销页首屏**。
|
||||
*
|
||||
* 为什么这条判据存在:`OPEN-01` 的验收判据①是「六页首屏有 B 类原语且承担构图」。
|
||||
* 没有这条闸时,判据只活在 ADR 文字里 —— 把六处 `<SpanField>` 删掉,R12–R21 全绿,
|
||||
* 于是「复刻完成」可以在一夜之间退回「六张白底文字块」而没有任何仪器喊。
|
||||
* 为什么这条判据存在:`OPEN-01` 的验收判据①是「首屏有 B 类原语且承担构图」。
|
||||
* 没有这条闸时,判据只活在 ADR 文字里 —— 把原语删掉,R12–R21 全绿,
|
||||
* 于是「复刻完成」可以在一夜之间退回「白底文字块」而没有任何仪器喊。
|
||||
* 分母为 0(路径全改)按「判据失去目标」判红,而不是静默通过。
|
||||
*
|
||||
* 不在此列的两类(有意排除,不是漏):
|
||||
* - `/privacy` `/terms`:法律文本页,排版服从可读性,不宜插装饰位;
|
||||
* - `/cases/[slug]`:首屏是 Bain 式「大数字先行」构图,且零案例种子下不可达,
|
||||
* 换了构图也没有可观测收益 —— 待有真实案例后按需并入。
|
||||
*/
|
||||
const HUB_HERO_FILES = [
|
||||
// 六个 hub
|
||||
"src/app/(marketing)/products/products-content-v3.tsx",
|
||||
"src/app/(marketing)/solutions/solutions-content-v3.tsx",
|
||||
"src/app/(marketing)/services/services-content-v3.tsx",
|
||||
"src/app/(marketing)/cases/cases-content-v3.tsx",
|
||||
"src/app/(marketing)/news/news-content-v3.tsx",
|
||||
"src/app/(marketing)/insights/insights-content.tsx",
|
||||
// 详情页(共享组件覆盖 standalone/[id] 与 erp-upgrade-v3)
|
||||
"src/components/detail/detail-page-hero.tsx",
|
||||
"src/app/(marketing)/products/product-detail-content-v3.tsx",
|
||||
"src/app/(marketing)/solutions/solution-detail-content-v3.tsx",
|
||||
"src/app/(marketing)/services/service-detail-content-v4.tsx",
|
||||
"src/app/(marketing)/news/news-detail-content-v3.tsx",
|
||||
// 内容页
|
||||
"src/app/(marketing)/about/about-content-v4.tsx",
|
||||
"src/app/(marketing)/team/team-content-v3.tsx",
|
||||
"src/app/(marketing)/methodology/methodology-content.tsx",
|
||||
"src/app/(marketing)/contact/contact-content-v3.tsx",
|
||||
"src/app/(marketing)/products/erp-upgrade/erp-upgrade-content-v2.tsx",
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -636,11 +654,13 @@ function checkGrammar(rawText, rawFiles, twConfig = "", opts = {}) {
|
||||
/**
|
||||
* R22 hub 六页首屏必须有构图支点(ADR-0011 §5 判据①)。
|
||||
*
|
||||
* 判「有」的两种形态:B 类原语 `<SpanField`(本仓采纳的路线)或 `<Image`(A 类本地生成图)。
|
||||
* 两条都算,是因为 ADR 只禁止 C/D 类,没有禁止「哪天真做了 A 类图」。
|
||||
* 判「有」的两种形态:`<HeroPlate`(A 类影像片,2026-12-01 起的路线)或 `<Image`(页面自带的影像)。
|
||||
* 两条都算,是因为 ADR 只禁止 C/D 类,没有禁止页面自己接一张图。
|
||||
* 历史:本条最初守的是 B 类矢量原语 `<SpanField`;该形态因「灰阶堆叠读成骨架屏」
|
||||
* 被用户否决并撤除,判据随之改为守影像片 —— 闸要守的是「首屏有构图支点」,不是某一种实现。
|
||||
*
|
||||
* 为什么必须先剥注释:本仓踩过——`constants.ts` 注释里的示例 import 骗过了
|
||||
* `export { … } from` 正则。这里同理:一段被注释掉的 `<SpanField>` 不该算作构图支点。
|
||||
* `export { … } from` 正则。这里同理:一段被注释掉的 `<HeroPlate>` 不该算作构图支点。
|
||||
*
|
||||
* 为什么分母按「找到几页」而不是恒定 6:路径改名时若照常除以 6,一条红都不会出,
|
||||
* 判据就变成了空转。缺页本身判红,与 R13 的 `MARKETING_FLOOR` 同一纪律。
|
||||
@@ -650,15 +670,15 @@ function checkGrammar(rawText, rawFiles, twConfig = "", opts = {}) {
|
||||
const r22Red = [];
|
||||
for (const rel of hubPresent) {
|
||||
const src = stripComments(files.get(rel) ?? "", { line: true });
|
||||
if (!/<SpanField\b|<Image\b/.test(src)) {
|
||||
r22Red.push(`${rel}:首屏既无 <SpanField> 也无 <Image> —— 该页退回「白底文字块」,构图支点缺失`);
|
||||
if (!/<HeroPlate\b|<Image\b/.test(src)) {
|
||||
r22Red.push(`${rel}:首屏既无 <HeroPlate> 也无 <Image> —— 该页退回「白底文字块」,构图支点缺失`);
|
||||
}
|
||||
}
|
||||
if (hubPresent.length < hubFloor) {
|
||||
r22Red.push(`hub 首屏只找到 ${hubPresent.length}/${hubFloor} 页 —— 路径改名或文件被移动,本条对缺的那几页空转`);
|
||||
r22Red.push(`营销页首屏只找到 ${hubPresent.length}/${hubFloor} 页 —— 路径改名或文件被移动,本条对缺的那几页空转`);
|
||||
}
|
||||
rule({ id: "R22", name: "hub 六页首屏必须有构图支点(B 类原语或影像)", denominator: hubPresent.length, red: r22Red,
|
||||
note: `找到 ${hubPresent.length}/${HUB_HERO_FILES.length} 页 · 判据 = 非注释行内出现 <SpanField 或 <Image` });
|
||||
rule({ id: "R22", name: "营销页首屏必须有构图支点(影像片)", denominator: hubPresent.length, red: r22Red,
|
||||
note: `找到 ${hubPresent.length}/${HUB_HERO_FILES.length} 页 · 判据 = 非注释行内出现 <HeroPlate 或 <Image` });
|
||||
|
||||
return results;
|
||||
}
|
||||
@@ -724,10 +744,10 @@ function selftest() {
|
||||
|
||||
/**
|
||||
* R22 双向自证:六页都带原语 ⇒ 不判红;抽掉任意一页 ⇒ **恰好**判那一页。
|
||||
* 第三维单独测「注释掉的 <SpanField> 不算数」—— 这是本仓踩过的同一类坑
|
||||
* 第三维单独测「注释掉的 <HeroPlate> 不算数」—— 这是本仓踩过的同一类坑
|
||||
* (`constants.ts` 注释里的示例 import 曾骗过再导出正则)。
|
||||
*/
|
||||
const hubSrc = "export function Hero(){ return (<div><SpanField layers={5} /></div>); }";
|
||||
const hubSrc = 'export function Hero(){ return (<div><HeroPlate variant="facade" /></div>); }';
|
||||
const hubBare = "export function Hero(){ return (<div>纯白底文字块</div>); }";
|
||||
// 「文件在、原语没了」= 单页判红;「文件本身缺了」= 分母缩水,靠 hubFloor 判。
|
||||
// 两种失败形态分开测,否则一条闸看起来只防住了其中一半。
|
||||
@@ -738,7 +758,7 @@ function selftest() {
|
||||
const r22Clean = r22RedFor(hubMapWithHole(null), { hubFloor: 0 });
|
||||
const r22Hole = r22RedFor(hubMapWithHole(HUB_HERO_FILES[0]), { hubFloor: 0 });
|
||||
const r22Commented = r22RedFor(
|
||||
new Map(HUB_HERO_FILES.map((rel, i) => [rel, i === 0 ? "// <SpanField layers={5} />" : hubSrc])),
|
||||
new Map(HUB_HERO_FILES.map((rel, i) => [rel, i === 0 ? '// <HeroPlate variant="facade" />' : hubSrc])),
|
||||
{ hubFloor: 0 },
|
||||
);
|
||||
// 只给 5 页、地板仍是 6 ⇒ 必须判「对缺的那页空转」
|
||||
@@ -749,14 +769,14 @@ function selftest() {
|
||||
const r22Catches = r22Hole.length === 1 && r22Hole[0].includes(HUB_HERO_FILES[0]);
|
||||
const r22Ignores = r22Clean.length === 0;
|
||||
const r22StripsComments = r22Commented.length === 1 && r22Commented[0].includes(HUB_HERO_FILES[0]);
|
||||
const r22Floor = r22Short.length === 1 && r22Short[0].includes("5/6");
|
||||
const r22Floor = r22Short.length === 1 && r22Short[0].includes(`5/${HUB_HERO_FILES.length}`);
|
||||
if (!r22Catches || !r22Ignores || !r22StripsComments || !r22Floor) {
|
||||
console.log(
|
||||
` ✗ R22 不自证:缺原语判红 ${r22Catches}、齐全不误报 ${r22Ignores}、注释不算数 ${r22StripsComments}、缺页判红 ${r22Floor} ⇒ 这条闸没有约束力`,
|
||||
` ✗ R22 不自证:缺影像判红 ${r22Catches}、齐全不误报 ${r22Ignores}、注释不算数 ${r22StripsComments}、缺页判红 ${r22Floor} ⇒ 这条闸没有约束力`,
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
console.log(" ✓ R22 四向:缺原语判红、六页齐全不误报、注释不算数、缺页按分母缩水判红");
|
||||
console.log(" ✓ R22 四向:缺影像判红、全页齐全不误报、注释不算数、缺页按分母缩水判红");
|
||||
|
||||
// R10 单独两侧自证:它是存量棘轮,判据是「数量 > 上限」,所以负例要按数量构造。
|
||||
// 用真实 globals.css 做底,避免其它规则的红因混进来干扰这一维的读数。
|
||||
|
||||
Reference in new issue
Block a user