diff --git a/apps/app/src/components/secondary-panel/terminalPanelTabs.test.ts b/apps/app/src/components/secondary-panel/terminalPanelTabs.test.ts
index e419c5cf615..fb61c298c84 100644
--- a/apps/app/src/components/secondary-panel/terminalPanelTabs.test.ts
+++ b/apps/app/src/components/secondary-panel/terminalPanelTabs.test.ts
@@ -165,35 +165,6 @@ describe("terminalPanelTabs", () => {
expect(tabIds(tabs)).toEqual(["terminal:term_1:none"]);
});
- it("keeps disconnected terminal tabs", () => {
- const disconnectedTerminal = createTerminalFixedPanelTab({
- terminalId: "term_disconnected",
- });
- const runningTerminal = createTerminalFixedPanelTab({
- terminalId: "term_running",
- });
- const sessions = [
- terminalSession({
- id: "term_disconnected",
- status: "disconnected",
- }),
- terminalSession({ id: "term_running" }),
- ];
-
- expect(
- tabIds(
- buildTerminalSyncedSecondaryFileTabs({
- orderedTabs: [disconnectedTerminal, runningTerminal],
- pendingTerminalIds: NO_PENDING_TERMINALS,
- terminalSessions: sessions,
- }),
- ),
- ).toEqual([
- "terminal:term_disconnected:none",
- "terminal:term_running:none",
- ]);
- });
-
it("syncs missing server terminal sessions into fixed panel state", () => {
const fileTab = createHostFilePreviewFixedPanelTab({
environmentId: "env_1",
diff --git a/apps/app/src/components/settings/KeyboardSettingsSection.test.tsx b/apps/app/src/components/settings/KeyboardSettingsSection.test.tsx
index f0e5c5f9f56..d24bd580044 100644
--- a/apps/app/src/components/settings/KeyboardSettingsSection.test.tsx
+++ b/apps/app/src/components/settings/KeyboardSettingsSection.test.tsx
@@ -419,23 +419,6 @@ describe("KeyboardSettingsSection", () => {
).toBe(true);
});
- it("ranks visible label matches ahead of description matches across groups", () => {
- render(
);
-
- fireEvent.change(
- screen.getByRole("textbox", { name: "Search keyboard shortcuts" }),
- {
- target: { value: " SiDeBaR " },
- },
- );
-
- expect(
- screen
- .getAllByRole("button", { name: /^Record shortcut for / })[0]
- ?.getAttribute("aria-label"),
- ).toMatch(/^Record shortcut for Toggle sidebar,/);
- });
-
it("ranks exact labels, label prefixes, label substrings, IDs, and descriptions in order", () => {
setPluginSlotRegistrations(
"test-shortcuts",
@@ -458,7 +441,7 @@ describe("KeyboardSettingsSection", () => {
fireEvent.change(
screen.getByRole("textbox", { name: "Search keyboard shortcuts" }),
{
- target: { value: "sidebar" },
+ target: { value: " SiDeBaR " },
},
);
diff --git a/apps/app/src/components/sidebar/SidebarUpdatesBadge.test.tsx b/apps/app/src/components/sidebar/SidebarUpdatesBadge.test.tsx
index 9434e7895c4..d58ffe329a8 100644
--- a/apps/app/src/components/sidebar/SidebarUpdatesBadge.test.tsx
+++ b/apps/app/src/components/sidebar/SidebarUpdatesBadge.test.tsx
@@ -343,19 +343,6 @@ describe("SidebarUpdatesBadge", () => {
expect(providerChip.querySelector('[data-icon="Download"]')).toBeTruthy();
});
- it("renders no provider chip when a CLI is not installed", () => {
- renderBadge({
- machines: [
- machine({
- issues: [missingInstallIssue("claude-code", "Claude Code")],
- }),
- ],
- });
-
- expect(screen.queryByTestId("sidebar-updates-badge-providers")).toBeNull();
- expect(screen.queryByTestId("sidebar-updates-badge-bb")).toBeNull();
- });
-
it("still shows the bb chip when the only provider issue is a missing CLI", () => {
renderBadge({
appUpdateAvailable: true,
diff --git a/apps/app/src/components/thread/ThreadTitle.test.tsx b/apps/app/src/components/thread/ThreadTitle.test.tsx
index db1b354c405..9bb7086ff3d 100644
--- a/apps/app/src/components/thread/ThreadTitle.test.tsx
+++ b/apps/app/src/components/thread/ThreadTitle.test.tsx
@@ -35,7 +35,9 @@ describe("ThreadTitle", () => {
,
);
- expect(screen.getByText("Design review")).not.toBeNull();
+ expect(
+ screen.getByText("Design review").closest("a, [role='link']"),
+ ).toBeNull();
expect(container.textContent).not.toContain("@thread:thr_mentioned");
expect(container.querySelector("mark")?.textContent).toBe("auth");
expect(screen.getByTitle("Follow up on Design review auth")).not.toBeNull();
diff --git a/apps/app/src/components/thread/ThreadTitleMentions.resources.test.ts b/apps/app/src/components/thread/ThreadTitleMentions.resources.test.ts
index 0b79e63a3a1..691c3f4355d 100644
--- a/apps/app/src/components/thread/ThreadTitleMentions.resources.test.ts
+++ b/apps/app/src/components/thread/ThreadTitleMentions.resources.test.ts
@@ -3,7 +3,7 @@ import { makeThreadListEntry } from "@bb/test-helpers/domain-fixtures";
import {
buildThreadTitleMentionResources,
EMPTY_TITLE_MENTION_RESOURCES,
- threadTitleTextSegments,
+ resolveThreadTitleDisplayText,
type ThreadTitleMentionNavigationSource,
} from "./ThreadTitleMentions";
@@ -97,7 +97,7 @@ describe("buildThreadTitleMentionResources", () => {
});
});
-describe("threadTitleTextSegments", () => {
+describe("resolveThreadTitleDisplayText", () => {
const rawId = "thr_dcwivn5n8w";
function resourcesWithThread(title: string) {
@@ -117,105 +117,31 @@ describe("threadTitleTextSegments", () => {
};
}
- it("renders serialized mentions in the thread title as pills", () => {
- const segments = threadTitleTextSegments(
- "Review @docs/foo.test.ts with @thread:thr_worker",
- EMPTY_TITLE_MENTION_RESOURCES,
- );
-
- expect(segments.map((segment) => segment.text)).toEqual([
- "Review ",
- "foo.test.ts",
- " with ",
- "thr_worker",
- ]);
- expect(segments[1]?.resource).toMatchObject({
- kind: "path",
- path: "docs/foo.test.ts",
- });
- expect(segments[3]?.resource).toMatchObject({
- kind: "thread",
- threadId: "thr_worker",
- });
- });
-
- it("renders a raw thread id in the title as a mention pill", () => {
- const segments = threadTitleTextSegments(
- `Continue from ${rawId} docs/foo.ts`,
- resourcesWithThread("Raw title target"),
- );
-
- expect(segments.map((segment) => segment.text)).toEqual([
- "Continue from ",
- "Raw title target",
- " docs/foo.ts",
- ]);
- expect(segments[1]?.resource).toMatchObject({
- kind: "thread",
- threadId: rawId,
- });
- });
-
it.each([
- ["straight closing quote", `Review "${rawId}."`],
- ["curly closing quote", `Review β${rawId}.β`],
+ [
+ "mid-title",
+ `Continue from ${rawId} docs/foo.ts`,
+ "Continue from Raw title target docs/foo.ts",
+ ],
+ [
+ "before a straight closing quote",
+ `Review "${rawId}."`,
+ 'Review "Raw title target."',
+ ],
+ [
+ "before a curly closing quote",
+ `Review \u201c${rawId}.\u201d`,
+ "Review \u201cRaw title target.\u201d",
+ ],
])(
- "renders a sentence-final raw id before a %s in a title",
- (_label, title) => {
- const segments = threadTitleTextSegments(
- title,
- resourcesWithThread("Quoted title target"),
- );
-
- expect(segments.find((segment) => segment.resource !== null)?.text).toBe(
- "Quoted title target",
- );
+ "shows a known raw thread id %s as its title",
+ (_label, title, expected) => {
+ expect(
+ resolveThreadTitleDisplayText(
+ title,
+ resourcesWithThread("Raw title target"),
+ ),
+ ).toBe(expected);
},
);
-
- it("leaves raw-id path, extension, and overlong continuations literal in titles", () => {
- const title = [
- `${rawId}.md`,
- `${rawId}/path`,
- `${rawId}2`,
- `/tmp/${rawId}`,
- `docs/${rawId}`,
- `C:\\tmp\\${rawId}`,
- `docs\\${rawId}`,
- `${rawId}\\logs`,
- ].join(" ");
-
- expect(
- threadTitleTextSegments(title, resourcesWithThread("Should not render")),
- ).toEqual([
- {
- resource: null,
- serializedText: null,
- text: title,
- unresolvedThreadId: null,
- },
- ]);
- });
-
- it("leaves an unresolvable raw thread id literal and requests it", () => {
- expect(
- threadTitleTextSegments(
- "Unknown thr_2222222222",
- EMPTY_TITLE_MENTION_RESOURCES,
- ),
- ).toEqual([
- {
- resource: null,
- serializedText: null,
- text: "Unknown ",
- unresolvedThreadId: null,
- },
- {
- resource: null,
- serializedText: "thr_2222222222",
- text: "thr_2222222222",
- unresolvedThreadId: "thr_2222222222",
- },
- ]);
- });
});
diff --git a/apps/app/src/components/thread/ThreadTitleMentions.test.tsx b/apps/app/src/components/thread/ThreadTitleMentions.test.tsx
deleted file mode 100644
index f2a75c1f025..00000000000
--- a/apps/app/src/components/thread/ThreadTitleMentions.test.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-// @vitest-environment jsdom
-
-import { cleanup, render, screen } from "@testing-library/react";
-import { afterEach, describe, expect, it } from "vitest";
-import { makeThreadListEntry } from "@bb/test-helpers/domain-fixtures";
-import {
- ThreadTitle,
- ThreadTitleMentionResourcesProvider,
- useThreadTitleDisplayText,
-} from "./ThreadTitleMentions";
-
-afterEach(cleanup);
-
-function DisplayText({ title }: { title: string }) {
- return (
-
{useThreadTitleDisplayText(title)}
- );
-}
-
-describe("ThreadTitle", () => {
- it("renders serialized thread mentions in a title as non-interactive pills", () => {
- const mentionedThread = makeThreadListEntry({
- id: "thr_mentioned",
- projectId: "proj_mentioned",
- title: "Mention target",
- titleFallback: "Mention target",
- });
- const title = "Continue from @thread:thr_mentioned";
-
- render(
-
-
-
- ,
- );
-
- expect(screen.queryByText(/@thread:thr_mentioned/)).toBeNull();
- const pill = screen.getByText("Mention target");
- expect(pill.closest("a")).toBeNull();
- expect(pill.closest("[role='link']")).toBeNull();
- expect(screen.getByTestId("display-text").textContent).toBe(
- "Continue from Mention target",
- );
- });
-});
diff --git a/apps/app/src/components/thread/ThreadTitleMentions.tsx b/apps/app/src/components/thread/ThreadTitleMentions.tsx
index f93405a67d8..45f14ac6f3e 100644
--- a/apps/app/src/components/thread/ThreadTitleMentions.tsx
+++ b/apps/app/src/components/thread/ThreadTitleMentions.tsx
@@ -588,7 +588,7 @@ function serializedThreadMentionId(token: string): string | null {
return token.startsWith(prefix) ? token.slice(prefix.length) : null;
}
-export function threadTitleTextSegments(
+function threadTitleTextSegments(
title: string,
resources: ThreadTitleMentionResources,
): ThreadTitleTextSegment[] {
diff --git a/apps/app/src/components/thread/terminal/ThreadTerminalView.test.ts b/apps/app/src/components/thread/terminal/ThreadTerminalView.test.ts
index 2d137aefa90..df4f27a46d9 100644
--- a/apps/app/src/components/thread/terminal/ThreadTerminalView.test.ts
+++ b/apps/app/src/components/thread/terminal/ThreadTerminalView.test.ts
@@ -228,19 +228,25 @@ describe("terminal output encoding", () => {
expect(decoded.toString("utf8")).toBe(input);
});
- it("keeps UTF-8 bytes intact when a glyph spans output chunks", () => {
+ it("keeps UTF-8 bytes intact when a glyph spans output chunks", async () => {
+ const terminal = new Terminal({ cols: 80, rows: 24 });
+ const replayWriteState = { suppressedWriteCount: 0 };
const encoded = new TextEncoder().encode("π");
- const first = decodeBase64Bytes(
- Buffer.from(encoded.subarray(0, 2)).toString("base64"),
- );
- const second = decodeBase64Bytes(
- Buffer.from(encoded.subarray(2)).toString("base64"),
- );
- const decoder = new TextDecoder();
+ for (const chunk of [encoded.subarray(0, 2), encoded.subarray(2)]) {
+ writeTerminalOutput({
+ data: decodeBase64Bytes(Buffer.from(chunk).toString("base64")),
+ isReplay: false,
+ onParsed: () => undefined,
+ replayWriteState,
+ terminal,
+ });
+ }
+ await new Promise
((resolve) => terminal.write("", resolve));
- expect(
- decoder.decode(first, { stream: true }) + decoder.decode(second),
- ).toBe("π");
+ expect(terminal.buffer.active.getLine(0)?.translateToString(true)).toBe(
+ "π",
+ );
+ terminal.dispose();
});
it("does not send terminal protocol replies generated by replayed output", async () => {
diff --git a/apps/app/src/components/thread/timeline/MessageActionBar.test.ts b/apps/app/src/components/thread/timeline/MessageActionBar.test.ts
index d18ed0f5fbf..09cfb94cd12 100644
--- a/apps/app/src/components/thread/timeline/MessageActionBar.test.ts
+++ b/apps/app/src/components/thread/timeline/MessageActionBar.test.ts
@@ -48,16 +48,6 @@ describe("computeMessageActionRowLayout", () => {
).toEqual({ inlineCount: 1, overflowCount: 2 });
});
- it("puts every candidate in the menu when none fit beside the trigger", () => {
- expect(
- computeMessageActionRowLayout({
- actionCount: 3,
- availableWidth: 30,
- ...metrics,
- }),
- ).toEqual({ inlineCount: 0, overflowCount: 3 });
- });
-
it("returns an empty layout for zero candidates", () => {
expect(
computeMessageActionRowLayout({
diff --git a/apps/app/src/components/thread/timeline/useTimelineWorkRowFullOutput.test.ts b/apps/app/src/components/thread/timeline/useTimelineWorkRowFullOutput.test.ts
index f1999abac25..7507615ad4b 100644
--- a/apps/app/src/components/thread/timeline/useTimelineWorkRowFullOutput.test.ts
+++ b/apps/app/src/components/thread/timeline/useTimelineWorkRowFullOutput.test.ts
@@ -88,16 +88,6 @@ describe("resolveTimelineWorkRowFullOutput", () => {
).toEqual({ output: PREVIEW_OUTPUT, state: "streaming-preview" });
});
- it("keeps the preview when the full-output load fails", () => {
- expect(
- resolveTimelineWorkRowFullOutput({
- row: bigCommandRow(),
- data: undefined,
- isError: true,
- }),
- ).toEqual({ output: PREVIEW_OUTPUT, state: "error" });
- });
-
it.each([
{ availability: "detail-limit", state: "limited-preview" },
{ availability: "retention-expired", state: "expired-preview" },
diff --git a/apps/app/src/components/thread/user-questions/QuestionForm.test.tsx b/apps/app/src/components/thread/user-questions/QuestionForm.test.tsx
index 54f345eecb7..f8c59cb165b 100644
--- a/apps/app/src/components/thread/user-questions/QuestionForm.test.tsx
+++ b/apps/app/src/components/thread/user-questions/QuestionForm.test.tsx
@@ -390,21 +390,6 @@ describe("answering a single-select question", () => {
} satisfies InteractionResponse);
});
- it("selects an option with its number-key shortcut", () => {
- const submit = vi.fn<(value: InteractionResponse) => Promise>(
- async () => undefined,
- );
- const slot = render(singleSelect, { submit });
-
- fireEvent.keyDown(window, { key: "2" });
- fireEvent.click(getButtonByText(slot, "Submit answer"));
-
- expect(submit).toHaveBeenCalledTimes(1);
- expect(submit.mock.calls[0]?.[0]).toEqual({
- answers: { q0: { selected: ["q0o1"] } },
- } satisfies InteractionResponse);
- });
-
it("ignores number keys typed into the free-text box", () => {
const slot = render(singleSelect);
fireEvent.click(getButtonByText(slot, "Otherβ¦"));
@@ -725,14 +710,6 @@ describe("multi-select and multi-question flows", () => {
composer.remove();
}
});
-
- it("cancels the request instead of submitting", () => {
- const cancel = vi.fn(async () => undefined);
- const slot = render(multi, { cancel });
-
- fireEvent.click(getButtonByText(slot, "Cancel"));
- expect(cancel).toHaveBeenCalledTimes(1);
- });
});
describe("question answer dictation", () => {
diff --git a/apps/app/src/components/tools/detail-page-recipes.test.tsx b/apps/app/src/components/tools/detail-page-recipes.test.tsx
index d3a107e5ace..550993c13ca 100644
--- a/apps/app/src/components/tools/detail-page-recipes.test.tsx
+++ b/apps/app/src/components/tools/detail-page-recipes.test.tsx
@@ -171,57 +171,6 @@ describe("Plugin detail recipe", () => {
).toBeTruthy();
});
- it("lists declared capabilities without category chrome", () => {
- const { container } = renderPlugin({
- ...PLUGIN,
- cliCommand: { name: "gh", summary: "Work with GitHub" },
- capabilities: [
- {
- kind: "skill",
- id: "review",
- label: "review",
- detail: "Skill this plugin adds to your agents",
- },
- {
- kind: "theme",
- id: "github.dark",
- label: "GitHub Dark",
- detail: null,
- },
- {
- kind: "agent-tool",
- id: "gh_search",
- label: "gh_search",
- detail: "Search GitHub",
- },
- {
- kind: "thread-integration",
- id: "mention:pr",
- label: "Pull requests",
- detail: "Mentions with #",
- },
- ],
- });
-
- const capabilities = container.querySelector(
- '[data-resource-detail-section="includes"]',
- );
- expect(capabilities?.querySelector("table")).not.toBeNull();
- expect(
- capabilities?.querySelector("[data-plugin-capability-group]"),
- ).toBeNull();
-
- for (const item of [
- "bb gh",
- "review",
- "gh_search",
- "Pull requests",
- "GitHub Dark",
- ] as const) {
- expect(screen.getByText(item)).toBeTruthy();
- }
- });
-
it("collapses long capability descriptions until requested", () => {
const description = "Long capability guidance ".repeat(20).trim();
const { container } = renderPlugin({
diff --git a/apps/app/src/components/ui/markdown-message-directives.test.ts b/apps/app/src/components/ui/markdown-message-directives.test.ts
index e3929bfeaed..c5252ce47df 100644
--- a/apps/app/src/components/ui/markdown-message-directives.test.ts
+++ b/apps/app/src/components/ui/markdown-message-directives.test.ts
@@ -27,19 +27,6 @@ afterEach(() => {
});
describe("buildMessageDirectiveRegistry", () => {
- it("maps a unique directive id to its slot", () => {
- const registry = buildMessageDirectiveRegistry([
- slot({ id: "inline-vis", pluginId: "demo" }),
- ]);
- expect(registry.get("inline-vis")).toEqual({
- status: "ok",
- slot: expect.objectContaining({
- id: "inline-vis",
- pluginId: "demo",
- }),
- });
- });
-
it("records cross-plugin collisions with no winner and warns once", () => {
const warn = vi.fn();
const registry = buildMessageDirectiveRegistry(
diff --git a/apps/app/src/hooks/cache-owners/thread-state-cache-owner.test.ts b/apps/app/src/hooks/cache-owners/thread-state-cache-owner.test.ts
index 3388da0416f..bdc56196d5c 100644
--- a/apps/app/src/hooks/cache-owners/thread-state-cache-owner.test.ts
+++ b/apps/app/src/hooks/cache-owners/thread-state-cache-owner.test.ts
@@ -313,68 +313,6 @@ describe("thread state cache owner", () => {
},
);
- it("optimistically renames thread in thread, list, and sidebar caches", async () => {
- const { queryClient } = createQueryClientTestHarness();
- const threadId = "thread-1";
- const thread = makeThreadWithRuntime({
- id: threadId,
- title: "Old title",
- });
- const listEntry = makeThreadListEntry({
- id: threadId,
- title: "Old title",
- });
- const threadListKey = threadListQueryKey({
- archived: false,
- projectId: "project-1",
- });
-
- queryClient.setQueryData(threadQueryKey(threadId), thread);
- queryClient.setQueryData(threadListKey, [listEntry]);
- queryClient.setQueryData(
- sidebarNavigationQueryKey(),
- makeSidebarNavigation([listEntry]),
- );
-
- const transaction = await beginThreadMetadataTransaction({
- queryClient,
- threadId,
- title: "New title",
- });
-
- expect(
- queryClient.getQueryData(threadQueryKey(threadId))
- ?.title,
- ).toBe("New title");
- expect(
- queryClient.getQueryData(threadListKey)?.[0]?.title,
- ).toBe("New title");
- expect(
- queryClient.getQueryData(
- sidebarNavigationQueryKey(),
- )?.projects[0]?.threads[0]?.title,
- ).toBe("New title");
-
- rollbackThreadListMutationTransaction({
- queryClient,
- threadId,
- transaction,
- });
-
- expect(
- queryClient.getQueryData(threadQueryKey(threadId))
- ?.title,
- ).toBe("Old title");
- expect(
- queryClient.getQueryData(threadListKey)?.[0]?.title,
- ).toBe("Old title");
- expect(
- queryClient.getQueryData(
- sidebarNavigationQueryKey(),
- )?.projects[0]?.threads[0]?.title,
- ).toBe("Old title");
- });
-
it("optimistically marks read state in thread, list, and sidebar caches", async () => {
const { queryClient } = createQueryClientTestHarness();
const threadId = "thread-1";
diff --git a/apps/app/src/hooks/mutations/thread-pin-mutations.test.tsx b/apps/app/src/hooks/mutations/thread-pin-mutations.test.tsx
index 621872aec24..487ba4caf81 100644
--- a/apps/app/src/hooks/mutations/thread-pin-mutations.test.tsx
+++ b/apps/app/src/hooks/mutations/thread-pin-mutations.test.tsx
@@ -273,27 +273,6 @@ it("keeps the latest pin toggle through stale reads until every write settles",
);
});
-it("shows the server's pinnedAt as soon as the pin is acknowledged", async () => {
- const server = serve([entry("t1", null)]);
- await waitFor(() =>
- expect(server.pinnedAt("t1")).toEqual([null, null, null]),
- );
- const pin = createDeferredPromise>();
- vi.mocked(sdk.threads.pin).mockReturnValue(pin.promise);
- act(() => server.view.result.current.pin.mutate({ id: "t1" }));
- await waitFor(() => expect(typeof server.pinnedAt("t1")[0]).toBe("number"));
- const never = new Promise(() => {});
- vi.mocked(sdk.threads.list).mockReturnValue(never);
- vi.mocked(sdk.threads.get).mockReturnValue(never);
- vi.mocked(request).mockReturnValue(never);
-
- await act(async () =>
- pin.resolve(makeThreadResponse({ ...entry("t1", 777) })),
- );
-
- await waitFor(() => expect(server.pinnedAt("t1")).toEqual([777, 777, 777]));
-});
-
it("predicts on a thread list mounted while the pin is pending", async () => {
const server = serve([entry("t1", null)]);
await waitFor(() =>
diff --git a/apps/app/src/hooks/mutations/thread-runtime-mutations.test.ts b/apps/app/src/hooks/mutations/thread-runtime-mutations.test.ts
index 72d846cde43..b65362763f6 100644
--- a/apps/app/src/hooks/mutations/thread-runtime-mutations.test.ts
+++ b/apps/app/src/hooks/mutations/thread-runtime-mutations.test.ts
@@ -343,7 +343,7 @@ describe("thread runtime mutations", () => {
}
});
- it("forwards execution input sources when sending a thread message", async () => {
+ it("forwards execution input sources and compactFirst when sending a thread message", async () => {
const queryClient = createTestQueryClient();
const mutation = new MutationObserver(
queryClient,
@@ -355,35 +355,18 @@ describe("thread runtime mutations", () => {
mode: "auto",
input: [{ type: "text", text: "Run this", mentions: [] }],
executionInputSources,
+ compactFirst: true,
});
expect(sdk.threads.send).toHaveBeenCalledWith(
expect.objectContaining({
executionInputSources,
+ compactFirst: true,
threadId: "thread-1",
}),
);
});
- it("forwards compactFirst when sending a thread message", async () => {
- const queryClient = createTestQueryClient();
- const mutation = new MutationObserver(
- queryClient,
- sendThreadMessageMutationOptions(queryClient),
- );
-
- await mutation.mutate({
- id: "thread-1",
- mode: "queue-if-active",
- input: [{ type: "text", text: "Resume", mentions: [] }],
- compactFirst: true,
- });
-
- expect(sdk.threads.send).toHaveBeenCalledWith(
- expect.objectContaining({ compactFirst: true, threadId: "thread-1" }),
- );
- });
-
it("restores a queued-row steer when provisioning keeps it queued", async () => {
const queuedMessage = makeQueuedMessage({
waitingOn: { kind: "thread-busy" },
diff --git a/apps/app/src/hooks/queries/plugin-settings-queries.test.ts b/apps/app/src/hooks/queries/plugin-settings-queries.test.ts
index 2e129002a9d..b60e92330af 100644
--- a/apps/app/src/hooks/queries/plugin-settings-queries.test.ts
+++ b/apps/app/src/hooks/queries/plugin-settings-queries.test.ts
@@ -242,7 +242,7 @@ describe("plugin list envelope", () => {
).rejects.toThrow();
});
- it("drops a row with a partial lastFailure rather than showing the quiet state", async () => {
+ it("rejects a list whose row has a partial lastFailure rather than showing the quiet state", async () => {
const partialFailure = {
...ROW,
updateState: { lastFailure: { version: "1.7.0", label: "1.7.0" } },
diff --git a/apps/app/src/hooks/queries/thread-queries.test.ts b/apps/app/src/hooks/queries/thread-queries.test.ts
index 2045788bfb4..4a79ccdd727 100644
--- a/apps/app/src/hooks/queries/thread-queries.test.ts
+++ b/apps/app/src/hooks/queries/thread-queries.test.ts
@@ -1159,28 +1159,18 @@ describe("thread open cache retention", () => {
});
describe("palette lifecycle queries", () => {
- it("loads bounded archived recents only while selected before typing", async () => {
+ it("requests a bounded archived list only when enabled", async () => {
const { queryClient } = createQueryClientTestHarness();
const archived = makeThreadListEntry({ id: "archived", archivedAt: 1 });
vi.mocked(sdk.threads.list).mockResolvedValue([archived]);
- const options = ({
- recent,
- selected,
- }: {
- recent: boolean;
- selected: boolean;
- }) =>
- paletteRecentArchivedThreadsQueryOptions({
- enabled: recent && selected,
- });
const observer = observe(
queryClient,
- options({ recent: true, selected: false }),
+ paletteRecentArchivedThreadsQueryOptions({ enabled: false }),
);
expect(sdk.threads.list).not.toHaveBeenCalled();
- observer.setOptions(options({ recent: false, selected: true }));
- expect(sdk.threads.list).not.toHaveBeenCalled();
- observer.setOptions(options({ recent: true, selected: true }));
+ observer.setOptions(
+ paletteRecentArchivedThreadsQueryOptions({ enabled: true }),
+ );
await vi.waitFor(() =>
expect(observer.getCurrentResult().data).toEqual([archived]),
);
diff --git a/apps/app/src/hooks/realtime-cache-effects.test.ts b/apps/app/src/hooks/realtime-cache-effects.test.ts
index 0dabdcde389..5ed07d7e015 100644
--- a/apps/app/src/hooks/realtime-cache-effects.test.ts
+++ b/apps/app/src/hooks/realtime-cache-effects.test.ts
@@ -43,14 +43,7 @@ import {
} from "./queries/query-keys";
import { afterEach, describe, expect, it, vi } from "vitest";
import { QueryObserver, type QueryClient } from "@tanstack/react-query";
-import {
- ENVIRONMENT_CHANGE_KINDS,
- HOST_CHANGE_KINDS,
- PROJECT_CHANGE_KINDS,
- SYSTEM_CHANGE_KINDS,
- THREAD_CHANGE_KINDS,
- defaultExperiments,
-} from "@bb/domain";
+import { SYSTEM_CHANGE_KINDS, defaultExperiments } from "@bb/domain";
import { makeEnvironment } from "@bb/test-helpers/domain-fixtures";
import { createAppQueryClient } from "@/lib/query-client";
import { makeSystemConfig } from "@/test/fixtures/system-config";
@@ -61,13 +54,7 @@ import {
resolveThreadInvalidationDebounce,
type RealtimeCacheEffectsVisibility,
} from "./realtime-cache-effects";
-import {
- REALTIME_ENVIRONMENT_CHANGE_REGISTRY,
- REALTIME_HOST_CHANGE_REGISTRY,
- REALTIME_PROJECT_CHANGE_REGISTRY,
- REALTIME_SYSTEM_CHANGE_REGISTRY,
- REALTIME_THREAD_CHANGE_REGISTRY,
-} from "./cache-owners/realtime-cache-registry";
+import { REALTIME_SYSTEM_CHANGE_REGISTRY } from "./cache-owners/realtime-cache-registry";
const PROJECT_PROMPT_HISTORY_THREAD_CHANGES = [
"thread-created",
@@ -406,30 +393,11 @@ describe("createRealtimeCacheEffects", () => {
vi.useRealTimers();
});
- it.each<
- [
- string,
- readonly string[],
- Record,
- ]
- >([
- ["thread", THREAD_CHANGE_KINDS, REALTIME_THREAD_CHANGE_REGISTRY],
- [
- "environment",
- ENVIRONMENT_CHANGE_KINDS,
- REALTIME_ENVIRONMENT_CHANGE_REGISTRY,
- ],
- ["project", PROJECT_CHANGE_KINDS, REALTIME_PROJECT_CHANGE_REGISTRY],
- ["host", HOST_CHANGE_KINDS, REALTIME_HOST_CHANGE_REGISTRY],
- ["system", SYSTEM_CHANGE_KINDS, REALTIME_SYSTEM_CHANGE_REGISTRY],
- ])(
- "maps every realtime %s change to a registry entry",
- (_entity, changeKinds, registry) => {
- for (const changeKind of changeKinds) {
- expect(registry[changeKind]).toBeDefined();
- }
- },
- );
+ it("maps every realtime system change to a registry entry", () => {
+ for (const changeKind of SYSTEM_CHANGE_KINDS) {
+ expect(REALTIME_SYSTEM_CHANGE_REGISTRY[changeKind]).toBeDefined();
+ }
+ });
it("refreshes only the server move status when a move changes", () => {
const { effects, queryClient } = createRealtimeEffectsTestContext();
diff --git a/apps/app/src/lib/audio-input-device-preference.test.ts b/apps/app/src/lib/audio-input-device-preference.test.ts
index b94d9e0fcff..1bb46c0608d 100644
--- a/apps/app/src/lib/audio-input-device-preference.test.ts
+++ b/apps/app/src/lib/audio-input-device-preference.test.ts
@@ -1,6 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import {
- buildAudioInputConstraints,
parsePreferredAudioInputDeviceId,
requestAudioInputStream,
} from "./audio-input-device-preference";
@@ -14,13 +13,6 @@ describe("audio input device preference", () => {
"studio-mic",
);
});
-
- it("builds default and exact-device getUserMedia constraints", () => {
- expect(buildAudioInputConstraints(null)).toEqual({ audio: true });
- expect(buildAudioInputConstraints("studio-mic")).toEqual({
- audio: { deviceId: { exact: "studio-mic" } },
- });
- });
});
describe("requestAudioInputStream", () => {
diff --git a/apps/app/src/lib/audio-input-device-preference.ts b/apps/app/src/lib/audio-input-device-preference.ts
index b156818fb0a..b536115b515 100644
--- a/apps/app/src/lib/audio-input-device-preference.ts
+++ b/apps/app/src/lib/audio-input-device-preference.ts
@@ -40,7 +40,7 @@ const audioInputDevicePreferenceAtom =
{ getOnInit: true },
);
-export function buildAudioInputConstraints(
+function buildAudioInputConstraints(
preferredDeviceId: PreferredAudioInputDeviceId,
): MediaStreamConstraints {
if (preferredDeviceId === null) {
diff --git a/apps/app/src/lib/composer-submissions.test.ts b/apps/app/src/lib/composer-submissions.test.ts
deleted file mode 100644
index 7e2f1306962..00000000000
--- a/apps/app/src/lib/composer-submissions.test.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { describe, expect, it, vi } from "vitest";
-import {
- notifyComposerSubmitted,
- subscribeComposerSubmitted,
-} from "./composer-submissions";
-
-describe("composer submissions", () => {
- it("scopes notifications and disposes listeners", () => {
- const listener = vi.fn();
- const dispose = subscribeComposerSubmitted(
- { kind: "thread", threadId: "one" },
- listener,
- );
- notifyComposerSubmitted({ kind: "thread", threadId: "two" });
- expect(listener).not.toHaveBeenCalled();
- notifyComposerSubmitted({ kind: "thread", threadId: "one" });
- expect(listener).toHaveBeenCalledOnce();
- dispose();
- notifyComposerSubmitted({ kind: "thread", threadId: "one" });
- expect(listener).toHaveBeenCalledOnce();
- });
-});
diff --git a/apps/app/src/lib/dev-websocket-url.test.ts b/apps/app/src/lib/dev-websocket-url.test.ts
index e01783eae9d..1881324a0ec 100644
--- a/apps/app/src/lib/dev-websocket-url.test.ts
+++ b/apps/app/src/lib/dev-websocket-url.test.ts
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it, vi } from "vitest";
-import { buildDevWebSocketUrl } from "./dev-websocket-url";
+import { buildBrowserWebSocketUrl } from "./dev-websocket-url";
function installWindowLocation(url: string): void {
const location = new URL(url);
@@ -13,7 +13,7 @@ function installWindowLocation(url: string): void {
});
}
-describe("buildDevWebSocketUrl", () => {
+describe("buildBrowserWebSocketUrl", () => {
afterEach(() => {
vi.unstubAllGlobals();
});
@@ -23,9 +23,7 @@ describe("buildDevWebSocketUrl", () => {
vi.stubGlobal("__BB_DEV_APP_BROWSER_HOST_PORT__", 15_802);
installWindowLocation("http://devbox.local:15802/threads/thr_1");
- expect(buildDevWebSocketUrl({ path: "/ws" })).toBe(
- "ws://devbox.local:23802/ws",
- );
+ expect(buildBrowserWebSocketUrl("/ws")).toBe("ws://devbox.local:23802/ws");
});
it("uses the proxied app origin for HTTPS bb connect shares", () => {
@@ -35,7 +33,7 @@ describe("buildDevWebSocketUrl", () => {
"https://sawyer--15802.getbb.app/threads/thr_jew2ruik89",
);
- expect(buildDevWebSocketUrl({ path: "/ws" })).toBe(
+ expect(buildBrowserWebSocketUrl("/ws")).toBe(
"wss://sawyer--15802.getbb.app/ws",
);
});
@@ -45,7 +43,7 @@ describe("buildDevWebSocketUrl", () => {
vi.stubGlobal("__BB_DEV_APP_BROWSER_HOST_PORT__", 15_802);
installWindowLocation("http://sawyer.localhost:35802/threads/thr_1");
- expect(buildDevWebSocketUrl({ path: "/ws" })).toBe(
+ expect(buildBrowserWebSocketUrl("/ws")).toBe(
"ws://sawyer.localhost:35802/ws",
);
});
@@ -55,14 +53,14 @@ describe("buildDevWebSocketUrl", () => {
vi.stubGlobal("__BB_DEV_APP_BROWSER_HOST_PORT__", 15_802);
installWindowLocation("https://dev.example.test:15802/threads/thr_1");
- expect(buildDevWebSocketUrl({ path: "/ws/terminals/term_1" })).toBe(
+ expect(buildBrowserWebSocketUrl("/ws/terminals/term_1")).toBe(
"wss://dev.example.test:15802/ws/terminals/term_1",
);
});
- it("returns undefined outside the dev build", () => {
+ it("uses the page origin outside the dev build", () => {
installWindowLocation("https://app.example.test/threads/thr_1");
- expect(buildDevWebSocketUrl({ path: "/ws" })).toBeUndefined();
+ expect(buildBrowserWebSocketUrl("/ws")).toBe("wss://app.example.test/ws");
});
});
diff --git a/apps/app/src/lib/dev-websocket-url.ts b/apps/app/src/lib/dev-websocket-url.ts
index 036f68044b7..7793c0d7d9c 100644
--- a/apps/app/src/lib/dev-websocket-url.ts
+++ b/apps/app/src/lib/dev-websocket-url.ts
@@ -32,7 +32,7 @@ function resolveDevWebSocketBaseUrl(): string | undefined {
return undefined;
}
-export function buildDevWebSocketUrl(
+function buildDevWebSocketUrl(
args: BuildDevWebSocketUrlArgs,
): string | undefined {
const baseUrl = resolveDevWebSocketBaseUrl();
diff --git a/apps/app/src/lib/environment-workspace-display.test.ts b/apps/app/src/lib/environment-workspace-display.test.ts
index 17760a3cf51..e7a30d27698 100644
--- a/apps/app/src/lib/environment-workspace-display.test.ts
+++ b/apps/app/src/lib/environment-workspace-display.test.ts
@@ -11,14 +11,6 @@ import {
} from "./environment-workspace-display";
describe("isHostAmbiguous", () => {
- it("treats a lone persistent machine as unambiguous", () => {
- expect(isHostAmbiguous(false, "persistent")).toBe(false);
- });
-
- it("treats more than one persistent machine as ambiguous", () => {
- expect(isHostAmbiguous(true, "persistent")).toBe(true);
- });
-
it("treats a machine that is not persistent as ambiguous", () => {
expect(isHostAmbiguous(false, "ephemeral")).toBe(true);
expect(isHostAmbiguous(false, null)).toBe(true);
diff --git a/apps/app/src/lib/in-app-browser-link-preference.test.ts b/apps/app/src/lib/in-app-browser-link-preference.test.ts
index f287d40929a..f56026aad3a 100644
--- a/apps/app/src/lib/in-app-browser-link-preference.test.ts
+++ b/apps/app/src/lib/in-app-browser-link-preference.test.ts
@@ -1,131 +1,99 @@
import { describe, expect, it } from "vitest";
-import {
- openUrlByPreference,
- resolveUrlOpenTarget,
-} from "./in-app-browser-link-preference";
+import { openUrlByPreference } from "./in-app-browser-link-preference";
-describe("resolveUrlOpenTarget", () => {
- it("routes http(s) links into the in-app browser on desktop when enabled", () => {
- expect(
- resolveUrlOpenTarget({
- desktopBrowserAvailable: true,
- openLinksInAppBrowser: true,
- url: "https://example.com/docs",
- }),
- ).toBe("in-app-browser");
- expect(
- resolveUrlOpenTarget({
- desktopBrowserAvailable: true,
- openLinksInAppBrowser: true,
- url: "HTTP://EXAMPLE.COM",
- }),
- ).toBe("in-app-browser");
- });
-
- it("routes http(s) links to the external browser when the preference is off", () => {
- expect(
- resolveUrlOpenTarget({
- desktopBrowserAvailable: true,
- openLinksInAppBrowser: false,
- url: "https://example.com/docs",
- }),
- ).toBe("external-browser");
- });
-
- it("routes http(s) links to the external browser when the desktop browser is unavailable (web)", () => {
- expect(
- resolveUrlOpenTarget({
- desktopBrowserAvailable: false,
- openLinksInAppBrowser: true,
- url: "https://example.com/docs",
- }),
- ).toBe("external-browser");
- });
+describe("openUrlByPreference", () => {
+ it.each([
+ {
+ name: "opens http(s) URLs in the in-app browser when enabled on desktop",
+ desktopBrowserAvailable: true,
+ openLinksInAppBrowser: true,
+ url: "https://example.com/docs",
+ handled: true,
+ inApp: ["https://example.com/docs"],
+ external: [],
+ },
+ {
+ name: "matches the http scheme case-insensitively",
+ desktopBrowserAvailable: true,
+ openLinksInAppBrowser: true,
+ url: "HTTP://EXAMPLE.COM",
+ handled: true,
+ inApp: ["HTTP://EXAMPLE.COM"],
+ external: [],
+ },
+ {
+ name: "opens http(s) URLs externally when the preference is off",
+ desktopBrowserAvailable: true,
+ openLinksInAppBrowser: false,
+ url: "https://example.com/docs",
+ handled: true,
+ inApp: [],
+ external: ["https://example.com/docs"],
+ },
+ {
+ name: "opens http(s) URLs externally when the desktop browser is unavailable (web)",
+ desktopBrowserAvailable: false,
+ openLinksInAppBrowser: true,
+ url: "https://example.com/docs",
+ handled: true,
+ inApp: [],
+ external: ["https://example.com/docs"],
+ },
+ {
+ name: "routes application links externally even when the in-app browser is preferred",
+ desktopBrowserAvailable: true,
+ openLinksInAppBrowser: true,
+ url: "reflect://note/Project%20X",
+ handled: true,
+ inApp: [],
+ external: ["reflect://note/Project%20X"],
+ },
+ ])(
+ "$name",
+ ({
+ desktopBrowserAvailable,
+ openLinksInAppBrowser,
+ url,
+ handled,
+ inApp,
+ external,
+ }) => {
+ const openedInApp: string[] = [];
+ const openedExternally: string[] = [];
- it("does not handle non-http links, even on desktop with the preference on", () => {
- for (const url of [
- "mailto:hi@example.com",
- "file:///Users/me/app.ts",
- "/projects/abc",
- "#section",
- "//example.com",
- "javascript:alert(1)",
- ]) {
expect(
- resolveUrlOpenTarget({
- desktopBrowserAvailable: true,
- openLinksInAppBrowser: true,
+ openUrlByPreference({
+ desktopBrowserAvailable,
+ openLinksInAppBrowser,
+ openExternalBrowser: (opened) => openedExternally.push(opened),
+ openInAppBrowser: (opened) => openedInApp.push(opened),
url,
}),
- ).toBe("unhandled");
- }
- });
-});
+ ).toBe(handled);
-describe("openUrlByPreference", () => {
- it("routes application links externally even when the in-app browser is preferred", () => {
- const openedInApp: string[] = [];
- const openedExternally: string[] = [];
- expect(
- openUrlByPreference({
- desktopBrowserAvailable: true,
- openLinksInAppBrowser: true,
- openExternalBrowser: (url) => openedExternally.push(url),
- openInAppBrowser: (url) => openedInApp.push(url),
- url: "reflect://note/Project%20X",
- }),
- ).toBe(true);
- expect(openedInApp).toEqual([]);
- expect(openedExternally).toEqual(["reflect://note/Project%20X"]);
- });
-
- it("opens http(s) URLs in the in-app browser when enabled", () => {
- const openedInApp: string[] = [];
- const openedExternally: string[] = [];
-
- expect(
- openUrlByPreference({
- desktopBrowserAvailable: true,
- openExternalBrowser: (url) => openedExternally.push(url),
- openInAppBrowser: (url) => openedInApp.push(url),
- openLinksInAppBrowser: true,
- url: "https://example.com/docs",
- }),
- ).toBe(true);
-
- expect(openedInApp).toEqual(["https://example.com/docs"]);
- expect(openedExternally).toEqual([]);
- });
-
- it("opens http(s) URLs externally when disabled", () => {
- const openedInApp: string[] = [];
- const openedExternally: string[] = [];
-
- expect(
- openUrlByPreference({
- desktopBrowserAvailable: true,
- openExternalBrowser: (url) => openedExternally.push(url),
- openInAppBrowser: (url) => openedInApp.push(url),
- openLinksInAppBrowser: false,
- url: "https://example.com/docs",
- }),
- ).toBe(true);
-
- expect(openedInApp).toEqual([]);
- expect(openedExternally).toEqual(["https://example.com/docs"]);
- });
+ expect(openedInApp).toEqual(inApp);
+ expect(openedExternally).toEqual(external);
+ },
+ );
- it("leaves file links and non-web schemes to their dedicated handlers", () => {
+ it.each([
+ "mailto:hi@example.com",
+ "file:///Users/me/app.ts",
+ "/projects/abc",
+ "#section",
+ "//example.com",
+ "javascript:alert(1)",
+ ])("leaves %s to its dedicated handler", (url) => {
const openedInApp: string[] = [];
const openedExternally: string[] = [];
expect(
openUrlByPreference({
desktopBrowserAvailable: true,
- openExternalBrowser: (url) => openedExternally.push(url),
- openInAppBrowser: (url) => openedInApp.push(url),
openLinksInAppBrowser: true,
- url: "file:///Users/me/app.ts",
+ openExternalBrowser: (opened) => openedExternally.push(opened),
+ openInAppBrowser: (opened) => openedInApp.push(opened),
+ url,
}),
).toBe(false);
diff --git a/apps/app/src/lib/in-app-browser-link-preference.ts b/apps/app/src/lib/in-app-browser-link-preference.ts
index bd518362f02..27496695841 100644
--- a/apps/app/src/lib/in-app-browser-link-preference.ts
+++ b/apps/app/src/lib/in-app-browser-link-preference.ts
@@ -25,7 +25,7 @@ function isHttpOrHttpsUrl(url: string): boolean {
return HTTP_URL_SCHEME_PATTERN.test(url);
}
-export function resolveUrlOpenTarget({
+function resolveUrlOpenTarget({
desktopBrowserAvailable,
openLinksInAppBrowser,
url,
diff --git a/apps/app/src/lib/lifecycle-errors.test.ts b/apps/app/src/lib/lifecycle-errors.test.ts
index 66a24ddb4f4..c7dbc8f4faa 100644
--- a/apps/app/src/lib/lifecycle-errors.test.ts
+++ b/apps/app/src/lib/lifecycle-errors.test.ts
@@ -4,7 +4,6 @@ import { HttpError } from "./api";
import {
describeLifecycleError,
formatLifecycleErrorDescription,
- parseLifecycleError,
type LifecycleErrorDescription,
type LifecycleErrorOperation,
} from "./lifecycle-errors";
@@ -58,22 +57,6 @@ const descriptionCases: DescriptionCase[] = [
severity: "warning",
},
},
- {
- name: "environment_not_ready ready with path",
- body: {
- code: "environment_not_ready",
- message: "Environment unavailable",
- details: {
- environmentStatus: "ready",
- hasPath: true,
- },
- },
- expected: {
- title: "Workspace unavailable",
- body: "Workspace is unavailable.",
- severity: "warning",
- },
- },
{
name: "environment_not_ready error",
body: {
@@ -537,36 +520,6 @@ const descriptionCases: DescriptionCase[] = [
},
];
-describe("parseLifecycleError", () => {
- it("parses HttpError bodies that match the lifecycle union", () => {
- const body: LifecycleApiError = {
- code: "environment_not_ready",
- message: "Environment unavailable",
- details: {
- environmentStatus: "provisioning",
- hasPath: false,
- },
- };
-
- expect(parseLifecycleError(httpError(body))).toEqual(body);
- });
-
- it("returns null for non-lifecycle errors", () => {
- const genericError = new HttpError({
- body: {
- code: "invalid_request",
- message: "Request failed",
- },
- code: "invalid_request",
- message: "Request failed",
- status: 400,
- });
-
- expect(parseLifecycleError(new Error("Nope"))).toBeNull();
- expect(parseLifecycleError(genericError)).toBeNull();
- });
-});
-
describe("describeLifecycleError", () => {
it.each(descriptionCases)("$name", ({ body, expected, operation }) => {
expect(
@@ -610,11 +563,18 @@ describe("describeLifecycleError", () => {
});
it("returns null for non-lifecycle errors", () => {
- expect(
- describeLifecycleError({
- error: new Error("Failed"),
- }),
- ).toBeNull();
+ const genericError = new HttpError({
+ body: {
+ code: "invalid_request",
+ message: "Request failed",
+ },
+ code: "invalid_request",
+ message: "Request failed",
+ status: 400,
+ });
+
+ expect(describeLifecycleError({ error: new Error("Failed") })).toBeNull();
+ expect(describeLifecycleError({ error: genericError })).toBeNull();
});
it("keeps a gate rejection readable under an operation title", () => {
diff --git a/apps/app/src/lib/lifecycle-errors.ts b/apps/app/src/lib/lifecycle-errors.ts
index 756aaba9f77..fd9251fc73a 100644
--- a/apps/app/src/lib/lifecycle-errors.ts
+++ b/apps/app/src/lib/lifecycle-errors.ts
@@ -427,7 +427,7 @@ function describeDispatchHookFailed({
});
}
-export function parseLifecycleError(error: unknown): LifecycleApiError | null {
+function parseLifecycleError(error: unknown): LifecycleApiError | null {
if (!(error instanceof HttpError) && !(error instanceof BbHttpError)) {
return null;
}
diff --git a/apps/app/src/lib/notifications/app-toast-title-overflow.test.tsx b/apps/app/src/lib/notifications/app-toast-title-overflow.test.tsx
deleted file mode 100644
index 52b8fa46633..00000000000
--- a/apps/app/src/lib/notifications/app-toast-title-overflow.test.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-// @vitest-environment jsdom
-import { cleanup, fireEvent, render, screen } from "@testing-library/react";
-import { afterEach, expect, it, vi } from "vitest";
-import { AppToastContent } from "@/components/ui/app-toast";
-import {
- getNotificationCenterState,
- resetNotificationStore,
-} from "./notification-store";
-
-afterEach(() => {
- cleanup();
- vi.restoreAllMocks();
- resetNotificationStore();
-});
-
-it("opens the recorded notification when a title-only toast is truncated", () => {
- vi.spyOn(HTMLElement.prototype, "scrollWidth", "get").mockReturnValue(600);
- vi.spyOn(HTMLElement.prototype, "clientWidth", "get").mockReturnValue(300);
-
- render(
- ,
- );
-
- fireEvent.click(screen.getByRole("button", { name: "Show more" }));
-
- expect(getNotificationCenterState()).toEqual({
- open: true,
- focusedId: "notification-7",
- });
-});
diff --git a/apps/app/src/lib/notifications/notification-center.test.tsx b/apps/app/src/lib/notifications/notification-center.test.tsx
index d02b1e02ffa..ef61282c92e 100644
--- a/apps/app/src/lib/notifications/notification-center.test.tsx
+++ b/apps/app/src/lib/notifications/notification-center.test.tsx
@@ -13,6 +13,7 @@ import { NotificationCenter } from "@/components/notifications/NotificationCente
import { appToast } from "@/components/ui/app-toast";
import {
getNotificationCenterState,
+ getNotifications,
openNotificationCenter,
resetNotificationStore,
} from "./notification-store";
@@ -55,6 +56,9 @@ it("keeps notification details open when dismissing the toast restores composer
});
fireEvent.click(showMore);
expect(getNotificationCenterState().open).toBe(true);
+ expect(getNotificationCenterState().focusedId).toBe(
+ getNotifications()[0]?.id,
+ );
await act(async () => {
await vi.advanceTimersByTimeAsync(5000);
});
diff --git a/apps/app/src/lib/pierre-worker-pool-theme.test.ts b/apps/app/src/lib/pierre-worker-pool-theme.test.ts
index d2ace3f5b89..aa94d77f820 100644
--- a/apps/app/src/lib/pierre-worker-pool-theme.test.ts
+++ b/apps/app/src/lib/pierre-worker-pool-theme.test.ts
@@ -12,14 +12,6 @@ function createFakePool() {
}
describe("syncPierreWorkerPoolTheme", () => {
- it("does not call setRenderOptions when the pool already has the current theme", () => {
- const { pool, setRenderOptions } = createFakePool();
-
- syncPierreWorkerPoolTheme(pool, { ...CURRENT }, CURRENT);
-
- expect(setRenderOptions).not.toHaveBeenCalled();
- });
-
it("pushes a theme change once, then stays quiet until the next change", () => {
const { pool, setRenderOptions } = createFakePool();
const next = { dark: "github-dark", light: CURRENT.light };
diff --git a/apps/app/src/lib/plugin-bound-sdk.test.ts b/apps/app/src/lib/plugin-bound-sdk.test.ts
index d228e60c5e3..fe1ee04dd18 100644
--- a/apps/app/src/lib/plugin-bound-sdk.test.ts
+++ b/apps/app/src/lib/plugin-bound-sdk.test.ts
@@ -185,13 +185,23 @@ describe("bindSdkToPlugin", () => {
});
});
- it("preserves SDK arguments while applying cache updates", async () => {
- const { sdk, queryClient, threads, threadSections } = makeSdk();
+ it("adds a created section to the sidebar before resolving", async () => {
+ const { sdk, queryClient, threadSections } = makeSdk();
+ const sidebarKey = sidebarNavigationQueryKey();
+ queryClient.setQueryData(
+ sidebarKey,
+ makeSidebarBootstrapResponse({ sections: [] }),
+ );
const bound = bindSdkToPlugin(sdk, "thread-list", queryClient);
- await bound.threads.pin({ threadId: "thr_1" });
+
await bound.threadSections.create({ name: "Later" });
- expect(threads.pin).toHaveBeenCalledWith({ threadId: "thr_1" });
+
expect(threadSections.create).toHaveBeenCalledWith({ name: "Later" });
+ expect(
+ queryClient
+ .getQueryData(sidebarKey)
+ ?.sections.map((section) => section.id),
+ ).toEqual(["sec_created"]);
});
it("batches synchronous plugin thread metadata updates into one optimistic transaction", async () => {
diff --git a/apps/app/src/lib/plugin-sdk-hooks.test.ts b/apps/app/src/lib/plugin-sdk-hooks.test.ts
index 04fe2b6f946..34392be7c12 100644
--- a/apps/app/src/lib/plugin-sdk-hooks.test.ts
+++ b/apps/app/src/lib/plugin-sdk-hooks.test.ts
@@ -78,6 +78,7 @@ describe("callPluginRpc", () => {
["not_found", 404],
["conflict", 409],
["invalid", 422],
+ ["invalid_input", 400],
])(
"preserves refusal %s and HTTP %s for useRpc and query hooks",
async (code, status) => {
@@ -135,29 +136,6 @@ describe("callPluginRpc", () => {
});
});
- it("surfaces structured wire failures with stable code and issues", async () => {
- const fetchImpl = vi.fn(async () =>
- jsonResponse(
- {
- ok: false,
- error: {
- code: "invalid_input",
- message: "rpc input validation failed",
- issues: [{ path: ["id"], message: "Required" }],
- },
- },
- false,
- 400,
- ),
- );
- const promise = callPluginRpc(fetchImpl, "demo", "lookup", {});
- await expect(promise).rejects.toMatchObject({
- code: "invalid_input",
- message: "rpc input validation failed",
- issues: [{ path: ["id"], message: "Required" }],
- });
- });
-
it("rejects cyclic and non-finite inputs before fetch", async () => {
const fetchImpl = vi.fn();
const cyclic: { self?: unknown } = {};
diff --git a/apps/app/src/lib/plugin-sidebar-hooks.test.tsx b/apps/app/src/lib/plugin-sidebar-hooks.test.tsx
index 6c250289477..7e3731fa12b 100644
--- a/apps/app/src/lib/plugin-sidebar-hooks.test.tsx
+++ b/apps/app/src/lib/plugin-sidebar-hooks.test.tsx
@@ -18,7 +18,6 @@ import {
useSidebarThreadRowStatuses,
useSidebarThreadShortcut,
useSidebarThreads,
- useSidebarThreadEntry,
} from "./plugin-sidebar-hooks";
import {
clearPluginThreadRowStatuses,
@@ -275,17 +274,6 @@ describe("sidebar lifecycle selection", () => {
expect(result.current.threads).toHaveLength(1);
expect(result.current.experimental_archived?.status).toBe("error");
});
-
- it("resolves archived entries for host-owned row actions and status", () => {
- const archived = makeThreadListEntry({
- id: "thr_archived",
- archivedAt: 42,
- });
- state.data = payload([]);
- archiveQuery.data = { pages: [[archived]] };
- const { result } = renderHook(() => useSidebarThreadEntry(archived.id));
- expect(result.current).toBe(archived);
- });
});
describe("useSidebarThreads sections", () => {
diff --git a/apps/app/src/lib/plugin-sidebar-threads.test.ts b/apps/app/src/lib/plugin-sidebar-threads.test.ts
index 9aef539124c..87b23f17bcb 100644
--- a/apps/app/src/lib/plugin-sidebar-threads.test.ts
+++ b/apps/app/src/lib/plugin-sidebar-threads.test.ts
@@ -21,8 +21,9 @@ describe("toPluginSidebarThread", () => {
it("resolves the display title through the same rules bb's row uses", () => {
expect(toPluginSidebarThread(makeThread()).displayTitle).toBe("A thread");
expect(
- toPluginSidebarThread(makeThread({ title: null, titleFallback: "Fallback" }))
- .displayTitle,
+ toPluginSidebarThread(
+ makeThread({ title: null, titleFallback: "Fallback" }),
+ ).displayTitle,
).toBe("Fallback");
expect(
toPluginSidebarThread(
@@ -65,43 +66,6 @@ describe("toPluginSidebarThread", () => {
});
});
- it("resolves the indicator with the host's precedence", () => {
- expect(
- toPluginSidebarThread(
- makeThread({
- hasPendingInteraction: true,
- runtime: {
- displayStatus: "active",
- },
- }),
- ).indicator,
- ).toBe("waiting-for-input");
-
- expect(
- toPluginSidebarThread(
- makeThread({
- runtime: {
- displayStatus: "active",
- },
- }),
- ).indicator,
- ).toBe("runtime");
-
- expect(
- toPluginSidebarThread(
- makeThread({
- activity: {
- activeWorkflowCount: 1,
- activeBackgroundAgentCount: 0,
- activeBackgroundCommandCount: 0,
- activePlanModeCount: 0,
- activeGoalCount: 0,
- },
- }),
- ).indicator,
- ).toBe("workflow");
- });
-
it("carries the host's accessible label, and null for none", () => {
expect(
toPluginSidebarThread(makeThread({ hasPendingInteraction: true }))
diff --git a/apps/app/src/lib/plugin-slots.test.ts b/apps/app/src/lib/plugin-slots.test.ts
index 22d55d6be12..2ea2a367d25 100644
--- a/apps/app/src/lib/plugin-slots.test.ts
+++ b/apps/app/src/lib/plugin-slots.test.ts
@@ -43,6 +43,7 @@ describe("plugin slot store", () => {
registrationSet({
homepageSections: [
{ id: "a", title: "Alpha", component: SectionComponent },
+ { id: "b", title: "Beta", component: SectionComponent },
],
composerCustomizations: [
{
@@ -55,8 +56,15 @@ describe("plugin slot store", () => {
const snapshot = getPluginSlotSnapshot();
expect(
- snapshot.homepageSections.map((section) => section.pluginId),
- ).toEqual(["alpha", "zeta"]);
+ snapshot.homepageSections.map((section) => [
+ section.pluginId,
+ section.id,
+ ]),
+ ).toEqual([
+ ["alpha", "a"],
+ ["alpha", "b"],
+ ["zeta", "z"],
+ ]);
expect(snapshot.composerCustomizations).toHaveLength(1);
expect(snapshot.composerCustomizations[0]?.pluginId).toBe("alpha");
});
@@ -139,43 +147,6 @@ describe("plugin slot store", () => {
expect(listener).toHaveBeenCalledTimes(2);
unsubscribe();
});
-
- it("returns a stable snapshot object between changes", () => {
- setPluginSlotRegistrations("demo", registrationSet());
- const first = getPluginSlotSnapshot();
- expect(getPluginSlotSnapshot()).toBe(first);
- });
-
- it("flattens messageDirectives sorted by plugin id with generation metadata", () => {
- setPluginSlotRegistrations(
- "zeta",
- registrationSet({
- messageDirectives: [{ id: "z-vis", component: DirectiveComponent }],
- }),
- );
- setPluginSlotRegistrations(
- "alpha",
- registrationSet({
- messageDirectives: [
- { id: "inline-vis", component: DirectiveComponent },
- { id: "chart", component: DirectiveComponent },
- ],
- }),
- );
-
- const snapshot = getPluginSlotSnapshot();
- expect(
- snapshot.messageDirectives.map((directive) => ({
- pluginId: directive.pluginId,
- id: directive.id,
- generation: directive.generation,
- })),
- ).toEqual([
- { pluginId: "alpha", id: "inline-vis", generation: 1 },
- { pluginId: "alpha", id: "chart", generation: 1 },
- { pluginId: "zeta", id: "z-vis", generation: 1 },
- ]);
- });
});
describe("plugin slot store structural sharing", () => {
diff --git a/apps/app/src/lib/provider-icon.test.tsx b/apps/app/src/lib/provider-icon.test.tsx
index bde6efe359f..bf16dadea20 100644
--- a/apps/app/src/lib/provider-icon.test.tsx
+++ b/apps/app/src/lib/provider-icon.test.tsx
@@ -145,6 +145,7 @@ describe("getProviderIconInfo", () => {
it("renders a generic fallback for a provider known only by id", () => {
const info = getProviderIconInfo("agent", "codex");
+ expect(info.ariaLabel).toBe("codex");
const view = render(createElement(info.icon));
expect(view.container.querySelector('[data-icon="Code"]')).not.toBeNull();
act(() =>
@@ -209,65 +210,6 @@ describe("getProviderIconInfo", () => {
bothView.container.querySelector("[data-provider-logo]"),
).not.toBeNull();
bothView.unmount();
-
- expect(
- getProviderIconInfo("agent", "echo-agent", { logoUrl: null }),
- ).toBeDefined();
- });
-
- it("lets a plugin-registered component win, and falls back when it goes away", () => {
- const iconInfo = getProviderIconInfo("agent", "codex", {
- logoUrl: "/api/v1/system/providers/codex/logo",
- });
- if (iconInfo === undefined) {
- throw new Error("Expected icon info for codex");
- }
- const view = render(createElement(iconInfo.icon, { className: "size-4" }));
- expect(view.container.querySelector("[data-testid]")).toBeNull();
- expect(view.container.querySelector("[data-provider-logo]")).not.toBeNull();
-
- act(() => {
- setPluginSlotRegistrations("provider-codex", {
- ...EMPTY_REGISTRATIONS,
- providerIcons: [
- { providerKind: "agent", providerId: "codex", icon: PluginCodexIcon },
- ],
- });
- });
-
- const pluginMark = view.container.querySelector(
- '[data-testid="plugin-codex-icon"]',
- );
- expect(pluginMark).not.toBeNull();
- expect(view.container.querySelector("[data-provider-logo]")).toBeNull();
-
- act(() => {
- removePluginSlotRegistrations("provider-codex");
- });
- expect(
- view.container.querySelector('[data-testid="plugin-codex-icon"]'),
- ).toBeNull();
- expect(view.container.querySelector("[data-provider-logo]")).not.toBeNull();
- view.unmount();
- });
-
- it("renders a plugin icon for a provider that has no vendored mark", () => {
- setPluginSlotRegistrations("provider-thing", {
- ...EMPTY_REGISTRATIONS,
- providerIcons: [
- { providerKind: "agent", providerId: "thing", icon: PluginCodexIcon },
- ],
- });
- const iconInfo = getProviderIconInfo("agent", "thing");
- if (iconInfo === undefined) {
- throw new Error("Expected plugin icon info for thing");
- }
- expect(iconInfo.ariaLabel).toBe("thing");
- const view = render(createElement(iconInfo.icon, {}));
- expect(
- view.container.querySelector('[data-testid="plugin-codex-icon"]'),
- ).not.toBeNull();
- view.unmount();
});
it("keeps the first plugin by id when two claim one provider", () => {
@@ -316,6 +258,8 @@ describe("getProviderIconInfo", () => {
expect(byFamily.ariaLabel).toBe("ACP provider");
familyView.unmount();
- expect(getProviderIconInfo("agent", "acp-unregistered")).toBeDefined();
+ expect(getProviderIconInfo("agent", "acp-unregistered").ariaLabel).toBe(
+ "acp-unregistered",
+ );
});
});
diff --git a/apps/app/src/lib/retired-sidebar-pull-request.test.tsx b/apps/app/src/lib/retired-sidebar-pull-request.test.tsx
index fcfffb6d216..3370804466d 100644
--- a/apps/app/src/lib/retired-sidebar-pull-request.test.tsx
+++ b/apps/app/src/lib/retired-sidebar-pull-request.test.tsx
@@ -19,17 +19,6 @@ vi.mock("@tanstack/react-query", async (importOriginal) => ({
useQuery: () => ({ data: keyedQuery.pluginEnabled }),
}));
-vi.mock("@get-bb/plugin-sdk/app", () => ({
- experimental_useRpcKeyedQuery: (options: { keys: readonly string[] }) => ({
- data: keyedQuery.data,
- error: null,
- isLoading: false,
- isFetching: false,
- refetch: () => keyedQuery.refetch(options.keys),
- }),
- experimental_useRpcMutation: () => ({ mutate: vi.fn(), isPending: false }),
-}));
-
vi.mock("@/lib/plugin-sdk-hooks", () => ({
experimental_useRpcKeyedQuery: (options: { keys: readonly string[] }) => ({
data: keyedQuery.data,
diff --git a/apps/app/src/lib/split-layout/ops.test.ts b/apps/app/src/lib/split-layout/ops.test.ts
index 0816e71b98a..e980ef42e57 100644
--- a/apps/app/src/lib/split-layout/ops.test.ts
+++ b/apps/app/src/lib/split-layout/ops.test.ts
@@ -217,15 +217,14 @@ describe("split layout operations", () => {
const low = resizeSplit(two, [], 0, -10);
const high = resizeSplit(low, [], 0, 10);
- if (low.root.type === "split") {
- expect(low.root.sizes[0]).toBeCloseTo(0.15, 12);
- expect(low.root.sizes[1]).toBeCloseTo(0.85, 12);
- }
- if (high.root.type === "split") {
- expect(high.root.sizes[0]).toBeCloseTo(0.85, 12);
- expect(high.root.sizes[1]).toBeCloseTo(0.15, 12);
- expect(high.root.sizes.reduce((sum, size) => sum + size, 0)).toBe(1);
+ if (low.root.type !== "split" || high.root.type !== "split") {
+ throw new Error("Expected split roots");
}
+ expect(low.root.sizes[0]).toBeCloseTo(0.15, 12);
+ expect(low.root.sizes[1]).toBeCloseTo(0.85, 12);
+ expect(high.root.sizes[0]).toBeCloseTo(0.85, 12);
+ expect(high.root.sizes[1]).toBeCloseTo(0.15, 12);
+ expect(high.root.sizes.reduce((sum, size) => sum + size, 0)).toBe(1);
expect(resizeSplit(high, [], 1, 0.5)).toBe(high);
expect(resizeSplit(high, [0], 0, 0.5)).toBe(high);
});
diff --git a/apps/app/src/lib/use-composers.test.tsx b/apps/app/src/lib/use-composers.test.tsx
index 512873d2a2b..7df4d8ac322 100644
--- a/apps/app/src/lib/use-composers.test.tsx
+++ b/apps/app/src/lib/use-composers.test.tsx
@@ -139,8 +139,12 @@ describe("useComposers", () => {
const { result } = renderHook(() => useComposers(), { wrapper });
result.current[0]!.setInputLock(true);
+ result.current[0]!.setTextEffect({ className: "listed-effect" });
expect(warn).toHaveBeenCalledWith(
expect.stringContaining("useComposers() composer.setInputLock"),
);
+ expect(warn).toHaveBeenCalledWith(
+ expect.stringContaining("useComposers() composer.setTextEffect"),
+ );
});
});
diff --git a/apps/app/src/lib/ws.plugin-signal.test.ts b/apps/app/src/lib/ws.plugin-signal.test.ts
index cea20a4378a..d77e3fcb8dc 100644
--- a/apps/app/src/lib/ws.plugin-signal.test.ts
+++ b/apps/app/src/lib/ws.plugin-signal.test.ts
@@ -42,23 +42,4 @@ describe("WebSocketManager plugin-signal routing", () => {
expect(received).toHaveBeenCalledTimes(1);
expect(received.mock.calls[0]?.[0]).not.toHaveProperty("futureField");
});
-
- it("does not misroute other message types to plugin subscribers", () => {
- const manager = new WebSocketManager();
- const pluginSignals = vi.fn();
- const changed = vi.fn();
- manager.onPluginSignal(pluginSignals);
- manager.onChanged(changed);
-
- manager.handleIncomingMessage(
- JSON.stringify({
- type: "changed",
- entity: "system",
- changes: ["plugins-changed"],
- }),
- );
-
- expect(pluginSignals).not.toHaveBeenCalled();
- expect(changed).toHaveBeenCalledTimes(1);
- });
});
diff --git a/apps/app/src/lib/ws.test.ts b/apps/app/src/lib/ws.test.ts
index 9363d2b4659..702890d66e6 100644
--- a/apps/app/src/lib/ws.test.ts
+++ b/apps/app/src/lib/ws.test.ts
@@ -394,8 +394,10 @@ describe("WebSocketManager thread-open signals", () => {
const { manager } = createConnectedManager();
const changed = vi.fn();
const threadOpen = vi.fn();
+ const pluginSignals = vi.fn();
manager.onChanged(changed);
manager.onThreadOpen(threadOpen);
+ manager.onPluginSignal(pluginSignals);
dispatchRaw({
type: "changed",
@@ -406,6 +408,7 @@ describe("WebSocketManager thread-open signals", () => {
expect(changed).toHaveBeenCalledTimes(1);
expect(threadOpen).not.toHaveBeenCalled();
+ expect(pluginSignals).not.toHaveBeenCalled();
});
it("routes typed thread-pane actions separately", () => {
diff --git a/apps/app/src/test/virtualizer-scroll-lifecycle.test.tsx b/apps/app/src/test/virtualizer-scroll-lifecycle.test.tsx
deleted file mode 100644
index 8db778dacac..00000000000
--- a/apps/app/src/test/virtualizer-scroll-lifecycle.test.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-// @vitest-environment jsdom
-
-import { useVirtualizer, useWindowVirtualizer } from "@tanstack/react-virtual";
-import { cleanup, fireEvent, render } from "@testing-library/react";
-import { afterEach, describe, expect, it, vi } from "vitest";
-
-function ElementVirtualizer({
- scrollElement,
- onChange,
-}: {
- scrollElement: HTMLElement;
- onChange: () => void;
-}) {
- useVirtualizer({
- count: 100,
- estimateSize: () => 32,
- getScrollElement: () => scrollElement,
- onChange,
- });
- return null;
-}
-
-function WindowVirtualizer({ onChange }: { onChange: () => void }) {
- useWindowVirtualizer({
- count: 100,
- estimateSize: () => 32,
- onChange,
- });
- return null;
-}
-
-afterEach(() => {
- cleanup();
- vi.clearAllTimers();
- vi.useRealTimers();
-});
-
-describe("virtualizer scroll lifecycle", () => {
- it.each(["element", "window"] as const)(
- "cancels the pending scroll reset when the %s virtualizer unmounts",
- (target) => {
- vi.useFakeTimers();
- const onChange = vi.fn();
- const scrollElement = document.createElement("div");
- const rendered = render(
- target === "element" ? (
-
- ) : (
-
- ),
- );
- fireEvent.scroll(target === "element" ? scrollElement : window);
- expect(vi.getTimerCount()).toBeGreaterThan(0);
-
- rendered.unmount();
- onChange.mockClear();
- expect(vi.getTimerCount()).toBe(0);
- vi.advanceTimersByTime(300);
- expect(onChange).not.toHaveBeenCalled();
- },
- );
-});
diff --git a/apps/app/src/views/ToolsView.plugin-detail.test.tsx b/apps/app/src/views/ToolsView.plugin-detail.test.tsx
index 8742d2ecc60..5f4e47d9ba5 100644
--- a/apps/app/src/views/ToolsView.plugin-detail.test.tsx
+++ b/apps/app/src/views/ToolsView.plugin-detail.test.tsx
@@ -1998,6 +1998,7 @@ describe("PluginDetail banner precedence", () => {
expect(alerts[0]?.textContent).toContain("Wait, then reload.");
expect(alerts[0]?.textContent).not.toContain("issue-sync");
expect(alerts[0]?.textContent).not.toContain("handler");
+ expect(alerts[0]?.textContent).not.toContain("Restart bb");
expect(screen.getByRole("button", { name: "Reload" })).toBeTruthy();
expect(screen.queryByRole("button", { name: "Update" })).toBeNull();
});
@@ -2131,27 +2132,6 @@ describe("PluginDetail runtime health", () => {
).toBeTruthy();
});
- it("offers Reload for degraded runtime status and keeps diagnostics out of the banner", () => {
- renderRuntimeStatus("degraded", {
- statusDetail: "service issue-sync did not stop",
- handlerStats: {
- ...GITHUB_PLUGIN.handlerStats,
- errorCount: 3,
- },
- });
-
- const alerts = screen.getAllByRole("alert");
- expect(alerts).toHaveLength(1);
- const alertText = alerts[0]?.textContent;
- expect(alertText).toContain("Degraded");
- expect(alertText).toContain("A service is still stopping.");
- expect(alertText).toContain("Wait, then reload.");
- expect(alertText).not.toContain("issue-sync");
- expect(alertText).not.toContain("handler");
- expect(alertText).not.toContain("Restart bb");
- expect(screen.getByRole("button", { name: "Reload" })).toBeTruthy();
- });
-
it.each([
["incompatible", "This version is incompatible with bb.", "Update bb."],
["missing", "Plugin files are missing.", "Update or reinstall bb."],
diff --git a/apps/app/src/views/thread-detail/PaneMaximizeButton.test.tsx b/apps/app/src/views/thread-detail/PaneMaximizeButton.test.tsx
index da4a1b792c1..a9b553ac62e 100644
--- a/apps/app/src/views/thread-detail/PaneMaximizeButton.test.tsx
+++ b/apps/app/src/views/thread-detail/PaneMaximizeButton.test.tsx
@@ -15,10 +15,7 @@ import { createBbDesktopApi } from "@/test/bb-desktop-test-utils";
import { focusWithKeyboard } from "@/test/keyboard-focus";
import { useIsBrowserDimmingModalOpen } from "@/hooks/useBrowserDimmingModal";
import { PaneContext, type PaneContextValue } from "./PaneContext";
-import {
- PaneMaximizeButton,
- resolvePaneArrangementLabel,
-} from "./PaneMaximizeButton";
+import { PaneMaximizeButton } from "./PaneMaximizeButton";
vi.mock("@/components/commands/AppCommandProvider", () => ({
useAppCommandShortcut: () => ({
@@ -208,6 +205,12 @@ describe("PaneMaximizeButton", () => {
screen.getByRole("menuitem", { name: /Full Screen/ }),
).not.toBeNull();
expect(menu.textContent).not.toContain("Maximize pane");
+
+ cleanup();
+ renderButton(true);
+ expect(
+ screen.getByRole("button", { name: "Exit Full Screen (ββ§E)" }),
+ ).not.toBeNull();
});
it("hides the native desktop browser while the arrangement menu can cover it", () => {
@@ -275,19 +278,3 @@ describe("PaneMaximizeButton", () => {
expect(screen.queryByRole("button")).toBeNull();
});
});
-
-describe("resolvePaneArrangementLabel", () => {
- it.each([
- [false, false, "Maximize pane"],
- [false, true, "Restore split"],
- [true, false, "Full Screen"],
- [true, true, "Exit Full Screen"],
- ] as const)(
- "resolves desktop=%s fullScreen=%s as %s",
- (isDesktopApp, isFullScreen, expected) => {
- expect(resolvePaneArrangementLabel({ isDesktopApp, isFullScreen })).toBe(
- expected,
- );
- },
- );
-});
diff --git a/apps/app/src/views/thread-detail/PaneMaximizeButton.tsx b/apps/app/src/views/thread-detail/PaneMaximizeButton.tsx
index e75a3a98ec7..a96f82726f4 100644
--- a/apps/app/src/views/thread-detail/PaneMaximizeButton.tsx
+++ b/apps/app/src/views/thread-detail/PaneMaximizeButton.tsx
@@ -35,7 +35,7 @@ const ARRANGEMENT_REGION_CLASS: Record = {
bottom: "inset-x-[3px] bottom-[3px] h-1.5",
};
-export function resolvePaneArrangementLabel({
+function resolvePaneArrangementLabel({
isDesktopApp,
isFullScreen,
}: {