Skip to content

Commit e8d167a

Browse files
fix(server): refresh a removed worktree's status locally, drop no-op sidebar change
Main already clears a deleted checkout from sidebar rows once status says isRepo: false (#34878). What remains is telling the removed path's subscribers, so read only its local status: it has no remote to fetch. The branch-mismatch edit changed nothing: a non-repository reports a null ref, so no mismatch is computed either way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 85bb2a0 commit e8d167a

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎apps/server/src/ws.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,13 +3157,15 @@ export const layerWsRpc = (
31573157
[WS_METHODS.vcsCreateWorktree]: (input) =>
31583158
gitWorkflow.createWorktree(input).pipe(Effect.tap(() => refreshGitStatus(input.cwd))),
31593159
[WS_METHODS.vcsRemoveWorktree]: (input) =>
3160-
gitWorkflow
3161-
.removeWorktree(input)
3162-
.pipe(
3163-
Effect.tap(() =>
3164-
Effect.all([refreshGitStatus(input.cwd), refreshGitStatus(input.path)]),
3165-
),
3160+
gitWorkflow.removeWorktree(input).pipe(
3161+
Effect.tap(() => refreshGitStatus(input.cwd)),
3162+
// Subscribers of the removed checkout learn it is no longer a repository.
3163+
Effect.tap(() =>
3164+
vcsStatusBroadcaster
3165+
.refreshLocalStatus(input.path)
3166+
.pipe(Effect.ignoreCause({ log: true }), Effect.forkDetach, Effect.asVoid),
31663167
),
3168+
),
31673169
[WS_METHODS.vcsCreateRef]: (input) =>
31683170
gitWorkflow.createRef(input).pipe(Effect.tap(() => refreshGitStatus(input.cwd))),
31693171
[WS_METHODS.vcsSwitchRef]: (input) =>

‎apps/web/src/components/sidebar/SidebarThreadRow.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,9 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
806806
const isWokeStatus = topStatus?.icon === "woke";
807807

808808
const branchMismatch = resolveLocalCheckoutBranchMismatch({
809-
effectiveEnvMode: checkoutThread.worktreePath === null ? "local" : "worktree",
810-
activeWorktreePath: checkoutThread.worktreePath,
811-
activeThreadBranch: checkoutThread.branch,
809+
effectiveEnvMode: thread.worktreePath === null ? "local" : "worktree",
810+
activeWorktreePath: thread.worktreePath,
811+
activeThreadBranch: thread.branch,
812812
currentGitBranch: visibleGitStatus?.refName ?? null,
813813
});
814814
const prStatus = prStatusIndicator(pr, linkedPullRequestStatus?.sourceControlProvider);
@@ -1689,9 +1689,9 @@ export const SidebarSearchResultRow = memo(function SidebarSearchResultRow(props
16891689
);
16901690
const checkoutThread = withoutRemovedCheckout(thread, visibleGitStatus);
16911691
const branchMismatch = resolveLocalCheckoutBranchMismatch({
1692-
effectiveEnvMode: checkoutThread.worktreePath === null ? "local" : "worktree",
1693-
activeWorktreePath: checkoutThread.worktreePath,
1694-
activeThreadBranch: checkoutThread.branch,
1692+
effectiveEnvMode: thread.worktreePath === null ? "local" : "worktree",
1693+
activeWorktreePath: thread.worktreePath,
1694+
activeThreadBranch: thread.branch,
16951695
currentGitBranch: visibleGitStatus?.refName ?? null,
16961696
});
16971697
const modelInstanceId = thread.runtime?.providerInstanceId ?? thread.modelSelection.instanceId;

0 commit comments

Comments
 (0)