feat(profile): 创建临时层课表时支持同时创建临时时间表#1781
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 333b44f783
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| public async void Open(Uri? uri = null) | ||
| public async void Open() |
There was a problem hiding this comment.
Restore URI-based tab routing in profile settings open path
Changing Open to take no Uri and removing the segment-based tab selection breaks app URI navigation for profile subpages. The app still routes profile links with a URI (App.axaml.cs line 872 via MainWindow.OpenProfileSettingsWindow(Uri?)), so links like /profile/timelayouts will no longer land on the requested tab and can only open whatever tab was previously selected.
Useful? React with 👍 / 👎.
| e.Cancel = true; | ||
| _isOpen = false; | ||
| ViewModel.ProfileService.SaveProfile(); | ||
| Hide(); |
There was a problem hiding this comment.
Save profile before hiding the editor window
The non-shutdown close path now just cancels and hides the window, but no longer persists the profile first. This risks losing recent edits if the process exits unexpectedly before another explicit save, because profile autosave is wired to Profile.PropertyChanged and many class/time-table edits mutate nested objects rather than raising a top-level profile change.
Useful? React with 👍 / 👎.
HelloWRC
left a comment
There was a problem hiding this comment.
请回滚 ProfileSettingsWindow.xaml[.cs] 中所有无关更改和所有 SentrySdk 用法的更改。
请修复所有的编译错误,并确保应用能正常编译并运行。
如果您持续提交此类低质量 PR,我们可能会临时或永久限制您向本仓库提交补丁的能力。
|
在本地编译成功,可以正常运行,请提供您的意见 |
- Add IsOverlay and OverlaySourceId properties to TimeLayout - Add createTempTimeLayout parameter to CreateTempClassPlan - Add checkbox in flyout: create temp time layout together - CleanExpiredTempClassPlan auto-cleans orphaned temp time layouts - ConvertToStdClassPlan converts associated temp time layout too
- Revert ProfileSettingsWindow Open/Close changes (separate PR) - Revert MainWindow and App.axaml URI routing changes (separate PR) - Use method overload instead of default parameter in IPublicProfileService - Keep only temp time layout creation feature
- 回滚 ProfileSettingsWindow.axaml/.cs 到上游版本,仅加 CheckBox + 参数传递 - 回滚 ViewModel 无关属性,仅保留 TempOverlayCreateTimeLayout - 回滚 SentrySdk EmitCounter -> Increment 的 API 变更 - 回滚 Weather/Plugins/Toast 等 15 个无关文件变更 - 核心功能完整保留:IsOverlay、CreateTempClassPlan(createTempTimeLayout)、清理逻辑
126e5ac to
729515a
Compare
|
已经进行重构,确保符合要求 |
| } | ||
|
|
||
| var activeTimeLayoutIds = Profile.ClassPlans.Values | ||
| .Where(x => !x.IsOverlay || orderedSchedules.Contains(GetKey(x))) |
There was a problem hiding this comment.
此处应该直接对 ClassPlans 字典进行查询,这样查询时可以直接从 x 中同时获取到对应课表的值和 Guid 键,无需再引入 GetKey 方法进行查询,以降低时间复杂度。
| /// <summary> | ||
| /// 创建临时层课表,并可选择同时创建临时时间表。如果已经存在临时层课表,则本方法不起作用。 | ||
| /// </summary> | ||
| Guid? CreateTempClassPlan(Guid id, Guid? timeLayoutId, DateTime? enableDateTime, bool createTempTimeLayout); |
There was a problem hiding this comment.
好的,我立即修改,感谢您的建议
- 将 CleanExpiredTempClassPlan 中 ClassPlans.Values 遍历改为字典直接迭代,移除 GetKey 辅助方法。- 为 IPublicProfileService.CreateTempClassPlan(4参数) 重载补充 XML 文档注释。
dfae432 to
9d391a5
Compare
-2026-05-02-202931.mp4这是测试后的效果 |
|
@all-contributors please add @Chineseshuaji for code |
|
I've put up a pull request to add @Chineseshuaji! 🎉 |
* feat(profile): create temp time layout alongside temp class plan - Add IsOverlay and OverlaySourceId properties to TimeLayout - Add createTempTimeLayout parameter to CreateTempClassPlan - Add checkbox in flyout: create temp time layout together - CleanExpiredTempClassPlan auto-cleans orphaned temp time layouts - ConvertToStdClassPlan converts associated temp time layout too * fix: revert unrelated changes, use method overload for binary compat - Revert ProfileSettingsWindow Open/Close changes (separate PR) - Revert MainWindow and App.axaml URI routing changes (separate PR) - Use method overload instead of default parameter in IPublicProfileService - Keep only temp time layout creation feature * style: remove consecutive blank lines (SA1507) * style: remove all consecutive blank lines (SA1507) * fix: 移除无关更改,仅保留临时层时间表核心功能 - 回滚 ProfileSettingsWindow.axaml/.cs 到上游版本,仅加 CheckBox + 参数传递 - 回滚 ViewModel 无关属性,仅保留 TempOverlayCreateTimeLayout - 回滚 SentrySdk EmitCounter -> Increment 的 API 变更 - 回滚 Weather/Plugins/Toast 等 15 个无关文件变更 - 核心功能完整保留:IsOverlay、CreateTempClassPlan(createTempTimeLayout)、清理逻辑 * fix: 按审查意见修复临时时间表查询效率与文档注释 - 将 CleanExpiredTempClassPlan 中 ClassPlans.Values 遍历改为字典直接迭代,移除 GetKey 辅助方法。- 为 IPublicProfileService.CreateTempClassPlan(4参数) 重载补充 XML 文档注释。 --------- Co-authored-by: Chineseshuaji <chineseshuaji@github.com>
* feat(profile): create temp time layout alongside temp class plan - Add IsOverlay and OverlaySourceId properties to TimeLayout - Add createTempTimeLayout parameter to CreateTempClassPlan - Add checkbox in flyout: create temp time layout together - CleanExpiredTempClassPlan auto-cleans orphaned temp time layouts - ConvertToStdClassPlan converts associated temp time layout too * fix: revert unrelated changes, use method overload for binary compat - Revert ProfileSettingsWindow Open/Close changes (separate PR) - Revert MainWindow and App.axaml URI routing changes (separate PR) - Use method overload instead of default parameter in IPublicProfileService - Keep only temp time layout creation feature * style: remove consecutive blank lines (SA1507) * style: remove all consecutive blank lines (SA1507) * fix: 移除无关更改,仅保留临时层时间表核心功能 - 回滚 ProfileSettingsWindow.axaml/.cs 到上游版本,仅加 CheckBox + 参数传递 - 回滚 ViewModel 无关属性,仅保留 TempOverlayCreateTimeLayout - 回滚 SentrySdk EmitCounter -> Increment 的 API 变更 - 回滚 Weather/Plugins/Toast 等 15 个无关文件变更 - 核心功能完整保留:IsOverlay、CreateTempClassPlan(createTempTimeLayout)、清理逻辑 * fix: 按审查意见修复临时时间表查询效率与文档注释 - 将 CleanExpiredTempClassPlan 中 ClassPlans.Values 遍历改为字典直接迭代,移除 GetKey 辅助方法。- 为 IPublicProfileService.CreateTempClassPlan(4参数) 重载补充 XML 文档注释。 --------- Co-authored-by: Chineseshuaji <chineseshuaji@github.com>

概述
在创建临时层课表时,新增"同时创建临时时间表"选项。勾选后,临时层课表将获得独立的时间表副本,对时间表的修改不会影响源时间表。
变更内容
检查清单
关联 Issue
#1783
🤝 关于反馈
我是第一次提交PR,对项目架构还不够熟悉。
任何问题都欢迎直接指出——我会认真看每条评论。
如果可以的话,麻烦在指出问题时:
提前感谢花时间review 🙏