Skip to content

Activate an existing default profile when none is active [patch] - #179

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/174-activate-existing-default-profile
Oct 9, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/174-activate-existing-default-profile

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #174

What changed

KeybindingManager.CreateDefaultProfile returned null as soon as the profile existed, and ignored activation. If the active profile had been deleted, every later launch that followed the README startup sequence had no active profile, so BindChord returned false and ExecuteChord returned null.

Now, with ProfileActivation.Activate (the default), an existing profile is activated when no profile is active:

  • An active profile the user chose is never overridden.
  • DoNotActivate still activates nothing.
  • The return value keeps its documented meaning (null when 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 InitializeAsync fallback, which the issue lists as an alternative, is not included. It would change load behaviour for apps that never call CreateDefaultProfile, and that's a separate decision.

Tests

DefaultProfileReactivationTests:

  • Two-launch regression (the issue's repro): on the second launch default is active, BindChord succeeds and ExecuteChord finds the command. It fails without the fix (Assert.AreEqual("default", …GetActiveProfile()?.Id)) and passes with it.
  • Guards: an existing default doesn't override another active profile, and DoNotActivate leaves no profile active.

The full suite passes (200/200).

🤖 Generated with Claude Code

https://claude.ai/code/session_01T4yQx7YuowTGorXJRkhe8x


Generated by Claude Code

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
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 7750ce6 into main Oct 9, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/174-activate-existing-default-profile branch October 9, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant