Align Code navigation and branding with workspace header rows

This commit is contained in:
鲨鱼辣椒 committed 2026-09-30 00:39:24 +08:00
1 parent 9d47cd2146
commit 883ae1d788
10 files changed
+169 -50

No files matched your search

+1 -12
View File
@@ -11,7 +11,6 @@ import {
FolderKanban,
Gamepad2,
LogOut,
PanelLeftClose,
Plus,
RadioTower,
Settings as SettingsIcon,
@@ -91,7 +90,6 @@ export function Sidebar({
}: SidebarProps = {}) {
const { t } = useTranslation('common');
const storedSidebarCollapsed = useSettingsStore((state) => state.sidebarCollapsed);
const setSidebarCollapsed = useSettingsStore((state) => state.setSidebarCollapsed);
const sidebarWidth = useSettingsStore((state) => normalizeClassroomSidebarWidth(state.classroomSidebarWidth));
const sidebarPinnedCollapsed = !forceExpanded && storedSidebarCollapsed;
const sidebarCollapsed = sidebarPinnedCollapsed && !sidebarPeekOpen;
@@ -415,17 +413,8 @@ export function Sidebar({
)}
>
<div className="min-w-0 w-full">
{workspaceLayout && <div className="no-drag flex h-10 min-w-0 items-center gap-1" data-testid="classroom-sidebar-navigation">
{workspaceLayout && !['darwin', 'win32'].includes(window.electron?.platform ?? '') && <div className="no-drag flex h-10 min-w-0 items-center gap-1" data-testid="classroom-sidebar-navigation">
<ModuleSwitcher sidebarCollapsed={sidebarCollapsed} toolbar iconOnly />
{!sidebarPinnedCollapsed && ['darwin', 'win32'].includes(window.electron?.platform ?? '') && <button
type="button"
data-testid="titlebar-sidebar-toggle"
aria-label="折叠侧栏"
title="折叠侧栏"
aria-expanded="true"
onClick={() => setSidebarCollapsed(true)}
className="no-drag motion-press flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-subtle hover:text-foreground"
><PanelLeftClose className="h-4 w-4" /></button>}
</div>}
{workspaceLayout && <button type="button" aria-label="返回首页" title="返回首页" onClick={() => navigate('/module-select')} className="classroom-brand flex w-full items-center gap-2 rounded-lg text-left">
<span className="classroom-brand-mark"><img src={classroomMark} alt="" className="h-7 w-7" /></span>