Skip to content

Fix worktree creation bugs on Windows#142

Merged
PureWeen merged 4 commits intomainfrom
fix/worktree-button-disabled-windows
Feb 18, 2026
Merged

Fix worktree creation bugs on Windows#142
PureWeen merged 4 commits intomainfrom
fix/worktree-button-disabled-windows

Conversation

@PureWeen
Copy link
Owner

Summary

Fixes several bugs preventing worktree creation from working properly on Windows.

Changes

1. Worktree create button stays disabled while typing

File: \CreateSessionForm.razor\

The branch name and PR number inputs used @Bind\ which defaults to \onchange\ (fires on blur). The create button's \disabled\ attribute checked the bound value, so it stayed disabled while typing. Changed both inputs to @Bind:event="oninput"\ so the value updates on every keystroke.

2. Sidebar doesn't refresh when repos are added/removed

File: \SessionSidebar.razor\

\SessionSidebar\ subscribed to \CopilotService.OnStateChanged\ but not \RepoManager.OnStateChanged. When a repo was added (e.g. dotnet/maui), the sidebar never re-rendered. Added subscription with proper cleanup in \Dispose().

3. Repo groups disappear after app restart

File: \CopilotService.Organization.cs\

\ReconcileOrganization\ only created sidebar groups for repos that had sessions with worktrees. Repos added without creating sessions lost their group on restart. Now ensures every tracked repo has a sidebar group during reconciliation.

4. Worktree creation fails on repos with long file paths

File: \RepoManager.cs\

Repos like \dotnet/maui\ have test files exceeding Windows' MAX_PATH (260 chars), causing \git worktree add\ to fail with 'Filename too long'. Now sets \core.longpaths=true\ on bare clones — both for new repos and when re-fetching existing ones.

Testing

  • All 610 existing tests pass
  • Manually verified: MAUI repo group appears in sidebar, worktree creation succeeds on Windows

PureWeen and others added 4 commits February 18, 2026 08:26
The branch name and PR number inputs used @Bind which defaults to
onchange (fires on blur). The create button's disabled attribute
checked the bound value, so it stayed disabled while typing. Changed
both inputs to @Bind:event="oninput" so the value updates on every
keystroke and the button enables immediately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SessionSidebar subscribed to CopilotService.OnStateChanged but not to
RepoManager.OnStateChanged. When a repo was added (e.g. dotnet/maui),
the sidebar never re-rendered to show the new repo group. Subscribe to
RepoManager.OnStateChanged and trigger StateHasChanged so newly added
repos appear immediately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ReconcileOrganization only created sidebar groups for repos that had
sessions with worktrees. Repos added without creating any sessions
(e.g. dotnet/maui) lost their group on restart. Now ensures every
tracked repo in RepoManager.Repositories has a corresponding sidebar
group during reconciliation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Repos like dotnet/maui have test files that exceed the Windows
MAX_PATH limit (260 chars), causing worktree creation to fail with
'Filename too long' errors. Set core.longpaths=true on the bare
clone after adding a repository so all worktrees inherit the setting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit 0f86e1c into main Feb 18, 2026
5 checks passed
@PureWeen PureWeen deleted the fix/worktree-button-disabled-windows branch February 22, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant