fix(profile): 使时间表分割线等变更实时同步到课程表组件#1878
Merged
HelloWRC merged 3 commits intoJun 21, 2026
Merged
Conversation
分割线(TimeType==2)增删修改后,ValidTimeLayoutItems 缓存未失效,主界面课程表组件保持旧渲染结果,需要重启才更新。 修复方式: - TimeLayout:订阅每个 TimeLayoutItem 的属性变化,属性变更时触发 LayoutObjectChanged 通知关联课表 - ClassPlan:TimeLayoutOnLayoutItemChanged 末尾补充 NotifyClassesChanged(),使分割线等非上课时间点增删也令 ValidTimeLayoutItems 标脏并通知绑定
- 删除 ClassesChanged 事件定义后的空行 - 保持代码格式整洁一致
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9028e22b89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- 在Replace操作中正确处理移除和插入的类信息 - 添加TimeLayoutItem属性变更事件监听以同步类索引 - 实现时间类型变更时的类索引映射和通知机制 - 为Move操作添加类列表刷新功能 - 优化时间布局项的属性变更处理逻辑
HelloWRC
approved these changes
Jun 21, 2026
Member
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.

分割线(TimeType==2)增删修改后,ValidTimeLayoutItems 缓存未失效,主界面课程表组件保持旧渲染结果,需要重启才更新。
修复方式:
这个 Pull Request 做了什么?
档案编辑器中修改时间表(增删分割线、修改时间点属性等)后,主界面课程表组件无法实时更新,需重启应用才能生效。
根因在于
ClassPlan.ValidTimeLayoutItems存在缓存,而分割线(TimeType == 2)及时间点属性变化不会触发ClassesChanged,导致缓存未标脏,界面仍显示旧数据。修复方案保持在模型层,无需在编辑器窗口额外手动刷新:
TimeLayout:监听每个TimeLayoutItem的属性变化,任何字段(StartTime、EndTime、TimeType、BreakName等)变动时,通过LayoutObjectChanged通知所有关联课表;ClassPlan:在TimeLayoutOnLayoutItemChanged末尾补充NotifyClassesChanged(),确保新增/删除分割线或非上课时间点时,ValidTimeLayoutItems缓存失效。该改动对所有使用
ValidTimeLayoutItems的位置(课程表组件、明日课表、倒计时组件、通知提供方等)均生效,编辑器修改后即同步更新。检查清单
2026-06-21.12-55-33.mp4