feat: 应用级的消息提示增加耗时#2284
Hidden character warning
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough该 PR 在操作通知中加入运行耗时:当任务状态发生(开始/成功/失败)时,计算从 Changes操作通知耗时显示
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
src/one_dragon/base/operation/operation_notify.py
Summary by CodeRabbit