mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 02:01:48 +03:00
fix(webui): center project session labels
This commit is contained in:
@@ -993,7 +993,7 @@ export const ChatList = memo(function ChatList({
|
|||||||
) : null}
|
) : null}
|
||||||
<span className="min-w-0 flex-1 overflow-hidden">
|
<span className="min-w-0 flex-1 overflow-hidden">
|
||||||
{projectMode ? (
|
{projectMode ? (
|
||||||
<span className="relative flex w-full min-w-0 items-baseline gap-2">
|
<span className="relative flex w-full min-w-0 items-center gap-2">
|
||||||
<SidebarSessionHandle handle={s.handle} />
|
<SidebarSessionHandle handle={s.handle} />
|
||||||
<span className="min-w-0 flex-1 truncate font-medium leading-5">
|
<span className="min-w-0 flex-1 truncate font-medium leading-5">
|
||||||
{title}
|
{title}
|
||||||
|
|||||||
@@ -983,6 +983,7 @@ describe("ChatList", () => {
|
|||||||
session({
|
session({
|
||||||
chatId: "alpha",
|
chatId: "alpha",
|
||||||
title: "Alpha task",
|
title: "Alpha task",
|
||||||
|
handle: { id: "handle_alpha", name: "mira" },
|
||||||
updatedAt: "2026-05-20T11:00:00Z",
|
updatedAt: "2026-05-20T11:00:00Z",
|
||||||
workspaceScope: {
|
workspaceScope: {
|
||||||
project_path: "/Users/me/nanobot",
|
project_path: "/Users/me/nanobot",
|
||||||
@@ -1030,6 +1031,12 @@ describe("ChatList", () => {
|
|||||||
"border-sidebar-foreground/10",
|
"border-sidebar-foreground/10",
|
||||||
);
|
);
|
||||||
expect(within(nanobotSection).getByText("Alpha task")).toBeInTheDocument();
|
expect(within(nanobotSection).getByText("Alpha task")).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
within(nanobotSection)
|
||||||
|
.getByText("@mira")
|
||||||
|
.closest("[data-sidebar-session-handle]")
|
||||||
|
?.parentElement,
|
||||||
|
).toHaveClass("items-center");
|
||||||
expect(within(nanobotSection).getByText("Zeta task")).toBeInTheDocument();
|
expect(within(nanobotSection).getByText("Zeta task")).toBeInTheDocument();
|
||||||
expect(nanobotText.indexOf("Alpha task")).toBeLessThan(nanobotText.indexOf("Zeta task"));
|
expect(nanobotText.indexOf("Alpha task")).toBeLessThan(nanobotText.indexOf("Zeta task"));
|
||||||
expect(within(nanobotSection).getByLabelText("Agent running")).toBeInTheDocument();
|
expect(within(nanobotSection).getByLabelText("Agent running")).toBeInTheDocument();
|
||||||
|
|||||||
Reference in New Issue
Block a user