Repository navigation
fix(hub): reduce manage prototypes latency - #25
Merged
Merged
Conversation
Render the authorized management page before fetching eligible branches and repository choices. Load each section independently with its own loading state and retry, keeping listed prototype edits available. Reuse request-scoped GitHub configuration and installation tokens, and bound concurrent permission and authorship checks to four workers. Retain complete branch-history checks, eligible-only pagination, and fresh registration authorization. Reload deferred sections when a full response replaces the same URL without remounting. Preserve the current management UI and gear-button spinner, without introducing a global loading overlay. Add regression coverage for authorization, cache reuse and invalidation, concurrent requests, retries, section grafts, and same-URL refreshes, and document the loading flow. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 19c396a8-0c3a-446d-98d0-3105b22af77a
There was a problem hiding this comment.
🔵 Needs a closer look
Shared authorization concurrency and asynchronous refresh behavior need final human review with runtime verification.
1 open issue
What changed in this PR
Reduces Hub’s Manage prototypes latency by showing listed prototypes before loading branch candidates and repository choices.
Changes:
- Loads sections independently with loading, error, retry, and refresh handling.
- Reuses installation tokens and limits concurrent GitHub checks to four.
- Adds regression coverage, presentation states, and documentation.
| File | Description |
|---|---|
hub/test/models/repository/prototype_candidates_test.rb |
Covers bounded comparisons and caching. |
hub/test/models/repository/authorization_test.rb |
Protects fresh permission checks. |
hub/test/models/github_client_batch_test.rb |
Covers concurrency and failures. |
hub/test/integration/repositories_test.rb |
Checks permission and token reuse. |
hub/test/integration/prototype_registrations_test.rb |
Covers independent sections and registration checks. |
hub/test/integration/local_development_test.rb |
Covers local section loading. |
hub/docs/gallery.md |
Explains loading and retry behavior. |
hub/docs/architecture.md |
Documents asynchronous checks. |
hub/config/locales/gallery.en.yml |
Adds loading and retry labels. |
hub/app/views/prototype_management/show.tsx |
Connects section-loading hooks. |
hub/app/views/prototype_management/show.json.props |
Supplies shell and section data. |
hub/app/models/repository/prototype_candidates.rb |
Batches uncached branch comparisons. |
hub/app/models/repository/authorization.rb |
Supports prefetched permissions. |
hub/app/models/github_client/repositories.rb |
Batches repository permission requests. |
hub/app/models/github_client/batch.rb |
Adds bounded parallel execution. |
hub/app/javascript/pages/prototype-management-page/types.ts |
Defines section presentation data. |
hub/app/javascript/pages/prototype-management-page/stories.tsx |
Adds loading and failure examples. |
hub/app/javascript/pages/prototype-management-page/index.tsx |
Passes section states to features. |
hub/app/javascript/hooks/use-page-section/index.ts |
Loads, retries, and cancels sections. |
hub/app/javascript/hooks/use-page-section/index.test.tsx |
Covers independent request lifecycles. |
hub/app/javascript/features/workspace-sidebar/index.tsx |
Passes repository-choice status. |
hub/app/javascript/features/repository-workspace/index.tsx |
Forwards repository-choice status. |
hub/app/javascript/features/repository-navigation/index.tsx |
Connects selector status. |
hub/app/javascript/features/prototype-metadata-management/types.ts |
Adds branch-loading fields. |
hub/app/javascript/features/prototype-metadata-management/styles.css |
Styles branch-loading feedback. |
hub/app/javascript/features/prototype-metadata-management/index.tsx |
Displays loading and retry controls. |
hub/app/javascript/features/prototype-metadata-management/index.test.tsx |
Covers loading and retry presentation. |
hub/app/javascript/components/repository-selector/types.ts |
Defines selector status props. |
hub/app/javascript/components/repository-selector/index.tsx |
Displays repository-loading states. |
hub/app/javascript/components/repository-selector/index.test.tsx |
Covers status and keyboard retries. |
hub/app/javascript/application/sidebar-inbox-views.test.tsx |
Updates management view fixtures. |
hub/app/javascript/application/build-visit-and-remote/management.test.tsx |
Covers partial updates and refreshes. |
hub/app/controllers/prototype_management_controller.rb |
Separates shell and section requests. |
hub/app/controllers/concerns/has_repository_workspace.rb |
Defers choices and batches permissions. |
Review effort: Max
nshki
approved these changes
Oct 19, 2026
Cache completed branch comparisons even when another GitHub request fails. Skip queued comparisons after a failure, let in-flight calls finish, and write successful results on the request thread before surfacing the original error. Cover mixed-success retries and queued-call cancellation. Clarify when to use the deferred page-section hook and how Superglue updates the rendered page data. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 19c396a8-0c3a-446d-98d0-3105b22af77a
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.

Why
Manage prototypes currently waits for GitHub branch and repository checks before showing the page. Slow checks can make the button feel unresponsive and delay editing existing prototypes.
What changes
Show the authorized page and existing prototypes first, then load available branches and repository choices independently, each with loading, error, and retry states. Reuse GitHub installation tokens and run at most four checks concurrently instead of repeating them serially.
Keep the current layout, branch eligibility rules, and fresh access checks when adding a prototype. Both sections also reload correctly after same-page refreshes.
Loading state (Storybook fixture)