zhangxiang
f23500ff07
docs(grammar): 落 ADR-0008 并改掉说谎的那一方,含四条经验教训与台账 §11
...
对标实测证伪了 ADR-0004 的两条视觉判据,所以本笔的主体是**改文档**:
判据错在文档里,而不是错在代码里,不一起改就是文档变成说谎的那一方。
新增 `docs/adr/0008-benchmark-grammar-takeover.md`(取证方法、实测对照表、
四项裁定、已知偏差 6 条、验证契约):
- Bain 走 archive.org 快照 2026-08-31(1600×846)绕开 Cloudflare,
Porsche 取 live 国际站 + 中国站导航,逐元素 `getComputedStyle`。
- **被证伪 ①**(决策四)「关键数字 = 超大字号 + 品牌色」:
Bain 成果数字实测 **40px / 字重 500 / 纯黑**;
本仓 `--font-size-5xl: 2.25rem` 在桌面根字号 18px 下 = 40.5px ⇒ 现档正好命中,零新增令牌。
- **被证伪 ②**(决策一)「4px 色条为辅」:两家**都不用颜色给内容分类**,
饱和红用作"面"的次数为 **0**(Bain #CC0000 出现 65 次全是字与线,
Porsche 红出现 4 次全是按钮)。
ADR-0004 决策一、决策四两处就地加 ⚠️ 修订块并指向 ADR-0008。
ADR 不重写历史,但必须让读者不会把已废判据当现状。
`DESIGN.md`:front-matter 的 `rounded:` 改成 0–4px 记档 + 新增 `cta: "0px"`;
`components.cta-*/badge-pill/card-bain/input-field` 的 `rounded` 从
`{rounded.full}` 改 `{rounded.cta}` 或 `{rounded.md}`,
padding 按实测 `14px 28px`;Elevation 段删掉「hover 升至 card-shadow-hover + translateY(-4px)」;
数据条段把「font-black + 品牌红」改为「text-5xl / 500 / text-ink」并注明是被实测推翻的那条;
Navigation 段写入双轴与「真源是代码、CMS 行须满足 IA 契约才采纳」。
`CONTEXT.md` 关键决策表 +9 行:对标双轴导航 / 导航真源=代码 / 视觉语法记档 /
僵尸令牌 / 彩色编码适用面 / 成果槽 ResultsSlot / 替代信号槽 / 承诺单一真源 /
「注释写在 JSX children 位 = 页面文字」。
`docs/development/quality-gates.md`:
- §1 的 lint warning **权威计数就地更新**:本树 `EXIT=0 / 0 error / 81 warning`,
分项相加必须等于总数(55+12+8+4+1+1 = 81 ✓),
并给出与 2026-09-23 那 104 条的逐项对账(`no-explicit-any` 25→4 等,净 −23 ✓)。
归因**已实证到文件**而不是只看方向一致:逐个 `git show da9a5cb6:<被删文件>` 数出
33 处 `any` 命中(v15.test 12 / NewsDetailClient.test 8 / v15 4 / …),
并说明命中数 ≠ 告警数的差额来源,附可复算命令。
- §5.1 `check:motion` 现状 23 处 → **8 处 / 4 文件**,
并写明残留 8 处全部经 `git show` 自证为基线 `da9a5cb6` 既有红、非本轮引入。
- 新增 §5.2 记录 `check:visual`(R1–R11 每条的分母口径与两条闸的**适用边界**),
§7 的 `test:all` 组成改为八段并注明自证先跑。
- 另记一条:这条计数一度被读成 0 error,是因为管道吞掉了 EXIT=1(见 §5.38)。
`docs/lessons-learned.md` 四条(§5.38–§5.41)+ 更新记录 4 行:
管道吞退出码复犯 / 合法 JSX 的注释渲染成页面文字而三道门禁全绿 /
仪器只在被复用时才坏(module 层累加器 + 互斥前提塞进同一份夹具)/
僵尸令牌(删了值没删引用,R5 与 R7 各看一侧所以两条都绿)。
`docs/acceptance/qa-tracker.md` §11:四台仪器表(每台的可失败证据)、
本轮 5 条缺陷与根因、6 个 spec 的重锚对照表、
新登记 4 条待拍(DEC-N1 彩色编码第二通道 / N2 stagger 默认值 /
N3 motion 残留 8 处 / N4 既有案例区无门槛)+ 2 条待授权(AUTH-VISUAL / AUTH-NAV)。
`config/test/lighthouserc.json`:URL 集补 `/insights`(新的一级轴)与
`/solutions/manufacturing`(本批 tracer-bullet 承载页)——
不补就是新页没有任何 Lighthouse 覆盖。
`README.md`:加本批进度条目,并把「check:motion 仍 23 处」的旧数改为指向
quality-gates §5.1 的现取口径。
探针 7 份入库 `docs/acceptance/2026-10-17-ia-e2e/`(导航结构 / 面板链接 /
首页 testid 与文案 / 段序文档坐标 / 页脚入口),是本批所有 E2E 断言的取证来源。
本笔纯文档 + 配置,不改运行时代码;同树已跑过的验证仍成立:
`npm run test:all` EXIT=0、`type-check` EXIT=0、`lint` EXIT=0(0/81)、
`test:unit` 141 套件 / 1747 例、`check:visual` 11/11 + accents 成立、`build` EXIT=0。
2026-10-17 01:08:45 +08:00
zhangxiang
6bb7c557ee
test(qa): e2e 装配修正 + 集成/门禁测试与工具链重构
...
- e2e:修死选择器与蜜罐误命中、补断言、GA4/security-headers 用例诚实标注
skip 边界;新增 assert-helpers/fixtures/hydrated/primary-nav/touch-targets
等复用桩。
- 集成层:config/test/jest.integration.config.js + tests-integration/ 真库
一次性 SQLite 用例,teardown 守卫开发库指纹。
- 门禁工具链:jest.setup 归位到根、scripts/accessibility 全站 axe 节点计数、
check-brand-text-token/check-motion-constraints 机械守卫、stryker/lighthouse
配置收敛。
2026-09-28 10:48:08 +08:00
zhangxiang
5a4d3106ca
chore(test): harden e2e/lighthouse tooling and ignore tool cache
...
- Playwright:firefox/webkit 使用空 storageState,消除 newContext 阶段浏览器
兼容噪声;路径以配置目录为基准兼容多种调用方式
- Lighthouse:lighthouserc 补 chromeFlags(--disable-crash-reporter --no-sandbox
--headless=new),规避 TRAE 沙箱对 Crashpad 目录的拦截
- .gitignore:忽略 .impeccable 评审工具缓存
2026-08-19 14:43:53 +08:00
zhangxiang
3e93317988
fix(e2e): resolve admin user journey authentication and stabilize flaky tests
...
- Fix loginAdminAndSetCookie to set both cookie (middleware) and localStorage (auth-context)
- Add page navigation before localStorage evaluate to avoid SecurityError
- Update Playwright webServer to npm run dev for API route support
- Fix UJ-10 CSS selector parsing error (text= regex mixed with CSS)
- Fix cases-filter flaky test (getByRole('radio') → locator('button[role="radio"]'))
- Update test-strategy-plan.md: mark UJ-03/06/07 as ✅ completed
- Update README.md with admin fix progress record
2026-08-03 08:36:50 +08:00
zhangxiang
602ed6a671
test(hooks): finalize mutation test improvements and release acceptance
...
- Raise use-swipe-gesture mutation score to 66.13% (target 65%+)
- Maintain use-reduced-motion mutation score at 76.32% (target 50%+)
- Fix use-reduced-motion.ts ESLint set-state-in-effect warning
- Add UJ-10 deep searcher journey (category browse → article read → content discovery)
- Add 40 new test files (analytics, detail, sections, ui, lib components)
- Update test-strategy-plan.md to v2.0 (sync test count to 1591)
- Sync README.md with final release metrics
Quality gates: TS 0 errors, ESLint 0 errors, 121 suites / 1591 tests passed
2026-08-02 19:39:27 +08:00
zhangxiang
a022a612c5
test(seo): expand structured data tests to cover all 7 schema components
...
- Add 24 new tests for ServiceSchema, ProductSchema, FAQSchema,
BreadcrumbSchema, and LocalBusinessSchema (previously uncovered)
- Raise SEO component coverage from 40.89% → 100% (all metrics)
- Update jest.config.js coverage thresholds to reflect Phase 7实测 values
- Sync test-strategy-plan.md to v1.8 with latest coverage data
- Update README.md progress with 1509 tests / 73.59% stmts / 82.38% branches
2026-08-02 13:36:28 +08:00
zhangxiang
dd088a5ee1
chore(test): add test infrastructure, CI config, and security scanning
...
- Add Jenkinsfile with E2E/visual regression/security scan stages
- Add Stryker mutation testing configuration
- Add security header scanning script (check-security-headers.ts)
- Remove old playwright.config.ts (migrated to e2e/playwright.config.ts)
- Remove obsolete .claude/skills/impeccable
- Update jest config for test path patterns
- Update package.json with comprehensive test scripts
- Update .gitignore for stryker-tmp/ and .pi/ temp files
2026-07-31 20:24:01 +08:00
张翔
10404dbb36
chore: sync marketing pages, CMS extensions, tests and project docs
...
同步工作区剩余变更,主要包括:
- 营销页面组件与布局持续优化(about/news/services/solutions/team 等)
- 详情页四层叙事组件、布局组件、UI 组件调整
- CMS 数据模型、API 路由、权限、工作流、站内通知、媒体管理扩展
- 新增/补充单元测试与 E2E 测试(cms-workflow.spec.ts 等)
- ESLint 9 迁移、jest/tsconfig 配置更新、依赖调整
- 新增 ADR、CMS 评估文档、Release Review / Acceptance 报告
- 移除水墨装饰组件与大体积未使用字体文件
2026-07-25 08:04:01 +08:00
张翔
a6ea2cc72c
test(e2e,unit): add navigation edge cases and component coverage
...
- Add missing-paths E2E spec for desktop/mobile navigation and contrast
- Add local Playwright config for dev server testing
- Expand unit tests for CMS data server, products, contact and UI components
- Adjust jest config for new test patterns
2026-07-08 14:47:07 +08:00
张翔
38be4a19ef
test(core): 补充单元测试,修复 useCountUp 精度问题,新增项目文档
...
- 新增 hooks/components/lib 共 9 个测试文件,覆盖边界条件与异常路径
- 补充 animations.test.tsx 用例(RotatingBorder、CounterWithEffect 等)
- 修复 useCountUp 结束时 toFixed 精度问题
- 调整 jest 覆盖率配置为渐进式阈值,收缩收集范围
- 新增 docs/lessons-learned.md(经验教训汇总)与 docs/troubleshooting.md(问题排查索引)
- 更新 README.md 文档索引
2026-07-07 19:42:50 +08:00
张翔
c9de806109
chore(config): 更新项目构建与测试配置
...
- 升级 Next.js 配置,移除 webpackBuildWorker 实验特性
- 更新 Tailwind 设计令牌系统,对齐新品牌色与字体
- 配置 TypeScript strict 模式 (noUncheckedIndexedAccess)
- 更新 ESLint 规则与 Jest 测试配置
- 添加 prisma.config.ts 数据库配置
2026-07-07 06:51:48 +08:00
张翔
2f45818724
feat(analytics): enhance Google Analytics with privacy compliance and comprehensive tracking
...
- Add automatic route change tracking for SPA navigation
- Implement Cookie consent banner for GDPR compliance
- Add performance tracking (LCP, FID, CLS Web Vitals)
- Add outbound link click tracking
- Integrate contact form submission tracking with conversion events
- Add CTA button click tracking in hero section
- Integrate error tracking in ErrorBoundary component
- Extend analytics utility library with 15+ tracking functions
- Configure IP anonymization and privacy settings
- Remove unused test files and deployment scripts
- Update case studies to include only specified cases
- Fix mobile navigation active state issues
- Fix lint errors in test files and components
BREAKING CHANGE: Google Analytics now requires user consent before tracking
2026-04-22 07:19:29 +08:00
张翔
78090d1f15
fix: 修正 Jest 配置中的文件路径,移除 next-auth mock
2026-04-21 07:43:28 +08:00
张翔
ebaa7f3c50
fix: 修复Woodpecker CI配置文件中的linter错误
...
ci/woodpecker/manual/woodpecker Pipeline was successful
- 移除未使用的YAML锚点定义
- 替换commands字段中的锚点引用为实际值
- 移除有问题的通知步骤
- 修复测试文件中的问题
- 添加新的测试用例和配置文件
2026-03-28 09:42:45 +08:00
张翔
498bb3a3c8
refactor: reorganize project structure and improve code quality
...
- Move CI/CD configs to config/ci/ directory
- Reorganize scripts into categorized directories (deployment, monitoring, testing, utils)
- Consolidate documentation into docs/ directory with proper structure
- Update linting and testing configurations
- Remove obsolete test reports and performance summaries
- Add new documentation for code quality tools and contact form security
- Improve project organization and maintainability
- Fix lint-staged config to only lint JS/TS files
- Disable react/react-in-jsx-scope rule for Next.js compatibility
- Ignore scripts and test config directories in ESLint
2026-03-24 13:38:58 +08:00