Skip to content

fix: align NextClass display with effective schedule data#74

Closed
yusancky wants to merge 2 commits into
Programmer-MrWang:mainfrom
yusancky:copilot/update-next-class-component-logic
Closed

fix: align NextClass display with effective schedule data#74
yusancky wants to merge 2 commits into
Programmer-MrWang:mainfrom
yusancky:copilot/update-next-class-component-logic

Conversation

@yusancky
Copy link
Copy Markdown

@yusancky yusancky commented May 12, 2026

问题

NextClassDisplayComponent 原先直接读取原始课程配置数据,在「档案设置」中禁用时间线上的下一节课程后,仍会显示这些未启用的课程作为“下一节课”,导致组件显示与实际课程表安排不一致。

解决策略

重构 Controls/Components/NextClassDisplayComponent.axaml.cs 相关逻辑,改为直接依赖 ILessonsService 提供的已计算字段:

  • NextClassSubject
  • NextClassTimeLayoutItem

这些字段ILessonsService 基于当前启用状态、有效课表和时间上下文计算得出,已经排除未启用课程,确保显示内容准确。同时,复用服务层课表计算逻辑,避免 UI 层重复实现筛选,提升了相关逻辑健壮性。

验证

  • GitHub Copilot 已在本地构建 dotnet build -c Release -p:EnableWindowsTargeting=true 通过,并已执行 parallel_validation,确认 CodeQL 扫描无告警和完成 Code Review 反馈处理。
  • 我通过在 ClassIsland 2.0.3.2 安装 GitHub Actions 工作流 构建的插件测试,确认在修改课程启用状态时,NextClass 组件会立即正确刷新。

@Programmer-MrWang
Copy link
Copy Markdown
Owner

嗯诶
我在2.5.0.0发布后已经解决该问题了诶
也就是你改前这代码好像无问题()
你试试 action 里最新构建2.5.0.106有没有这个问题
@yusancky

@Programmer-MrWang
Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ 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".

@Programmer-MrWang
Copy link
Copy Markdown
Owner

目前长时间上学面临高考,可能需要一段时间审查完成代码。敬请谅解。

@yusancky
Copy link
Copy Markdown
Author

我在2.5.0.0发布后已经解决该问题了诶
也就是你改前这代码好像无问题()
你试试 action 里最新构建2.5.0.106有没有这个问题

试了一下,在我的测试情况下,工作都符合预期。


这样的话,这个 PR 只能说是用一些预计算值对逻辑做了轻微简化,实际收益有限。为节省时间避免意外引入问题,我决定关闭它。

@yusancky yusancky closed this May 16, 2026
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.

3 participants