From 7487cce5c8d946813f6cc31f463353a40b84e020 Mon Sep 17 00:00:00 2001 From: Todti Date: Tue, 9 Jun 2026 13:14:44 +0100 Subject: [PATCH 1/4] fix(web-components): fix markdown truncation and HTML attachment modal issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - MarkdownPreview: use dedicated CSS class without flex height constraints so the dynamically-measured iframe height attribute is respected (#679) - MarkdownPreview: drop height="100%" fallback before content loads; browser default height is more sensible in a block container - Modal: change overflow: hidden → overflow-y: auto on modal-data-component so tall markdown content can be scrolled within the modal (#679) - Modal: wire .attachmentViewStack/.attachmentViewPane into the flex height chain so HtmlPreview fills the fullscreen modal instead of collapsing to the browser default ~150px (#692) - HtmlPreview: set blob MIME to text/html; charset=utf-8 to prevent the iframe from guessing encoding from stale meta tags (#692) - TrAttachment: pass current preview state when opening the modal so HTML attachments open in preview mode, not source-code mode (#692) --- .../components/TestResult/TrSteps/TrAttachment.tsx | 3 ++- .../src/components/Attachment/HtmlPreview.tsx | 2 +- .../src/components/Attachment/MarkdownPreview.tsx | 4 ++-- .../src/components/Attachment/styles.scss | 6 ++++++ .../src/components/Modal/styles.scss | 14 +++++++++++++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/packages/web-awesome/src/components/TestResult/TrSteps/TrAttachment.tsx b/packages/web-awesome/src/components/TestResult/TrSteps/TrAttachment.tsx index b6d9a1092c7..0f15b1b4605 100644 --- a/packages/web-awesome/src/components/TestResult/TrSteps/TrAttachment.tsx +++ b/packages/web-awesome/src/components/TestResult/TrSteps/TrAttachment.tsx @@ -104,7 +104,8 @@ export const TrAttachment: FunctionComponent<{ event.stopPropagation(); openModal({ data: item, - component: , + preview: showPreview, + component: , }); }; diff --git a/packages/web-components/src/components/Attachment/HtmlPreview.tsx b/packages/web-components/src/components/Attachment/HtmlPreview.tsx index ba1f2eb07f9..930b4c53da9 100644 --- a/packages/web-components/src/components/Attachment/HtmlPreview.tsx +++ b/packages/web-components/src/components/Attachment/HtmlPreview.tsx @@ -40,7 +40,7 @@ export const HtmlPreview: FunctionalComponent = ({ a wrapped = DARK_STYLE + sanitizedText; } } - const blob = new Blob([wrapped], { type: "text/html" }); + const blob = new Blob([wrapped], { type: "text/html; charset=utf-8" }); const url = URL.createObjectURL(blob); setBlobUrl(url); diff --git a/packages/web-components/src/components/Attachment/MarkdownPreview.tsx b/packages/web-components/src/components/Attachment/MarkdownPreview.tsx index 1b39ae0c851..5d01c860009 100644 --- a/packages/web-components/src/components/Attachment/MarkdownPreview.tsx +++ b/packages/web-components/src/components/Attachment/MarkdownPreview.tsx @@ -67,13 +67,13 @@ export const MarkdownPreview: FunctionalComponent +
{blobUrl && (