From 2e61feb94eb4380b1173350146d468fc5b426afc Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Mon, 27 Jul 2026 21:51:27 -0500 Subject: [PATCH] fix(desktop): anchor the inline image download button to the image, not the block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The carried max-w-[min(100%,var(--image-preview-max-width))] while its container was w-fit max-w-full. A percentage max-width resolves to none while the container measures its fit-content width, so the container took the full column while the image stayed capped — and the absolutely positioned download button, which anchors to the container, drifted into the margin on any image wider than it is tall. Move the width cap onto the container and leave the image at max-w-full. The container now shrink-wraps the rendered image, so right-2/top-2 lands on the image's own corner at every aspect ratio. --- .../desktop/src/components/assistant-ui/markdown-text.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.tsx index 3d9b44bf9ee9..a54b1d1efe91 100644 --- a/apps/desktop/src/components/assistant-ui/markdown-text.tsx +++ b/apps/desktop/src/components/assistant-ui/markdown-text.tsx @@ -373,14 +373,18 @@ function MarkdownImage({ className, src, alt, ...props }: ComponentProps<'img'>) return Loading {name}... } + // The width cap belongs on the container, not the : a percentage + // max-width resolves to none while the container measures its fit-content + // width, so the box overshoots the rendered image and strands the download + // button — which anchors to the container — out in the margin. return (