mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-06 17:38:35 +00:00
fix(webui): move automations after skills
This commit is contained in:
parent
848378d0db
commit
153f2d9529
@ -161,13 +161,6 @@ export function Sidebar(props: SidebarProps) {
|
|||||||
active={props.activeUtility === "apps"}
|
active={props.activeUtility === "apps"}
|
||||||
icon={<Blocks className="h-4 w-4" />}
|
icon={<Blocks className="h-4 w-4" />}
|
||||||
/>
|
/>
|
||||||
<SidebarActionButton
|
|
||||||
collapsed={collapsed}
|
|
||||||
label={t("sidebar.automations", { defaultValue: "Automations" })}
|
|
||||||
onClick={props.onOpenAutomations}
|
|
||||||
active={props.activeUtility === "automations"}
|
|
||||||
icon={<CalendarClock className="h-4 w-4" />}
|
|
||||||
/>
|
|
||||||
<SidebarActionButton
|
<SidebarActionButton
|
||||||
collapsed={collapsed}
|
collapsed={collapsed}
|
||||||
label={t("sidebar.skills.title")}
|
label={t("sidebar.skills.title")}
|
||||||
@ -175,6 +168,13 @@ export function Sidebar(props: SidebarProps) {
|
|||||||
active={props.activeUtility === "skills"}
|
active={props.activeUtility === "skills"}
|
||||||
icon={<Brain className="h-4 w-4" />}
|
icon={<Brain className="h-4 w-4" />}
|
||||||
/>
|
/>
|
||||||
|
<SidebarActionButton
|
||||||
|
collapsed={collapsed}
|
||||||
|
label={t("sidebar.automations", { defaultValue: "Automations" })}
|
||||||
|
onClick={props.onOpenAutomations}
|
||||||
|
active={props.activeUtility === "automations"}
|
||||||
|
icon={<CalendarClock className="h-4 w-4" />}
|
||||||
|
/>
|
||||||
{props.archivedCount ? (
|
{props.archivedCount ? (
|
||||||
<SidebarActionButton
|
<SidebarActionButton
|
||||||
collapsed={collapsed}
|
collapsed={collapsed}
|
||||||
|
|||||||
@ -271,6 +271,23 @@ describe("App layout", () => {
|
|||||||
expect(asideClassNames.some((cls) => cls.includes("lg:block"))).toBe(true);
|
expect(asideClassNames.some((cls) => cls.includes("lg:block"))).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("places Automations after Skills in the main sidebar", async () => {
|
||||||
|
render(<App />);
|
||||||
|
|
||||||
|
await waitFor(() => expect(connectSpy).toHaveBeenCalled());
|
||||||
|
const sidebar = screen.getByRole("navigation", { name: "Sidebar navigation" });
|
||||||
|
const appsButton = within(sidebar).getByRole("button", { name: "Apps" });
|
||||||
|
const skillsButton = within(sidebar).getByRole("button", { name: "Skills" });
|
||||||
|
const automationsButton = within(sidebar).getByRole("button", { name: "Automations" });
|
||||||
|
|
||||||
|
expect(appsButton.compareDocumentPosition(skillsButton) & Node.DOCUMENT_POSITION_FOLLOWING)
|
||||||
|
.toBeTruthy();
|
||||||
|
expect(
|
||||||
|
skillsButton.compareDocumentPosition(automationsButton) &
|
||||||
|
Node.DOCUMENT_POSITION_FOLLOWING,
|
||||||
|
).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
it("opens Skills from the main sidebar", async () => {
|
it("opens Skills from the main sidebar", async () => {
|
||||||
mockFetchRoutes({
|
mockFetchRoutes({
|
||||||
"/api/settings": baseSettingsPayload(),
|
"/api/settings": baseSettingsPayload(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user