Improve Worktrunk sidebar refresh performance#25
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f26b07faf4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if shouldScheduleRefreshRerun(for: trigger) { | ||
| refreshAllNeedsRerun = true | ||
| } | ||
| await existing.value | ||
| return |
There was a problem hiding this comment.
Preserve rerun when awaiting an already-finished refresh task
If refreshAll(trigger:) is called in the small window after the internal task has finished but before refreshAllTask is cleared, this branch still takes existing, sets refreshAllNeedsRerun = true, awaits an already-completed task, and returns without starting a new refresh. In that scenario, .repositoryAdded, .worktrunkInstalled, or .manual requests can be dropped, leaving sidebar/worktree state stale until some later refresh happens.
Useful? React with 👍 / 👎.
Summary
Verification