镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Reconcile a default profile created before InitializeAsync with the stored profiles [patch] - #250

Open
matt-edmondson wants to merge 2 commits into
mainfrom
fix/create-before-init-placeholder
Open

matt-edmondson wants to merge 2 commits into
mainfrom
fix/create-before-init-placeholder

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #247
Fixes #248

Both issues are gaps in the create-before-init path that #206 made supported, and their triage asked for one fix, so this PR covers both.

What changed

KeybindingManager now remembers the profile CreateDefaultProfile() makes before InitializeAsync() has run, along with the name and description it gave it. InitializeAsync() then reconciles that placeholder with what is stored:

This follows the triage note on #248: it reconciles inside InitializeAsync rather than throwing before init, so the call order #206 supports keeps working.

Tests

New tests in ProfileCreatedBeforeInitializeTests:

  • ProfileCreatedBeforeInitialize_TakesTheStoredNameAndDescription: the rename survives a create-before-init launch, a save, and a reload
  • ProfileCreatedBeforeInitialize_ResolvesDuplicateStoredChordsAsAFreshLoadDoes: the issue's duplicate-chord fixture resolves to a.cmd and keeps both bindings after a save
  • DefaultProfileCreatedBeforeInitialize_DoesNotBringBackADeletedDefault: the A "default" profile the user deleted comes back for good when CreateDefaultProfile() runs before InitializeAsync() (#189 returns on the #206 path) #248 sequence ends with only vim, in memory and on disk
  • DefaultProfileCreatedBeforeInitialize_ActivatesAStoredProfileWhenItsPlaceholderIsDropped
  • DefaultProfileCreatedBeforeInitialize_IsKeptOnceTheAppHasBoundIt: guard test; it passes before and after the change

I reverted KeybindingManager.cs and reran the class: the first four tests fail without the fix and pass with it. The full suite passes: 439 tests, 0 failures. dotnet format --verify-no-changes is clean on the changed files.


Generated by Claude Code

…tored profiles [patch]

A placeholder from CreateDefaultProfile() called before InitializeAsync() now takes
the stored profile's name and description, copies stored bindings as a fresh load
would (duplicate chords included), and is dropped when the user deleted "default"
but has other profiles stored.

Fixes #247
Fixes #248

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW2nqDpBsFvG1itmU1b
…ts complexity in bounds [patch]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW2nqDpBsFvG1itmU1b
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants