fix(nav): 修复问答梳理等带子路径页面的导航高亮丢失问题
KnowledgeBasePage 加载后自动跳转至 /knowledge/:noteId,原精确路径匹配 导致顶栏和侧边栏选中态丢失。将 hasActiveChild / isItemActive / menuItemContainsPath 等 8 处判断统一改为前缀匹配 (pathname === path || pathname.startsWith(path + "/")), 覆盖浅色侧边栏、深色侧边栏、顶部导航栏三套组件。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
88b1a330a6
commit
69c8c14c91
10 files changed
+161
-101
No files matched your search
@@ -44,7 +44,7 @@ export function WorkspaceSidebar({
|
||||
variant="sidebar"
|
||||
collapsible="none"
|
||||
className={cn(
|
||||
"h-full w-(--sidebar-width)",
|
||||
"h-full w-(--sidebar-width) border-r border-border",
|
||||
useWhiteSidebar &&
|
||||
"[&_[data-slot=sidebar-inner]]:bg-white [&_[data-slot=sidebar-container]]:bg-white",
|
||||
className,
|
||||
|
||||
Reference in new issue
Block a user