Merge teacher composer and compact prompt UI into main
This commit is contained in:
commit
2b2d39449c
62 files changed
+2327
-158
No files matched your search
@@ -47,6 +47,9 @@ import { CodingConversationHeader } from './CodingConversationHeader';
|
||||
import { CodingConversationTimeline } from './CodingConversationTimeline';
|
||||
import { CodingInteractionPanel } from './CodingInteractionPanel';
|
||||
import { CodingWelcomeHero } from './CodingWelcomeHero';
|
||||
import { CodingStartHeading } from './CodingStartHeading';
|
||||
import { CodingChatBody } from './CodingChatBody';
|
||||
import { CommunityInvitation } from '@/components/community/CommunityInvitation';
|
||||
import { createLocalConversationSnapshot } from './coding-chat-snapshot';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { TeacherChatPanel } from './TeacherChatPanel';
|
||||
@@ -676,6 +679,8 @@ export function CodingChatPanel({
|
||||
});
|
||||
}, [loginRecovery, activeProject, targetConversationId, entryLoadState, workspaceLoadState, handleRecovery, draftKey, onLoginRecoveryConsumed]);
|
||||
const autoCreating = Boolean(selectedAgent && creatingAgentIds[selectedAgent.id]);
|
||||
const showWelcome = editable && !selectedConversation?.archivedAt && !running && runStatus === 'idle'
|
||||
&& (!targetConversationId || (entryLoadState === 'live' && snapshot?.nodes.length === 0));
|
||||
|
||||
if (!activeProject && workspaceLoadState !== 'loading') {
|
||||
return (
|
||||
@@ -770,9 +775,8 @@ export function CodingChatPanel({
|
||||
onRecover={async () => {
|
||||
if (targetConversationId) await handleRecovery(codingRecovery(runtimeError?.code).action, false);
|
||||
}}
|
||||
browserOpen={agentBrowserOpen}
|
||||
browserAvailable={Boolean(activeProject)}
|
||||
onToggleBrowser={() => setAgentBrowserOpen((current) => !current)}
|
||||
consultationAvailable={Boolean(activeProject)}
|
||||
onToggleConsultation={() => setConsultationOpen((current) => !current)}
|
||||
projectName={activeProject?.name}
|
||||
consultationOpen={consultationOpen}
|
||||
teacherEntry={activeProject ? <TeacherCompanion companion={teacherCompanion} open={consultationOpen} onOpen={openTeacher} onToggle={toggleTeacher} bubbleRef={setTeacherBubble} introductionRef={setTeacherIntroduction} /> : undefined}
|
||||
@@ -807,6 +811,7 @@ export function CodingChatPanel({
|
||||
}
|
||||
}} />
|
||||
</div>
|
||||
<CodingChatBody welcome={showWelcome} hidden={agentBrowserOpen} bubble={teacherBubble}>
|
||||
<div id="classroom-chat-view" role="tabpanel" aria-labelledby="classroom-chat-tab" hidden={agentBrowserOpen} className="classroom-chat-view min-h-0 flex-1 flex-col">
|
||||
|
||||
{(workspaceError || conversationMetadataError || connectionError) && (
|
||||
@@ -829,7 +834,7 @@ export function CodingChatPanel({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{targetConversationId
|
||||
{showWelcome ? <CodingStartHeading /> : targetConversationId
|
||||
? (
|
||||
<CodingConversationTimeline
|
||||
key={targetConversationId}
|
||||
@@ -892,6 +897,7 @@ export function CodingChatPanel({
|
||||
|
||||
</div>
|
||||
<div hidden={agentBrowserOpen} className="classroom-composer-view shrink-0">
|
||||
{showWelcome && <CommunityInvitation />}
|
||||
{selectedConversation?.archivedAt ? (
|
||||
<div className="m-4 flex items-center justify-between gap-3 rounded-xl border bg-surface-subtle px-4 py-3 text-sm">
|
||||
<span>{running ? '此对话已归档,任务仍在运行。' : '此对话已归档,恢复后可继续聊天。'}</span>
|
||||
@@ -959,6 +965,7 @@ export function CodingChatPanel({
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
</CodingChatBody>
|
||||
</div>
|
||||
|
||||
{consultationOpen && activeProject && (
|
||||
|
||||
Reference in new issue
Block a user