Skip to content

Commit ae973c6

Browse files
authored
Merge pull request #418 from Harbour-Enterprises/nick/har-9349-sidebar-flicker
HAR-9349 - Additional flickering fix, fix mentions in threaded comments
2 parents 8fbea8a + 6ddc3aa commit ae973c6

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

packages/superdoc/src/SuperDoc.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ watch(getFloatingComments, () => {
589589
v-click-outside="cancelPendingComment"
590590
/>
591591
592-
<div class="floating-comments" v-if="!isCommentsListVisible">
592+
<div class="floating-comments">
593593
<FloatingComments
594594
v-if="hasInitializedLocations && getFloatingComments.length > 0"
595595
v-for="doc in documentsWithConverations"
@@ -606,8 +606,13 @@ watch(getFloatingComments, () => {
606606
display: flex;
607607
}
608608
609+
.right-sidebar {
610+
min-width: 320px;
611+
}
612+
609613
.floating-comments {
610614
min-width: 300px;
615+
width: 300px;
611616
}
612617
613618
.superdoc--with-sidebar { /* */ }

packages/superdoc/src/helpers/use-selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ref, reactive, toRaw } from 'vue';
33
export default function useSelection(params) {
44
const documentId = ref(params.documentId);
55
const page = ref(params.page);
6-
const selectionBounds = reactive(params.selectionBounds);
6+
const selectionBounds = reactive(params.selectionBounds || {});
77
const source = ref(params.source);
88

99
/* Get the ID of the container */

packages/superdoc/src/stores/comments-store.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ export const useCommentsStore = defineStore('comments', () => {
358358
const newComment = useComment(comment.getValues());
359359

360360
if (pendingComment.value) newComment.setText({ text: currentCommentText.value, suppressUpdate: true });
361+
else newComment.setText({ text: comment.commentText, suppressUpdate: true });
361362
newComment.selection.source = pendingComment.value?.selection?.source;
362363

363364
// Set isInternal flag
@@ -390,7 +391,6 @@ export const useCommentsStore = defineStore('comments', () => {
390391
// Emit event for end users
391392
if (__IS_DEBUG__) console.debug('[addComment] emitting...', event);
392393
superdoc.emit('comments-update', event);
393-
394394
};
395395

396396
const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => {
@@ -550,8 +550,8 @@ export const useCommentsStore = defineStore('comments', () => {
550550
generalCommentIds,
551551
editorCommentIds,
552552
commentsParentElement,
553-
hasInitializedLocations,
554553
editorCommentPositions,
554+
hasInitializedLocations,
555555

556556
// Floating comments
557557
floatingCommentsOffset,

0 commit comments

Comments
 (0)