fix(webui): underline focused sidebar titles instead of boxing the row (#6750)

This commit is contained in:
chengyongru authored and GitHub committed 2026-11-22 17:32:41 +08:00
1 parent b65c3ac7fa
commit 843dc20121
2 files changed
+8 -4

No files matched your search

+4 -1
View File
@@ -17,7 +17,10 @@ for (const method of ["Enter", "Save button"] as const) {
const renamedTopic = sidebar.getByRole("button", { name: "@jaru Renamed topic", exact: true }); const renamedTopic = sidebar.getByRole("button", { name: "@jaru Renamed topic", exact: true });
await expect(renamedTopic).toBeFocused(); await expect(renamedTopic).toBeFocused();
await expect(activeTopic).toHaveAttribute("aria-current", "page"); await expect(activeTopic).toHaveAttribute("aria-current", "page");
await expect(renamedTopic).toHaveCSS("outline-style", method === "Enter" ? "solid" : "none"); await expect(renamedTopic).toHaveCSS("outline-style", "none");
await expect(renamedTopic.getByText("Renamed topic", { exact: true })).toHaveCSS(
"text-decoration-line", method === "Enter" ? "underline" : "none",
);
if (method === "Enter") { if (method === "Enter") {
await page.keyboard.press("Tab"); await page.keyboard.press("Tab");
await expect(sidebar.getByRole("button", { name: "Topic actions for Renamed topic" })).toBeFocused(); await expect(sidebar.getByRole("button", { name: "Topic actions for Renamed topic" })).toBeFocused();
+4 -3
View File
@@ -81,7 +81,8 @@ import type { ChatSummary, SidebarDensity, SidebarSortMode } from "@/lib/types";
const INITIAL_VISIBLE_SESSIONS = 160; const INITIAL_VISIBLE_SESSIONS = 160;
const VISIBLE_SESSIONS_INCREMENT = 160; const VISIBLE_SESSIONS_INCREMENT = 160;
const ACTION_MENU_CONTENT_CLASS = "w-[11rem] min-w-[11rem] whitespace-nowrap"; const ACTION_MENU_CONTENT_CLASS = "w-[11rem] min-w-[11rem] whitespace-nowrap";
const TOPIC_BUTTON_FOCUS_CLASS = "rounded-md focus-visible:outline focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-sidebar-muted-foreground"; const TOPIC_BUTTON_FOCUS_CLASS = "group/topic focus-visible:[outline:none]";
const TOPIC_TITLE_CLASS = "min-w-0 flex-1 truncate underline-offset-2 group-focus-visible/topic:underline";
const COLLAPSED_PANE_GROUPS_STORAGE_KEY = "nanobot-webui.collapsed-pane-groups.v1"; const COLLAPSED_PANE_GROUPS_STORAGE_KEY = "nanobot-webui.collapsed-pane-groups.v1";
const DETACH_PANE_DROP_TARGET = "__sidebar-standalone__"; const DETACH_PANE_DROP_TARGET = "__sidebar-standalone__";
@@ -1019,7 +1020,7 @@ export const ChatList = memo(function ChatList({
) : null} ) : null}
<span className="relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden"> <span className="relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
<SidebarSessionHandle handle={s.handle} /> <SidebarSessionHandle handle={s.handle} />
<span className="min-w-0 flex-1 truncate font-normal leading-5"> <span className={cn(TOPIC_TITLE_CLASS, "font-normal leading-5")}>
{title} {title}
</span> </span>
{isPinned ? <PinnedChatIndicator /> : null} {isPinned ? <PinnedChatIndicator /> : null}
@@ -1501,7 +1502,7 @@ function ActivePaneRows({
) : null} ) : null}
<span className="relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden"> <span className="relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
<SidebarSessionHandle handle={pane.handle} /> <SidebarSessionHandle handle={pane.handle} />
<span className="min-w-0 flex-1 truncate">{pane.title}</span> <span className={TOPIC_TITLE_CLASS}>{pane.title}</span>
{isPinned ? <PinnedChatIndicator /> : null} {isPinned ? <PinnedChatIndicator /> : null}
</span> </span>