feat: 添加上下文事件驱动的InfoBar提醒 - #2365
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新增 Changes上下文通知系统
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: 2
🤖 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_qt/windows/main_app_window_base.py`:
- Line 55: The event listener registered on line 55 using
`self.ctx.listen_event(ContextNotifyEvent.EVENT_ID, self._emit_context_notify)`
is never unbound when the window is destroyed, causing a resource leak. In the
`closeEvent` method of either `MainAppWindowBase` or its subclass `AppWindow`,
add explicit event cleanup by calling `self.ctx.unlisten_all_event(self)` or the
corresponding `unlisten_event` method after the existing cleanup calls like
`pip_btn.dispose()` and `overlay_manager.shutdown()`. This ensures consistency
with the resource cleanup pattern used in other UI components throughout the
codebase.
In `@src/zzz_od/auto_battle/auto_battle_dodge_context.py`:
- Around line 89-92: The microphone initialization code that calls
sc.get_microphone() and _mic.recorder() on lines 89-91 is currently positioned
outside the try block. Move these initialization statements into the try block
so that if an error occurs during microphone or recorder initialization, the
_error_callback will be executed and self.running will be properly reset in the
finally block. This ensures proper error handling and state cleanup for
initialization failures, preventing the running state from being left in an
inconsistent state that would block subsequent microphone starts.
🪄 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: 4aa00f94-4702-47c6-b5bf-4e6e2cb79fc7
📒 Files selected for processing (4)
src/one_dragon/base/operation/context_event_bus.pysrc/one_dragon/base/operation/context_notify_event.pysrc/one_dragon_qt/windows/main_app_window_base.pysrc/zzz_od/auto_battle/auto_battle_dodge_context.py
1706ae8 to
660f93f
Compare
Summary by CodeRabbit
发布说明
新功能
改进
稳定性