refactor(lesson-preparation): V2 审计深度修复 — Server Actions i18n + 错误码模式 + 类型断言清零 + a11y 深度修复 + Tracker 埋点接入

V2-1: 12 个 Server Action 通过 getTranslations 翻译错误消息;Service/DataAccess 层抛出错误码异常(PublishServiceError/LessonPlanDataError),Actions 层通过 PUBLISH_ERROR_KEY_MAP 翻译为 i18n 消息
V2-2: SYSTEM_TEMPLATES name/title 改为 i18n 键,createLessonPlan 接受 translateTitle 函数在服务端翻译后存储到 DB
V2-3: 8 处 as unknown as 断言替换为显式类型映射函数(mapRowToLessonPlan/mapRowToListItem/mapRowToTemplate/mapRowToVersion)+ 类型守卫(isLessonPlanStatus/isTemplateType/isTemplateScope)
V2-4: MiniMap nodeColor 复用 lib/node-summary.ts 的 getNodeColor
V2-5: a11y 深度修复 — lesson-plan-filters/exercise-block/inline-question-editor 的 select 添加 label htmlFor 关联;exercise-block 题目列表改为 ul/li;node-editor 画布添加 role=application + 键盘导航配置
V2-6: Tracker 埋点接入 — 新增 useLessonPlanTrackerSafe hook,在 create/save/publish/revert/duplicate/archive 6 处调用 tracker.track

同步更新架构图 004 和 005 文档
This commit is contained in:
SpecialX
2026-06-22 18:45:35 +08:00
parent 1fe30984b6
commit 97e59b95a1
23 changed files with 668 additions and 135 deletions

View File

@@ -63,9 +63,30 @@
"tpl_experiment": "Experiment Lesson",
"tpl_inquiry": "Inquiry Lesson",
"tpl_blank": "Blank Template"
},
"blocks": {
"tpl_review": {
"1": "Knowledge Network",
"2": "Typical Examples",
"3": "Variant Training"
},
"tpl_experiment": {
"1": "Equipment Preparation",
"2": "Experiment Steps",
"3": "Observation Record",
"4": "Discussion"
},
"tpl_inquiry": {
"0": "Scenario Introduction",
"1": "Problem Driven",
"2": "Group Inquiry",
"3": "Results Presentation",
"4": "Inductive Elevation"
}
}
},
"editor": {
"canvasLabel": "Lesson Plan Canvas",
"canvasEmpty": "Canvas is empty",
"canvasEmptyHint": "Click \"Add Node\" at the bottom left to start",
"selectNodeHint": "Click a node to edit content, or drag to connect",
@@ -142,6 +163,7 @@
"addBtn": "Add"
},
"exercise": {
"purposeLabel": "Purpose",
"purpose": {
"class_practice": "Class Practice",
"after_class_homework": "After-class Homework"

View File

@@ -63,9 +63,30 @@
"tpl_experiment": "实验课",
"tpl_inquiry": "探究课",
"tpl_blank": "空白模板"
},
"blocks": {
"tpl_review": {
"1": "知识网络梳理",
"2": "典型例题精讲",
"3": "变式训练"
},
"tpl_experiment": {
"1": "器材准备",
"2": "实验步骤",
"3": "观察记录表",
"4": "交流讨论"
},
"tpl_inquiry": {
"0": "情境导入",
"1": "问题驱动",
"2": "小组探究",
"3": "成果展示",
"4": "归纳提升"
}
}
},
"editor": {
"canvasLabel": "备课画布",
"canvasEmpty": "画布为空",
"canvasEmptyHint": "点击左下角\"添加节点\"开始备课",
"selectNodeHint": "点击节点编辑内容,或拖拽连线建立流程",
@@ -142,6 +163,7 @@
"addBtn": "添加"
},
"exercise": {
"purposeLabel": "用途",
"purpose": {
"class_practice": "课堂练习",
"after_class_homework": "课后作业"