Skip to content

perf(ui): batch PR fetching with parallel repo calls#150

Merged
renato0307 merged 2 commits intomainfrom
feat-show-pr-number
Feb 1, 2026
Merged

perf(ui): batch PR fetching with parallel repo calls#150
renato0307 merged 2 commits intomainfrom
feat-show-pr-number

Conversation

@renato0307
Copy link
Copy Markdown
Owner

@renato0307 renato0307 commented Feb 1, 2026

Summary

  • Optimize PR info fetching by using gh pr list to fetch all PRs per repo in one call
  • Group sessions by repository and fetch in parallel using goroutines
  • Trigger batch fetch on TUI init and session detach

Changes

  • Added FetchAllPRs to PRInfoProvider interface and implementations
  • Added GroupSessionsByRepo helper and StartBatchPRInfoFetcher command
  • Updated Model.Init() and detach handler to use batch fetch
  • Added unit tests for GroupSessionsByRepo

Test plan

  • Unit tests pass (go test ./internal/...)
  • Manual testing: start TUI with multiple sessions from different repos
  • Verify PR numbers appear after init and after detaching from a session

Optimize PR info fetching by:
- Using gh pr list to fetch all PRs per repo in one call
- Grouping sessions by repository and fetching in parallel
- Triggering batch fetch on TUI init and session detach

This reduces the number of gh CLI calls from O(n) to O(repos),
significantly improving startup time for users with many sessions.
@renato0307 renato0307 merged commit a591f7d into main Feb 1, 2026
2 checks passed
@renato0307 renato0307 deleted the feat-show-pr-number branch February 1, 2026 22: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