Skip to content

feat: AI course content expansion (40 lessons) + sync/UX/typography fixes#9

Merged
roclee2692 merged 5 commits into
Algebraaaa:masterfrom
roclee2692:feature/ai-course-visualizations-info-theory
Jul 7, 2026
Merged

feat: AI course content expansion (40 lessons) + sync/UX/typography fixes#9
roclee2692 merged 5 commits into
Algebraaaa:masterfrom
roclee2692:feature/ai-course-visualizations-info-theory

Conversation

@roclee2692

Copy link
Copy Markdown
Collaborator

概要

四模型众测择优合并 + 后续修复迭代:

课程补齐

  • NLP/CV/RL/LLM 四章扩至各 10 课节(共新增 30 节,全站 112 节),每节含理论推导、公式、C++/Python 代码、复杂度分析、知识点对比、随堂测验
  • 新增 scripts/auditFormulas.mjs:KaTeX 严格解析全部 10 章公式防回归

Bug 修复

  • 课节页左侧目录切换课节时不再跳回顶部(课节页纳入 guide 模式,侧栏/正文独立滚动区;深链进入自动定位当前课节)
  • 块级公式此前被按行内渲染(单行 $$ 的 remark-math 陷阱)→ 渲染入口统一展开,全站公式独立成块
  • 裸 h1-h5/p/a CSS 重置未分层压制一切 @layer 规则 → 归入 @layer base;katex.css 同理
  • llm-mlm 公式 % 未转义、llm-sft 公式含非法 # → 修复
  • SyncService:mergeProgress 补 attempted 维度;新增 flushNow + pagehide 冲刷
  • RemoteStore fetchProgress 异常防护;StepController 拖拽监听器泄漏修复
  • AI 可视化/笔记模块错误边界;generate:ai-index 缺 .js 扩展名修复

验证

201 tests passed · eslint clean · build OK · 浏览器实测通过

🤖 Generated with Claude Code

roclee2692 and others added 5 commits July 6, 2026 17:30
… fixes

- 课程补齐(采纳 nebula_quick):NLP/CV/RL/LLM 扩至各 10 课节,
  全部含理论推导/公式/双语代码/复杂度/知识点对比/随堂测验
- SyncService:mergeProgress 补 attempted 维度合并;新增 flushNow
  (initSynced 守卫),ProgressContext 内部 pagehide 时冲刷 pending 队列
- RemoteStore:fetchProgress 网络/查询异常返回 null 跳过本次同步,
  防止半空快照合并覆盖远端更高测验分;realtime 清理防 unhandled rejection
- StepController:拖拽中途卸载时清理 window 监听器(组件内 ref 方案)
- AILessonPage/AlgorithmTabs:AI 可视化与笔记模块加错误边界;
  snapshot key 改用 canonicalLessonId
- AlgorithmPage:pathNav 计算 useMemo 化
- 测试:保留原 SyncService 套件并追加 4 用例;curriculum 测试锁定
  25 个补齐课节的完整性

拒收项:onyx_quick 的 useCourseProgress 重构(解构不存在的
markComplete 会崩溃且污染算法进度统计)、占位 Playground、
重复的页面级错误边界;mirage/piston 为空交付。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
冲突解决与适配:
- StepController:保留双方——本方拖拽监听器卸载清理 + upstream 活跃实例快捷键作用域
- AILessonPage:采用 upstream 按需加载架构(curriculumIndex + loadLesson),保留本方 AIExercise 错误边界
- curriculum.test:双方新增测试全部保留
- SyncService.flushNow 改走 runFlush 串行化入口,避免与 in-flight flush 并发
- chapters/it.js、data/algorithms/it.js:补 .js 扩展名(generate:ai-index 纯 Node 运行必需)
- 重新生成 curriculumIndex(10 章 112 课节,含本次补齐的 30 节)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
根因:课节页此前依赖 AppLayout 外层 main 滚动(.music-lesson-shell 是
min-height 可增长的,侧栏 overflow-y-auto 从未生效),而 AppLayout 在
每次路由变化时对外层 main 执行 scrollTo(0,0)——课节间切换把左侧目录
一并拽回顶部(视觉上"跳回机器学习章节")。

修复:
- /ai-course/lesson/* 纳入 guide 模式(外层 main 不滚动,页面自管滚动)
- 新增 .music-lesson-shell--fit:shell 锁定容器高度,侧栏/正文成为
  独立滚动区;手机端为全局底部导航预留安全区
- 换课节时仅正文回顶(useLayoutEffect on canonicalLessonId)
- 首次进入(含深链直达)目录自动滚到当前课节居中处,之后完全跟随用户
- CurriculumIndex 当前课节加 data-active 标记供定位

验证:桌面 1440px 下点击目录中相邻课节,目录 scrollTop 保持 2539 不变、
正文回到顶部、高亮正确迁移、控制台零报错;/ai-course 目录页不受影响。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
公式修复:
- llm-mlm 掩码策略公式:\text{} 内未转义的 % 是 KaTeX 注释符,把收尾
  大括号全注释掉导致整条公式解析失败原样显示 → 转义为 \%
- llm-sft 数据格式:公式里塞 #(宏参数符)与 \n 非法 → 改为缩进代码块
- 新增 scripts/auditFormulas.mjs:用 KaTeX 严格解析全部 10 章课程数据
  的每条公式,防回归(当前 ALL FORMULAS OK)
- 单行 $$...$$ 会被 remark-math 按行内公式渲染(挤在文字流里)——
  LessonViewer 渲染入口统一展开为多行块级形式,全站公式获得
  katex-display 独立成块排版

排版放宽(用户反馈太紧密):
- .prose-lesson:正文/列表行高 1.75,段距 12→16px,标题上距 24/32px,
  表格加垫、公式块上下 20px 呼吸空间
- 根因修复:3061 行的裸 h1-h5/p/a 重置未分层,级联优先级压制一切
  @layer 规则(prose 段距、a 上的 text-accent 等全被吞)→ 归入
  @layer base;katex.css 同理改由 index.css 以 layer(base) 引入

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@roclee2692 is attempting to deploy a commit to the Algebra's projects Team on Vercel.

A member of the Team first needs to authorize it.

@roclee2692
roclee2692 merged commit 6c56d6f into Algebraaaa:master Jul 7, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant