Skip to content

feat(server): report image dimensions with signed asset URLs - #226

Merged
leoisadev1 merged 2 commits into
mainfrom
feat/asset-image-dimensions
Sep 11, 2026
Merged

feat(server): report image dimensions with signed asset URLs#226
leoisadev1 merged 2 commits into
mainfrom
feat/asset-image-dimensions

Conversation

@leoisadev1

@leoisadev1 leoisadev1 commented Sep 10, 2026

Copy link
Copy Markdown
Member

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 imageDimensions read 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-file resources; 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 ChatMarkdown slot sizing on bot and group chat routes. Video streaming, native previews, and preview recording transfers are separate.

Verification

Head 68804d0e40bfe4c961a763c5fdfcf3d34990298b on feat/asset-image-dimensions. Isolated home /tmp/akeru-ui.7d51ZM (populated fixture + workspace/shot.png 240×480). Server/web from vp run dev --home-dir /tmp/akeru-ui.7d51ZM ([dev-runner] serverPort=15008 webPort=6968). Paired agent-browser session image-layout2-f780f086c461 on /bots/ui-scout. Direct projection_thread_messages seed is a visual fixture, not command-path proof.

Focused tests:

  • vp test run on packages/shared/src/imageDimensions.test.ts, apps/server/src/assets/AssetAccess.test.ts, and apps/web/src/components/ChatMarkdown.workspace-images.test.tsx: 29 passed.
  • Typecheck for shared, contracts, server, and web exited 0.
  • Targeted lint reported no new errors.

Browser (this agent, isolated client):

  • Desktop 1280×800 on /bots/ui-scout: live <img alt="portrait"> box 240×480, computed aspect-ratio: 240 / 480, inline width: 240px. A 16:9 slot at width 240 would be 135px tall. Signed src was /api/assets/.../shot.png.
  • Reserved slot without decoded pixels: clearing src dropped naturalWidth/Height to 0×0; the box stayed 240×480 with aspect-ratio: 240 / 480 (heightHeld: true). This is after signed-URL success, not during the loading placeholder.
  • Mobile web viewport 390×844: same box 240×480, ratio 0.5, aspect-ratio: 240 / 480.
  • Error path: pointing the live <img> at /api/assets/missing-fixture.png replaced it with Image unavailable · portrait and left no remaining <img>. Reload restored the 240×480 portrait.
  • Loading placeholder is still aspect-video (16:9) until createUrl succeeds. The live loading-to-success jump was not captured; URL state was already Success when measured.

Not verified (blockers, not claimed):

  • Group chat image layout. projection_groups count is 0 in this fixture. /groups/missing rendered no group conversation, so GroupThreadLanding ChatMarkdown was not measured. Same component as bot chat; live group route still unproven.
  • Landscape image. Only the 240×480 portrait fixture was measured. Greptile/T-Rex landscape numbers are not this pass.
  • Native mobile slot sizing (fix(mobile): size a chat image's frame before its bytes arrive pingdotgg/t3code#10199). Not in this PR. Host is Linux; no iOS/Android client was run.
  • File preview panel. FilePreviewPanel also mounts ChatMarkdown; that route was not opened.
  • createUrl Failure for a missing workspace path was unit-tested, not live-seeded. The live error case was the <img onError> fallback.

gh-attach is not installed on this host (gh 2.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

Implemented with Grok 4.6 High in Grok Build via Orca.

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.
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
akeru-bot-landing Ready Ready Preview Sep 10, 2026 5:58pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 10, 2026
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

This 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/5

Safe 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

@leoisadev1
leoisadev1 merged commit 69dc014 into main Sep 11, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the feat/asset-image-dimensions branch September 11, 2026 13:10
@github-actions github-actions Bot mentioned this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant