fix: move Code return navigation into the chat sidebar

This commit is contained in:
鲨鱼辣椒
2026-09-29 22:55:07 +08:00
parent a77ddbd681
commit 10b179fb71
4 changed files with 104 additions and 6 deletions

View File

@@ -133,6 +133,7 @@ export function Sidebar({
const isProgrammingModule = activeModule === 'programming';
const isPaintingModule = activeModule === 'painting';
const isRobotModule = activeModule === 'robot';
const isProjectConfigPage = location.pathname === '/project-config' || location.pathname.startsWith('/project-config/');
const visibleProjects = projects;
const selectedProjectFolderName = getFolderName(newProjectSelectedPath);
const accountName = userProfile?.displayName?.trim() || getAuthUserDisplayName(authUser) || '未登录用户';
@@ -403,7 +404,7 @@ export function Sidebar({
)}
>
{workspaceLayout && !sidebarPinnedCollapsed && <ClassroomSidebarResizer />}
<div
{!isProjectConfigPage && <div
className={cn(
'bg-transparent px-3 text-foreground',
isPaintingModule && !sidebarCollapsed ? 'pb-2 pt-10' : 'py-2',
@@ -411,12 +412,13 @@ export function Sidebar({
)}
>
<div className="min-w-0 w-full">
{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">
{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>
<span className="min-w-0"><span className="block text-base font-semibold tracking-tight">麦洛</span><span className="classroom-brand-caption">把脑洞变成作品</span></span>
</button> : <ModuleSwitcher sidebarCollapsed={sidebarCollapsed} compact={!sidebarCollapsed} />}
</button>}
<ModuleSwitcher sidebarCollapsed={sidebarCollapsed} compact={!sidebarCollapsed} />
</div>
</div>
</div>}
<div className="classroom-sidebar-content min-h-0 flex-1 overflow-auto px-2 py-2">
{isPaintingModule ? (