Skip to content

refactor: 移除评论功能相关代码#316

Merged
xun082 merged 2 commits into
xun082:mainfrom
Hemomoo:feat-del-comment
Mar 13, 2026
Merged

refactor: 移除评论功能相关代码#316
xun082 merged 2 commits into
xun082:mainfrom
Hemomoo:feat-del-comment

Conversation

@Hemomoo

@Hemomoo Hemomoo commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

移除评论功能的所有相关代码,包括评论面板、评论存储、评论菜单项及相关逻辑

PR 描述

PR 类型

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

Issue 关联

Closes #

其他信息

移除评论功能的所有相关代码,包括评论面板、评论存储、评论菜单项及相关逻辑
@netlify

netlify Bot commented Mar 12, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit a7a0284
🔍 Latest deploy log https://app.netlify.com/projects/ornate-blancmange-89db6b/deploys/69b29675ee7ed40008b71d43

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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!

此拉取请求旨在通过完全移除评论功能来简化应用程序。这一变更清除了所有相关的UI组件、状态管理逻辑以及编辑器集成,从而减少了代码库的复杂性,并使应用程序更专注于其核心文档编辑能力。此举有助于提升代码的可维护性,并可能为未来的功能迭代提供更清晰的路径。

Highlights

  • 评论功能移除: 全面移除了应用程序中的评论功能,包括前端UI组件、状态管理和后端API集成。
  • UI组件删除: 删除了所有与评论相关的用户界面组件,如评论面板、评论项和评论线程。
  • 状态管理移除: 移除了用于管理评论状态的Zustand存储。
  • 编辑器集成解耦: 从Tiptap编辑器扩展和文本菜单中解除了评论功能的集成。
  • NPM配置更新: 更新了.npmrc文件,将engine-strict配置从true更改为false
Changelog
  • apps/DocFlow/src/app/docs/[room]/page.tsx
    • 移除了CommentPanel的动态导入。
    • 删除了useCommentStore的导入和使用。
    • 移除了ExtensionKit配置中与评论相关的回调函数。
    • 删除了处理编辑器点击事件以关闭评论面板的useEffect钩子。
    • 移除了CommentPanel组件的渲染。
  • apps/DocFlow/src/app/docs/_components/DocumentHeader/components/document-actions.tsx
    • 移除了useCommentStore的导入和使用。
    • 删除了文档操作菜单中“打开/关闭评论”的PopoverItem
  • apps/DocFlow/src/components/menus/TextMenu/TextMenu.tsx
    • 移除了文本菜单中的“添加评论”按钮。
  • apps/DocFlow/src/components/menus/TextMenu/hooks/useTextMenuCommands.ts
    • 移除了useCommentStore的导入和使用。
    • 删除了onCommentonRemoveComment命令。
  • apps/DocFlow/src/components/menus/TextMenu/hooks/useTextMenuStates.ts
    • 移除了isComment状态检查。
  • apps/DocFlow/src/extensions/extension-kit.ts
    • 移除了Comment扩展的导入。
    • 删除了CommentCallbacksExtensionKitPropsWithComment接口。
    • ExtensionKit数组中移除了Comment.configure
Activity
  • 此拉取请求目前没有人工活动记录。
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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

本次 PR 旨在移除评论功能,大部分相关的组件、store 和 UI 都被移除了,这很好。但是,代码库中似乎仍然存在一些与评论功能相关的文件和目录。为了彻底完成重构并避免留下无用的“死代码”,建议将这些文件也一并删除。

具体来说,以下目录及其内容似乎是多余的,应该被删除:

  • apps/DocFlow/src/services/comment/
  • apps/DocFlow/src/extensions/Comment/

另外,在 .npmrc 文件中将 engine-strict 设置为 false 的更改似乎与本次重构无关,并且可能会降低项目环境的一致性。我已就此提出具体建议。

Comment thread .npmrc Outdated
# Performance
prefer-frozen-lockfile=true
engine-strict=true
engine-strict=false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

engine-strict 设置为 false 可能会导致开发环境和生产(或CI)环境之间的不一致,因为不同版本的 Node.js 或包管理器可能会有不同的行为。建议保持 engine-strict=true 以确保所有协作者和部署环境的一致性。如果存在特定的版本冲突问题,最好是解决根本原因,而不是禁用此项严格检查。

engine-strict=true

@xun082 xun082 merged commit ec75a3c into xun082:main Mar 13, 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.

2 participants