refactor(详情页+S8): 详情页减重(导航互斥/入口去重/i18n去重) + 品牌标识入库
Regression / regression (push) Canceled after 0s

本提交含两条并行工作线,因互相咬合(package.json scripts、regression.yml、
npm run build 链)无法按文件干净拆分,故合并为一次自洽提交。

## 详情页减重(本轮主任务:修复「AI 干太重」)

- 导航收敛:宽屏只用右侧目录、≤1200px 只用页内 sticky 导航,纯 CSS 媒体查询
  实现(不引入 JS 宽度监听)。此前两套导航同时可见,active 状态互相打架。
- 入口去重:标题区由「查看示例/在线测试/契约 JSON」三个减为「在线测试」一个;
  契约 JSON 归入实现资源;删除示例底部重复的「在线测试」。
- 示例工具栏:删除与目录锚点重复的示例下拉选择器;「全部展开代码」只在
  示例数 >1 时出现(103 个组件里 49 个仅 1 个示例,此前恒显示)。
- 重复文案:示例区两句同义导语合并为一句。
- 首页 CTA 由 5 个减为 2 个(浏览组件/快速开始),测试总览入口挂到已有的
  通过率统计卡上,不再另占 Hero 按钮。
- 统一详情取数:抽出 fetchDetail/loadDetail 作为 details/*.json 的唯一路径,
  FAQ 不再自行 fetch 一遍,与组件页共用缓存与失败兜底。

## i18n

- 删除 12 组重复键(含整段 FAQ 说明),字典 604 → 585 唯一键。
- 删除本次改动产生的 6 个死键。
- verify-i18n.mjs 新增 `unique dictionary keys` 断言:重复键在对象字面量里
  是静默的后值覆盖,此前无从发现;现由门禁拦住。

## 文档事实修正(实测为准)

- TESTING/CONTRIBUTING:79 → 103 组件;旧断言数改为回指 tests/report.json。
- PLATFORMS:移动端 108 文件/18 端 → 282 文件/47 端;契约 5 → 47;
  令牌 17 → 15;uni-app SFC 21 → 50。
- AGENTS:断言 1405/18 页 → 1464/103 页(PC)、807/47 页(移动端)。
- package.json:YOUR-ACCOUNT 占位 → gitea 实址与 kole-ui.mymoyu.top。

## 品牌标识(并行会话成果,一并入库)

- brand-mark.json 收归真源,build:brand 生成 favicon 与单色 SVG;
  PC 与移动端共用资产,verify:brand 24 条断言。
- regression.yml 增加 verify:brand 步骤。

## 门禁与验收

新增工具:verify-component-page.mjs(86 条真实浏览器断言,随详情页改造同步
更新为「只允许一套导航可见」)、verify-brand-mark.mjs、lib/i18n-dead-keys.mjs
(只读诊断)。

回归:PC 100%(1464/1464,103 页,N/A 50)· 移动端 100%(807/807,47 页)。
门禁:component-page 86 · i18n 17 · brand 24 · routes all · smoke all ·
theme OK · isolation 31 · nav all · examples 9 · api-docs 10 · mobile-docs 12。

已知未做:i18n 另有约 44 条历史死键(非本次产生),已记为 ROADMAP S8-P6;
顶栏与悬浮区的两个主题入口为刻意设计(verify-theme 断言其互斥),未删。
This commit is contained in:
aurora-admin
2026-09-22 23:56:05 +08:00
parent f1fbfc2ddb
commit 5ee5d829a4
92 changed files with 1320 additions and 463 deletions
+17 -13
View File
@@ -12,6 +12,23 @@
'use strict';
var EN = {
'组件内容导航': 'Component sections',
'组件路径': 'Component breadcrumb',
'概览': 'Overview',
'示例': 'Examples',
'设计与资源': 'Design & resources',
'用法与示例': 'Usage & examples',
'全部展开代码': 'Expand all code',
'全部收起代码': 'Collapse all code',
'显示用法代码': 'Show usage code',
'收起用法代码': 'Hide usage code',
'用法代码': 'Usage code',
'示例代码技术栈': 'Example code stack',
'示例链接': 'Example link',
'规格详情': 'Specification details',
'完整规格与边界条件': 'Full specification and constraints',
'设计建议、无障碍要求与实现文件集中于此。': 'Design guidance, accessibility recommendations and implementation files in one place.',
'打开测试页': 'Open test page',
/* ---------- 快速开始 · npm 安装 ---------- */
'了解如何在本项目中使用 Kole UI 组件:从 npm 私有源安装、引入设计令牌、按端取用组件源码、以及目录与命名约定。':
'Understand how to use Kole UI components: install from the private npm registry, import design tokens, take component sources per stack, plus directory and naming conventions.',
@@ -90,7 +107,6 @@
'A rational, efficient and restrained design system for B2B admin panels — moderate information density, clear hierarchy, immediate feedback.',
'浏览组件 →': 'Browse components →',
'场景示范': 'Live Scenario',
'测试总览': 'Test Overview',
'个大类': 'categories',
'端实现': 'platforms',
'份规范': 'spec docs',
@@ -206,18 +222,10 @@
'指同一栅格中相邻卡片之间的 gap,以及不同容器宽度下 gap 是否保持不变。': 'The gap between adjacent cards in one grid, including whether it stays fixed as the container width changes.',
'通用规范只给出组件之间 16px/24px 的间距梯度,CardList 只说明采用栅格,没有给出卡片专用 gap、列数或响应式断点。': 'The general spec only gives a 16px/24px component-spacing scale, while CardList only says to use a grid; no card-specific gap, column count, or responsive breakpoints are defined.',
'需要确认 CardList 的默认 gap、列数和响应式断点后,才能把实现值升级为正式契约。': 'Confirm CardList’s default gap, column count, and responsive breakpoints before promoting an implementation value into the formal contract.',
'不要自行发明(设计边界):': 'Do not invent (design boundary):',
'规范未明示(待确认):': 'Unspecified by spec (needs decision):',
'这类条目不是待实现功能清单,而是明确禁止把实现细节当成设计规范。': 'These are not an implementation backlog; they mark details that must not be presented as design rules.',
'这类条目不是报错,而是规格还没有给出可执行答案,生成前需要补充设计决策。': 'These are not errors; the spec has no executable answer yet and needs a design decision before generation.',
'这是什么意思': 'What does this mean',
'为什么会出现': 'Why is it here',
'需要确认什么': 'What needs deciding',
'命中': 'Matched',
'条,': ' entries, ',
'个组件': ' components',
'共': 'Total ',
'条,': ' entries, ',
'个组件有条目': ' components have entries',
'加载中…': 'Loading…',
'核心组件契约:dims(变体维度)、variants、usage(使用要点)、structure、anatomy、doNot(不发明)、unknowns(未明示);data.js 外壳仅留 hasContract,详情见 site/details/<slug>.json':
@@ -367,7 +375,6 @@
'松石绿': 'Turquoise',
/* ---------- 设计规范页 ---------- */
'设计规范': 'Design Tokens',
'Kole UI 设计系统的全部设计令牌,共 <strong>': 'All design tokens of the Kole UI system — <strong>',
'</strong> 项。所有组件均基于这些令牌构建,来源 <code>colors_and_type.css</code>。':
'</strong> in total. Every component is built on these tokens, sourced from <code>colors_and_type.css</code>.',
@@ -431,8 +438,6 @@
'<span class="badge-opt">可选</span>': '<span class="badge-opt">Optional</span>',
/* ---------- 零散片段 ---------- */
'断言通过': 'assertions passed',
'预览': 'Preview',
'全部 (': 'All (',
'共 <strong>': '',
'</strong> 个组件(核心 <strong>': ' components (core ',
@@ -442,7 +447,6 @@
' categories. Built on the Kole UI specification with H5 / React / Vue 2 / Vue 3 implementations.',
'色彩 · ': 'Color · ',
' 个组件': ' components',
'组件': 'Components',
/* ---------- 设计规范色彩分组 ---------- */
'品牌色': 'Brand',