refactor(Table): 移除自定义表格实现,改用tiptap原生扩展#318
Conversation
重构表格相关代码,删除自定义实现的Table、TableCell、TableRow等组件及相关菜单工具,改为直接使用@tiptap/extension-table提供的原生实现。简化代码结构,提升维护性。 - 删除自定义表格组件及工具类 - 更新表格样式配置 - 移除不再需要的表格菜单组件 - 调整相关导入路径
❌ Deploy Preview for ornate-blancmange-89db6b failed. Why did it fail? →
|
Summary of ChangesHello, 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! 本次PR旨在通过将自定义的表格实现替换为Tiptap原生提供的表格扩展,来重构应用程序中的表格功能。这一改变将显著简化代码结构,提高系统的可维护性,并确保表格功能与Tiptap生态系统更好地集成,从而提供更稳定和标准化的表格编辑体验。 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
这是一个很棒的重构!将自定义的表格实现替换为 Tiptap 的原生扩展,极大地简化了代码库,并提高了可维护性。大部分的自定义代码和相关组件都已正确移除。我只发现了一个小问题,在 table.css 文件中,一些与旧的自定义表格实现相关的 CSS 样式没有被完全删除,变成了死代码。请看我在文件中的具体评论。除此之外,其他修改看起来都很好。
I am having trouble creating individual review comments. Click here to see my feedback.
apps/DocFlow/src/styles/partials/table.css (67-78)
感谢移除这部分不再需要的样式。
不过,在本次重构中,似乎有一些相关的 CSS 规则被遗漏了,它们也属于旧的自定义表格实现,现在已经成为死代码。为了保持代码整洁,建议将它们一并移除。
需要移除的规则包括:
.ProseMirror .tableWrapper::after(和:hover状态).ProseMirror .tableWrapper::before(和:hover状态).dark .ProseMirror table td a.right.ProseMirror table td.has-focus a.right.ProseMirror table td a.right::before(和.dark版本)
这些样式都与已被删除的自定义表格功能(如单元格菜单、点击添加行/列)相关联。
PR 描述
PR 类型
Issue 关联
Closes #
其他信息