fix(webui): tighten mobile chat layout and soften transcript edges
This commit is contained in:
1 parent
ce885fa31e
commit
8af2d396ab
10 files changed
+183
-26
No files matched your search
@@ -35,6 +35,7 @@ import { FileEditPathFixture } from "./file-edit-path-fixture";
|
||||
import { QueuedGuidanceFixture } from "./queued-guidance-fixture";
|
||||
import { WorkspaceAlignmentFixture } from "./workspace-alignment-fixture";
|
||||
import { ComposerActionFixture } from "./composer-action-fixture";
|
||||
import { MobileChatLayoutFixture } from "./mobile-chat-layout-fixture";
|
||||
|
||||
const history: UIMessage[] = [
|
||||
{ id: "question", role: "user", content: "Earlier question", createdAt: 1_700_000_000_000 },
|
||||
@@ -186,7 +187,9 @@ if (parameters.get("case") === "skeleton-additions") installSkeletonPreviewApi()
|
||||
if (parameters.get("case") === "idle-compaction") installIdleCompactionApi();
|
||||
await initializeI18n();
|
||||
createRoot(document.getElementById("root")!).render(<TooltipProvider>
|
||||
{parameters.get("case") === "composer-action"
|
||||
{parameters.get("case") === "mobile-chat-layout"
|
||||
? <ClientProvider client={railClient} token="fixture"><MobileChatLayoutFixture parameters={parameters} /></ClientProvider>
|
||||
: parameters.get("case") === "composer-action"
|
||||
? <ComposerActionFixture parameters={parameters} />
|
||||
: parameters.get("case") === "workspace-alignment"
|
||||
? <WorkspaceAlignmentFixture parameters={parameters} />
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { CalendarClock, ListFilter } from "lucide-react";
|
||||
import { ThreadComposer } from "@/components/thread/ThreadComposer";
|
||||
import { ThreadHeader } from "@/components/thread/ThreadHeader";
|
||||
import { ThreadViewport } from "@/components/thread/ThreadViewport";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import type { UIMessage, WorkspaceScopePayload, WorkspacesPayload } from "@/lib/types";
|
||||
|
||||
const messages: UIMessage[] = [
|
||||
{ id: "layout-question-1", role: "user", content: "手机上的聊天布局,能不能再紧凑自然一些?", createdAt: 1_700_000_000_000 },
|
||||
{ id: "layout-answer-1", role: "assistant", content: "可以。先把空间分给真正需要阅读的消息,再整理输入框附近的辅助信息。\n\n工作区、上下文用量和权限都很有用,但不需要各占一行;减少空白,也不等于缩小按钮的点击范围。", createdAt: 1_700_000_001_000 },
|
||||
{ id: "layout-question-2", role: "user", content: "Context 出现时不要把输入框顶上去,顶部的文字也别切得那么生硬。", createdAt: 1_700_000_002_000 },
|
||||
{ id: "layout-answer-2", role: "assistant", content: "这版保留熟悉的输入方式,只调整空间和边缘。\n\n**辅助信息合成一行**\n\n工作区在左,上下文用量与权限在右。手机上用圆环和百分比表示 Context,详细用量仍可点开查看。\n\n**把空间还给消息**\n\n输入框下方不再堆两层状态,底部只保留舒适的安全间距,按钮仍然容易点击。\n\n**顶部自然收边**\n\n靠近顶栏的内容轻轻淡出,不再突然截成半行;正文仍然可以自由滚动。", createdAt: 1_700_000_003_000 },
|
||||
];
|
||||
const initialScope: WorkspaceScopePayload = { project_path: "/projects/nanobot", project_name: "nanobot", access_mode: "full" };
|
||||
const catalog: WorkspacesPayload = {
|
||||
schema_version: 1,
|
||||
default_access_mode: "full",
|
||||
default_scope: initialScope,
|
||||
recent_projects: [{ path: "/projects/nanobot", name: "nanobot" }],
|
||||
controls: { can_change_project: true },
|
||||
};
|
||||
|
||||
export function MobileChatLayoutFixture({ parameters }: { parameters: URLSearchParams }) {
|
||||
const [dark, setDark] = useState(parameters.has("dark"));
|
||||
const [scope, setScope] = useState<WorkspaceScopePayload>(() => parameters.has("long-project")
|
||||
? { ...initialScope, project_name: "nanobot-mobile-layout-preview" }
|
||||
: initialScope);
|
||||
useEffect(() => { document.documentElement.classList.toggle("dark", dark); }, [dark]);
|
||||
return (
|
||||
<main className="thread-workspace relative flex min-w-0 flex-col overflow-hidden bg-background" style={{ height: "100dvh" }}>
|
||||
<ThreadHeader title="Mobile layout preview" hideTitle theme={dark ? "dark" : "light"}
|
||||
onToggleSidebar={() => {}} onToggleTheme={() => setDark(value => !value)}
|
||||
sessionInfoAction={<Button variant="ghost" size="icon" aria-label="Session details"><CalendarClock className="h-3.5 w-3.5" /></Button>}
|
||||
promptNavigatorAction={<Button variant="ghost" size="icon" aria-label="Conversation navigation"><ListFilter className="h-3.5 w-3.5" /></Button>}
|
||||
/>
|
||||
<ThreadViewport messages={messages} isStreaming={false} conversationReady conversationKey="websocket:mobile-layout-preview"
|
||||
hasMoreBefore={false} showScrollToBottomButton
|
||||
composer={<ThreadComposer variant="thread" onSend={() => {}}
|
||||
modelLabel="6.1-max" modelProvider="openai-codex" onTranscribeAudio={async () => ""}
|
||||
contextUsage={parameters.has("no-context") ? null : { contextTokens: 44_000, contextWindowTokens: 200_000 }}
|
||||
workspaceScope={scope} workspaceDefaultScope={initialScope} workspaceControls={catalog.controls}
|
||||
workspaceProjectLocked={!parameters.has("project")}
|
||||
onWorkspaceScopeChange={setScope} onLoadWorkspaceProjects={async () => catalog}
|
||||
onResolveWorkspaceProject={async path => ({ path, name: "nanobot" })}
|
||||
onFavoriteWorkspaceProject={async () => []}
|
||||
onBrowseWorkspaceDirectories={async path => ({ path, parent: null, entries: [], truncated: false, host: "preview", platform: "Linux" })}
|
||||
/>}
|
||||
/>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
for (const { width, dark } of [{ width: 360, dark: false }, { width: 314, dark: true }, { width: 600, dark: false }]) {
|
||||
test.describe(`mobile transcript at ${width}px`, () => {
|
||||
test.use({ viewport: { width, height: 740 }, hasTouch: true, reducedMotion: "reduce" });
|
||||
test("keeps metadata tappable on one row and the top fade fixed while scrolling", async ({ page }) => {
|
||||
await page.addInitScript(() => localStorage.setItem("nanobot.locale", "en"));
|
||||
await page.route("**/api/**", route => route.fulfill({ json: {} }));
|
||||
await page.goto(`/browser/fixture.html?case=mobile-chat-layout&project&long-project${dark ? "&dark" : ""}`);
|
||||
const workspace = page.getByRole("button", { name: "Switch directory" });
|
||||
const usage = page.getByRole("button", { name: "Context 22%. Open context usage" });
|
||||
const access = page.getByRole("button", { name: "Workspace access mode: Full Access" });
|
||||
await expect(usage).toHaveText("22%");
|
||||
const boxes = await Promise.all([workspace, usage, access].map(control => control.boundingBox()));
|
||||
const [directoryBox, usageBox, accessBox] = boxes.map(box => box!);
|
||||
for (const box of boxes) {
|
||||
expect(box!.height).toBeGreaterThanOrEqual(44);
|
||||
expect(box!.width).toBeGreaterThanOrEqual(44);
|
||||
expect(box!.y).toBeCloseTo(accessBox.y, 1);
|
||||
}
|
||||
expect(directoryBox.x + directoryBox.width).toBeLessThanOrEqual(usageBox.x);
|
||||
expect(usageBox.x + usageBox.width).toBeLessThanOrEqual(accessBox.x);
|
||||
expect(accessBox.x + accessBox.width).toBeLessThanOrEqual(width);
|
||||
expect(740 - accessBox.y - accessBox.height).toBeCloseTo(8, 1);
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBe(width);
|
||||
|
||||
await usage.click();
|
||||
const details = page.getByRole("dialog", { name: "Context usage" });
|
||||
await expect(details.getByRole("progressbar", { name: "Context 22%" })).toHaveAttribute("aria-valuenow", "22");
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(usage).toBeFocused();
|
||||
|
||||
const scroller = page.locator(".thread-message-viewport");
|
||||
await expect(scroller).toHaveCSS("--thread-top-clearance", "6px");
|
||||
await expect(scroller).toHaveCSS("--thread-top-fade-height", "22px");
|
||||
const mask = await scroller.evaluate(node => getComputedStyle(node).maskImage);
|
||||
expect(mask).toContain("6px");
|
||||
expect(mask).toContain("22px");
|
||||
expect(mask).toContain("calc(100% - 36px)");
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
await expect.poll(() => scroller.evaluate(node => node.scrollHeight - node.clientHeight)).toBeGreaterThan(100);
|
||||
await expect.poll(() => scroller.evaluate(node => node.scrollHeight - node.clientHeight - node.scrollTop)).toBeLessThanOrEqual(1);
|
||||
const before = (await scroller.boundingBox())!;
|
||||
const initialScrollTop = await scroller.evaluate(node => node.scrollTop);
|
||||
await page.mouse.move(before.x + before.width / 2, before.y + before.height / 2);
|
||||
await page.mouse.wheel(0, -100);
|
||||
await expect.poll(() => scroller.evaluate(node => node.scrollTop)).toBeLessThan(initialScrollTop - 50);
|
||||
expect((await scroller.boundingBox())!.y).toBeCloseTo(before.y, 1);
|
||||
expect(await scroller.evaluate(node => getComputedStyle(node).maskImage)).toBe(mask);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
test.describe("desktop transcript spacing", () => {
|
||||
test.use({ viewport: { width: 1440, height: 900 }, reducedMotion: "reduce" });
|
||||
test("preserves desktop footer spacing and the bottom-only fade", async ({ page }) => {
|
||||
await page.addInitScript(() => localStorage.setItem("nanobot.locale", "en"));
|
||||
await page.route("**/api/**", route => route.fulfill({ json: {} }));
|
||||
await page.goto("/browser/fixture.html?case=mobile-chat-layout&project");
|
||||
const access = page.getByRole("button", { name: "Workspace access mode: Full Access" });
|
||||
await expect(access).toBeVisible();
|
||||
expect(await access.evaluate(node => !!node.closest(".thread-composer-footer-primary"))).toBe(true);
|
||||
const meta = (await page.locator(".thread-composer-meta").boundingBox())!;
|
||||
expect(900 - meta.y - meta.height).toBeCloseTo(18, 1);
|
||||
const scroller = page.locator(".thread-message-viewport");
|
||||
await expect(scroller).toHaveCSS("--thread-top-clearance", "0px");
|
||||
await expect(scroller).toHaveCSS("--thread-top-fade-height", "0px");
|
||||
expect(await scroller.evaluate(node => getComputedStyle(node).maskImage)).toContain("calc(100% - 36px)");
|
||||
});
|
||||
});
|
||||
@@ -58,9 +58,9 @@ for (const variant of ["hero", "thread"]) for (const width of [280, 320, 390, 60
|
||||
});
|
||||
}
|
||||
|
||||
for (const variant of ["hero", "thread"]) {
|
||||
test.describe(`${variant} mobile permission with usage`, () => {
|
||||
test.use({ viewport: { width: 320, height: 900 }, hasTouch: true, reducedMotion: "reduce" });
|
||||
for (const variant of ["hero", "thread"]) for (const width of [320, 600]) {
|
||||
test.describe(`${variant} mobile permission with usage at ${width}px`, () => {
|
||||
test.use({ viewport: { width, height: 900 }, hasTouch: true, reducedMotion: "reduce" });
|
||||
test("keeps access on the lower right when context usage appears", async ({ page }) => {
|
||||
await page.addInitScript(() => localStorage.setItem("nanobot.locale", "en"));
|
||||
await page.route("**/api/commands", route => route.fulfill({ json: { commands: [] } }));
|
||||
@@ -69,11 +69,14 @@ for (const variant of ["hero", "thread"]) {
|
||||
const access = (await page.getByRole("button", { name: "Workspace access mode: Full Access" }).boundingBox())!;
|
||||
const usage = (await page.getByTestId("composer-context-usage").boundingBox())!;
|
||||
expect(Math.abs(access.y - workspace.y)).toBeLessThan(1);
|
||||
expect(usage.y + usage.height).toBeLessThanOrEqual(access.y);
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth)).toBe(false);
|
||||
await page.getByTestId("composer-context-usage").focus();
|
||||
expect(Math.abs(usage.y - access.y)).toBeLessThan(1);
|
||||
expect(workspace.x + workspace.width).toBeLessThanOrEqual(usage.x);
|
||||
expect(usage.x + usage.width).toBeLessThanOrEqual(access.x);
|
||||
expect(access.x + access.width).toBeLessThanOrEqual(width);
|
||||
expect(await page.getByTestId("composer-context-usage").textContent()).toBe("50%");
|
||||
await page.getByRole("button", { name: "Switch directory" }).focus();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(page.getByRole("button", { name: "Switch directory" })).toBeFocused();
|
||||
await expect(page.getByTestId("composer-context-usage")).toBeFocused();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(page.getByRole("button", { name: "Workspace access mode: Full Access" })).toBeFocused();
|
||||
});
|
||||
|
||||
@@ -59,11 +59,13 @@ export function ComposerUsagePopover({
|
||||
context,
|
||||
rounds,
|
||||
showLabel = false,
|
||||
compactLabel = false,
|
||||
bottomSheet = false,
|
||||
}: {
|
||||
context: ComposerContextUsage | null;
|
||||
rounds: readonly ComposerRoundUsage[];
|
||||
showLabel?: boolean;
|
||||
compactLabel?: boolean;
|
||||
bottomSheet?: boolean;
|
||||
}) {
|
||||
const { t, i18n } = useTranslation();
|
||||
@@ -123,6 +125,7 @@ export function ComposerUsagePopover({
|
||||
const RoundTrigger = bottomSheet ? PopoverTrigger : TooltipTrigger;
|
||||
const RoundContent = bottomSheet ? PopoverContent : TooltipContent;
|
||||
const RoundBar = bottomSheet ? "button" : "span";
|
||||
const showTextLabel = showLabel && (!compactLabel || contextPercentage !== null);
|
||||
const trigger = (
|
||||
<Trigger asChild>
|
||||
<button
|
||||
@@ -133,7 +136,7 @@ export function ComposerUsagePopover({
|
||||
"touch-target inline-flex size-5 shrink-0 items-center justify-center rounded-full",
|
||||
"text-muted-foreground transition-colors hover:text-foreground",
|
||||
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
||||
showLabel && "w-auto gap-1.5 px-2 text-xs",
|
||||
showTextLabel && "w-auto gap-1.5 px-2 text-xs",
|
||||
)}
|
||||
>
|
||||
{contextPercentage === null ? (
|
||||
@@ -179,7 +182,11 @@ export function ComposerUsagePopover({
|
||||
/>
|
||||
</svg>
|
||||
)}
|
||||
{showLabel ? <span aria-hidden>{contextDescription}</span> : null}
|
||||
{showTextLabel ? (
|
||||
<span aria-hidden className="whitespace-nowrap tabular-nums">
|
||||
{compactLabel && contextPercentage !== null ? `${contextPercentage}%` : contextDescription}
|
||||
</span>
|
||||
) : null}
|
||||
</button>
|
||||
</Trigger>
|
||||
);
|
||||
|
||||
@@ -2547,8 +2547,9 @@ export function ThreadComposer({
|
||||
onClick={modelNeedsSetup ? onModelBadgeClick : undefined}
|
||||
/>
|
||||
) : null;
|
||||
const usageInMeta = mobileWorkspaceControls || compactControls;
|
||||
const usageControl = !voiceRecorder.isRecording && (contextUsage || recentRoundUsage.length) ? (
|
||||
<ComposerUsagePopover context={contextUsage} rounds={recentRoundUsage} showLabel={compactControls} bottomSheet={compactControls} />
|
||||
<ComposerUsagePopover context={contextUsage} rounds={recentRoundUsage} showLabel={usageInMeta} compactLabel={mobileWorkspaceControls} bottomSheet={usageInMeta} />
|
||||
) : null;
|
||||
const inputTextClasses = cn(
|
||||
// Keep the overlay's CJK/Latin spacing aligned with the native textarea caret.
|
||||
@@ -2610,7 +2611,7 @@ export function ThreadComposer({
|
||||
"thread-composer-form relative w-full [--composer-action-margin:0px]",
|
||||
isHero
|
||||
? "px-0 [--composer-action-size:2rem] [--composer-footer-inset:0.75rem] sm:[--composer-footer-inset:1rem]"
|
||||
: "px-1 pb-1.5 pt-1 [--composer-action-size:2.25rem] [--composer-footer-inset:0.625rem] sm:px-0 sm:[--composer-footer-inset:0.75rem]",
|
||||
: "px-1 pb-0 pt-1 [--composer-action-size:2.25rem] [--composer-footer-inset:0.625rem] sm:px-0 sm:pb-1.5 sm:[--composer-footer-inset:0.75rem]",
|
||||
compactWhenIdle && "thread-composer-collapsible-layout",
|
||||
paletteBeside && "grid grid-cols-2 items-start gap-2 p-0",
|
||||
)}
|
||||
@@ -2838,7 +2839,7 @@ export function ThreadComposer({
|
||||
)}
|
||||
>
|
||||
{modelControl}
|
||||
{!compactControls ? usageControl : null}
|
||||
{!usageInMeta ? usageControl : null}
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -2899,18 +2900,22 @@ export function ThreadComposer({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{workspaceControl || mobileWorkspaceControls && accessControl || compactControls && usageControl ? (
|
||||
{workspaceControl || mobileWorkspaceControls && accessControl || usageInMeta && usageControl ? (
|
||||
<div className={cn(
|
||||
"thread-composer-meta mx-auto mt-1 flex w-full min-w-0 flex-wrap items-center gap-x-2 gap-y-1 pr-2 sm:pr-3",
|
||||
"thread-composer-meta mx-auto mt-1 flex w-full min-w-0 items-center gap-x-2 pr-2 sm:pr-3",
|
||||
mobileWorkspaceControls ? "flex-nowrap gap-x-1 pr-0" : "flex-wrap gap-y-1",
|
||||
isHero ? "max-w-[58rem]" : "max-w-[49.5rem]",
|
||||
paletteBeside && "col-start-1 row-start-2",
|
||||
)}>
|
||||
{mobileWorkspaceControls && compactControls && usageControl ? <div className="flex w-full justify-end">{usageControl}</div> : null}
|
||||
<div className={cn("thread-composer-workspace-group flex min-w-0 items-center gap-1", mobileWorkspaceControls ? "flex-1" : "flex-auto max-[359px]:flex-wrap")}>
|
||||
{workspaceControl}
|
||||
</div>
|
||||
{!mobileWorkspaceControls && compactControls && usageControl ? <div className="ml-auto shrink-0">{usageControl}</div> : null}
|
||||
{mobileWorkspaceControls && accessControl ? <div className="ml-auto min-w-0 max-w-[55%] shrink">{accessControl}</div> : null}
|
||||
{usageInMeta && usageControl || mobileWorkspaceControls && accessControl ? (
|
||||
<div className={cn("ml-auto flex shrink-0 items-center gap-1", mobileWorkspaceControls && "h-11 max-w-[calc(100%-3rem)]")}>
|
||||
{usageInMeta ? usageControl : null}
|
||||
{mobileWorkspaceControls ? accessControl : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</form>
|
||||
|
||||
@@ -1213,7 +1213,7 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
||||
<div
|
||||
className={cn(
|
||||
hasThreadLayout
|
||||
? "px-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] sm:px-4"
|
||||
? "px-3 pb-[calc(0.5rem+env(safe-area-inset-bottom))] sm:px-4 sm:pb-[calc(0.75rem+env(safe-area-inset-bottom))]"
|
||||
: "",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -830,7 +830,7 @@ export function PaneWorkbench({
|
||||
</div>
|
||||
|
||||
{chrome ? (
|
||||
<footer className="workbench-composer-footer shrink-0 bg-background px-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] sm:px-4">
|
||||
<footer className="workbench-composer-footer shrink-0 bg-background px-3 pb-[calc(0.5rem+env(safe-area-inset-bottom))] sm:px-4 sm:pb-[calc(0.75rem+env(safe-area-inset-bottom))]">
|
||||
<div
|
||||
ref={setComposerPortalTarget}
|
||||
data-testid="workbench-composer-host"
|
||||
|
||||
+19
-5
@@ -567,6 +567,7 @@
|
||||
*/
|
||||
.thread-layout {
|
||||
--thread-composer-fade-height: 2.25rem;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-rows: minmax(min-content, 1fr) auto 0fr;
|
||||
transition: grid-template-rows 220ms ease-out;
|
||||
}
|
||||
@@ -585,23 +586,36 @@
|
||||
/**
|
||||
* Keep the transcript and composer visually continuous. The scrollport owns
|
||||
* the fade because overflow clips its contents before an adjacent overlay
|
||||
* can soften the edge. The matching in-flow gap keeps the last line fully
|
||||
* visible once the user reaches the bottom.
|
||||
* can soften the edge. On phones, the same mask keeps a clear top edge even
|
||||
* after the initial inset scrolls away. The matching bottom in-flow gap keeps
|
||||
* the last line fully visible once the user reaches the bottom.
|
||||
*/
|
||||
.thread-message-viewport {
|
||||
--thread-top-clearance: 0px;
|
||||
--thread-top-fade-height: 0px;
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to bottom,
|
||||
#000 0,
|
||||
transparent 0,
|
||||
transparent var(--thread-top-clearance),
|
||||
#000 var(--thread-top-fade-height),
|
||||
#000 calc(100% - var(--thread-composer-fade-height)),
|
||||
transparent 100%
|
||||
);
|
||||
mask-image: linear-gradient(
|
||||
to bottom,
|
||||
#000 0,
|
||||
transparent 0,
|
||||
transparent var(--thread-top-clearance),
|
||||
#000 var(--thread-top-fade-height),
|
||||
#000 calc(100% - var(--thread-composer-fade-height)),
|
||||
transparent 100%
|
||||
);
|
||||
}
|
||||
@media (max-width: 639px) {
|
||||
.thread-message-viewport {
|
||||
--thread-top-clearance: 6px;
|
||||
--thread-top-fade-height: 22px;
|
||||
}
|
||||
}
|
||||
.thread-message-end-gap {
|
||||
height: var(--thread-composer-fade-height);
|
||||
}
|
||||
@@ -1302,7 +1316,7 @@
|
||||
.thread-composer-form { --composer-action-size: 2.75rem; }
|
||||
}
|
||||
|
||||
/* Narrow composers keep message and permission actions together, with usage below. */
|
||||
/* Compact composers keep their primary actions on a stable 44px touch grid. */
|
||||
.thread-composer-form[data-compact-controls] {
|
||||
--composer-action-size: 2.25rem;
|
||||
--composer-action-margin: 0.25rem;
|
||||
|
||||
@@ -1359,7 +1359,10 @@ describe("ThreadComposer", () => {
|
||||
expect(container.querySelector(".thread-composer-surface")!.nextElementSibling).toBe(meta);
|
||||
expect(meta.querySelector(".thread-composer-workspace-group")).toContainElement(workspace);
|
||||
expect(meta).toContainElement(access);
|
||||
expect(meta).toContainElement(screen.getByTestId("composer-context-usage"));
|
||||
const usage = screen.getByTestId("composer-context-usage");
|
||||
expect(meta).toContainElement(usage);
|
||||
expect(usage).toHaveTextContent(/^50%$/);
|
||||
expect(usage).toHaveAccessibleName("Context 50%. Open context usage");
|
||||
expect(access.closest(".thread-composer-footer-primary")).toBeNull();
|
||||
const user = userEvent.setup();
|
||||
await user.click(access);
|
||||
|
||||
Reference in new issue
Block a user