Skip to content

Commit 32edc5f

Browse files
authored
feat(docflow): replace ChatPanel with AgentEditPanel and agent suggestion flow (#327)
* feat(docflow): replace ChatPanel with AgentEditPanel and agent suggestion flow remove legacy ChatPanel components and wire AgentEditPanel into docs page add agent suggestion extension/collaboration modules and update chat store/request client/style entry * refactor(docflow): clean up code formatting and improve readability in various components
1 parent 91d9d84 commit 32edc5f

File tree

19 files changed

+2067
-1725
lines changed

19 files changed

+2067
-1725
lines changed

apps/DocFlow/src/app/docs/[room]/page.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ import { useDocumentPermission } from '@/hooks/useDocumentPermission';
3333
import { useCollaboration } from '@/hooks/useCollaboration';
3434
import { useTemplateInsertion } from '@/hooks/useTemplateInsertion';
3535

36-
const ChatPanel = dynamic(
37-
() => import('@/app/docs/_components/ChatPanel').then((mod) => ({ default: mod.ChatPanel })),
36+
const AgentEditPanel = dynamic(
37+
() =>
38+
import('@/app/docs/_components/AgentEditPanel').then((mod) => ({
39+
default: mod.AgentEditPanel,
40+
})),
3841
{
3942
ssr: false,
4043
loading: () => (
41-
<div className="flex flex-col h-full bg-gradient-to-br from-gray-50 to-blue-50/30 items-center justify-center gap-2">
42-
<div className="h-5 w-5 animate-spin rounded-full border-2 border-blue-500 border-t-transparent" />
44+
<div className="flex flex-col h-full bg-white items-center justify-center gap-2">
45+
<div className="h-5 w-5 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent" />
4346
<span className="text-xs text-gray-400">加载中...</span>
4447
</div>
4548
),
@@ -52,7 +55,7 @@ export default function DocumentPage() {
5255
const documentId = params?.room as string;
5356
const forceReadOnly = searchParams?.get('readonly') === 'true';
5457

55-
const { isOpen: isChatOpen } = useChatStore();
58+
const { isOpen: isChatOpen, setIsOpen } = useChatStore();
5659
const { setEditor, clearEditor } = useEditorStore();
5760

5861
const menuContainerRef = useRef<HTMLDivElement>(null);
@@ -290,7 +293,7 @@ export default function DocumentPage() {
290293

291294
<div className="flex flex-1 overflow-hidden">
292295
<Group orientation="horizontal" className="flex-1" groupRef={groupRef}>
293-
<Panel id="editor" defaultSize={65} minSize={30}>
296+
<Panel id="editor" defaultSize={25} minSize={20}>
294297
<div className="h-full relative overflow-hidden">
295298
<div className="h-full overflow-y-auto overflow-x-hidden relative w-full">
296299
<EditorContent editor={editor} className="prose-container h-full pl-14" />
@@ -313,12 +316,16 @@ export default function DocumentPage() {
313316
panelRef={chatPanelRef}
314317
defaultSize="35"
315318
minSize="20"
316-
maxSize="60"
319+
maxSize="30"
317320
collapsible
318321
collapsedSize="0"
319322
>
320323
<Activity mode={isChatOpen ? 'visible' : 'hidden'}>
321-
<ChatPanel documentId={documentId} />
324+
<AgentEditPanel
325+
documentId={documentId}
326+
onClose={() => setIsOpen(false)}
327+
className="h-full"
328+
/>
322329
</Activity>
323330
</Panel>
324331
</Group>

0 commit comments

Comments
 (0)