Repository navigation
perf(web): load the pull request panels only when opened #16042
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
Closed
+204
−110
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
920770b
refactor(web): register the Diff side panel
saphid e1ae808
refactor(web): register the Preview side panel
github-actions[bot] 4851ae8
perf(web): keep the panel host stable across chat view renders
github-actions[bot] 30972c6
fix(web): send a late annotation only to the thread it was picked in
github-actions[bot] 52a78e7
fix(web): lend the annotation sender only after the chat view commits
github-actions[bot] 7be7fb5
refactor(web): move the thread terminal panel and drawer out of ChatView
github-actions[bot] a0ea164
refactor(web): open the right-panel terminal through the panel host
github-actions[bot] 02d7fe8
fix(web): keep a local-checkout terminal launch off the thread's work…
github-actions[bot] ca03345
fix(web): keep a terminal the server opened on the checkout off the t…
github-actions[bot] 4b7aa2e
fix(web): keep device results in the thread that started them
github-actions[bot] a1d256b
refactor(web): open the Device side panel through the panel host
github-actions[bot] bcb7b41
refactor(web): open the pull request side panels through the panel host
github-actions[bot] cfd56f6
test(web): build the pull request panel fixture against current main
github-actions[bot] c93a18c
Merge upstream main and drop the stacked layers from this branch
github-actions[bot] 6c1b6df
perf(web): load the pull request panels only when opened
github-actions[bot] 39197c7
fix(web): show the list ghost while the linked pull requests panel loads
github-actions[bot] 9e86a21
chore: integrate upstream main for perf(web): load the pull request p…
github-actions[bot] e984b0a
merge: preserve lazy pull request panels and current detail tab state
saphid 30417ce
perf(web): integrate main while preserving lazy pull request chunks
saphid 9cd48e4
fix(web): integrate current main into lazy pull request panels
saphid 0b04d2d
fix(web): preserve side chats while updating panel #16042
saphid 5bdc9e3
fix(web): complete pull request panel merge integration
saphid ad71d67
perf(web): defer standalone PR detail loading
saphid 03ec00d
fix(web): contain failed right-panel downloads
saphid a5d65df
Merge remote-tracking branch 'github/main' into stack/05-pr-panel
maria-rcks 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
35 changes: 35 additions & 0 deletions
35
apps/web/src/components/RightPanelContentBoundary.browser.test.tsx
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,35 @@ | ||
| import { lazy, Suspense } from "react"; | ||
| import { expect, it, vi } from "vite-plus/test"; | ||
|
|
||
| import { render } from "../../test/render"; | ||
| import { RightPanelContentBoundary } from "./RightPanelContentBoundary"; | ||
|
|
||
| it("contains a failed panel download and recovers when another surface opens", async () => { | ||
| using _error = vi.spyOn(console, "error").mockImplementation(() => {}); | ||
| const FailedPanel = lazy(async () => { | ||
| throw new Error("Panel download failed"); | ||
| }); | ||
| await using screen = await render( | ||
| <> | ||
| <main>Running chat</main> | ||
| <RightPanelContentBoundary surfaceId="failed-pr"> | ||
| <Suspense fallback={<span>Loading panel</span>}> | ||
| <FailedPanel /> | ||
| </Suspense> | ||
| </RightPanelContentBoundary> | ||
| </>, | ||
| ); | ||
| await expect.element(screen.getByRole("button", { name: "Reload app" })).toBeVisible(); | ||
| await expect.element(screen.getByRole("main")).toHaveTextContent("Running chat"); | ||
|
|
||
| await screen.rerender( | ||
| <> | ||
| <main>Running chat</main> | ||
| <RightPanelContentBoundary surfaceId="other-panel"> | ||
| <p>Other panel</p> | ||
| </RightPanelContentBoundary> | ||
| </>, | ||
| ); | ||
| await expect.element(screen.getByText("Other panel", { exact: true })).toBeVisible(); | ||
| await expect.element(screen.getByRole("main")).toHaveTextContent("Running chat"); | ||
| }); |
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,29 @@ | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| import { RenderErrorBoundary } from "./RenderErrorBoundary"; | ||
| import { Button } from "./ui/button"; | ||
| import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "./ui/empty"; | ||
|
|
||
| export function RightPanelContentBoundary(props: { | ||
| readonly surfaceId: string; | ||
| readonly children: ReactNode; | ||
| }) { | ||
| return ( | ||
| <RenderErrorBoundary | ||
| resetKeys={[props.surfaceId]} | ||
| fallback={ | ||
| <Empty> | ||
| <EmptyHeader> | ||
| <EmptyTitle>Could not load this panel</EmptyTitle> | ||
| <EmptyDescription>Reload the app to try again.</EmptyDescription> | ||
| </EmptyHeader> | ||
| <Button variant="outline" size="sm" onClick={() => window.location.reload()}> | ||
| Reload app | ||
| </Button> | ||
| </Empty> | ||
| } | ||
| > | ||
| {props.children} | ||
| </RenderErrorBoundary> | ||
| ); | ||
| } |
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.
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.