Skip to content

r on a PR does not refresh its worktree status (deleted worktree not noticed) #97

Description

@mayfieldiv

This was generated by AI during triage.

Summary

Pressing r (refresh selected PR) does not refresh worktree status. After deleting a PR's worktree outside the app, r still shows the PR as having a worktree; the stale entry stays until something re-lists worktrees.

Reproduction (maintainer report + code trace)

  1. Create a worktree for a PR (w).
  2. Delete that worktree on disk / via git worktree remove.
  3. Select the PR and press r.
  4. The PR still shows worktree status as if the worktree exists.

Code trace

  • Cmd::ListWorktrees is only dispatched from list_worktree_cmds (src/app/update.rs:93), which is called in exactly two places:
    • Msg::ConfigLoaded (src/app/update.rs:984)
    • after a successful worktree creation (src/app/update.rs:1184)
  • rMsg::RefreshSelectedrefresh_selected_cmdsbegin_refresh (src/app/update/refresh.rs:29,159) only dispatches Cmd::RefreshPr (GitHub enrichment). It never re-lists worktrees, so model.worktrees_by_repo keeps the deleted entry.
  • R notices deletions only incidentally: refresh_all_cmds (src/app/update/refresh.rs:49) dispatches Cmd::LoadConfig, whose ConfigLoaded re-lists worktrees.

Expected

r on a PR should also refresh that PR's (or its repo's) worktree listing, so a deleted worktree disappears from the UI. Arguably R's worktree re-list should also be explicit rather than a side effect of the config reload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions