diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd3f5f39f..cef92a728b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Fixes [#5323](https://github.com/microsoft/BotFramework-WebChat/issues/5323). Removed unused CSS class from carousel component, eliminating unintended styling, in PR [#5325](https://github.com/microsoft/BotFramework-WebChat/pull/5325), by [@OEvgeny](https://github.com/OEvgeny) - Resolved CSS class name conflicts between component and fluent packages to prevent styling issues, in PR [#5326](https://github.com/microsoft/BotFramework-WebChat/pull/5326), in PR [#5327](https://github.com/microsoft/BotFramework-WebChat/pull/5327), by [@OEvgeny](https://github.com/OEvgeny) - Fixed [#5350](https://github.com/microsoft/BotFramework-WebChat/issues/pull/5350). Bundled `shiki` in component package, in PR [#5349](https://github.com/microsoft/BotFramework-WebChat/pull5349), by [@compulim](https://github.com/compulim) +- Fixed modal dialog rendering to prevent visual flicker and improve UX when opening code views, in PR [#5374](https://github.com/microsoft/BotFramework-WebChat/pull/5374), by [@OEvgeny](https://github.com/OEvgeny) # Removed diff --git a/__tests__/__image_snapshots__/html/default-citation-modal-js-markdown-render-html-when-unset-should-render-sanitized-html-in-citation-modal-1-snap.png b/__tests__/__image_snapshots__/html/default-citation-modal-js-markdown-render-html-when-unset-should-render-sanitized-html-in-citation-modal-1-snap.png index da17ca3f70..f70752d2f2 100644 Binary files a/__tests__/__image_snapshots__/html/default-citation-modal-js-markdown-render-html-when-unset-should-render-sanitized-html-in-citation-modal-1-snap.png and b/__tests__/__image_snapshots__/html/default-citation-modal-js-markdown-render-html-when-unset-should-render-sanitized-html-in-citation-modal-1-snap.png differ diff --git a/packages/component/src/Attachment/Text/private/CodeContent.tsx b/packages/component/src/Attachment/Text/private/CodeContent.tsx index f39c4a2be5..04c961e086 100644 --- a/packages/component/src/Attachment/Text/private/CodeContent.tsx +++ b/packages/component/src/Attachment/Text/private/CodeContent.tsx @@ -55,6 +55,10 @@ const CodeContent = memo(({ children, className, code, language, title }: Props) }; }, [code, codeBlockTheme, language]); + if (!highlightedCode) { + return null; + } + return (
diff --git a/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx b/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx index e08c98b16f..0172f33ce9 100644 --- a/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx +++ b/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx @@ -236,7 +236,7 @@ const MarkdownTextContent = memo(({ activity, children, markdown }: Props) => { )}
- {activity.type === 'message' && isBasedOnSoftwareSourceCode(messageThing) ? ( + {activity.type === 'message' && isBasedOnSoftwareSourceCode(messageThing) && messageThing.isBasedOn.text ? ( dialogRef.current?.close(), [dialogRef]); - useEffect(() => dialogRef.current?.showModal(), [dialogRef]); + useLayoutEffect(() => dialogRef.current?.showModal(), [dialogRef]); return (