Skip to content

Your lightweight open-source personal agent.

fix(webui): hide settings kicker on automations

chengyongru828759d1b699
diff --git a/webui/src/components/settings/SettingsView.tsx b/webui/src/components/settings/SettingsView.tsx
index 5fe36e4c9..2442d0dcc 100644
--- a/webui/src/components/settings/SettingsView.tsx
+++ b/webui/src/components/settings/SettingsView.tsx
@@ -1733,7 +1733,7 @@ export function SettingsView({
{t("settings.backToChat")}
</button>
) : null}
- {activeSection !== "automations" ? (
+ {showSidebar ? (
<p className="mb-2 text-[12px] font-normal text-muted-foreground">
{t("settings.sidebar.title")}
</p>
diff --git a/webui/src/tests/app-layout.test.tsx b/webui/src/tests/app-layout.test.tsx
index a0c74a018..75ae92a82 100644
--- a/webui/src/tests/app-layout.test.tsx
+++ b/webui/src/tests/app-layout.test.tsx
@@ -439,7 +439,11 @@ describe("App layout", () => {
fireEvent.click(automationsButton);
- expect(await screen.findByRole("heading", { name: "Automations" })).toBeInTheDocument();
+ const heading = await screen.findByRole("heading", { name: "Automations" });
+ expect(heading).toBeInTheDocument();
+ const automationsMain = heading.closest("main");
+ expect(automationsMain).not.toBeNull();
+ expect(within(automationsMain as HTMLElement).queryByText("Settings")).not.toBeInTheDocument();
expect(screen.getAllByText("Daily repo check").length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText("Check the repo status").length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText("Release prep").length).toBeGreaterThanOrEqual(1);
@@ -586,7 +590,11 @@ describe("App layout", () => {
const sidebar = screen.getByRole("navigation", { name: "侧边栏导航" });
fireEvent.click(within(sidebar).getByRole("button", { name: "自动任务" }));
- expect(await screen.findByRole("heading", { name: "自动任务" })).toBeInTheDocument();
+ const heading = await screen.findByRole("heading", { name: "自动任务" });
+ expect(heading).toBeInTheDocument();
+ const automationsMain = heading.closest("main");
+ expect(automationsMain).not.toBeNull();
+ expect(within(automationsMain as HTMLElement).queryByText("设置")).not.toBeInTheDocument();
expect(screen.getByText("任务队列")).toBeInTheDocument();
expect(screen.getAllByText("每日检查").length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText("检查仓库状态").length).toBeGreaterThanOrEqual(1);
diff --git a/webui/src/tests/settings-view.test.tsx b/webui/src/tests/settings-view.test.tsx
index eac0b9c6b..85a35b957 100644
--- a/webui/src/tests/settings-view.test.tsx
+++ b/webui/src/tests/settings-view.test.tsx
@@ -159,8 +159,9 @@ const installedAnyGen = {
function renderSettingsView(
options: {
- initialSection?: "overview" | "apps" | "advanced" | "models";
+ initialSection?: "overview" | "apps" | "automations" | "advanced" | "models";
initialSettings?: SettingsPayload;
+ showSidebar?: boolean;
onSettingsChange?: (payload: SettingsPayload) => void;
onNativeEngineRestart?: () => Promise<string>;
} = {},
@@ -171,6 +172,7 @@ function renderSettingsView(
theme="light"
initialSection={options.initialSection ?? "apps"}
initialSettings={options.initialSettings}
+ showSidebar={options.showSidebar}
onToggleTheme={() => {}}
onBackToChat={() => {}}
onModelNameChange={() => {}}
@@ -187,6 +189,25 @@ describe("SettingsView Apps catalog", () => {
vi.unstubAllGlobals();
});
+ it("does not show the Settings kicker on the standalone Automations surface", async () => {
+ vi.stubGlobal("fetch", vi.fn(async (input: RequestInfo | URL) => {
+ const url = String(input);
+ if (url === "/api/settings") return jsonResponse(settingsPayload());
+ if (url === "/api/webui/automations") return jsonResponse({ jobs: [] });
+ return jsonResponse({});
+ }));
+
+ renderSettingsView({
+ initialSection: "automations",
+ initialSettings: settingsPayload(),
+ showSidebar: false,
+ });
+
+ expect(screen.getByRole("heading", { name: "Automations" })).toBeInTheDocument();
+ expect(await screen.findByText("No automations yet.")).toBeInTheDocument();
+ expect(screen.queryByText("Settings")).not.toBeInTheDocument();
+ });
+
it("shows a visible uninstall button for installed CLI apps and calls uninstall", async () => {
const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
const url = String(input);