optimize TUI load times#79
Open
skarim wants to merge 1 commit intoskarim/graphql-optimizationsfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
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:
syncStackPRsnow returns per-branchPRDetailsand performs API requests concurrently (capped).LoadBranchNodesaccepts optional pre-fetched PR details and parallelizes git-derived branch computations (capped).view/modifyshow 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
- 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>
431b1f5 to
c6aebd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimize
view/modifyTUI load time with parallel fetchingsyncStackPRsnow returnsPRDetailsforLoadBranchNodesto reuse, eliminating redundantFindPRDetailsForBranchcallssyncStackPRs(capped at 6 concurrent requests)LoadBranchNodes(capped at 4 concurrent)Stack created with GitHub Stacks CLI • Give Feedback 💬