diff --git a/packages/desktop-app/src/lib/design/components/code-block-node.svelte b/packages/desktop-app/src/lib/design/components/code-block-node.svelte index 6f40f0383..6d6148d59 100644 --- a/packages/desktop-app/src/lib/design/components/code-block-node.svelte +++ b/packages/desktop-app/src/lib/design/components/code-block-node.svelte @@ -69,14 +69,11 @@ const dispatch = createEventDispatcher(); - // Internal reactive state - sync with content prop changes + // Internal reactive state - initialized from content prop + // Note: Content updates flow through handleContentChange event, not prop sync + // External changes are rare (only from parent re-renders) and handled by component remount let internalContent = $state(content); - // Sync internalContent when content prop changes externally - $effect(() => { - internalContent = content; - }); - // Parse language from opening fence (```language or just ```) let language = $state(parseLanguage(content)); diff --git a/packages/desktop-app/src/lib/design/components/ordered-list-node.svelte b/packages/desktop-app/src/lib/design/components/ordered-list-node.svelte index c0d92c9ce..43560cd08 100644 --- a/packages/desktop-app/src/lib/design/components/ordered-list-node.svelte +++ b/packages/desktop-app/src/lib/design/components/ordered-list-node.svelte @@ -44,17 +44,14 @@ const NEWLINE_LENGTH = 1; // \n character const LIST_PREFIX_LENGTH = 3; // "1. " prefix length - // Internal reactive state - sync with content prop changes + // Internal reactive state - initialized from content prop + // Note: Content updates flow through handleContentChange event, not prop sync + // External changes are rare (only from parent re-renders) and handled by component remount let internalContent = $state(content); // Track if we just added prefixes (for cursor adjustment) let pendingCursorAdjustment = $state(null); - // Sync internalContent when content prop changes externally - $effect(() => { - internalContent = content; - }); - // Ordered lists use multiline editing (Shift+Enter for new lines with auto "1. " prefix) // Prevent merging into ordered-lists (structured content can't accept arbitrary merges) const editableConfig = { allowMultiline: true, allowMergeInto: false }; diff --git a/packages/desktop-app/src/lib/design/components/quote-block-node.svelte b/packages/desktop-app/src/lib/design/components/quote-block-node.svelte index 42d579eb1..d226e6bc4 100644 --- a/packages/desktop-app/src/lib/design/components/quote-block-node.svelte +++ b/packages/desktop-app/src/lib/design/components/quote-block-node.svelte @@ -45,17 +45,14 @@ const NEWLINE_LENGTH = 1; // \n character const QUOTE_PREFIX_LENGTH = 2; // "> " prefix - // Internal reactive state - sync with content prop changes + // Internal reactive state - initialized from content prop + // Note: Content updates flow through handleContentChange event, not prop sync + // External changes are rare (only from parent re-renders) and handled by component remount let internalContent = $state(content); // Track if we just added prefixes (for cursor adjustment) let pendingCursorAdjustment = $state(null); - // Sync internalContent when content prop changes externally - $effect(() => { - internalContent = content; - }); - // Quote blocks use multiline editing (Shift+Enter for new lines with auto > prefix) // Prevent merging into quote-blocks (structured content can't accept arbitrary merges) const editableConfig = { allowMultiline: true, allowMergeInto: false };