重做到期通知的逐项处置与忽略语义 - #78
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d95ab3a96
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Refs #55
本 PR 取代冲突的 #59;#59 不应继续合入,并应在本 PR 完成后关闭。
目的
把多任务同时到期时的通知改为完全逐项处置:每条任务只在自己的行内完成、独立推迟或忽略,移除复选框和底部批量区,避免用户在到期瞬间维护额外选择状态。
行为变化
_adjust_size_and_position策略,不改变主列表、托盘、主题切换或存储结构。行内控件形态
使用紧凑的行内按钮组:完成是单击按钮,推迟是带四项菜单的按钮,忽略是单击按钮。任何单条处置不超过两次点击,也不存在需要提前维护的选择状态。移除底部区后,视觉层级与行为入口统一集中在对应任务行。
“忽略”字段语义
dueDateNonesnoozeUntilNonenotifiedForReminderFalsenotifiedForDueFalsereminderOffsetcompletedlastNotifiedAt数据变更仍只由
main_window.pyhandler 执行;dialogs.py只发出单元素 ID 列表。处理后统一保存、刷新主列表并从通知窗口移除对应行,清空时复用现有关闭行为。相对时间格式化与刷新
主列表 formatter 是
TodoItemWidget的私有实例方法,且widgets.py不在本 Issue 范围;本 PR 在NotificationDialog内保留最小时长 formatter,严格沿用主列表的天/时/分/秒单位、向下取整和最多两段规则。对话框持有 1 秒QTimer,每轮以同一个 UTC 当前时刻刷新全部可见行,不调用_adjust_size_and_position。修改过的现有断言
未删除覆盖场景,按最终交互替换旧断言:
test_actions_emit_only_selected_tasks_and_keep_remaining_rows重命名为test_dialog_has_only_inline_actions_and_keeps_remaining_rows。旧的默认勾选、批量按钮 enable/no-op 和批量 signal 断言已不再适用,替换为:对话框根布局只有标题与任务区、没有任何QCheckBox、旧四个批量控件属性与batchIgnoreButton均不存在。test_inline_actions_target_only_their_own_task保留完成/独立推迟/忽略只发送自己的 ID,并新增“忽略”文案和 tooltip 中“清除截止时间”的断言。新增与既有测试继续覆盖行内单条完成/推迟/忽略、四个推迟菜单项、绝对+相对时间、1 秒全行刷新、不同任务不同推迟时长,以及忽略字段语义和后续 tick。
本地验证
解释器:
D:\Develop\Tool\Miniconda\envs\try\python.exe,PySide6 6.9.0;仓库锁定 PySide6 6.11.1 由 CI 验证。python -m unittest discover -s tests -v:Ran 74 tests,OK,0 failure、0 error、0 skip。python -m unittest tests.test_notifications -v:16 项通过。python -m compileall todo_app:通过。git diff --check:通过。git diff --name-status origin/main...HEAD -- tests/:M tests/test_notifications.py。Windows Qt 手工/视觉验证
使用 Windows 原生 Qt 构造三个相近到期任务:
截图已在本地交付环境生成;CLI 无法直接把本地二进制作为 PR 附件上传。
CI 根因与新 HEAD
e48f2ce的 run 31119608056 三次尝试均在执行仓库代码前失败:两个 job 15 分钟未获 hosted runner;一个 job 获得 Ubuntu runner后,在下载官方 action 元数据时连续收到Service Unavailable与 HTTP timeout。compileall或unittest,因此失败与本地代码或断言无关,修改 workflow/业务代码无法修复 GitHub runner/下载服务。b82516952fbec122b9d10a49f3c9d2ed9609e767。已推送并等待 GitHub 为 synchronize 事件创建新的tests.ymlcheck;创建后将回写实际运行结果与用例总数。Codex review closure
1d95ab3指出相对时间不持续刷新,已在e48f2ce修复并解决 thread。b825169包含新的 UI 精简,需以该 HEAD 的后续 Codex review 结论为最终依据。文档与锚点
v2.1.0。已知风险
tests.yml为准。