From 092410d3f2bd0a98296d88c621301a04488923c3 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Fri, 11 Sep 2026 22:02:46 +0800 Subject: [PATCH] fix(webui): align automation styling with settings pages Reuse the Channels search styling and segmented filters, and bring the Skills catalog surface, typography, and compact row spacing to Automations so the feature pages share a consistent visual language. Preserve task dialogs, disclosure motion, search and sort behavior, and the deletion focus regression coverage. --- .../settings/system/AutomationsSettings.tsx | 261 +++++++++--------- webui/src/tests/automations-settings.test.tsx | 17 +- webui/src/tests/settings-system.test.tsx | 2 +- 3 files changed, 142 insertions(+), 138 deletions(-) diff --git a/webui/src/components/settings/system/AutomationsSettings.tsx b/webui/src/components/settings/system/AutomationsSettings.tsx index 60d631d81..a9263642b 100644 --- a/webui/src/components/settings/system/AutomationsSettings.tsx +++ b/webui/src/components/settings/system/AutomationsSettings.tsx @@ -158,141 +158,147 @@ export function AutomationsSettings({ return (
-
-

+
+

{tx("settings.nav.automations", "Automations")}

- {jobs.length ? ( -
-
-
- +
+ {jobs.length ? ( +
+
+ onQueryChange(event.target.value)} aria-label={tx("settings.automations.search", "Search task, message, linked chat, or schedule")} placeholder={tx("settings.automations.search", "Search task, message, linked chat, or schedule")} - className={cn("h-9 w-full rounded-full pl-9 text-[13px]", SETTINGS_SEARCH_INPUT_CLASS)} + className={cn("h-12 ps-11 text-[15px]", SETTINGS_SEARCH_INPUT_CLASS)} />
- - - - - - {(Object.keys(sortLabel) as AutomationSort[]).map((value) => ( - onSortChange(value)}> - {sortLabel[value]} - {sort === value ? : null} - - ))} - - -
-
- {summaryOptions.map((option) => ( - - ))} -
-
- ) : null} +
+ ({ + value: option.value, + label: <>{option.label} {option.count}, + }))} + onChange={onFilterChange} + /> +
+ + ) : null} - {error ? : null} - {loading && !payload ? ( -
- - {tx("settings.automations.loading", "Loading automations...")} -
- ) : ( - <> - {personal.length ? ( -
    - {personal.map(renderJob)} -
- ) : !personalJobs.length && !query && filter === "all" ? ( -
-

- {tx("settings.automations.empty", "No automations yet.")} -

-

- {tx("settings.automations.emptyHint", "Tell nanobot in a chat what you'd like it to do on a schedule.")} -

-
- ) : !filtered.length ? ( -
-

{tx("settings.automations.noMatches", "No automations match this view.")}

- + + {jobs.length ? ( +
+
+

+ {tx("settings.automations.yourTasks", "Your automations")} +

+ {personal.length} +
+ + + + + + {(Object.keys(sortLabel) as AutomationSort[]).map((value) => ( + onSortChange(value)}> + {sortLabel[value]} + {sort === value ? : null} + + ))} + +
) : null} - {system.length ? ( -
- - - -
    - {system.map(renderJob)} -
-
-
-
- ) : null} - - )} + + {error ? : null} + {loading && !payload ? ( +
+ + {tx("settings.automations.loading", "Loading automations...")} +
+ ) : ( +
+ {personal.length ? ( +
    + {personal.map(renderJob)} +
+ ) : !personalJobs.length && !query && filter === "all" ? ( +
+

+ {tx("settings.automations.empty", "No automations yet.")} +

+

+ {tx("settings.automations.emptyHint", "Tell nanobot in a chat what you'd like it to do on a schedule.")} +

+
+ ) : !filtered.length ? ( +
+

{tx("settings.automations.noMatches", "No automations match this view.")}

+ +
+ ) : null} + {system.length ? ( +
+ + +
    + {system.map(renderJob)} +
+
+
+ ) : null} +
+ )} +
+
{selectedJob ? ( @@ -356,22 +362,15 @@ function AutomationListItem({ job, locale, disabled, onSelect }: { aria-haspopup="dialog" onClick={(event) => onSelect(event.currentTarget)} className={cn( - "automation-task-row grid w-full grid-cols-1 items-center gap-x-4 gap-y-2 text-left transition-colors", - compact ? "settings-list-row py-3 settings-hover" : "min-h-[92px] rounded-lg py-5 hover:bg-muted/35", + "automation-task-row grid w-full grid-cols-1 items-center gap-x-4 gap-y-2 rounded-control px-2 py-3 text-left transition-colors duration-150 settings-hover", formControlFocusClassName, )} > - {job.name || job.id} - {summary ? {summary} : null} + {job.name || job.id} + {summary ? {summary} : null} - + {running ? : null} {attention && !running ? ( <> diff --git a/webui/src/tests/automations-settings.test.tsx b/webui/src/tests/automations-settings.test.tsx index 9719d36b8..511bfac70 100644 --- a/webui/src/tests/automations-settings.test.tsx +++ b/webui/src/tests/automations-settings.test.tsx @@ -222,20 +222,25 @@ describe("Automation task list and detail sheet", () => { expect(dialog).not.toHaveAttribute("aria-describedby"); }); - it("reuses compact settings rows for system tasks without changing personal rows", async () => { + it("uses channel search controls and the skills catalog surface for both task groups", async () => { const user = userEvent.setup(); render(); + expect(screen.getByRole("heading", { name: "Automations" })).toHaveClass("font-normal", "text-[24px]"); const personalRow = screen.getByRole("button", { name: /PR watch/ }); - expect(personalRow).toHaveClass("min-h-[92px]"); - expect(personalRow).not.toHaveClass("settings-list-row"); + expect(personalRow).toHaveClass("rounded-control", "px-2", "py-3", "settings-hover"); const list = screen.getByRole("list", { name: "System tasks" }); - expect(list.parentElement).toHaveClass("rounded-panel", "bg-settings-surface"); + const surface = personalRow.closest(".bg-settings-surface"); + expect(surface).toHaveClass("rounded-panel"); + expect(list.closest(".bg-settings-surface")).toBe(surface); + const search = screen.getByRole("textbox"); + expect(search.closest(".rounded-panel")).toBeNull(); + expect(search).toHaveClass("h-12", "bg-settings-surface", "focus-visible:bg-background"); + expect(screen.getByRole("button", { name: "All 1" }).parentElement).toHaveClass("segmented-control", "flex-wrap"); const heartbeat = within(list).getByRole("button", { name: /heartbeat/ }); - expect(heartbeat).toHaveClass("settings-list-row", "settings-hover"); - expect(heartbeat).not.toHaveClass("min-h-[92px]"); + expect(heartbeat.className).toBe(personalRow.className); expect(within(list).queryByText("System-managed automation")).not.toBeInTheDocument(); expect(within(list).getByText("Memory update failed")).toBeVisible(); expect(within(list).getByText("Needs attention")).toBeVisible(); diff --git a/webui/src/tests/settings-system.test.tsx b/webui/src/tests/settings-system.test.tsx index 0241600a8..c4a7654c3 100644 --- a/webui/src/tests/settings-system.test.tsx +++ b/webui/src/tests/settings-system.test.tsx @@ -241,7 +241,7 @@ describe("Settings system domains", () => { renderSettingsView({ initialSection: "automations", initialSettings: settingsPayload(), showSidebar: false }); const filters = await screen.findByRole("group", { name: "Automations" }); - expect(filters).toHaveClass("flex-wrap"); + expect(within(filters).getByRole("button", { name: "All 1" }).parentElement).toHaveClass("segmented-control", "flex-wrap"); expect(within(filters).getAllByRole("button")).toHaveLength(4); expect(within(filters).getByRole("button", { name: "All 1" })).toHaveAttribute("aria-pressed", "true"); expect(within(filters).queryByRole("button", { name: /System/ })).not.toBeInTheDocument();