style(webui): refine composer surface and workspace hover (#6444)
* style(webui): refine the chat composer surface Use a themed card background with a subtle edge and soft shadow. Keep focus stable without a darker frame while preserving Goal and drag rings. Align the startup composer surface and add composer-scoped browser coverage. * style(webui): align workspace hover with access control Keep the workspace trigger background clear on hover and use its existing text-color feedback, matching the adjacent access control. Preserve focus, disabled, and directory-picker behavior.
This commit is contained in:
1 parent
e7e94bda1c
commit
4f7c4f0885
6 files changed
+83
-6
No files matched your search
@@ -8,6 +8,7 @@ export function ComposerActionFixture({ parameters }: { parameters: URLSearchPar
|
||||
<ThreadComposer
|
||||
variant={parameters.get("composerVariant") === "thread" ? "thread" : "hero"}
|
||||
modelLabel="Preview"
|
||||
goalState={parameters.has("goal") ? { active: true, objective: "Keep the work in focus." } : undefined}
|
||||
isStreaming={running}
|
||||
onTranscribeAudio={async () => "Voice draft"}
|
||||
onSend={() => { setStopRequested(false); setRunning(true); }}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.route("**/api/commands", route => route.fulfill({ json: { commands: [] } }));
|
||||
});
|
||||
|
||||
for (const theme of ["light", "dark"]) {
|
||||
test.describe(theme, () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.addInitScript((theme) => {
|
||||
localStorage.setItem("nanobot.locale", "en");
|
||||
localStorage.setItem("nanobot-webui.theme", theme);
|
||||
document.documentElement.classList.toggle("dark", theme === "dark");
|
||||
}, theme);
|
||||
});
|
||||
|
||||
test("composer focus keeps the surface and actions stable", async ({ page }) => {
|
||||
await page.goto(`/browser/fixture.html?case=new-chat-skeleton${theme === "dark" ? "&dark" : ""}`);
|
||||
const surface = page.locator(".thread-composer-surface");
|
||||
await expect(surface).toBeVisible();
|
||||
const input = page.getByRole("textbox", { name: "Message input" });
|
||||
await input.blur();
|
||||
await page.getByTestId("hero-greeting").click();
|
||||
const rest = await surface.evaluate(element => getComputedStyle(element).boxShadow);
|
||||
const bounds = await surface.boundingBox();
|
||||
const footer = await page.locator(".thread-composer-footer").boundingBox();
|
||||
await input.focus();
|
||||
await expect(input).toBeFocused();
|
||||
await expect.poll(() => surface.evaluate(element => getComputedStyle(element).boxShadow)).toBe(rest);
|
||||
expect(await surface.boundingBox()).toEqual(bounds);
|
||||
expect(await page.locator(".thread-composer-footer").boundingBox()).toEqual(footer);
|
||||
await input.fill("Keep the work in focus.");
|
||||
await expect(input).toHaveValue("Keep the work in focus.");
|
||||
});
|
||||
|
||||
test("composer focus preserves the active goal's blue ring", async ({ page }) => {
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await page.goto("/browser/fixture.html?case=composer-action&goal");
|
||||
const surface = page.locator(".thread-composer-surface");
|
||||
await expect(surface).toBeVisible();
|
||||
const ring = await surface.evaluate(element => {
|
||||
const probe = document.createElement("span");
|
||||
probe.style.color = getComputedStyle(element).getPropertyValue("--tw-ring-color");
|
||||
document.body.append(probe);
|
||||
const color = getComputedStyle(probe).color;
|
||||
probe.remove();
|
||||
return color;
|
||||
});
|
||||
const input = page.getByRole("textbox", { name: "Message input" });
|
||||
await input.blur();
|
||||
const rest = await surface.evaluate(element => getComputedStyle(element).boxShadow);
|
||||
expect(rest).toContain(ring);
|
||||
await input.focus();
|
||||
const focused = await surface.evaluate(element => getComputedStyle(element).boxShadow);
|
||||
expect(focused).toContain(ring);
|
||||
expect(focused).toBe(rest);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user