From 0876c294bddf08ecb022390588ecf93d82a1d51d Mon Sep 17 00:00:00 2001 From: hugo Date: Tue, 10 Feb 2026 17:29:43 +0100 Subject: [PATCH] fix: bubble popup fixed --- .../WysiwygEditor/WysiwygEditor.tsx | 18 +- tests/renderer/components/Editor.test.ts | 361 +++++++++++------- .../renderer/components/SettingsView.test.ts | 340 ++++++++++++----- 3 files changed, 475 insertions(+), 244 deletions(-) diff --git a/src/renderer/components/WysiwygEditor/WysiwygEditor.tsx b/src/renderer/components/WysiwygEditor/WysiwygEditor.tsx index dd623c4..4c440a8 100644 --- a/src/renderer/components/WysiwygEditor/WysiwygEditor.tsx +++ b/src/renderer/components/WysiwygEditor/WysiwygEditor.tsx @@ -211,9 +211,23 @@ export const WysiwygEditor: React.FC = ({ )} - {/* Floating menu appears on empty lines */} + {/* Floating menu appears on empty lines, but only when editor has content */} {editor && ( - + { + // Only show floating menu if editor has real content (not just empty paragraph) + const text = editor.state.doc.textContent; + if (!text || text.trim().length === 0) { + return false; + } + // Also check if we're on an empty line (default behavior) + const { $from } = editor.state.selection; + const isEmptyLine = $from.parent.content.size === 0; + return isEmptyLine; + }} + >