From 843dc20121ce8abf496874a2e3373c2f266d400d Mon Sep 17 00:00:00 2001 From: chengyongru <61816729+chengyongru@users.noreply.github.com> Date: Sun, 22 Nov 2026 17:32:41 +0800 Subject: [PATCH] fix(webui): underline focused sidebar titles instead of boxing the row (#6750) --- webui/browser/sidebar-rename.spec.ts | 5 ++++- webui/src/components/ChatList.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/webui/browser/sidebar-rename.spec.ts b/webui/browser/sidebar-rename.spec.ts index 3bb7bbaf2..1cb4cbc8c 100644 --- a/webui/browser/sidebar-rename.spec.ts +++ b/webui/browser/sidebar-rename.spec.ts @@ -17,7 +17,10 @@ for (const method of ["Enter", "Save button"] as const) { const renamedTopic = sidebar.getByRole("button", { name: "@jaru Renamed topic", exact: true }); await expect(renamedTopic).toBeFocused(); 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") { await page.keyboard.press("Tab"); await expect(sidebar.getByRole("button", { name: "Topic actions for Renamed topic" })).toBeFocused(); diff --git a/webui/src/components/ChatList.tsx b/webui/src/components/ChatList.tsx index 0ec6a100a..1b8e467a4 100644 --- a/webui/src/components/ChatList.tsx +++ b/webui/src/components/ChatList.tsx @@ -81,7 +81,8 @@ import type { ChatSummary, SidebarDensity, SidebarSortMode } from "@/lib/types"; const INITIAL_VISIBLE_SESSIONS = 160; const VISIBLE_SESSIONS_INCREMENT = 160; 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 DETACH_PANE_DROP_TARGET = "__sidebar-standalone__"; @@ -1019,7 +1020,7 @@ export const ChatList = memo(function ChatList({ ) : null} - + {title} {isPinned ? : null} @@ -1501,7 +1502,7 @@ function ActivePaneRows({ ) : null} - {pane.title} + {pane.title} {isPinned ? : null}