From 2bc0018a015925dc7acdfd1e936bf1cfb8f339ed Mon Sep 17 00:00:00 2001 From: tianma-if Date: Thu, 8 Oct 2026 01:06:30 +0800 Subject: [PATCH] fix(web): clarify selected notebook styling --- apps/web/src/components/NotebookTreeItem.tsx | 12 ++++-------- apps/web/src/components/WorkspaceMobileChrome.tsx | 8 ++------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/apps/web/src/components/NotebookTreeItem.tsx b/apps/web/src/components/NotebookTreeItem.tsx index a39fc5a0..3ab0106f 100644 --- a/apps/web/src/components/NotebookTreeItem.tsx +++ b/apps/web/src/components/NotebookTreeItem.tsx @@ -8,7 +8,6 @@ import { hasNotebookDragData, getMemoDragIds, getNotebookDropPosition, - notebookTreeContainsId, focusNotebookTreeButton, NOTEBOOK_DRAG_MIME, setMemoDragPreview, @@ -65,7 +64,6 @@ export const NotebookTreeItem = ({ const showsSplitCount = !showDescendantNotes && hasChildren; const selected = node.id === selectedNotebookId; const isInbox = node.slug === "inbox"; - const hasSelectedDescendant = selectedNotebookId ? notebookTreeContainsId(node.children, selectedNotebookId) : false; const [dropPosition, setDropPosition] = useState(null); const [actionsOpen, setActionsOpen] = useState(false); const actionsRef = useRef(null); @@ -178,9 +176,7 @@ export const NotebookTreeItem = ({ "group relative flex h-9 cursor-pointer items-center gap-1 rounded-md px-2 text-xs transition-all duration-200 select-none", selected ? "edgeever-workspace-selection font-medium text-slate-950" - : hasSelectedDescendant - ? "bg-slate-50 text-slate-900 hover:bg-slate-100" - : "text-slate-700 hover:bg-slate-50", + : "text-slate-700 hover:bg-slate-50", dropPosition === "inside" && "ring-2 ring-slate-300", dropPosition === "inside" && hasChildren && !open && "bg-slate-100" )} @@ -270,11 +266,11 @@ export const NotebookTreeItem = ({ } }} > - + {node.name} diff --git a/apps/web/src/components/WorkspaceMobileChrome.tsx b/apps/web/src/components/WorkspaceMobileChrome.tsx index 50e6096d..a617f4ed 100644 --- a/apps/web/src/components/WorkspaceMobileChrome.tsx +++ b/apps/web/src/components/WorkspaceMobileChrome.tsx @@ -20,7 +20,6 @@ import { filterNotebookTree, getExpandableNotebookIds, getNotebookAncestorIds, - notebookTreeContainsId, } from "@/lib/app-helpers"; const MobileBottomNavButton = ({ @@ -332,7 +331,6 @@ const MobileNotebookPickerItem = ({ const { t } = useTranslation(); const selected = node.id === selectedNotebookId; const hasChildren = node.children.length > 0; - const hasSelectedDescendant = selectedNotebookId ? notebookTreeContainsId(node.children, selectedNotebookId) : false; const expanded = searchActive || expandedNotebookIds.has(node.id); return ( @@ -342,10 +340,8 @@ const MobileNotebookPickerItem = ({ className={cn( "flex h-12 w-full items-center gap-3 rounded-md px-3 text-left text-sm transition", selected - ? "bg-slate-100 font-semibold text-slate-950" - : hasSelectedDescendant - ? "bg-slate-50 text-slate-900 hover:bg-slate-100" - : "text-slate-800 hover:bg-slate-50" + ? "bg-slate-100 font-semibold text-black dark:text-slate-950" + : "text-slate-800 hover:bg-slate-50" )} style={{ paddingLeft: `${12 + depth * 18}px` }} >