fix(web): size the chat image slot from server-reported dimensions #10200
Mergedjuliusmarmingemerged 3 commits into
media-dims/mobile fromrefs/pull/10200/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge changed the title
- apps/web/src/components/ChatMarkdown.tsx line 1549OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1538,3 +1538,12 @@15381538 const reference = path ? mediaFileReference(path, props.workspaceRoot) : undefined;15391539 const relativePath = reference?.relativePath;15401540 const src = assetUrl._tag === "Success" ? assetUrl.url + (props.srcFragment ?? "") : null;1541+ // The server reads the pixel size from the file header, so the slot can be1542+ // the image's final box instead of a 16:9 guess. An authored size, or a1543+ // caller's cap such as the viewed-image row's max height, layers on top.1544+ const knownSize = assetUrl._tag === "Success" ? assetUrl.imageDimensions : undefined;1545+ const knownSizeStyle = knownSize1546+ ? authoredImageSizeStyle(knownSize.width, knownSize.height)1547+ : undefined;1548+ const style =1549+ knownSizeStyle && props.style
juliusmarminge merged thisd0f855b
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed