feat: consolidate plugin navigation

This commit is contained in:
inman
2026-08-31 16:30:17 +08:00
parent 38f85f6b5e
commit b3f4166f21
12 changed files with 227 additions and 69 deletions

View File

@@ -12,8 +12,6 @@ import {
FolderKanban,
LogOut,
Plus,
Puzzle,
Library,
Store,
Settings as SettingsIcon,
UserCircle2,
@@ -604,21 +602,6 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
<Store className="h-4 w-4 shrink-0 text-brand" />
{!sidebarCollapsed ? <span>插件中心</span> : null}
</button>
<button
type="button"
data-testid="sidebar-nav-my-plugins"
aria-current={location.pathname === '/my-plugins' ? 'page' : undefined}
aria-label="我的插件"
onClick={() => navigate('/my-plugins')}
className={cn(
'motion-press flex min-h-10 w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm font-medium transition-colors duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/35',
location.pathname === '/my-plugins' ? 'bg-brand-selected text-foreground' : 'text-foreground hover:bg-surface-subtle',
sidebarCollapsed && 'justify-center px-0',
)}
>
<Library className="h-4 w-4 shrink-0 text-brand" />
{!sidebarCollapsed ? <span>我的插件</span> : null}
</button>
</div>
<div className="mt-3">
<button
@@ -688,23 +671,6 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
</DisclosureContent>
) : null}
</div>
{activeProject ? (
<button
type="button"
data-testid="sidebar-nav-project-plugins"
aria-current={location.pathname === '/project-plugins' ? 'page' : undefined}
aria-label="项目插件"
onClick={() => navigate('/project-plugins')}
className={cn(
'motion-press mt-3 flex min-h-10 w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm font-medium transition-colors duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/35',
location.pathname === '/project-plugins' ? 'bg-brand-selected text-foreground' : 'text-foreground hover:bg-surface-subtle',
sidebarCollapsed && 'justify-center px-0',
)}
>
<Puzzle className="h-4 w-4 shrink-0 text-brand" />
{!sidebarCollapsed ? <span>项目插件</span> : null}
</button>
) : null}
</>
) : isLearningModule ? (
<LearningSidebar sidebarCollapsed={sidebarCollapsed} />