feat(detail): 承载详情页接上反伪造成果槽,并修掉三处校验/注释位置缺陷

tracer-bullet 的第二半:/solutions/manufacturing(计划 §8 选的承载页)。

- ResultsSlot 上到详情页,与首页**同一个**插槽实现 —— 不再出现"首页说不存在、
  详情页却端出一个像案例的东西"两套空态语法的分裂。
- 5 处 text-[11px] tracking-[0.4em] 收进记档(--letter-spacing-widest = 0.12em)。
  第一遍我只改了 CTA 那一处,剩下的在同一次提交里查出来 —— 同一页留 4 处一模一样
  的裸字面量,等于把不一致写进"一致性"这笔改动里。
- 套件组合图的中心节点由装饰圆改方角牌:rounded-full 只承载功能性的圆,
  这条区分是 check:grammar R2/R9 的正向守卫。
- Hero 容器 py-20/24/28/32 与 min-h-[80vh] 叠加收成两档(审计 P2-3 的 200px+ 空白成因),
  并顺手去掉 max-w-container + mx-auto 与 .container-x 的重复(两套 gutter 同时在线)。

三处由"跑一遍"才发现、静态检查全绿时看不见的缺陷:

1) **校验位置错在数据出口的下游**。我自己的用例抓到:h2 标题取 caseItem.result
   (Bain 的"标题即成果"写法),而 ReadyCard 在 h2 **之后**才渲染 —— 只在卡片层设闸的话,
   卡片被拦下、页面大标题仍在喊那个没验证过的数字,整条不变量被绕过。
   ⇒ 判据上移到 ResultsSlot 决定标题之前。判据要放在离数据出口最近的地方。

2) **渲染期抛错把内容事故升级成可用性事故**。原本 ready 态校验不过就 throw。
   仓库既有的 solution-detail 用例(喂了一条没有 verified、没有证言署名、
   没有任何 verified 指标的案例)当场把它引爆:一条没填全的后台数据 = 整条详情页 500。
   ⇒ 改为降级成看得见的 blocked 空态 + console.error 喊出原因。
   fail-closed 的正确形态是"这一格不展示成果",不是炸页面。
   顺带查出一个更大的既有缺口(本笔**未**修,见下)。

3) **JSX 注释的合法位置**。我把一条解释性注释放进三元分支的根位置 ⇒
   "一个表达式两个子节点",Turbopack 报 Expected '</', got 'ident' 直接打挂构建。
   而这一刻 tsc EXIT=0、jest 1834 例全过 —— 与上一笔的重复定义同源:
   **类型检查和单测都不代表能构建**。本笔再次实跑 npm run build 才拿到红。

既有缺口(本笔不修,需单独立项):
  仓库原有的 CaseStudiesSection / detail-trust-section 对 case-study 数据**完全没有任何
  授权或 basis 闸门** —— 它才是详情页真正渲染案例列表的那个组件,ResultsSlot 只是我新增的
  成果格。也就是说"给案例加反伪造判据"这件事只覆盖了一半:新插槽有闸,旧列表没闸。
  同一批 solution.caseStudies 会同时喂给两边,行为还不一致。修法要把判据推到
  CaseStudiesSection 与 CMS 写入侧(发布 case-study 时就校验),比本笔的改动面大,
  已记入台账待办,不留在这条提交里悄悄算完成。

门禁实测:type-check EXIT=0 · **npm run build EXIT=0**(同一缺陷修完后重跑一次,
构建产物含 /insights 静态预渲染、dist/static+public 已装配)·
全量 jest 148 套件 / 1834 例通过 · check:grammar 9/9 与 selftest 9/9 ·
token-twins 44/44 · contrast 44/44 · brand-token 0 违规 · check:motion 22(未新增)·
dev 真实渲染 /solutions/manufacturing HTTP=200,成果槽落 co-creation、透明承诺在场

KNOWN-RED: test:visual —— 详情页 Hero 留白、eyebrow 字距、套件节点形状变更,
solution-manufacturing × 5 project 基线预期 churn;仍按计划统一到 #10 一次性重捕。
This commit is contained in:
zhangxiang committed 2026-10-16 21:10:16 +08:00
1 parent 9083509df2
commit d9f9ee77cf
3 files changed
+102 -18

No files matched your search

@@ -8,6 +8,16 @@ import { Factory, ShoppingCart, Heart, GraduationCap, Lightbulb, Settings, Users
import type { Solution } from '@/lib/constants/solutions';
import type { Product } from '@/lib/constants/products';
import { L3EmptyFallback, CaseStudiesSection, CertificationsSection } from '@/components/detail';
import { ResultsSlot } from '@/components/sections/results-slot';
import type { CaseStudy } from '@/lib/constants/cases';
/** 共创阶段的可验证事实 —— 与首页同一份语义,不冒充案例 */
const CO_CREATION_STEPS = [
{ label: '问题梳理', desc: '把该行业的业务断点写成书面诊断' },
{ label: '小步验证', desc: '在一个可衡量的范围内先跑通' },
{ label: '交付物验收', desc: '每阶段有明确交付物与验收指标' },
{ label: '能力交接', desc: '把维护能力留在企业内部' },
];
const INDUSTRY_ICONS: Record<string, React.ReactNode> = {
制造业: <Factory className="w-8 h-8" />,
@@ -42,7 +52,12 @@ function DetailHero({ solution }: DetailHeroProps) {
return (
<section className="relative min-h-[80vh] flex items-center overflow-hidden bg-bg-primary pt-24">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-20 sm:py-24 md:py-28 lg:py-32">
{/* 原来 py-20/24/28/32 与 min-h-[80vh] 叠加,是审计 P2-3 记的「Hero 后 200px+ 空白」
的成因:容器已经撑到 80vh,内部再加最高 128px 上下内边距 ⇒ 纯空。收成两档。
顺带收成单一容器 primitive:max-w-container + mx-auto + 三档 px 与 .container-x
本身重复(它已含 width/max-width/margin/padding),两套 gutter 同时在线是
计划 §6.5 点名的病。 */}
<div className="container-x relative z-10 w-full py-14 md:py-20">
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
@@ -154,7 +169,9 @@ function SolutionsSection({ solutions }: SolutionsSectionProps) {
<SectionLabel className="justify-center">
<div className="flex items-center gap-5">
<div className="w-14 h-px bg-brand" />
<span className="text-[11px] tracking-[0.4em] uppercase font-bold text-brand-ink">
/* tracking-[0.4em] 是记档外的裸字面量(--letter-spacing-widest = 0.12em);
近单色对标的按钮/eyebrow 实测 letterSpacing: normal。收到记档里。 */
<span className="text-xs tracking-widest uppercase font-bold text-brand-ink">
Solutions
</span>
<div className="w-14 h-px bg-brand" />
@@ -209,7 +226,7 @@ function ValuePropositionSection({ valueProposition }: ValuePropositionProps) {
<SectionLabel className="justify-center">
<div className="flex items-center gap-5">
<div className="w-14 h-px bg-brand" />
<span className="text-[11px] tracking-[0.4em] uppercase font-bold text-brand-ink">
<span className="text-xs tracking-widest uppercase font-bold text-brand-ink">
Value Proposition
</span>
<div className="w-14 h-px bg-brand" />
@@ -264,7 +281,7 @@ function SuiteCombinationSection({ suiteCombination, products }: SuiteCombinatio
<SectionLabel className="justify-center">
<div className="flex items-center gap-5">
<div className="w-14 h-px bg-brand" />
<span className="text-[11px] tracking-[0.4em] uppercase font-bold text-brand-ink">
<span className="text-xs tracking-widest uppercase font-bold text-brand-ink">
Suite Combination
</span>
<div className="w-14 h-px bg-brand" />
@@ -298,7 +315,9 @@ function SuiteCombinationSection({ suiteCombination, products }: SuiteCombinatio
</StaggerReveal>
<ScrollReveal delay={0.2} className="flex items-center justify-center lg:col-span-1 bg-bg-elevated">
<div className="w-20 h-20 rounded-full bg-brand-soft/30 border-2 border-brand/30 flex items-center justify-center text-brand-ink font-bold text-xl">
/* 装饰圆改方角牌:rounded-full 只留给功能性的圆(头像/开关钮/滑块),
这是套件组合图的中心节点装饰,两家对标实测都没有装饰性圆形 */
<div className="w-20 h-20 rounded-cta bg-brand-soft border border-border-rule flex items-center justify-center text-brand-ink font-bold text-xl">
+
</div>
</ScrollReveal>
@@ -322,7 +341,7 @@ function SuiteCombinationSection({ suiteCombination, products }: SuiteCombinatio
<ScrollReveal>
<div className="p-10 bg-bg-secondary text-center border border-border-primary">
<div className="text-[11px] tracking-[0.4em] uppercase font-bold text-brand-ink mb-4">
<div className="text-xs tracking-widest uppercase font-bold text-brand-ink mb-4">
方案价值
</div>
<p className="text-xl lg:text-2xl text-ink leading-relaxed max-w-4xl mx-auto font-medium">
@@ -354,7 +373,7 @@ function CTASection({ solution }: CTASectionProps) {
<div className="flex justify-center mb-7">
<div className="flex items-center gap-5">
<div className="w-14 h-px bg-brand" />
<span className="text-[11px] tracking-[0.4em] uppercase font-bold text-brand-ink">
<span className="text-xs tracking-widest uppercase font-bold text-brand-ink">
Get Started
</span>
<div className="w-14 h-px bg-brand" />
@@ -400,6 +419,21 @@ export default function SolutionDetailContentV3({ solution, products = [] }: Sol
<L3EmptyFallback caseStudies={solution.caseStudies} certifications={solution.certifications} />
<CaseStudiesSection caseStudies={solution.caseStudies} heading="同行业落地案例" />
<CertificationsSection certifications={solution.certifications} />
{/* L3.5 客户成果槽:与首页同一个 ResultsSlot —— 空态、待授权、可发布三态
只有一份实现,不会出现"首页说不存在、详情页却端出一个像案例的东西"。
caseStudies 里的行必须过 assertCaseIsPublishable(verified + 署名 + 已验证指标)
才允许走 ready,否则组件直接抛。 */}
<ResultsSlot
state={
(solution.caseStudies?.length ?? 0) > 0
? { kind: 'ready', caseItem: solution.caseStudies![0] as unknown as CaseStudy }
: { kind: 'co-creation', steps: CO_CREATION_STEPS }
}
heading="同行业成果"
href={`/insights?kind=cases&industry=${encodeURIComponent(solution.industry ?? '')}`}
/>
<CTASection solution={solution} />
</div>
);