Skip to content

optimize TUI load times#79

Open
skarim wants to merge 1 commit intoskarim/graphql-optimizationsfrom
skarim/optimize-tui-load
Open

optimize TUI load times#79
skarim wants to merge 1 commit intoskarim/graphql-optimizationsfrom
skarim/optimize-tui-load

Conversation

@skarim
Copy link
Copy Markdown
Collaborator

@skarim skarim commented May 6, 2026

Optimize view/modify TUI load time with parallel fetching

  • Deduplicate API calls: syncStackPRs now returns PRDetails for LoadBranchNodes to reuse, eliminating redundant FindPRDetailsForBranch calls
  • Parallelize API calls in syncStackPRs (capped at 6 concurrent requests)
  • Parallelize git operations in LoadBranchNodes (capped at 4 concurrent)
  • Show "Loading stack..." indicator for interactive sessions

Stack created with GitHub Stacks CLIGive Feedback 💬

@skarim skarim marked this pull request as ready for review May 6, 2026 00:58
Copilot AI review requested due to automatic review settings May 6, 2026 00:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce view / modify TUI startup latency by avoiding redundant GitHub API calls and doing branch data loading in parallel, while also adding a lightweight “Loading stack…” indicator in interactive sessions.

Changes:

  • syncStackPRs now returns per-branch PRDetails and performs API requests concurrently (capped).
  • LoadBranchNodes accepts optional pre-fetched PR details and parallelizes git-derived branch computations (capped).
  • view / modify show and clear a “Loading stack…” indicator during the sync phase.
Show a summary per file
File Description
internal/tui/stackview/data.go Parallelizes per-branch git computations and reuses pre-fetched PR details to avoid extra API calls.
internal/tui/stackview/data_test.go Updates tests for the new LoadBranchNodes function signature.
cmd/view.go Adds interactive loading indicator and threads returned PR details into the TUI path.
cmd/utils.go Makes syncStackPRs return PR details and parallelizes PR discovery/sync with concurrency limits.
cmd/modify.go Shows loading indicator during PR sync and reuses returned PR details for TUI node loading.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1

Comment thread cmd/utils.go
- Deduplicate API calls: syncStackPRs now returns PRDetails for
  LoadBranchNodes to reuse, eliminating redundant FindPRDetailsForBranch calls
- Parallelize API calls in syncStackPRs (capped at 6 concurrent requests)
- Parallelize git operations in LoadBranchNodes (capped at 4 concurrent)
- Show "Loading stack..." indicator for interactive sessions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@skarim skarim force-pushed the skarim/optimize-tui-load branch from 431b1f5 to c6aebd0 Compare May 6, 2026 01:13
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.

2 participants