-
Notifications
You must be signed in to change notification settings - Fork 1
Optimize PRs tab loading #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
07ae2d7
Add autoresearch perf loop foundation + skills
arul28 a805397
docs(skills): codify lanes autoresearch guidance
arul28 d8da6a6
ade/optimizing lanes tab ed588b8d (#282)
arul28 f3cd4af
Optimize Work tab runtime and tools pane
arul28 bbc6ce6
Optimize PRs tab loading
arul28 bea68db
Merge origin/main into PRs tab lane
arul28 d56a77d
Address PR review feedback
arul28 465a67c
Address follow-up review feedback
arul28 40e5564
Address final PR review feedback
arul28 64d3928
Keep PR detail busy during snapshot prefill
arul28 cb9c4d1
Address latest PR review feedback
arul28 6fd0215
Address renderer PR review feedback
arul28 82d3a5c
Merge remote-tracking branch 'origin/main' into ade/opt-prs-tab-8fb08b2e
arul28 dc145e6
Handle partial PR refresh failures
arul28 10b73db
Guard warm PR detail snapshots
arul28 35dff40
Stabilize PR snapshot refreshes
arul28 d67012b
Guard PR and lane snapshot edge cases
arul28 ed92e3b
Harden PR and auto-rebase bulk paths
arul28 3c68ccd
Guard superseded PR snapshot fallback
arul28 8c352d8
Throttle queue fetches and snapshot loading
arul28 e971818
Stabilize PR detail and merge context freshness
arul28 e46cae7
Guard superseded PR refresh fallbacks
arul28 f2c53b5
Surface failed PR refresh batches
arul28 0379e63
Clarify auto rebase status refresh
arul28 9e36fb6
Make PR diagnostics refresh explicit
arul28 e409e55
Honor live PR detail and workflow diagnostics
arul28 c4433b5
Refine PR snapshot and rebase status freshness
arul28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| --- | ||
| name: ade-perf-prs | ||
| description: Performance practices for ADE's PRs tab. Read before editing | ||
| files under apps/desktop/src/renderer/components/prs/**, | ||
| apps/desktop/src/main/services/prs/**, PR IPC/preload contracts, or | ||
| PR-facing ADE actions. Preserve these patterns unless a new measured PRs UI | ||
| audit proves a better one. | ||
| metadata: | ||
| author: ade-autoresearch | ||
| version: 0.1.0 | ||
| status: active | ||
| --- | ||
|
|
||
| # ade-perf-prs | ||
|
|
||
| Use this as engineering guidance for keeping the PRs tab fast while adding | ||
| features. The PRs tab combines external GitHub search, local lane links, | ||
| mergeability, queue/integration workflows, Path to Merge state, review threads, | ||
| files, CI, and activity. Keep first paint local and defer expensive live GitHub | ||
| or Git operations until the visible surface needs them. | ||
|
|
||
| ## Measurement posture | ||
|
|
||
| - Test the real Electron `/prs` route against a private `perf-pass` GitHub repo | ||
| with enough PRs to cover single, queue, integration, and rebase/merge flows. | ||
| - Drive visible UI actions with Computer Use and mark important spans with | ||
| `window.ade.perf.recordEvent({ kind: "manualStep", ... })`. | ||
| - Do not measure only one PR forever. Seed several lanes and PRs per workflow | ||
| type, then optimize the batched path users actually hit. | ||
| - Separate stale-cache/no-op refreshes from true GitHub refreshes. If the UI | ||
| returns instantly because nothing is stale, also measure the explicit preload | ||
| path for the PR set changed by the optimization. | ||
|
|
||
| ## Startup and GitHub tab rules | ||
|
|
||
| - Opening the GitHub tab must not run conflict analysis, rebase scans, or | ||
| per-PR merge-context calls. First paint should use local PR rows and cached | ||
| GitHub snapshot data. | ||
| - Default GitHub snapshot search should fetch open external PRs only. Closed, | ||
| merged, and all-history views may opt into external closed PR history when | ||
| the user asks for that surface. | ||
| - Hydrate selected PR detail panes from `pull_request_snapshots` first, then run | ||
| live GitHub calls in the background. Detail panes should not render blank while | ||
| cached detail/files/checks/reviews/comments/commits exist. | ||
| - Keep snapshot hydration batched. Prefer `listSnapshots({ prId })` for detail | ||
| hydration and avoid separate status/checks/reviews/comments/files calls before | ||
| the cached view is visible. | ||
|
|
||
| ## Workflow and merge-context rules | ||
|
|
||
| - Use bulk merge-context APIs for workflow surfaces. `getMergeContexts(prIds)` | ||
| should replace N calls to `getMergeContext(prId)` whenever a queue, | ||
| integration, or rebase/merge view renders multiple PRs. | ||
| - Merge-context and conflict-analysis reads should use lane metadata only: | ||
| `laneService.list({ includeArchived: false, includeStatus: false })` unless | ||
| the UI is explicitly displaying fresh Git status. | ||
| - PR workflow context should also keep lane reads status-light. Use | ||
| `window.ade.lanes.list({ includeStatus: false })` for workflow rendering and | ||
| fetch fresh lane Git status only inside flows that actually inspect dirty, | ||
| ahead, behind, or rebase-in-progress state. | ||
| - The normal GitHub list should call `listWithConflicts({ includeConflictAnalysis: false })`. | ||
| Queue, integration, and rebase/merge workflows may request conflict analysis | ||
| because their UI depends on it. | ||
| - `listWithConflicts` must batch conflict assessment with lane inputs instead of | ||
| asking the conflict service one PR at a time. | ||
|
|
||
| ## Refresh rules | ||
|
|
||
| - Explicit PR refreshes should be bounded and parallel, not serialized one PR at | ||
| a time. Keep a conservative concurrency limit so GitHub is used efficiently | ||
| without flooding the API. | ||
| - Background refresh should stay small and stale-aware. The no-argument refresh | ||
| path is for hot or stale candidates, not a reason to sync every PR on every | ||
| tab open. | ||
| - Do not reintroduce "syncing to GitHub" as a blocking first-open state. The tab | ||
| should remain usable while refreshes run. | ||
| - Rebase diagnostics are useful workflow data, but they are not a reason to run | ||
| queue-target `git fetch` on every poll. Keep queue target tracking refreshes | ||
| best-effort and TTL-bound. | ||
|
|
||
| ## Proven PRs patterns | ||
|
|
||
| ### Keep GitHub first open-only and local-first | ||
|
|
||
| - **Why it helped**: The original PRs open path spent seconds fetching external | ||
| GitHub history and doing local workflow work before the list felt usable. | ||
| - **Apply when**: Editing `GitHubTab`, GitHub snapshot fetching, or first-load | ||
| PR state. | ||
| - **Avoid**: Loading closed/merged external PRs or conflict analysis before the | ||
| user opens those surfaces. | ||
| - **Verification**: `prs-ui-baseline-20260512-051124` had | ||
| `ade.prs.getGitHubSnapshot` at `5941ms`. After the open-only snapshot and | ||
| local-first hydration, `prs-ui-lane-metadata-fast-inproc-20260512-060555` | ||
| showed first-load `getGitHubSnapshot` at `1146ms`, `listWithConflicts` at | ||
| `1ms`, and `getMergeContexts` at `52ms`. | ||
|
|
||
| ### Batch merge contexts and keep lane reads metadata-only | ||
|
|
||
| - **Why it helped**: Workflow pages previously fanned out merge-context calls | ||
| and each one could pay for lane status work. | ||
| - **Apply when**: Queue, integration, rebase/merge, or Path to Merge surfaces | ||
| need per-PR merge context. | ||
| - **Avoid**: Looping over `getMergeContext` or using bare `laneService.list()` | ||
| from merge-context helpers. | ||
| - **Verification**: In `prs-ui-lane-metadata-fast-inproc-20260512-060555`, | ||
| workflow `getMergeContexts` calls measured `28-72ms`; the prior workflow pass | ||
| had repeated merge-context batches around `1.2-1.4s`. | ||
|
|
||
| ### Bound explicit refresh with parallel workers | ||
|
|
||
| - **Why it helped**: Refreshing PRs one at a time made workflow refresh feel | ||
| stuck even when the UI was otherwise local-first. | ||
| - **Apply when**: Changing `prService.refresh`, refresh buttons, or explicit | ||
| refresh actions from automations. | ||
| - **Avoid**: Serial `for await` refresh of PR detail/status/check/files for | ||
| multiple PRs. | ||
| - **Verification**: Before parallel refresh, the measured workflow refresh span | ||
| had `ade.prs.refresh` at `12284ms`. After bounded parallel refresh, an | ||
| explicit all-18 preload/IPC refresh in | ||
| `prs-ui-lane-metadata-fast-inproc-20260512-060555` completed in `3800ms`. | ||
|
|
||
| ### Keep workflow lane reads status-light | ||
|
|
||
| - **Why it helped**: Queue workflow reloads still paid full lane Git status and | ||
| auto-rebase status cleanup even though the visible workflow cards only needed | ||
| lane identity, branch, color, queue state, rebase needs, and merge context. | ||
| - **Apply when**: Editing `PrsContext`, workflow tabs, or auto-rebase status | ||
| hydration for PRs. | ||
| - **Avoid**: `window.ade.lanes.list({ includeStatus: true })` on PR workflow | ||
| startup or background PR refreshes that do not display lane dirty/ahead/behind | ||
| state. | ||
| - **Verification**: In | ||
| `prs-ui-rebase-fetch-ttl-20260512-062130`, queue reload lane reads dropped | ||
| from `1393ms` to `47-80ms`, and `listAutoRebaseStatuses` dropped from | ||
| `1404-1407ms` to `40-70ms`. | ||
|
|
||
| ### Keep Path to Merge start/stop local and state-first | ||
|
|
||
| - **Why it helped**: Path to Merge controls should react to local pipeline | ||
| settings, convergence state, and issue inventory without waiting on a full PR | ||
| refresh or workflow sweep. | ||
| - **Apply when**: Editing `PrConvergencePanel`, pipeline settings, issue | ||
| inventory sync, or Path to Merge IPC. | ||
| - **Avoid**: Coupling the start/stop buttons to fresh detail hydration, merge | ||
| context fan-out, or agent dispatch prework that can run after the local state | ||
| transition. | ||
| - **Verification**: In `prs-ui-ptm-audit-20260512-0635`, with PLAN mode and | ||
| auto-merge off, the UI covered native Path to Merge start/stop safely: | ||
| `ade.prs.pathToMerge.start` completed in `5ms` and | ||
| `ade.prs.pathToMerge.stop` completed in `2ms`. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.