fix: patch P0 security vulnerabilities and critical UX issues across 6 modules

Security: Add admin/layout.tsx auth guard; Add requirePermission() to 12 admin pages

Dashboard: Fix StudentStatsGrid rendering; Fix teacher greeting; Add loading/error boundaries; Fix col-span; Add metadata

Announcements: Fix audience filtering; Add user detail page; Trigger notifications on publish; Pass classes data; Add loading.tsx

Messages: Implement soft delete; Add unread badge with polling; Add notification dropdown polling; Add keyword search; Add quiet hours DND

Management: Add loading/error for 9 admin routes; Fix admin-classes-view to use Select for school/grade

Profile/Settings: Add loading/error; Fix parent role routing; Create ParentSettingsView; Integrate AiProviderSettingsCard; Add Tab URL persistence; Add logout confirm; Add avatar; Fix Progress arbitrary class

Schema: Add senderDeletedAt/receiverDeletedAt to messages; Add quietHours to notificationPreferences; Add uniqueIndex import

Docs: Update architecture docs 004/005
This commit is contained in:
SpecialX
2026-06-22 13:57:31 +08:00
parent 5ff7ab9e72
commit a4d096a6fc
81 changed files with 2145 additions and 124 deletions

View File

@@ -1119,15 +1119,19 @@ src/auth.ts ──▶ import { ... } from "@/shared/lib/permissions"
|------|------|------|
| `data-access.ts` | 243 | 子女关系 + 仪表盘数据聚合 + 关系校验 + 子女姓名列表v4 新增 `getChildNameList` + `buildWeeklySchedule` |
| `types.ts` | 79 | 类型定义(含 JSDocv4 新增 `ChildWeeklyScheduleItem` |
| `components/parent-dashboard.tsx` | 97 | 仪表盘v4 重构:待办横幅 + 宫格快捷入口) |
| `components/parent-attention-banner.tsx` | 116 | v4 新增:待办事项/异常聚合横幅 |
| `components/parent-dashboard.tsx` | 110 | 仪表盘v4 重构:待办横幅 + 宫格快捷入口 + 移动端水平滑动 |
| `components/parent-attention-banner.tsx` | 128 | v4 新增:待办事项/异常聚合横幅(作业项直接跳转详情页 homework tab |
| `components/parent-attendance-warning.tsx` | 89 | v4 新增:考勤异常预警 |
| `components/parent-attendance-rate-card.tsx` | 105 | v4 新增:考勤出勤率汇总卡片 |
| `components/parent-attendance-calendar.tsx` | 175 | v4 新增考勤月历视图use client |
| `components/parent-export-button.tsx` | 50 | v4 新增:成绩导出按钮(占位) |
| `components/child-card.tsx` | 148 | 子女卡片v4 增强:异常突出 + 趋势图标) |
| `components/child-detail-header.tsx` | 78 | 详情页头部v4 增强:面包屑) |
| `components/child-detail-panel.tsx` | 187 | 详情页 Tab 面板 + SiblingSwitcherv4 重写) |
| `components/child-homework-summary.tsx` | 147 | 作业摘要v4 增强:科目标识 + 触摸区域) |
| `components/child-detail-panel.tsx` | 200 | 详情页 Tab 面板 + SiblingSwitcherv4 重写,集成 Homework/Grade Detail |
| `components/child-homework-summary.tsx` | 147 | 作业摘要v4 增强:科目标识 + 触摸区域 + pts 单位 |
| `components/child-homework-detail.tsx` | 145 | v4 新增:作业详情视图(完整作业信息) |
| `components/child-grade-summary.tsx` | 159 | 成绩趋势v4 增强:趋势图标 + aria-label |
| `components/child-grade-detail.tsx` | 165 | v4 新增:成绩详情视图(按科目分组分析) |
| `components/child-schedule-card.tsx` | 119 | 课表卡片v4 增强:周课表视图) |
| `components/parent-children-data-page.tsx` | 92 | 共享数据页v4 增强headerExtra |

View File

@@ -12247,11 +12247,11 @@
}
},
"classes": {
"description": "班级/选课/课表",
"description": "班级/选课/课表/邀请码v3 新增邀请码体系,对标 Google Classroom / 钉钉教育)",
"tables": {
"classes": {
"owner": "classes",
"description": "班级"
"description": "班级invitationCode 字段保留作为 fallbackv3 迁移至 classInvitationCodes 表)"
},
"classSubjectTeachers": {
"owner": "classes",
@@ -12264,6 +12264,10 @@
"classSchedule": {
"owner": "scheduling",
"description": "课表(注意:三处写入口,见 knownIssues P0-6)"
},
"classInvitationCodes": {
"owner": "classes",
"description": "v3 新增:班级邀请码(独立表,支持有效期/次数限制/审计/多码并存6 位字母数字剔除歧义字符)"
}
}
},
@@ -12601,6 +12605,48 @@
"v3 P1-4 家长多子女绑定:动态多行 UI支持一次绑定多个子女",
"v3 P1-5 跳过机制明确化parent 不可跳过子女绑定(核心功能)"
]
},
"i18n": {
"description": "v3 新增项目国际化体系next-intl 4.xwithout i18n routing 模式cookie 驱动)",
"tables": {},
"exports": {
"config": [
{
"name": "getRequestConfig",
"file": "src/i18n/request.ts",
"purpose": "next-intl 请求配置:从 cookie 读取 locale按命名空间加载字典"
},
{
"name": "setLocaleAction",
"file": "src/i18n/actions.ts",
"purpose": "Server Action切换语言写 cookie + revalidatePath"
}
],
"shared": [
{
"name": "LOCALES / Locale / DEFAULT_LOCALE / LOCALE_COOKIE",
"file": "src/shared/i18n/locale.ts",
"purpose": "locale 常量与工具函数"
},
{
"name": "LocaleSwitcher",
"file": "src/shared/components/locale-switcher.tsx",
"purpose": "语言切换组件DropdownMenu + cookie 持久化)"
}
],
"messages": [
"src/shared/i18n/messages/zh-CN/{common,auth,onboarding,classes,errors}.json",
"src/shared/i18n/messages/en/{common,auth,onboarding,classes,errors}.json"
]
},
"routes": {},
"securityNotes": [
"不使用 URL 路由段,避免破坏现有 (auth)/(dashboard)/(onboarding) 路由组结构",
"locale 通过 cookie 持久化SSR 时由 getRequestConfig 读取",
"不使用 Accept-Language 自动协商,避免 SSR 与客户端 hydration 不一致",
"字典放在 shared/i18n/messages/符合三层架构约束shared 为被依赖方)",
"NextIntlClientProvider 在根 layout 注入,服务端/客户端组件均可使用 useTranslations"
]
}
},
"dependencyMatrix": {