Repository navigation
Leave a later toggle alone when the tray icon's first toggle is disabled [patch] - #68
Merged
Merged
Conversation
…led [patch] The left-click shortcut skipped a disabled first toggle and flipped the next enabled one instead. The icon follows the first toggle by default, so the click changed (and, with persistAs, remembered) a setting the icon doesn't show. Stop at the first toggle and activate it only when it is enabled. Fixes #67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW67k6oxx5vQPHu3V4Q
|
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.



Fixes #67
What changed
When the first toggle was disabled,
TrayApplication.OnTrayIconClickedskipped it and flipped the next enabled toggle instead. The icon follows the first toggle by default (ActiveWhen→FirstToggleState). So a left click changed a setting the icon doesn't show, andonToggledsaved that change when the toggle had apersistAskey.The loop now stops at the first
TrayToggleItem, whether or not it is enabled, and callsActivateonly whenIsEnabledis true. The<summary>and remarks now describe it as "the first toggle, or nothing" rather than "the first enabled toggle".Tests
TrayIconClick_WithTheFirstToggleDisabled_LeavesTheSecondToggleAlone: two toggles with the first disabled. A click on the icon runs neither setter and never callsonToggled.Assert.AreEqual(0, secondSetterCalls). With the fix, it passes.Generated by Claude Code