fix: handle unsupported hotkey gracefully in menu builder#219
Closed
gamedevCloudy wants to merge 2 commits intoRustCastLabs:masterfrom
Closed
fix: handle unsupported hotkey gracefully in menu builder#219gamedevCloudy wants to merge 2 commits intoRustCastLabs:masterfrom
gamedevCloudy wants to merge 2 commits intoRustCastLabs:masterfrom
Conversation
Panic occurred when toggle_hotkey config contained keys unsupported by tray-icon's Accelerator (e.g. ALT/Option on macOS). Changed unwrap to ok() and added fallback menu item without accelerator.
Collaborator
To me, this seems like more than 25% AI Code, and hence I cannot accept this change right now. If you are able to improve the code quality without using AI, I can merge this PR. |
Author
|
Thank you for the review. I understand the AI requirements, I will close this request. |
Collaborator
|
No worries, since this is a beta version I'll add this feature for you, and it should be available either today or tomorrow (If you join the discord server you can opt in for new release pings) |
Merged
Collaborator
|
@gamedevCloudy the fix has been added to rustcast! |
Author
|
thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Bug]App crashes on launch with UnsupportedKey("OPT") panic in menu builder
Explanation:
Rustcast v0.7.0-beta crashes immediately on macOS when launched in standard (non-agent) mode. The app attempts to parse the default toggle hotkey (ALT+SPACE) and register it as a tray menu accelerator. On macOS, the ALT modifier maps to the Option key which tray-icon's Accelerator does not support. The unwrap() call on the parse result causes a panic that terminates the main thread, making the app completely unusable.
What we did to find it:
How to reproduce:
System info:
Fix applied:
Changed .unwrap() to .ok() on the hotkey parse and added graceful degradation, when the hotkey contains unsupported keys, the "Toggle View" menu item renders without an accelerator and the app uses a simplified event handler.
Disclosure: AI Used