Skip to content

feat: 应用级的消息提示增加耗时#2284

Open
JoshCai233 wants to merge 2 commits into
OneDragon-Anything:mainfrom
JoshCai233:消息提示增加耗时

Hidden character warning

The head ref may contain hidden characters: "\u6d88\u606f\u63d0\u793a\u589e\u52a0\u8017\u65f6"
Open

feat: 应用级的消息提示增加耗时#2284
JoshCai233 wants to merge 2 commits into
OneDragon-Anything:mainfrom
JoshCai233:消息提示增加耗时

Conversation

@JoshCai233
Copy link
Copy Markdown
Contributor

@JoshCai233 JoshCai233 commented May 23, 2026

Summary by CodeRabbit

  • 功能改进
    • 运行状态通知消息中现已显示操作总耗时(开始/成功/失败均会显示),耗时以“{分}分{秒}秒”格式附加在消息末尾,便于快速了解任务执行时长。

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ce448ef-0585-4050-b0bf-596638dad412

📥 Commits

Reviewing files that changed from the base of the PR and between 286a349 and 36acd69.

📒 Files selected for processing (1)
  • src/one_dragon/base/operation/operation_notify.py

📝 Walkthrough

Walkthrough

该 PR 在操作通知中加入运行耗时:当任务状态发生(开始/成功/失败)时,计算从 app.operation_start_time 到当前的总耗时并以“{m}分{s}秒”格式追加到通知消息末尾。

Changes

操作通知耗时显示

Layer / File(s) Summary
耗时计算与消息扩展
src/one_dragon/base/operation/operation_notify.py
导入 time 模块,在 send_application_notify 中计算从 app.operation_start_time 到当前时间的总耗时,格式化为"{m}分{s}秒"后追加到状态通知消息末尾。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 时针轻跳入耳语,
任务行程分秒记,
起止之间有踪迹,
通知末尾现温度,
小兔鼓掌庆更新。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确描述了主要变更:为应用级消息提示增加耗时显示功能,与代码改动完全对应。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/one_dragon/base/operation/operation_notify.py`:
- Around line 104-109: The code passes a dynamic f-string into gt (duration_text
= gt(f"\n总耗时「{m}分{s}秒」") and message uses gt on composed parts), which prevents
proper translation; change to call gt only on static substrings (e.g.,
gt("\n总耗时「") and gt("」") or separate labels like gt("总耗时")/gt("分")/gt("秒")) and
build the final strings by concatenating or formatting those translated static
pieces with the dynamic variables m and s; similarly ensure message uses gt only
around static fragments (use _get_app_info(app) to get app_name, then
gt(app_name) for the name and translate "任务", "运行", and status_text separately,
then compose the final message).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2bf88211-d269-4c80-ad17-ff9c6187affc

📥 Commits

Reviewing files that changed from the base of the PR and between 5511999 and 286a349.

📒 Files selected for processing (1)
  • src/one_dragon/base/operation/operation_notify.py

Comment thread src/one_dragon/base/operation/operation_notify.py Outdated
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.

1 participant