Repository navigation
Activate an existing default profile when none is active [patch] - #179
Merged
Merged
Conversation
CreateDefaultProfile returned null as soon as the profile existed and never honoured its activation argument. Once the active profile was deleted, every later launch following the README startup sequence ran with no active profile, so BindChord returned false and ExecuteChord null, with no way back. With ProfileActivation.Activate, an existing profile is now activated when no profile is active. An active profile the user chose is left alone, and the return value keeps its documented meaning (null when the profile already existed). Fixes #174 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01T4yQx7YuowTGorXJRkhe8x
|
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 #174
What changed
KeybindingManager.CreateDefaultProfilereturnednullas soon as the profile existed, and ignoredactivation. If the active profile had been deleted, every later launch that followed the README startup sequence had no active profile, soBindChordreturnedfalseandExecuteChordreturnednull.Now, with
ProfileActivation.Activate(the default), an existing profile is activated when no profile is active:DoNotActivatestill activates nothing.nullwhen the profile already existed). The issue floated returning the existing profile instead, but that would quietly change a public contract that callers may branch on, so I left it out. It's easy to add if you want it.The
InitializeAsyncfallback, which the issue lists as an alternative, is not included. It would change load behaviour for apps that never callCreateDefaultProfile, and that's a separate decision.Tests
DefaultProfileReactivationTests:defaultis active,BindChordsucceeds andExecuteChordfinds the command. It fails without the fix (Assert.AreEqual("default", …GetActiveProfile()?.Id)) and passes with it.DoNotActivateleaves no profile active.The full suite passes (200/200).
🤖 Generated with Claude Code
https://claude.ai/code/session_01T4yQx7YuowTGorXJRkhe8x
Generated by Claude Code