fix(webui): move appearance help to hints and smooth theme preview
This commit is contained in:
1 parent
01a1ef5370
commit
9270137d65
4 files changed
+44
-11
No files matched your search
@@ -78,12 +78,42 @@ for (const narrow of [false, true]) {
|
||||
await checkbox.click();
|
||||
await expect(checkbox).toHaveAttribute("aria-checked", "false");
|
||||
await page.getByRole("button", { name: "折叠修改", exact: true }).click();
|
||||
await expect(page.getByText("默认收起代码差异,需要时点开。", { exact: true })).toBeVisible();
|
||||
await page.getByRole("button", { name: "修改预览", exact: true }).click();
|
||||
await expect(page.getByRole("tooltip")).toHaveText("默认收起代码差异,需要时点开。");
|
||||
await page.keyboard.press("Escape");
|
||||
await page.locator("main").evaluate((element) => element.scrollTo(0, 0));
|
||||
await page.screenshot({ path: info.outputPath("appearance.png") });
|
||||
});
|
||||
}
|
||||
|
||||
test("appearance explanations open on demand and follow the selected display modes", async ({ page }) => {
|
||||
await page.goto("/browser/fixture.html?case=appearance");
|
||||
const explanations = [
|
||||
["Reading text size", "Adjust messages, code and the composer—not navigation."],
|
||||
["Activity display", "Choose how much detail appears as nanobot works."],
|
||||
["Activity details", "Show progress while working; keep finished work compact."],
|
||||
["Edit preview", "Show changed files and line counts."],
|
||||
];
|
||||
for (const [label, description] of explanations) {
|
||||
await expect(page.getByText(description, { exact: true })).toBeHidden();
|
||||
await page.getByRole("button", { name: label, exact: true }).hover();
|
||||
await expect(page.getByRole("tooltip")).toHaveText(description);
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.getByRole("tooltip")).toBeHidden();
|
||||
}
|
||||
|
||||
await page.getByRole("button", { name: "Expanded", exact: true }).click();
|
||||
const activity = page.getByRole("button", { name: "Activity details", exact: true });
|
||||
await activity.focus();
|
||||
await expect(page.getByRole("tooltip")).toHaveText("Keep activity details expanded by default.");
|
||||
await activity.press("Escape");
|
||||
await expect(page.getByRole("tooltip")).toBeHidden();
|
||||
await page.getByRole("button", { name: "Diff", exact: true }).click();
|
||||
const edits = page.getByRole("button", { name: "Edit preview", exact: true });
|
||||
await edits.focus();
|
||||
await expect(page.getByRole("tooltip")).toHaveText("Show code changes directly in the conversation.");
|
||||
});
|
||||
|
||||
test("changing a custom size reflows an existing composer and its mention layer", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.goto("/browser/fixture.html?case=typography");
|
||||
|
||||
Reference in new issue
Block a user