Integrate project classroom with teacher and friend consultations
This commit is contained in:
1 parent
e5d271bc45
commit
68e676cb62
28 files changed
+957
-314
No files matched your search
@@ -99,7 +99,7 @@ export function MainLayout() {
|
||||
data-testid="main-content"
|
||||
className={cn(
|
||||
'relative min-h-0 min-w-0 flex-1 overflow-auto bg-background',
|
||||
(isPaintingModule || isCloudAgents) ? 'basis-0 h-full overflow-hidden p-0' : 'p-5 sm:p-6',
|
||||
(isPaintingModule || isCloudAgents || isChatWorkspace) ? 'basis-0 h-full overflow-hidden p-0' : 'p-5 sm:p-6',
|
||||
(isChatWorkspace || isCloudAgents) && !isPaintingModule && 'basis-0 overflow-hidden p-0',
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -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} />}
|
||||
|
||||
@@ -79,12 +79,9 @@ function ProductTitleBar({
|
||||
};
|
||||
// The project sidebar preview is rendered below the title bar, so mirror
|
||||
// its full width in the title bar for ordinary pages. The chat workspace
|
||||
// has an independent conversation rail and must keep its pinned columns.
|
||||
// keeps project conversations in the sidebar and must preserve its title rail.
|
||||
const sidebarPreviewTitlebarVisible = sidebarCollapsed && sidebarPeekOpen && !workspaceLayout && !overlay;
|
||||
const sidebarTitlebarHidden = sidebarCollapsed && !sidebarPreviewTitlebarVisible;
|
||||
const conversationSurfaceOffset = sidebarTitlebarHidden
|
||||
? (nativeTrafficLights ? '-132px' : '-52px')
|
||||
: '0px';
|
||||
const sidebarToggle = (
|
||||
<button
|
||||
type="button"
|
||||
@@ -194,13 +191,6 @@ function ProductTitleBar({
|
||||
marginRight: 'var(--agent-browser-panel-width, 0px)',
|
||||
}}
|
||||
>
|
||||
{workspaceLayout ? (
|
||||
<div
|
||||
data-testid="titlebar-conversation-surface"
|
||||
className="pointer-events-none absolute inset-y-0 z-0 w-[256px] border-r border-border/80 bg-surface-tertiary"
|
||||
style={{ left: conversationSurfaceOffset }}
|
||||
/>
|
||||
) : null}
|
||||
{pageTitle ? (
|
||||
<h1
|
||||
data-testid="titlebar-page-title"
|
||||
@@ -219,7 +209,7 @@ function ProductTitleBar({
|
||||
<span className="truncate text-sm font-semibold">{activeProject?.name ?? 'Makelore 工作台'}</span>
|
||||
</div>
|
||||
) : null}
|
||||
{!overlay ? titlebarLogo : null}
|
||||
{!overlay && !workspaceLayout ? titlebarLogo : null}
|
||||
<div
|
||||
className={cn(
|
||||
'no-drag absolute inset-y-0 right-0 z-10 flex items-center justify-end gap-1 px-2',
|
||||
|
||||
Reference in new issue
Block a user