Skip to content

Improve Worktrunk sidebar refresh performance#25

Merged
nicosuave merged 2 commits intomainfrom
nicosuave/sidebar-fetch-audit
Mar 4, 2026
Merged

Improve Worktrunk sidebar refresh performance#25
nicosuave merged 2 commits intomainfrom
nicosuave/sidebar-fetch-audit

Conversation

@nicosuave
Copy link
Member

Summary

  • gate sidebar onAppear refreshes with a staleness window and trigger-aware rerun behavior
  • bound parallel repo/worktree refresh concurrency to avoid large fan-out spikes
  • overlap git tracking refresh with session refresh and skip heavy diff scans for clean trees

Verification

  • zig build
  • zig build test -Dtest-filter=Worktrunk
  • zig build run (app launched successfully)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 564 to 568
if shouldScheduleRefreshRerun(for: trigger) {
refreshAllNeedsRerun = true
}
await existing.value
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@nicosuave nicosuave merged commit 9589a09 into main Mar 4, 2026
287 of 296 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