Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions plugins/github/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,78 @@ describe("GitHub app navigation", () => {
expect(slot.container.firstElementChild?.className).not.toContain("p-3");
slot.lifecycle.unmount();
});

it("keeps removed pull-request files out of live workspace navigation", async () => {
const slot = renderSlot(
app.threadPanelActions[0]!,
{ threadId: "thr-1", params: null },
{
rpc: {
pullForThread: () => ({
pull: {
repo: "get-bb/bb",
number: 42,
environmentId: "env-1",
},
}),
getPull: () => ({
pull: {
repo: "get-bb/bb",
number: 42,
title: "Navigation fix",
state: "OPEN",
author: "octocat",
body: "",
url: "https://github.com/get-bb/bb/pull/42",
createdAt: "2026-08-20T00:00:00.000Z",
updatedAt: "2026-08-20T00:00:00.000Z",
baseRefName: "main",
headRefName: "fix-navigation",
additions: 1,
deletions: 1,
changedFiles: 2,
labels: [],
assignees: [],
reviewDecision: "",
mergeStateStatus: "CLEAN",
reviewRequests: [],
checks: [],
comments: [],
reviews: [],
reviewThreads: [],
files: [
{
path: "removed.ts",
status: "removed",
additions: 0,
deletions: 1,
patch: "@@ -1 +0,0 @@\n-removed",
},
{
path: "modified.ts",
status: "modified",
additions: 1,
deletions: 0,
patch: "@@ -0,0 +1 @@\n+added",
},
],
},
}),
listLinks: () => ({ links: {} }),
},
},
);

await slot.findByText("Navigation fix");
expect(slot.queryByRole("link", { name: "removed.ts" })).toBeNull();
expect(slot.getByRole("link", { name: "modified.ts" })).toBeDefined();

slot.getByRole("button", { name: "Expand removed.ts diff" }).click();
const diff = await slot.findByTestId("bb-diff");
expect(diff.getAttribute("data-path")).toBe("removed.ts");
expect(
slot.getByRole("button", { name: "Collapse removed.ts diff" }),
).toBeDefined();
slot.lifecycle.unmount();
});
});
2 changes: 1 addition & 1 deletion plugins/github/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ function FileDiffCard({
>
{open ? "▾" : "▸"}
</button>
{environmentId === null ? (
{environmentId === null || file.status === "removed" ? (
<span className="min-w-0 flex-1 truncate font-mono text-xs text-foreground">
{file.path}
</span>
Expand Down
Loading