From 9146b8876af4b2936e09f76f09336e0d9328627e Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Thu, 26 Feb 2026 16:17:57 -0300 Subject: [PATCH 01/14] feat(comments): redesign comment bubble UX with reply pill, thread collapse, and truncation --- packages/superdoc/src/SuperDoc.vue | 16 +- .../superdoc/src/assets/styles/tokens.css | 20 ++- .../CommentsLayer/CommentDialog.test.js | 39 ++++- .../CommentsLayer/CommentHeader.vue | 66 ++++++-- .../CommentsLayer/FloatingComments.vue | 144 ++++++++++++++++-- .../src/components/general/Avatar.vue | 29 ++-- .../superdoc/src/stores/comments-store.js | 22 +-- 7 files changed, 264 insertions(+), 72 deletions(-) diff --git a/packages/superdoc/src/SuperDoc.vue b/packages/superdoc/src/SuperDoc.vue index 6b1b7cf6c7..8fa1735e30 100644 --- a/packages/superdoc/src/SuperDoc.vue +++ b/packages/superdoc/src/SuperDoc.vue @@ -657,7 +657,13 @@ const onEditorCommentsUpdate = (params = {}) => { nextTick(() => { if (pendingComment.value) return; commentsStore.setActiveComment(proxy.$superdoc, activeCommentId); + // Briefly suppress click-outside so the same click that selected the comment + // highlight in the editor doesn't immediately deactivate it via the sidebar. + // Reset after the event loop settles so subsequent outside clicks work normally. isCommentHighlighted.value = true; + setTimeout(() => { + isCommentHighlighted.value = false; + }, 0); }); // Bubble up the event to the user, if handled @@ -1111,17 +1117,9 @@ const getPDFViewer = () => {