Skip to content

Commit 16e748b

Browse files
committed
Fix error handling UX: always show diagram pane on render errors
When Mermaid rendering fails, the error message is displayed in the diagram pane. Previously, if the user had selected 'code' view, they wouldn't see the error message. Now the view is always switched to 'diagram' on rendering errors to ensure users are notified of failures, improving the user experience.
1 parent e7aac16 commit 16e748b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/contentScript/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,7 @@ async function renderBlock(block: MermaidBlock) {
314314
updateDownloadButtons(registry)
315315
cleanupGhostNodes(renderId, diagramHost.ownerDocument)
316316

317-
if (registry.userSelectedView === 'code') {
318-
registry.setView('code')
319-
} else {
320-
registry.setView('diagram')
321-
}
317+
registry.setView('diagram')
322318
}
323319
}
324320

0 commit comments

Comments
 (0)