diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index 4533c6f3942..02a0150dd07 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -237,13 +237,24 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { return this.bubbleVisiblity; } - setBubbleVisible(visible: boolean): void { - if (visible && (this.textBubble || this.textInputBubble)) return; - if (!visible && !(this.textBubble || this.textInputBubble)) return; + /** + * Sets whether the bubble is visible or not. + * + * @returns A promise that resolves when the the bubble has finished opening. + */ + setBubbleVisible(visible: boolean): Promise { + if (visible && (this.textBubble || this.textInputBubble)) { + return Promise.resolve(); + } + if (!visible && !(this.textBubble || this.textInputBubble)) { + return Promise.resolve(); + } this.bubbleVisiblity = visible; - if (!this.sourceBlock.rendered || this.sourceBlock.isInFlyout) return; + if (!this.sourceBlock.rendered || this.sourceBlock.isInFlyout) { + return Promise.resolve(); + } if (visible) { if (this.sourceBlock.isEditable()) { @@ -263,6 +274,7 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { 'comment' ) ); + return Promise.resolve(); } /** diff --git a/core/icons/mutator_icon.ts b/core/icons/mutator_icon.ts index 8817450ce3e..6eb96f4d639 100644 --- a/core/icons/mutator_icon.ts +++ b/core/icons/mutator_icon.ts @@ -150,8 +150,13 @@ export class MutatorIcon extends Icon implements IHasBubble { return !!this.miniWorkspaceBubble; } - setBubbleVisible(visible: boolean): void { - if (this.bubbleIsVisible() === visible) return; + /** + * Sets whether the bubble is visible or not. + * + * @returns A promise that resolves when the the bubble has finished opening. + */ + setBubbleVisible(visible: boolean): Promise { + if (this.bubbleIsVisible() === visible) return Promise.resolve(); if (visible) { this.miniWorkspaceBubble = new MiniWorkspaceBubble( @@ -178,6 +183,8 @@ export class MutatorIcon extends Icon implements IHasBubble { 'mutator' ) ); + + return Promise.resolve(); } /** @returns the configuration the mini workspace should have. */ diff --git a/core/icons/warning_icon.ts b/core/icons/warning_icon.ts index f28e5effdf7..47c28c42847 100644 --- a/core/icons/warning_icon.ts +++ b/core/icons/warning_icon.ts @@ -164,8 +164,13 @@ export class WarningIcon extends Icon implements IHasBubble { return !!this.textBubble; } - setBubbleVisible(visible: boolean): void { - if (this.bubbleIsVisible() === visible) return; + /** + * Sets whether the bubble is visible or not. + * + * @returns A promise that resolves when the the bubble has finished opening. + */ + setBubbleVisible(visible: boolean): Promise { + if (this.bubbleIsVisible() === visible) return Promise.resolve(); if (visible) { this.textBubble = new TextBubble( @@ -187,6 +192,8 @@ export class WarningIcon extends Icon implements IHasBubble { 'warning' ) ); + + return Promise.resolve(); } /**