Skip to content

fix: find merged PRs even when worktree is deleted#14

Merged
piotrostr merged 2 commits intomainfrom
fix-pr-numbers-and-github-status
Jan 28, 2026
Merged

fix: find merged PRs even when worktree is deleted#14
piotrostr merged 2 commits intomainfrom
fix-pr-numbers-and-github-status

Conversation

@piotrostr
Copy link
Owner

@piotrostr piotrostr commented Jan 28, 2026

Summary

  • Fixed tasks with merged PRs staying in "In Progress" instead of moving to "Done"
  • Root cause: PR info was only looked up via worktree branch names, but merged branches are typically deleted
  • Now tries multiple lookup strategies: worktree branch, expected branch name, and fallback slug matching
  • Moved task_title_to_branch to state/tasks.rs for consistent reuse
  • Added refetch on kanban mount (like TanStack Query) - immediate refresh when returning from sessions or other views

Test plan

  • Added test_merged_pr_found_without_worktree test
  • All existing tests pass
  • Manual test: verify tasks with merged PRs appear in Done column
  • Manual test: verify PR data refreshes immediately when detaching from Zellij session

piotrostr and others added 2 commits January 28, 2026 10:35
Previously, PR info was only looked up via worktree branch names.
When a PR was merged and the branch deleted, there was no worktree
to match against, so merged PRs were never found - causing tasks
to stay in "In Progress" instead of moving to "Done".

The fix updates task-to-PR matching to:
1. Use consistent branch name derivation (including Linear ID prefixes)
2. Try multiple lookup strategies:
   - First via worktree branch name (existing behavior)
   - Then via expected branch name directly (for merged PRs)
   - Then fallback search for any matching PR branch

Also moved task_title_to_branch to state/tasks.rs for reuse.

Co-Authored-By: piotrek & opus <noreply@anthropic.com>
Similar to TanStack Query's refetchOnMount behavior - trigger immediate
refetch of PR and session info when:
- Returning from TaskDetail, Worktrees, Logs, or Search views
- Detaching from a Zellij session

This ensures fresh data is displayed immediately rather than waiting
for the next poll interval.

Co-Authored-By: piotrek & opus <noreply@anthropic.com>
@piotrostr piotrostr merged commit 1b353de into main Jan 28, 2026
2 checks passed
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