feat(server): report image dimensions with signed asset URLs - #226
Merged
Conversation
Chat images reserved a 16:9 slot, then jumped to their natural size after decode. The server now reads PNG, JPEG, GIF, and WebP headers when it issues a signed URL, and live bot/group markdown uses that size for the slot. Adapted from pingdotgg#10198 and pingdotgg#10200. Host-file media-file resources and native mobile slot sizing remain follow-up work. Implemented with Grok 4.6 High in Grok Build via Orca.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds bounded image-header dimension parsing, returns optional dimensions with signed asset URLs, and uses those dimensions to reserve proportional workspace-image space in chat markdown. No actionable issues were identified. Confidence Score: 5/5Safe to merge. There are no outstanding findings. Files Needing Attention: None. Reviews (2): Last reviewed commit: "Merge branch 'main' into feat/asset-imag..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Chat images reserved a 16:9 slot, then jumped to their natural size after decode. That resize moves every row below the image.
Fix
Signed asset URLs now include optional
imageDimensionsread from PNG, JPEG, GIF, and WebP headers. Live bot and group markdown apply that size as soon as the URL resolves. JPEG honours EXIF orientation 5–8.Adaptation
Reviewed port of pingdotgg/t3code#10198 and #10200. Akeru does not yet have host
media-fileresources; dimensions are read from existing workspace-file and attachment paths. Native mobile slot sizing (pingdotgg#10199) is later work. Expanded-image zoom/pan remains with the web-chat worker.Scope
Additive image metadata and live
ChatMarkdownslot sizing on bot and group chat routes. Video streaming, native previews, and preview recording transfers are separate.Verification
Head
68804d0e40bfe4c961a763c5fdfcf3d34990298bonfeat/asset-image-dimensions. Isolated home/tmp/akeru-ui.7d51ZM(populated fixture +workspace/shot.png240×480). Server/web fromvp run dev --home-dir /tmp/akeru-ui.7d51ZM([dev-runner]serverPort=15008 webPort=6968). Pairedagent-browsersessionimage-layout2-f780f086c461on/bots/ui-scout. Directprojection_thread_messagesseed is a visual fixture, not command-path proof.Focused tests:
vp test runonpackages/shared/src/imageDimensions.test.ts,apps/server/src/assets/AssetAccess.test.ts, andapps/web/src/components/ChatMarkdown.workspace-images.test.tsx: 29 passed.Browser (this agent, isolated client):
/bots/ui-scout: live<img alt="portrait">box 240×480, computedaspect-ratio: 240 / 480, inlinewidth: 240px. A 16:9 slot at width 240 would be 135px tall. Signed src was/api/assets/.../shot.png.srcdroppednaturalWidth/Heightto 0×0; the box stayed 240×480 withaspect-ratio: 240 / 480(heightHeld: true). This is after signed-URL success, not during the loading placeholder.aspect-ratio: 240 / 480.<img>at/api/assets/missing-fixture.pngreplaced it withImage unavailable · portraitand left no remaining<img>. Reload restored the 240×480 portrait.aspect-video(16:9) untilcreateUrlsucceeds. The live loading-to-success jump was not captured; URL state was alreadySuccesswhen measured.Not verified (blockers, not claimed):
projection_groupscount is 0 in this fixture./groups/missingrendered no group conversation, soGroupThreadLandingChatMarkdown was not measured. Same component as bot chat; live group route still unproven.FilePreviewPanelalso mountsChatMarkdown; that route was not opened.<img onError>fallback.gh-attachis not installed on this host (gh2.100.0 has no--attach). Screenshots stay in/tmp/akeru-pr-226-evidence/(desktop-portrait-scrolled.png,mobile-portrait.png,mobile-error-fallback.png) and were not uploaded.Limitations
media-filehost-path resource yet.ThreadMarkdownImageframe sizing (fix(mobile): size a chat image's frame before its bytes arrive pingdotgg/t3code#10199) is not in this PR.Implemented with Grok 4.6 High in Grok Build via Orca.