Skip to content

fix(staged): fix "Looking for changes" stuck after adding project from PR#654

Merged
matt2e merged 2 commits intomainfrom
looking-for-changes-forever
Apr 24, 2026
Merged

fix(staged): fix "Looking for changes" stuck after adding project from PR#654
matt2e merged 2 commits intomainfrom
looking-for-changes-forever

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Apr 23, 2026

Summary

  • Extract mergeBranchesPreservingWorktree helper to prevent stale async responses from overwriting populated worktreePath values with null
  • Apply the same merge-and-invalidate logic to the "add project from PR" code path, which was missing it — causing the "Looking for changes" state to persist indefinitely
  • Pass merged branches (with preserved worktree paths) to enqueueInitialSetup so workspace lifecycle correctly detects existing worktrees

Test plan

  • Add a project from a PR link and verify the timeline loads without getting stuck on "Looking for changes"
  • Switch between projects and verify worktree paths are preserved correctly
  • Verify existing project loading still works as before

🤖 Generated with Claude Code

matt2e and others added 2 commits April 23, 2026 10:55
…m PR

handleRepoSelected was racing with the project-setup-progress event
handler: it overwrote worktreePath back to null (no merge logic) and
never called invalidateProjectBranchTimelines, so BranchCard's effect
guard prevented re-triggering loadTimeline.

Add the same merge logic used in the project-setup-progress handler to
preserve worktreePath when the backend hasn't returned it yet, and
dispatch timeline invalidation so BranchCard re-fetches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deduplicate the branch merge logic that was copied verbatim in both
handleRepoSelected and the project-setup-progress event handler.
The new helper keeps the two call sites in sync and reduces the chance
of them diverging.

Also fix the project-setup-progress handler to pass mergedBranches
(instead of the raw unmerged branches) to enqueueInitialSetup,
matching what handleRepoSelected already did. This avoids attempting
to enqueue setup for branches whose worktreePath is already set.
@matt2e matt2e requested review from baxen and wesbillman as code owners April 23, 2026 03:44
@matt2e matt2e merged commit 3740e84 into main Apr 24, 2026
5 checks passed
@matt2e matt2e deleted the looking-for-changes-forever branch April 24, 2026 02:49
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