Skip to content

feat: integrate AI chat panel and enhance document editing experience#298

Merged
xun082 merged 2 commits intomainfrom
feat/doc_ai_chat
Feb 10, 2026
Merged

feat: integrate AI chat panel and enhance document editing experience#298
xun082 merged 2 commits intomainfrom
feat/doc_ai_chat

Conversation

@xun082
Copy link
Copy Markdown
Owner

@xun082 xun082 commented Feb 10, 2026

PR 描述

PR 类型

  • 🐛 Bug 修复
  • ✨ 新功能
  • 💄 UI/UX 改进
  • ♻️ 重构
  • 🚀 性能优化
  • 📝 文档更新
  • 🔄 其他

Issue 关联

Closes #

其他信息

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 10, 2026

Deploy Preview for ornate-blancmange-89db6b failed. Why did it fail? →

Name Link
🔨 Latest commit bd834ca
🔍 Latest deploy log https://app.netlify.com/projects/ornate-blancmange-89db6b/deploys/698b28dc49655a00084bcbbe

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @xun082, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求通过集成全新的 AI 聊天面板,显著增强了文档编辑体验。该面板提供了多会话管理、模型切换、联网搜索和深度思考等高级 AI 辅助功能。此外,PR 改进了用户与 AI 的交互方式,允许将选定的文档内容轻松引用到聊天面板中,并通过编辑器的上下文菜单提供 AI 驱动的写作辅助(润色或续写)。文档页面的布局也已更新,以支持可调整大小的面板,从而适应新的聊天界面。

Highlights

  • AI Chat Panel Integration: A new AI chat panel has been integrated into the document editing interface, supporting multi-session management, model switching, web search, deep thinking, and a brainstorm mode.
  • Enhanced Document Editing Experience: The editor now allows copying selected text with metadata for easy referencing in the AI chat panel, and provides AI-powered writing assistance (polish or continue) directly from the content item menu.
  • Resizable Panels: The main content area now utilizes react-resizable-panels to enable users to dynamically adjust the width of the editor and the new AI chat panel.
  • Refactored AI Features: Previous AI-related editor extensions (AI, AIContinue, AIPolish, AIBrainstorm) have been removed and their functionalities streamlined or migrated to the new centralized AI chat panel.
Changelog
  • apps/DocFlow/package.json
    • Updated next dev script to use --webpack.
    • Upgraded react-resizable-panels dependency to version 4.6.2.
  • apps/DocFlow/src/app/docs/[room]/page.tsx
    • Integrated react-resizable-panels components for a flexible layout.
    • Dynamically imported the new ChatPanel component.
    • Updated Ctrl+C functionality to include document reference metadata for AI features.
  • apps/DocFlow/src/app/docs/_components/ChatPanel/index.tsx
    • Added a new component for the AI chat panel, featuring tabbed conversations, AI model selection, web search, deep thinking, and a brainstorm mode.
    • Implemented handling of document references pasted from the clipboard.
  • apps/DocFlow/src/app/docs/_components/DocumentHeader/components/document-actions.tsx
    • Added a new action to toggle the AI chat panel's visibility.
  • apps/DocFlow/src/app/docs/_components/DocumentHeader/index.tsx
    • Added a button to toggle the AI chat panel in the document header.
  • apps/DocFlow/src/components/business/ai/markdown-components.tsx
    • Moved the SyntaxHighlight component implementation directly into this file.
  • apps/DocFlow/src/components/menus/ContentItemMenu/ContentItemMenu.tsx
    • Added a new 'AI Continue' button to the content item menu.
  • apps/DocFlow/src/components/menus/ContentItemMenu/hooks/useContentItemActions.tsx
    • Implemented handleAIContinue logic to interact with the new chat store, enabling AI polish for selected text or AI continue for preceding content.
  • apps/DocFlow/src/components/menus/TextMenu/TextMenu.tsx
    • Removed the 'AI润色' (AI Polish) button from the text menu.
  • apps/DocFlow/src/components/menus/TextMenu/hooks/useTextMenuCommands.ts
    • Removed the onPolish command and its related logic.
  • apps/DocFlow/src/extensions/AI/AI.ts
    • Removed the AI extension.
  • apps/DocFlow/src/extensions/AI/AIComponent.tsx
    • Removed the AIComponent.
  • apps/DocFlow/src/extensions/AI/actionButtons.ts
    • Removed the actionButtons configuration file.
  • apps/DocFlow/src/extensions/AI/components/AIInputPanel.tsx
    • Removed the AIInputPanel component.
  • apps/DocFlow/src/extensions/AI/components/AILoadingStatus.tsx
    • Removed the AILoadingStatus component.
  • apps/DocFlow/src/extensions/AI/components/Button.tsx
    • Removed the Button component.
  • apps/DocFlow/src/extensions/AI/components/ConcurrencySelector.tsx
    • Removed the ConcurrencySelector component.
  • apps/DocFlow/src/extensions/AI/components/CustomDivider.tsx
    • Removed the CustomDivider component.
  • apps/DocFlow/src/extensions/AI/components/ImageSizeSelector.tsx
    • Removed the ImageSizeSelector component.
  • apps/DocFlow/src/extensions/AI/components/KnowledgeBaseSelector.tsx
    • Removed the KnowledgeBaseSelector component.
  • apps/DocFlow/src/extensions/AI/components/SyntaxHighlight.tsx
    • Removed the SyntaxHighlight component file, as its logic was moved.
  • apps/DocFlow/src/extensions/AI/components/Textarea.tsx
    • Removed the Textarea component.
  • apps/DocFlow/src/extensions/AI/hooks/useQuestion.ts
    • Removed the useQuestion hook.
  • apps/DocFlow/src/extensions/AI/hooks/useSSEStream.ts
    • Removed the useSSEStream hook.
  • apps/DocFlow/src/extensions/AI/hooks/useTextExtraction.ts
    • Removed the useTextExtraction hook.
  • apps/DocFlow/src/extensions/AI/hooks/useTextToImage.ts
    • Removed the useTextToImage hook.
  • apps/DocFlow/src/extensions/AI/index.ts
    • Removed exports for the AI extension.
  • apps/DocFlow/src/extensions/AIBrainstorm/AIBrainstorm.ts
    • Removed the AIBrainstorm extension.
  • apps/DocFlow/src/extensions/AIBrainstorm/AIBrainstormComponent.tsx
    • Removed the AIBrainstormComponent.
  • apps/DocFlow/src/extensions/AIBrainstorm/index.ts
    • Removed exports for the AIBrainstorm extension.
  • apps/DocFlow/src/extensions/AIContinue/AIContinue.ts
    • Removed the AIContinue extension.
  • apps/DocFlow/src/extensions/AIContinue/AIContinueComponent.tsx
    • Removed the AIContinueComponent.
  • apps/DocFlow/src/extensions/AIContinue/index.ts
    • Removed exports for the AIContinue extension.
  • apps/DocFlow/src/extensions/AIPolish/AIPolish.ts
    • Removed the AIPolish extension.
  • apps/DocFlow/src/extensions/AIPolish/AIPolishComponent.tsx
    • Removed the AIPolishComponent.
  • apps/DocFlow/src/extensions/AIPolish/index.ts
    • Removed exports for the AIPolish extension.
  • apps/DocFlow/src/extensions/SlashCommand/groups.ts
    • Removed AI-related commands (continueWriting, brainstorm) from the slash command menu.
  • apps/DocFlow/src/extensions/extension-kit.ts
    • Removed AI, AIContinue, AIPolish, and AIBrainstorm extensions from the ExtensionKit.
  • apps/DocFlow/src/extensions/index.ts
    • Removed exports for AI, AIContinue, AIPolish, and AIBrainstorm extensions.
  • apps/DocFlow/src/hooks/ai/use-ai-stream.ts
    • Removed useAIStream, useAIContinue, and useAIPolish hooks.
  • apps/DocFlow/src/stores/chatStore.ts
    • Added a new Zustand store (useChatStore) to manage the state of the AI chat panel.
  • apps/DocFlow/src/utils/editor/is-custom-node-selected.ts
    • Removed references to AI, AIContinue, and AIBrainstorm from the isCustomNodeSelected utility.
  • pnpm-lock.yaml
    • Updated react-resizable-panels dependency version.
    • Added @mediapipe/tasks-vision dependency.
Activity
  • The pull request was created by xun082, indicating new features related to AI chat panel integration and document editing enhancements.
  • The description confirms the introduction of new functionalities.
  • No specific human activity such as comments or reviews is visible in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 引入了一个重要的新功能:集成的 AI 聊天面板,并对现有的 AI 功能进行了重构。旧的 Tiptap AI 扩展被移除,取而代之的是一个更灵活、更强大的聊天界面,这是一个很好的架构改进。新的聊天面板支持多会话、不同的聊天模式(如“普通对话”和“头脑风暴”),并能通过新的文档引用系统与文档内容进行交互。复制粘贴功能也得到了增强,以包含这种引用元数据。

我的审查主要集中在新的 ChatPanel 组件和相关的集成点。我发现了一些可以改进的地方,包括一个事件处理器中的潜在错误、一些硬编码的值,以及通过创建工具函数来减少代码重复的机会。总的来说,这是一个复杂功能的坚实实现。

@xun082 xun082 merged commit 5b6d2da into main Feb 10, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant