From b73cf4f0e2a4aab3ad5f59759593411acad9418b Mon Sep 17 00:00:00 2001 From: Vipin Chaudhary Date: Tue, 18 Nov 2025 15:27:01 +0530 Subject: [PATCH] [WEB-5449] fix: enhance content check for unique ID generation and update issue loader condition (#8132) --- apps/web/core/components/inbox/content/issue-root.tsx | 2 +- packages/editor/src/core/extensions/unique-id/extension.ts | 2 +- packages/editor/src/core/extensions/unique-id/utils.ts | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/web/core/components/inbox/content/issue-root.tsx b/apps/web/core/components/inbox/content/issue-root.tsx index 51531cb7c..f1f7c7d9d 100644 --- a/apps/web/core/components/inbox/content/issue-root.tsx +++ b/apps/web/core/components/inbox/content/issue-root.tsx @@ -191,7 +191,7 @@ export const InboxIssueMainContent: React.FC = observer((props) => { containerClassName="-ml-3" /> - {loader === "issue-loading" ? ( + {loader === "issue-loading" || issue.description_html === undefined ? ( ) : ( ({ // If not synced, the listener will be registered in the plugin // and handled there with proper cleanup } else { - return createIdsForView(this.editor.view, this.options); + createIdsForView(this.editor.view, this.options); } }, diff --git a/packages/editor/src/core/extensions/unique-id/utils.ts b/packages/editor/src/core/extensions/unique-id/utils.ts index 044a9dcea..617ff5dc6 100644 --- a/packages/editor/src/core/extensions/unique-id/utils.ts +++ b/packages/editor/src/core/extensions/unique-id/utils.ts @@ -10,6 +10,13 @@ export const createIdsForView = (view: EditorView, options: UniqueIDOptions) => const { state } = view; const { tr, doc } = state; const { types, attributeName, generateUniqueID } = options; + + // size > 2 means more than just the default empty paragraph + const hasContent = doc.content.size > 2; + if (!hasContent) { + return; + } + const nodesWithoutId = findChildren( doc, (node) => types.includes(node.type.name) && node.attrs[attributeName] === null