Conversation Markdown images and Browser Use / node_repl result images use one
shared thumbnail layout and full-screen preview dialog. Chat attachment previews also use the shared dialog while retaining their own
loading/error metadata. The persistent Preview Pane keeps its separate pane lifecycle.
max-h-90.h-44 thumbnails on desktop.rounded-xl, a semantic border/background, and
object-cover.The preview supports selection/moving annotations, pen, text, rectangle, ellipse, arrow, color, eraser, undo and redo. The eraser removes an entire annotation and never changes source pixels (confirmed by the user). Desktop tools sit on the right; narrow screens use a bottom toolbar. Save creates a PNG at the source image's natural resolution and adds it to the focused Composer as a new attachment. It preserves existing text/attachments and never sends a prompt or overwrites the source. Closing or navigating discards this preview's unsaved annotations.
Download continues to save original bytes. Video items keep their playback controls and do not expose annotation tools. Cross-origin canvas failures are explicit.
image + preview-local annotations → Save → capture focused Composer receiver
↓
async natural-size PNG export
↓
preview still open + receiver still valid → addAttachmentFiles
↓
existing upload/draft attachment owner
Impact: presentation, draft-default and commit-effect; planning mode. The shared
ImagePreviewDialog is used by Markdown, tool result images, user-message media
and Composer attachments. Each entry keeps its own gallery/loading state; the
preview owns only transform and annotation history. useComposerAttachments
remains the attachment owner and enforces existing limits. Desktop and mobile
use the same renderer path and existing local/remote upload adapter. No changes
to accepted input, runtime, snapshots, replay or original file persistence.
Must inspect: shared dialog, annotation surface and focused Composer admission. Should inspect: mixed video/image gallery and keyboard focus. Invariants: no automatic send, no cross-scope late append, original media unchanged. Evidence: codegraph is unavailable for this checkout; direct callers and attachment sink were traced with source search to depth two. The feature graph now includes this shared preview edit contract; there are no unresolved product decisions.
| Case | Setup/action | Expected | Decision |
|---|---|---|---|
| IPE01 | Fit image, click blank/image/control | Blank closes; image/control stays; cursor is normal | accepted |
| IPE02 | Wheel, button, pinch, pan, resize | Anchored bounded zoom/pan; grab only on overflow | accepted |
| IPE03 | Pen/text/shapes, select/move, erase, undo/redo | Original preserved; edits and history render consistently | accepted |
| IPE04 | Save with text and attachment already in Composer | One natural-size PNG appended; draft preserved; zero sends | accepted |
| IPE05 | Close/switch scope during export, full/disabled Composer, export failure | No late or duplicate append; failure retains editable history | accepted |
| IPE06 | 390/1100px, light/dark, Chinese/English | Tools/save accessible; no horizontal overflow | accepted |
Dimensions: image vs video, fit vs overflow, mouse vs touch, edit vs export, available vs invalid Composer, width/theme/locale. Sending/queue/fork/replay cross-products are pruned because saving only uses existing draft admission. E2E handoff: browser candidate covers IPE01–03/05–06; desktop pending candidate covers IPE04 with the real Composer. Promotion remains subject to human review.
ArrowLeft and ArrowRight controls centered
vertically against the viewport. Keyboard arrows perform the same navigation.titleBarOverlay caption area.
Linux keeps the dialog content below its self-drawn titlebar and preserves a
trailing inset for the action row. macOS places the action row below the hidden native titlebar; Web and mobile keep
the normal top-right inset.data: images continue through the bounded
byte payload path. Web uses a size-bounded response reader when JavaScript can
read the source, and falls back to browser-native navigation for cross-origin
HTTP(S) sources that reject CORS so renderer memory is not used as an
unbounded download buffer.data:image/... sources never enter the network path; their content is
bounded in renderer memory and saved through the byte-payload IPC variant.node_repl provides the retained images emitted by the same tool
result as one group and suggests result-image-{index}.{ext} filenames. Core
currently retains at most MAX_NODE_REPL_DISPLAY_IMAGES = 2 display images
per result.| Case | Setup | Action | Expected |
|---|---|---|---|
| SIG-001 | One Markdown or Browser Use image | Render message | At most half message width and max-h-90 |
| SIG-002 | Multiple images on narrow mobile | Render message | One column, wrapped without horizontal scrolling |
| SIG-003 | Multiple images on small screen | Render message | Two columns, equal-height cropped thumbnails |
| SIG-004 | Multiple images on desktop | Render message | Horizontal h-44 thumbnails wrapping to new rows |
| SIP-001 | One image | Open preview | Centered image, no navigation arrows |
| SIP-002 | Multiple images | Open the second thumbnail | Second image active; arrows and keyboard navigate the group |
| SIP-003 | Zoomed image | Drag or pinch | Translation/zoom stay within configured bounds |
| SIP-004 | Any image | Download | Active image is saved through the current platform path |
| SIP-005 | Navigated/zoomed image | Change image | Zoom and translation reset to 100%/center |
| SIP-006 | Windows or Linux desktop preview | Open preview | Download/close stay outside native or self-drawn controls |
grab, and wheel input left
zoom at 100%. The transparent Dialog content intercepted blank clicks, the
viewport cursor was unconditional, and there was no wheel listener.desktop-e2e-20261022124558480-p56523-2adaaa12b3911c95); existing gallery 5/5
passed (desktop-e2e-20261022125109960-p80041-c18b5ef3f853e9e2). The new case
verifies a 320×240 PNG, existing draft/attachment retention and zero sends.
Its first fixture had zero image dimensions; the repaired fixture explicitly
waits for successful decoding before drawing.