Skip to content

feat(app): make assistant image previews intent-aware - #4162

Closed
Juns-g wants to merge 2 commits into
getpaseo:mainfrom
Juns-g:feat/intent-aware-image-previews
Closed

feat(app): make assistant image previews intent-aware#4162
Juns-g wants to merge 2 commits into
getpaseo:mainfrom
Juns-g:feat/intent-aware-image-previews

Conversation

@Juns-g

@Juns-g Juns-g commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Discussion #4156

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Docs

Reasoning

Agent image inspection is working context, while a generated image is a result. Paseo flattened
Codex imageView, Codex imageGeneration, and image-bearing tool results into identical assistant
Markdown messages, then rendered each image at the full message width. A portrait screenshot could
therefore take several screens and interrupt the surrounding conversation.

This change preserves provider-neutral image purpose on assistant timeline messages. Inspected/tool
images render as a collapsed activity with an expandable thumbnail strip. Image results and ordinary
Markdown images remain visible, but use intrinsic dimensions, the measured message container, and a
viewport-relative height budget to determine their footprint.

Goals

  • Keep Codex imageView and image-bearing Codex/Claude tool results compact by default.
  • Keep Codex imageGeneration results prominent.
  • Preserve aspect ratio and avoid upscaling small images.
  • Constrain tall result images relative to the current viewport instead of a universal fixed box.
  • Reuse the existing zoomable lightbox for compact and rich previews.
  • Preserve the optional image-purpose metadata through coalescing, projection, client reduction, and
    replica-cache persistence without breaking older clients or daemons.
  • Keep virtualized row estimates aligned with the rendered geometry.

Non-goals

  • A new appearance preference for image sizes.
  • Replacing the existing lightbox.
  • A masonry layout or image editor.
  • Changing user attachment pills.

QA

Web

The browser E2E uses a real isolated daemon and the app's normal attachment path. It verifies that
an inspected image is absent while collapsed, appears as an 80 px thumbnail after expansion, and
still opens in the existing lightbox. It also verifies that a 540 × 1200 portrait result preserves
its aspect ratio and stays within 45% of the live viewport height.

Collapsed inspection:

Collapsed inspected image

Expanded inspection:

Expanded inspected image

Adaptive portrait result:

Adaptive portrait image result

$ npm run test:e2e --workspace=@getpaseo/app -- agent-tab-image-stability.spec.ts
7 passed (1.3m)

$ npx vitest run <18 focused protocol/server/app test files> --bail=1
Test Files  18 passed (18)
Tests       514 passed (514)

$ npm run typecheck
All 9 workspaces passed

$ npm run lint
Found 0 warnings and 0 errors.

$ npm run format:check
All matched files use the correct format.

Compatibility

imagePurpose is optional. Old clients strip it and continue rendering the Markdown image; new
clients receiving messages from an old daemon keep the existing rich-image fallback. A wire
compatibility test covers both shapes.

Platform Tested Notes
iOS No Shared React Native implementation; no simulator run
Android No Shared React Native implementation; no emulator run
Web Yes Chromium, real isolated daemon, 7 image-flow E2E tests
Desktop macOS No Electron wrapper not run manually
Desktop Windows No Not available locally
Desktop Linux No Not available locally

Checklist

  • One focused change
  • npm run typecheck passes
  • npm run lint passes
  • npm run format passes
  • QA evidence
  • Tests added or updated where it made sense

@Juns-g
Juns-g force-pushed the feat/intent-aware-image-previews branch from b798c87 to 5cf5c82 Compare September 1, 2026 14:03
@boudra

boudra commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closing this feature PR. Please discuss the workflow and shared need in Discussions, following CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants