feat(ia): 一级导航改对标双轴(行业 × 能力 + 洞察),并把导航真源从 DB 行反转为代码
依据实测:Bain 一级导航 = Industries · Consulting Services · Digital · Insights · About · Careers,
Porsche = 行业 · 实践 · 洞察 · 职业 · 关于我们 —— **两家的导航里都没有「产品」**。
咨询业按「客户的问题空间 × 本所的能力」组织,不按产品 SKU 组织。本仓此前 7 项里
产品居首,且 案例(case-study 0 行)、新闻动态(2 行) 是挂在骨架上的空渠道。
落地策略是**换标签、不换路由**:行业→既有 /solutions(solution 模型本就是行业),
能力→既有 /services(service 模型的 4 行本就是能力组)。
理由不是省事,而是避免制造重复内容:若新增 /capabilities 与 /services 并行,
同一个 ContentItem 会同时挂在两个 URL 下 —— 那是 canonical 冲突,比不改更糟。
URL 改名 + 308 留给第二批一次性处理。唯一真正新增的面是 /insights:
它聚合 news + methodology + case-study,今天没有任何单一页面做过这件事,故不构成重复。
「轴 = 视图,模型 = 真源」:本轮零新 ContentModel、零 schema、零 seed 权限测试改动。
沿用 solution/service/product 三个 code ⇒ src/lib/seed-permissions.test.ts:50 的
SUPER_ADMIN_ONLY_MODELS 断言保持绿。**这是设计选择的回报,不是没做事。**
最关键的一处:反转导航优先级
layout.tsx 原为 `(navData?.mainNav) || NAVIGATION_V2` —— **DB 行胜出、代码只兜底**。
`navigation` 的字段是泛型 json,改导航不需动 schema,听起来省事,实际是:
只改 navigation.ts 会上线一个**生产静默忽略它**的新导航。
而 footer 按 megaDropdown 的 key 取栏目 —— 新代码 key 对旧 DB key ⇒ 页脚三栏静默变空。
我在工作树里真的复现了这个状态:本地 navigation/default 行仍是旧 7 项,
它**内部完全自洽**(每个 dropdownKey 都找得到面板),所以「自洽即放行」会继续覆盖代码。
⇒ 新校验器的标准是「它是不是这套 IA」(必须覆盖 industries/capabilities/insights 三轴),
而不是「它是不是合法 JSON」。不合格则 fail-closed 到代码 + 把原因 console.warn 出来
(渲染期不写库:Notification 是后台数据,在 RSC 里写它等于给每次首页渲染挂写副作用)。
这条有专门用例:「旧 IA 的自洽配置必须被拒」。
顺带修掉两处同族缺陷
- injectStandaloneProducts 原按 `key === 'products'` 匹配;双轴改名后该 key 不存在 ⇒
独立产品会**静默不再注入**。改为按组 id(STANDALONE_GROUP_ID)找,组 id 比 key 稳定。
- 激活判定原来有**三套**:header 的 8 分支 per-id 阶梯(末尾落回 pathname===`/${item.id}`,
新 id industries 会拼出一个不存在的路由 ⇒ 行业永不高亮)、mobile-tab-bar 的 per-id
if 阶梯(改名后每项静默返回 false ⇒ tab bar 照渲染、永不高亮 = 绿但空洞)、footer 自一套。
现统一为 lib/nav-active.ts,按 segment 切(不被 /solutionship 这类同前缀误点亮)。
撤下两个空渠道入口(含一处我自己计划里的回退,已当场纠正)
- /cases 从一级导航与移动端 tab bar 撤下:case-study 0 行,点进去是空列表。
路由与模型**保留休眠**,真实授权案例到位当天即可渲染,不必二次迁移。
- 补 { id: 'all-products', href: '/products' } 进能力轴第二层:
撤「产品」时若不补这一条,/products(sitemap priority 0.9、6 个详情页的上游 hub)
就变成**没有导航入口的孤儿页** —— 那是回退不是重构。「降级」不等于「消失」,
已加守卫用例「被退出一级导航的 hub 必须在第二层仍可达」。
/insights 的三处登记(少一处就是「新页面没人扫、门禁仍然绿」的静默覆盖收缩)
- sitemap.ts:新增,priority 0.8;/news 暂留(已索引),第二批 301 归并
- check:headings 的 PAGES 列表:新增(该列表是硬编码路由清单)
- revalidate:新增 INSIGHTS_AFFECTED_MODELS(news/case-study/methodology)
—— /insights 不在 CONTENT_TYPE_CONFIGS 的任何 listPage 里,通用推导只刷 /news、
/methodology;少登记这条的后果不是报错,而是后台发了新内容、洞察页仍端出旧 ISR
快照最长 1 小时,且没有任何门禁会红。已钉 3 正向 + 1 负向(product 变更不得刷
/insights,否则该断言恒真、失去约束力)+ 1 去重。
删除 NAVIGATION(V1):7 个 href 全是 '/'、全站零生产引用,只被 constants.test.ts 供着 ——
那 4 条用例的作用是让死码看起来「有人在用」。已改写成断言活的 NAVIGATION_V2,
并保留其原有意图(每个目的地互不相同,正是 V1 缺的那条)。
KNOWN-RED: test:visual —— 一级导航 7→4、页脚三栏改标题改取数、移动端 tab bar 换轴,
header/footer 相关基线预期 churn。按计划 #10 在所有代码落地后一次性重捕(需 AUTH-VISUAL)。
待授权(本笔**未**执行,且必须执行才能对用户生效):
CMS 的 navigation/default 行仍是旧 7 项。本笔的反转校验会让它 fail-closed 到代码,
所以**新导航会立即在页面上生效**(不再被旧行遮蔽),但后台那一行要改需
`npm run db:seed`(生产为独立授权动作)。seed.ts:945 直接引用 NAVIGATION_V2,
重跑即得新行 —— 本地已复跑验证过(库内 mainNav 已是 industries/capabilities/insights)。
门禁实测:type-check EXIT=0 · 全量 jest 146 套件 / 1807 例通过 ·
eslint --quiet 改动文件 0 error · check:grammar 9/9 及其 selftest 9/9 ·
check:token-twins 44/44 · check:contrast 44/44 · check:brand-token 0 违规 ·
e2e nav-keyboard@chromium 6 passed(含 /insights 实测 HTTP 200)
This commit is contained in:
1 parent
e9bd965411
commit
7d1a22a596
23 files changed
+1083
-197
No files matched your search
@@ -1,7 +1,7 @@
|
||||
export { COMPANY_INFO, BRAND_NARRATIVE, TRUST_SIGNALS, EARLY_ACCESS } from './company';
|
||||
export type { BrandPillar } from './company';
|
||||
export { NAVIGATION, NAVIGATION_V2, MEGA_DROPDOWN_DATA } from './navigation';
|
||||
export type { NavigationItem, NavigationItemV2, MegaDropdownItem, MegaDropdownGroup, MegaDropdownData } from './navigation';
|
||||
export { NAVIGATION_V2, MEGA_DROPDOWN_DATA, MEGA_KEYS, STANDALONE_GROUP_ID } from './navigation';
|
||||
export type { NavigationItemV2, MegaDropdownItem, MegaDropdownGroup, MegaDropdownData } from './navigation';
|
||||
export { STATS, type StatItem } from './stats';
|
||||
export { SERVICES } from './services';
|
||||
export { PRODUCTS, type Product } from './products';
|
||||
|
||||
+106
-52
@@ -1,24 +1,37 @@
|
||||
export interface NavigationItem {
|
||||
id: string;
|
||||
label: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
export const NAVIGATION: NavigationItem[] = [
|
||||
{ id: 'home', label: '首页', href: '/' },
|
||||
{ id: 'services', label: '核心业务', href: '/' },
|
||||
{ id: 'solutions', label: '解决方案', href: '/' },
|
||||
{ id: 'products', label: '产品服务', href: '/' },
|
||||
{ id: 'about', label: '关于我们', href: '/' },
|
||||
{ id: 'news', label: '新闻动态', href: '/' },
|
||||
{ id: 'contact', label: '联系', href: '/contact' },
|
||||
];
|
||||
/**
|
||||
* 主导航与 mega 下拉的**代码真源**。
|
||||
*
|
||||
* 2026-10-16 改对标双轴。依据是实测而非口味:
|
||||
* - Bain 一级导航 = Industries · Consulting Services · Digital · Insights · About · Careers
|
||||
* - Porsche Consulting = 行业 · 实践 · 洞察 · 职业 · 关于我们(+ 联系我们作 CTA)
|
||||
* **两家的导航里都没有「产品」** —— 咨询业按「客户的问题空间(行业)× 本所的能力」组织,
|
||||
* 不按产品 SKU 组织。本仓此前 7 项里 产品 居首,且 案例(0 条数据)、新闻动态(2 条) 是空渠道。
|
||||
*
|
||||
* 落地策略(本轮刻意保守,可整体回退):
|
||||
* **换标签、不换路由**。行业→既有的 /solutions(solution 模型本就是行业)、
|
||||
* 能力→既有的 /services(service 模型的 4 行本就是能力组)。
|
||||
* 这样做的理由不是偷懒,而是避免制造重复内容:若新增 /capabilities 与 /services 并行,
|
||||
* 同一个 ContentItem 会同时挂在两个 URL 下 —— 那是 canonical 冲突,比不改更糟。
|
||||
* URL 改名 + 308 留给第二批一次性处理(须同批动 next.config redirects、@security、
|
||||
* revalidate 路径表、sitemap、lighthouserc)。
|
||||
* 唯一真正新增的面是 /insights:它聚合 news + methodology + cases,
|
||||
* 今天没有任何单一页面做过这件事,因此不构成重复。
|
||||
*
|
||||
* 「轴 = 视图,模型 = 真源」不变式(写进 PRD):
|
||||
* 一条路由可以 READ 或组合多个模型,但**不得 OWN** 另一个模型已持有实体的副本。
|
||||
* 需要新分组时,表达为既有 item 上的字段或一个 ContentZone,
|
||||
* 永远不是「装着同样 16 行的新 ContentModel」—— 后者会撞
|
||||
* src/lib/seed-permissions.test.ts:50 的 SUPER_ADMIN_ONLY_MODELS 断言,
|
||||
* 且授予只能靠重跑 seed(独立授权动作)。
|
||||
*/
|
||||
|
||||
export interface NavigationItemV2 {
|
||||
id: string;
|
||||
label: string;
|
||||
href: string;
|
||||
hasDropdown?: boolean;
|
||||
/** 指向 MEGA_DROPDOWN_DATA 的 key。⚠ 改名必须与 megaDropdown 的 key 同步,
|
||||
* 否则 resolveNavigation 的校验会判该 CMS/代码配置不完整。 */
|
||||
dropdownKey?: string;
|
||||
}
|
||||
|
||||
@@ -42,46 +55,38 @@ export interface MegaDropdownData {
|
||||
[key: string]: MegaDropdownGroup[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 主导航 4 项 + 常驻 CTA(联系我们不在列表里 —— 它是 header.tsx 的咨询按钮;
|
||||
* 两家对标也都把联系放在 utility 行 / CTA 位,而不是第六个阅读项)。
|
||||
*/
|
||||
export const NAVIGATION_V2: NavigationItemV2[] = [
|
||||
{ id: 'products', label: '产品', href: '/products', hasDropdown: true, dropdownKey: 'products' },
|
||||
{ id: 'solutions', label: '解决方案', href: '/solutions', hasDropdown: true, dropdownKey: 'solutions' },
|
||||
{ id: 'services', label: '服务', href: '/services' },
|
||||
{ id: 'cases', label: '案例', href: '/cases' },
|
||||
{ id: 'news', label: '新闻动态', href: '/news' },
|
||||
{ id: 'industries', label: '行业', href: '/solutions', hasDropdown: true, dropdownKey: 'industries' },
|
||||
{ id: 'capabilities', label: '能力', href: '/services', hasDropdown: true, dropdownKey: 'capabilities' },
|
||||
{ id: 'insights', label: '洞察', href: '/insights', hasDropdown: true, dropdownKey: 'insights' },
|
||||
{ id: 'about', label: '关于我们', href: '/about' },
|
||||
{ id: 'contact', label: '联系我们', href: '/contact' },
|
||||
];
|
||||
|
||||
/** megaDropdown 的 key —— footer 按这些 key 取栏目,改名必须两侧同步 */
|
||||
export const MEGA_KEYS = {
|
||||
industries: 'industries',
|
||||
capabilities: 'capabilities',
|
||||
insights: 'insights',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* 产品矩阵所在的组 id —— **不要改这个 id**。
|
||||
* src/app/layout.tsx 的 standalone 覆盖是按 `group.id === 'standalone-products'` 匹配的,
|
||||
* 改了 id 会让 CMS 的独立产品静默不再注入(面板照样渲染,只是少了那一组)。
|
||||
*/
|
||||
export const STANDALONE_GROUP_ID = 'standalone-products';
|
||||
|
||||
export const MEGA_DROPDOWN_DATA: MegaDropdownData = {
|
||||
products: [
|
||||
{
|
||||
id: 'enterprise-suite',
|
||||
title: '企业套装',
|
||||
description: '核心产品线,互为补充',
|
||||
items: [
|
||||
{ id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp', badge: '旗舰' },
|
||||
{ id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm', badge: '旗舰' },
|
||||
{ id: 'bi', title: 'BI 数据平台', description: '报表·仪表盘·预测·决策', href: '/products/bi' },
|
||||
{ id: 'cms', title: 'CMS 内容平台', description: '建站·运营·分发·分析', href: '/products/cms' },
|
||||
{ id: 'sds', title: 'SDS 供应链决策', description: '预测·补货·库存·协同', href: '/products/sds' },
|
||||
{ id: 'oa', title: 'OA 协同办公', description: '审批·公文·协作·知识', href: '/products/oa' },
|
||||
],
|
||||
highlight: true,
|
||||
},
|
||||
{
|
||||
id: 'standalone-products',
|
||||
title: '专业产品',
|
||||
description: '专业领域独立产品线',
|
||||
items: [
|
||||
{ id: 'novavis', title: '睿视 NovaVis', description: '面向执法机关的离线智能数据分析与资金关系图谱平台', href: 'https://novavis.p.novalon.cn', badge: '内测中' },
|
||||
],
|
||||
},
|
||||
],
|
||||
solutions: [
|
||||
/* 行业轴 —— 读 solution 模型(6 行已带 industry / painPoints / suiteCombination) */
|
||||
industries: [
|
||||
{
|
||||
id: 'industry-solutions',
|
||||
title: '行业解决方案',
|
||||
description: '基于企业套装的行业实践',
|
||||
title: '行业实践',
|
||||
description: '按行业问题空间组织的落地方案',
|
||||
items: [
|
||||
{ id: 'manufacturing', title: '制造业', description: '智能制造·MES·质量管控', href: '/solutions/manufacturing' },
|
||||
{ id: 'retail', title: '贸易零售', description: '全渠道·会员·精准营销', href: '/solutions/retail' },
|
||||
@@ -93,11 +98,13 @@ export const MEGA_DROPDOWN_DATA: MegaDropdownData = {
|
||||
highlight: true,
|
||||
},
|
||||
],
|
||||
services: [
|
||||
|
||||
/* 能力轴 —— 读 service 模型;产品矩阵作为「用什么交付」内嵌于此,不再独占一级导航 */
|
||||
capabilities: [
|
||||
{
|
||||
id: 'professional-services',
|
||||
title: '专业服务',
|
||||
description: '全流程技术支持',
|
||||
id: 'capability-groups',
|
||||
title: '能力组',
|
||||
description: '从判断到运营的四种陪跑方式',
|
||||
items: [
|
||||
{ id: 'consulting', title: '战略咨询', description: '数字化转型咨询规划', href: '/services/consulting' },
|
||||
{ id: 'software', title: '企业软件', description: 'ERP/CRM/BI 系统实施', href: '/services/software' },
|
||||
@@ -106,5 +113,52 @@ export const MEGA_DROPDOWN_DATA: MegaDropdownData = {
|
||||
],
|
||||
highlight: true,
|
||||
},
|
||||
{
|
||||
id: 'enterprise-suite',
|
||||
title: '产品矩阵',
|
||||
description: '能力交付所依托的自研套件',
|
||||
items: [
|
||||
/**
|
||||
* ⚠ 这一条不是可选项,是 /products 这个 hub 的**唯一导航入口**。
|
||||
* 决策 2 把「产品」从一级导航撤下,但 /products 仍在 sitemap(priority 0.9)、
|
||||
* 仍是 6 个产品详情页的上游。若只撤导航而不补这一条,就等于把最高价值的 hub
|
||||
* 变成孤儿页 —— 那是回退,不是重构。
|
||||
* 所以「产品不占一级导航」的正确落法是:**降级为能力轴的第二层**,而不是消失。
|
||||
*/
|
||||
{ id: 'all-products', title: '产品矩阵总览', description: '六款自研套件的组合与定位', href: '/products' },
|
||||
{ id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp', badge: '旗舰' },
|
||||
{ id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm', badge: '旗舰' },
|
||||
{ id: 'bi', title: 'BI 数据平台', description: '报表·仪表盘·预测·决策', href: '/products/bi' },
|
||||
{ id: 'cms', title: 'CMS 内容平台', description: '建站·运营·分发·分析', href: '/products/cms' },
|
||||
{ id: 'sds', title: 'SDS 供应链决策', description: '预测·补货·库存·协同', href: '/products/sds' },
|
||||
{ id: 'oa', title: 'OA 协同办公', description: '审批·公文·协作·知识', href: '/products/oa' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: STANDALONE_GROUP_ID,
|
||||
title: '专业产品',
|
||||
description: '专业领域独立产品线',
|
||||
items: [
|
||||
{ id: 'novavis', title: '睿视 NovaVis', description: '面向执法机关的离线智能数据分析与资金关系图谱平台', href: 'https://novavis.p.novalon.cn', badge: '内测中' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
/* 洞察轴 —— 聚合 news + methodology + cases。
|
||||
案例条目**故意不列**:case-study 模型当前 0 行(prisma/seeds/case-studies.ts:11 明示
|
||||
「首批客户共创阶段,暂无对外可验证案例」)。零编造原则下不放一个指向空列表的入口,
|
||||
等真实授权到位再加 —— 这是个有意的留白,不是漏配。 */
|
||||
insights: [
|
||||
{
|
||||
id: 'insight-groups',
|
||||
title: '洞察',
|
||||
description: '方法论、观点与公开写作',
|
||||
items: [
|
||||
{ id: 'all', title: '全部洞察', description: '按时间倒序的公开内容', href: '/insights' },
|
||||
{ id: 'methodology', title: '方法论', description: '四阶段交付与验收标准', href: '/methodology' },
|
||||
{ id: 'writing', title: '技术与观点', description: '数字化转型的公开写作', href: '/news' },
|
||||
],
|
||||
highlight: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in new issue
Block a user