diff --git a/webui/src/components/settings/SettingsView.tsx b/webui/src/components/settings/SettingsView.tsx index 5fe36e4c..2442d0dc 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")} ) : null} - {activeSection !== "automations" ? ( + {showSidebar ? (
{t("settings.sidebar.title")}
diff --git a/webui/src/tests/app-layout.test.tsx b/webui/src/tests/app-layout.test.tsx index a0c74a01..75ae92a8 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 eac0b9c6..85a35b95 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