From 7879e127184f8d183c87ab07fed454527e9bf9ce Mon Sep 17 00:00:00 2001 From: L-Sun Date: Thu, 3 Jul 2025 18:08:00 +0800 Subject: [PATCH] fix(editor): comment style and creation issues (#13006) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### PR Dependency Tree * **PR #13006** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) ## Summary by CodeRabbit * **Style** * Updated embedded note content to remove background color and underline from inline comments for a cleaner appearance. * **Bug Fixes** * Improved comment functionality by ensuring comments are only added to blocks without text content. --- .../blocks/embed/src/common/embed-note-content-styles.ts | 5 +++++ .../src/services/comment-service/block-comment-manager.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/blocksuite/affine/blocks/embed/src/common/embed-note-content-styles.ts b/blocksuite/affine/blocks/embed/src/common/embed-note-content-styles.ts index 2cc4c5e6da..cb9f1a3d3d 100644 --- a/blocksuite/affine/blocks/embed/src/common/embed-note-content-styles.ts +++ b/blocksuite/affine/blocks/embed/src/common/embed-note-content-styles.ts @@ -57,6 +57,11 @@ export const embedNoteContentStyles = css` font-weight: 600; } + .affine-embed-doc-content-note-blocks inline-comment { + background-color: unset !important; + border-bottom: unset !important; + } + .affine-embed-linked-doc-block.horizontal { affine-paragraph, affine-list { diff --git a/blocksuite/affine/shared/src/services/comment-service/block-comment-manager.ts b/blocksuite/affine/shared/src/services/comment-service/block-comment-manager.ts index faea93e78a..79c47e47bb 100644 --- a/blocksuite/affine/shared/src/services/comment-service/block-comment-manager.ts +++ b/blocksuite/affine/shared/src/services/comment-service/block-comment-manager.ts @@ -70,7 +70,7 @@ export class BlockCommentManager extends LifeCycleWatcher { } ); if (!selectedBlocks) return []; - return selectedBlocks.map(b => b.model); + return selectedBlocks.map(b => b.model).filter(m => !m.text); }); const needCommentBlocks = [