Skip to content

Commit 71a9b67

Browse files
committed
fix(web): keep workspace images on the text baseline
1 parent 1fcbe33 commit 71a9b67

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎apps/web/src/components/ChatMarkdown.tsx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,6 @@ const MarkdownLinkFavicon = memo(function MarkdownLinkFavicon({ host }: { host:
10501050
});
10511051

10521052
const CHAT_MARKDOWN_IMAGE_BOUNDS_CLASS_NAME = "max-h-[30rem] max-w-[min(100%,30rem)]";
1053-
const CHAT_MARKDOWN_IMAGE_ALIGNMENT_CLASS_NAME = "align-bottom";
10541053
const CHAT_MARKDOWN_IMAGE_SIZE_CLASS_NAME = cn(
10551054
"h-auto w-auto object-contain",
10561055
CHAT_MARKDOWN_IMAGE_BOUNDS_CLASS_NAME,
@@ -1084,10 +1083,7 @@ function authoredImageSizeStyle(
10841083
return undefined;
10851084
}
10861085

1087-
const CHAT_MARKDOWN_WORKSPACE_IMAGE_LAYOUT_CLASS_NAME = cn(
1088-
"inline-block!",
1089-
CHAT_MARKDOWN_IMAGE_ALIGNMENT_CLASS_NAME,
1090-
);
1086+
const CHAT_MARKDOWN_WORKSPACE_IMAGE_LAYOUT_CLASS_NAME = "inline-block!";
10911087
const CHAT_MARKDOWN_WORKSPACE_IMAGE_CLASS_NAME = cn(
10921088
CHAT_MARKDOWN_IMAGE_SIZE_CLASS_NAME,
10931089
CHAT_MARKDOWN_WORKSPACE_IMAGE_LAYOUT_CLASS_NAME,

‎apps/web/src/components/ChatMarkdown.workspace-images.test.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe("ChatMarkdown workspace images", () => {
183183
expect(loadedStyle).toHaveProperty(constraint, expectedValue);
184184
});
185185

186-
it("keeps direct images baseline-aligned, workspace images bottom-aligned, and centered raw images inline", () => {
186+
it("keeps all images baseline-aligned and workspace images inline", () => {
187187
const html = render(
188188
"![remote](https://example.com/badge.svg) ![workspace](.t3/workspace-image.svg)",
189189
);
@@ -192,8 +192,7 @@ describe("ChatMarkdown workspace images", () => {
192192
);
193193

194194
expect(classNames).toHaveLength(2);
195-
expect(classNames[0]).not.toContain("align-bottom");
196-
expect(classNames[1]).toContain("align-bottom");
195+
expect(classNames[1]).toContain("inline-block!");
197196

198197
const centeredHtml = render(
199198
'<p align="center"><img src=".t3/workspace-image.svg" alt="logo"></p>',

0 commit comments

Comments
 (0)