Skip to content

Keep iOS image layout when a sent message is delivered - #1101

Merged
ivanfenenko merged 1 commit into
mainfrom
fix/ios-optimistic-image-gallery
Nov 23, 2026
Merged

ivanfenenko merged 1 commit into
mainfrom
fix/ios-optimistic-image-gallery

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On iOS, a message sent with two or more images drew them as a tall stack, then snapped into a gallery when the server's copy arrived. The optimistic message now uses the same image grouping as the delivered message, so the layout stays put.

Checks

  • iOS and Android both covered, or the reason one is not: iOS only. Android already shares one grouping function across both paths.
  • Screenshots for UI changes: a real send is posted as a comment, alongside the earlier component renders.
  • Tests run: 449 tests across the image gallery, timeline blocks, timeline projector and Session Chat view model suites pass locally. The full ios-checks job passes on this commit.
  • Real send: on the iOS simulator against the scenario harness (v2 protocol), a message with two images stayed a side-by-side gallery from sending through delivery. The server stored both images on the message.

Risks / Follow-ups

  • Not checked against a v1 server. The harness could not run v1 because the installed opencode only serves v2.
  • From reading the code, an image with no decodable preview still shows as an attachment card while sending and can join a gallery on delivery. This case was not run.
  • On Android, a single attachment sits below the text while iOS puts it above. This is existing behavior and is left for a separate change.

Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A just-sent message drew each image on its own, then snapped into a gallery when the server copy arrived. Build both from the same grouping so the bubble keeps its layout.
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Two images sent with a message, rendered with mock images.

Before: while sending After: while sending and once delivered
Two images stacked above the text Two images side by side above the text

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 3 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.069

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Real send on the iOS simulator against the scenario harness (opencode v2 protocol, scripted model). The message carries two images, with 4 seconds of added proxy latency so the sending state stays on screen.

While sending After delivery
Two images side by side above the text, with a Sending indicator The same two images side by side above the text, with the reply below

@ivanfenenko
ivanfenenko added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 0d46481 Nov 23, 2026
@ivanfenenko
ivanfenenko deleted the fix/ios-optimistic-image-gallery branch November 23, 2026 09:23
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.

1 participant