diff --git a/webui/browser/appearance.spec.ts b/webui/browser/appearance.spec.ts
index 744fb16ba..24b5c2178 100644
--- a/webui/browser/appearance.spec.ts
+++ b/webui/browser/appearance.spec.ts
@@ -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");
diff --git a/webui/src/components/settings/overview/AppearanceSettingsView.tsx b/webui/src/components/settings/overview/AppearanceSettingsView.tsx
index e0c905fec..74b30d5bb 100644
--- a/webui/src/components/settings/overview/AppearanceSettingsView.tsx
+++ b/webui/src/components/settings/overview/AppearanceSettingsView.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
import { LanguageSwitcher } from "@/components/LanguageSwitcher";
import { SettingsGroup, SettingsRow, SettingsSectionTitle } from "@/components/settings/shared/SettingsControls";
+import { SettingsHint } from "@/components/settings/shared/SettingsHint";
import { ToggleButton } from "@/components/ui/toggle-button";
import { SegmentedControl } from "@/components/ui/segmented-control";
import type { ThemePreference } from "@/hooks/useTheme";
@@ -66,18 +67,20 @@ export function AppearanceSettingsView({ themePreference, onChangeTheme, localPr
{t("settings.appearance.processHelp")} {t(`settings.appearance.${localPrefs.activityMode === "auto" ? "autoHelp" : "expandedHelp"}`)} {t(`settings.appearance.${editHelp[localPrefs.fileEditDisplayMode]}`)}
{t("settings.appearance.readingHelp")}
{hint}