Skip to content

档案编辑器的时间表设置中,添加复制时间点功能 (#1786)#1803

Merged
HelloWRC merged 7 commits into
ClassIsland:masterfrom
genius-alray:master
Jun 25, 2026
Merged

档案编辑器的时间表设置中,添加复制时间点功能 (#1786)#1803
HelloWRC merged 7 commits into
ClassIsland:masterfrom
genius-alray:master

Conversation

@genius-alray

Copy link
Copy Markdown
Contributor

这个 Pull Request 做了什么?

在档案编辑器中时间表编辑的工具栏加入“创建副本”命令,可将选中的时间点进行原地复制(深拷贝)

相关 Issue

Fixes #1786

检查清单

  • 我已经在本地测试过这个 PR,确保欲实现的功能或修复的问题能正常工作。

genius-alray and others added 2 commits May 16, 2026 10:56
在档案编辑的时间表时间点列表中添加创建副本按钮,点击后可
原地复制当前选中的时间点(包括行动组 ActionSet 等所有属性),
并弹出成功提示。使用 ConfigureFileHelper.CopyObject 深拷贝,
与项目中其他复制功能(课表、时间表、科目)实现一致。
@genius-alray genius-alray requested review from a team and HelloWRC as code owners May 16, 2026 03:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1853734232

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

Comment thread ClassIsland/Views/ProfileSettingsWindow.axaml.cs
AddTimePoint 方法的循环条件 i < l.Count - 1 跳过了最后一个
元素,导致当复制的项目是倒数第二个时间点时,重复项被追加到
列表末尾而非插入到正确位置,破坏了时间顺序。

修复后将循环条件改为 i < l.Count,确保所有元素都参与比较。
Comment thread ClassIsland/Views/ProfileSettingsWindow.axaml.cs Outdated
Comment thread ClassIsland/Views/ProfileSettingsWindow.axaml.cs Outdated
@HelloWRC

Copy link
Copy Markdown
Member

另外对于像上课和课间休息这样的时间块,应该插入到当前时间点的后方,不应与其它时间点重叠。具体请参考新建时间点时的插入行为。

- 移除 DuplicateTimePoint 方法中的冗余注释
- 对于分割线和行动类型的时间点,复制时插入到当前时间点后方,避免重叠
修改 DuplicateTimePoint 方法,对所有时间点类型(上课、课间休息、分割线、行动)
都将 StartTime 设置为选中时间点的 EndTime,确保复制的时间点插入到当前时间点后方,
与新增时间点行为一致
@genius-alray genius-alray requested a review from HelloWRC May 16, 2026 04:59

@HelloWRC HelloWRC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发现了如下问题:

  1. 复制时间点时没有进行限界,可以将时间点一路复制到超出时间表范围
Image

ToolTip.Tip="创建选中时间点的副本。"
IsEnabled="{Binding $parent[views:ProfileSettingsWindow].ViewModel.SelectedTimePoint, Converter={x:Static ObjectConverters.IsNotNull}}"
Label="创建副本" />
<controls:CommandBarSeparator />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该考虑删除此分割线,将此操作与删除等时间点操作合并为一组。

… time point

- Add boundary check to prevent duplicating beyond 23:59:59
- Add overlap prevention for class/break time points (consistent with AddTimeLayoutItem)
- Add duplicate position check for separators and actions
- Group 'create copy' and 'delete' buttons together by removing redundant separator

Addresses review feedback from HelloWRC on PR ClassIsland#1803.
@genius-alray genius-alray requested a review from HelloWRC June 9, 2026 16:36
@HelloWRC

Copy link
Copy Markdown
Member

@genius-alray 合并一下上游

@HelloWRC HelloWRC merged commit 2471598 into ClassIsland:master Jun 25, 2026
2 checks passed
@HelloWRC

Copy link
Copy Markdown
Member

感谢您的贡献🤝

昔涟 爱

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.

(功能建议)档案编辑 时间表 行动 复制粘贴功能

2 participants