Skip to content

Commit b1b8ed1

Browse files
committed
fix(app): keep the skin tests and the composer hook passing
- The composer column keeps its literal class, so OpenDuet's hook still finds it. openbot.css sets the default skin's centered 720px column. - The work row test looks for the Bot's orb, not an svg. - The OpenDots frame test sets the OpenDots skin, so its avatars are the OpenDots ones. - The pagination test answers the approval inbox, so it counts only channel requests.
1 parent 848c141 commit b1b8ed1

5 files changed

Lines changed: 36 additions & 11 deletions

File tree

‎app/src/components/channels/conversation-view.tsx‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -447,16 +447,9 @@ export function ConversationView({
447447
working={working}
448448
/>
449449
</div>
450+
{/* In OpenBot's own look, openbot.css widens this column to the transcript's centered 720px. */}
450451
<div
451-
/*
452-
* In OpenBot's own look the composer shares the transcript's centered 720px column, set by
453-
* the padding here rather than by the composer.
454-
*/
455-
className={
456-
openbot
457-
? "w-full px-4 pb-4 shrink-0 md:px-[max(32px,calc((100%-720px)/2))]"
458-
: "max-w-2xl mx-auto w-full px-0 pb-4 shrink-0"
459-
}
452+
className="max-w-2xl mx-auto w-full px-0 pb-4 shrink-0"
460453
data-slot="composer-column"
461454
>
462455
{notice}

‎app/src/openbot.css‎

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/tests/channel-pagination.test.tsx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import userEvent from "@testing-library/user-event";
2525
import { AppSidebar } from "@/components/app-sidebar/app-sidebar";
2626
import { SidebarProvider } from "@/components/ui/sidebar";
2727
import { agentKeys } from "@/lib/agents/queries";
28+
import { approvalInboxOptions } from "@/lib/approvals";
2829
import { authKeys } from "@/lib/auth/queries";
2930
import { botLifecycleKeys } from "@/lib/bot-lifecycle/queries";
3031
import { browserKeys } from "@/lib/browser/queries";
@@ -184,6 +185,18 @@ function renderSidebar() {
184185
refetchInterval: false,
185186
});
186187
queryClient.setQueryData(botLifecycleKeys.attention, []);
188+
// The sidebar reads the approval inbox to mark conversations that wait for you; answered here so only channel requests are counted.
189+
queryClient.setQueryDefaults(approvalInboxOptions().queryKey, {
190+
staleTime: Number.POSITIVE_INFINITY,
191+
refetchInterval: false,
192+
});
193+
queryClient.setQueryData(approvalInboxOptions().queryKey, {
194+
enabled: true,
195+
requests: [],
196+
rules: [],
197+
teamRules: [],
198+
questions: [],
199+
});
187200
// The Browser button reads whether there is a browser once; answered here so only channel requests are counted.
188201
queryClient.setQueryData(browserKeys.state, {
189202
available: false,

‎app/tests/channel-work-row.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ test("says who was asked, with their avatar and no clock", () => {
5656
// The avatar is decoration beside a label that already names the Bot, so it is announced once.
5757
const avatar = row.querySelector("[aria-hidden='true'] [role='img']");
5858
expect(avatar?.getAttribute("aria-label")).toBe("Ana");
59-
expect(row.querySelector("svg")).not.toBeNull();
59+
// In OpenBot's own look the avatar is the Bot's orb.
60+
expect(row.querySelector("[data-variant]")).not.toBeNull();
6061
});
6162

6263
test("prefers the name and avatar the person knows the Bot by", () => {

‎app/tests/skins-opendots-frame.test.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ import {
1717
Outlet,
1818
RouterProvider,
1919
} from "@tanstack/react-router";
20-
import { cleanup, render, waitFor, within } from "@testing-library/react";
20+
import { act, cleanup, render, waitFor, within } from "@testing-library/react";
2121
import userEvent from "@testing-library/user-event";
2222
import { AbstractAvatar } from "@/components/agents/abstract-avatar";
2323
import { appConfig } from "@/lib/generated/application-config";
2424
import { NAVIGATION, navigationFor } from "@/lib/navigation";
2525
import { queryClient } from "@/query-client";
2626
import { opendots } from "@/skins/opendots";
27+
import { DEFAULT_SKIN, setSkin } from "@/skins/store";
2728
import type { AgentProfileStore } from "../../server/src/agents/profile-store";
2829
import type { AgentProfile } from "../../server/src/agents/profile-types";
2930
import { createAgentRoutes } from "../../server/src/agents/routes";
@@ -217,6 +218,8 @@ beforeAll(() => {
217218
});
218219

219220
beforeEach(() => {
221+
// The frame is OpenDots, so the avatars inside it wear OpenDots too.
222+
act(() => setSkin("opendots"));
220223
requests.length = 0;
221224
actor = person;
222225
agentsFail = false;
@@ -234,6 +237,7 @@ beforeEach(() => {
234237

235238
afterEach(() => {
236239
cleanup();
240+
act(() => setSkin(DEFAULT_SKIN));
237241
// The app's one client, as the mutations invalidate it; each test starts from an empty cache.
238242
queryClient.clear();
239243
});

0 commit comments

Comments
 (0)