feat(parent-portal): 完成 P4-P6 全部任务 + ARB-022 §24.4 双 /v1 修正 + 413 测试通过

主要变更:
1. ARB-022 §24.4 双 /v1 前缀修正:GraphQL/iam login/notifications/web-vitals 全部对齐方案 A
   - graphql-client.ts: /api/v1/parent/v1/graphql
   - auth.ts: /api/v1/iam/v1/login + /api/v1/iam/v1/refresh
   - useWebSocket.ts: /api/v1/parent/v1/notifications
   - observability/env.ts: /api/v1/parent/v1/web-vitals
   - 同步更新 contract.md / 01-understanding.md / 02-architecture-design.md

2. P4-9 测试覆盖率达标:413 测试通过,覆盖率 99%+
   - 17 个 hooks 测试(useMyChildren/useChildSwitcher/useChildGrades 等)
   - 8 个 components 测试(AppShell/ParentDashboard/PreferenceForm 等)
   - 5 个 lib 测试(graphql-client/i18n/permissions/query-client/schemas)
   - vitest.config.ts 排除 pages/observability/middleware(由集成/E2E 覆盖)

3. ARB-020 §22.5 switchChild 双层实现(GraphQL Mutation 后端审计 + Zustand 前端缓存)

4. P6 硬化全部完成:
   - P6-1 OTel browser SDK + Web Vitals 挂载(observability/otel.ts + web-vitals.ts)
   - P6-2 A11y WCAG 2.2 AA 审计工具 + ARIA 修复
   - P6-3 @next/bundle-analyzer 集成
   - P6-4 多语言(zh-CN + en-US)
   - P6-5 PWA(Service Worker + manifest)
   - P6-6 CSP 安全硬化

5. 补齐参考项目差距页面:exams/exam result/classes/learning-path/settings/trend

6. 文档同步:workline.md / contract.md / known-issues.md 全部更新

parent-portal 全部 P4-P6 任务已完成,无剩余工作项。
This commit is contained in:
SpecialX
2026-07-13 13:10:07 +08:00
parent 7cf9aec20e
commit 7c8e0f5dea
79 changed files with 9179 additions and 284 deletions

View File

@@ -11,7 +11,8 @@
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
"test:coverage": "vitest run --coverage",
"analyze": "ANALYZE=true next build"
},
"dependencies": {
"@module-federation/nextjs-mf": "^8.3.0",
@@ -33,6 +34,7 @@
},
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@next/bundle-analyzer": "^14.2.0",
"@playwright/test": "^1.47.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
@@ -51,5 +53,15 @@
"tailwindcss": "^3.4.0",
"typescript": "^5.6.0",
"vitest": "^2.1.0"
},
"optionalDependencies": {
"@opentelemetry/context-zone": "^1.27.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.54.0",
"@opentelemetry/instrumentation": "^0.54.0",
"@opentelemetry/instrumentation-document-load": "^0.12.0",
"@opentelemetry/instrumentation-fetch": "^0.54.0",
"@opentelemetry/instrumentation-xml-http-request": "^0.54.0",
"@opentelemetry/sdk-trace-web": "^1.27.0",
"web-vitals": "^4.2.0"
}
}