Integrate project classroom with teacher and friend consultations

This commit is contained in:
鲨鱼辣椒 committed 2026-09-22 15:50:18 +08:00
1 parent e5d271bc45
commit 68e676cb62
28 files changed
+957 -314

No files matched your search

+8 -4
View File
@@ -1,3 +1,4 @@
import classroomMark from '@/assets/consultations/mark.svg';
import { CodingProjectConversations } from '@/pages/Chat/CodingProjectConversations';
import { useCallback, useEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
@@ -374,6 +375,7 @@ export function Sidebar({
return (
<aside
data-testid="sidebar"
data-classroom={workspaceLayout}
aria-hidden={sidebarCollapsed}
onPointerEnter={() => onSidebarPeekChange?.(true, 'sidebar')}
onPointerLeave={() => onSidebarPeekChange?.(false, 'sidebar')}
@@ -400,7 +402,9 @@ export function Sidebar({
)}
>
<div className="min-w-0 w-full">
<ModuleSwitcher sidebarCollapsed={sidebarCollapsed} compact={!sidebarCollapsed} />
{workspaceLayout ? <button type="button" aria-label="返回首页" title="返回首页" onClick={() => navigate('/module-select')} className="flex w-full items-center gap-2.5 rounded-lg px-3 pb-4 pt-3 text-left hover:bg-black/[0.025]">
<img src={classroomMark} alt="" className="h-7 w-7" /><span className="text-lg font-semibold tracking-tight">麦洛<span className="ml-2 text-xs font-normal text-muted-foreground">Makelore</span></span>
</button> : <ModuleSwitcher sidebarCollapsed={sidebarCollapsed} compact={!sidebarCollapsed} />}
</div>
</div>
@@ -434,7 +438,7 @@ export function Sidebar({
<FolderKanban className="h-4 w-4 shrink-0" />
{!sidebarCollapsed && (
<>
<span className="min-w-0 flex-1 truncate">项目列表</span>
<span className="min-w-0 flex-1 truncate">项目</span>
<span className="text-xs">{projectsOpen ? '收起' : '展开'}</span>
</>
)}
@@ -460,11 +464,11 @@ export function Sidebar({
className={cn(
'motion-press group/project flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left transition-colors duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/35 focus-visible:ring-offset-1',
active
? 'bg-brand-selected text-foreground shadow-soft ring-1 ring-brand/25'
? 'bg-transparent text-foreground'
: 'bg-transparent text-foreground hover:bg-surface-tertiary',
)}
>
<span className="min-w-0 flex-1 truncate text-sm font-semibold">{project.name}</span>
<FolderKanban className="h-3.5 w-3.5 shrink-0 text-muted-foreground" /><span className="min-w-0 flex-1 truncate text-[13px] font-medium">{project.name}</span>
<ChevronRight aria-hidden="true" className="h-3.5 w-3.5 shrink-0 -translate-x-0.5 text-muted-foreground opacity-50 transition-[opacity,transform,color] duration-200 ease-out group-hover/project:translate-x-0 group-hover/project:text-foreground group-hover/project:opacity-100 group-focus-visible/project:translate-x-0 group-focus-visible/project:text-foreground group-focus-visible/project:opacity-100" />
</button>
{active && <CodingProjectConversations key={project.id} projectId={project.id} />}