fix: 阶段一通过后生命周期状态条不刷新,耗时与下一步指向旧阶段 - #60
Merged
XiaoCow666 merged 1 commit intoSep 19, 2026
Merged
Conversation
XiaoCow666
approved these changes
Sep 19, 2026
XiaoCow666
left a comment
Owner
There was a problem hiding this comment.
CodeSense 自动评审
核心目标已完成:阶段一通过后会触发既有的生命周期状态刷新,并保留原有阶段切换流程。未发现会导致功能无法运行、数据错误或明显回归的阻塞问题。
合并后可以继续改进的地方
- 新增测试仅通过源码字符串断言验证调用存在,无法覆盖请求失败、异步时序或实际状态条渲染结果;这是测试覆盖范围的可改进项,不阻塞本次修复。
已有验证信息
- PR 提供了新增的 pytest 测试文件,但事件中未提供任何测试执行或检查通过的证据。
评审事件:d1696b80-b3dc-11f1-90d8-743aba34de3a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景(一次真实操作观察到的缺灯)
在通过线上「学生体验」入口完整走核心学习路径(阶段一 → 阶段二)时发现:功能能完成,但关键状态变化无法及时观察。
关键路径与问题
/thinking/api/start_session,状态条「学习会话状态」在此时填充一次:current_stage更新为 2 并提交事务,还写了 stage_pass 日志状态条此前只在三种时机刷新:页面初始化、手动点「同步状态」、标签页重新可见。阶段提交成功这一最关键的状态变化点没有刷新,学生看到的是一盏"不亮的灯"。
根因
阶段一提交成功的处理分支(static/js/thinking.js)没有调用既有的
refreshSessionLifecycle()。该函数读取现有只读接口/thinking/api/session/<id>/status并原地渲染,不 reload、不跳转、不触碰输入——灯和开关都已存在,只差在阶段切换时按一下。改动(一个调用环节,static/js/thinking.js)
阶段一
data.passed分支在切换阶段前新增: