Skip to content

test(mobile): cover the message image grid layout - #1196

Merged
incognitojam merged 2 commits into
mainfrom
test/mobile-message-image-grid
Nov 1, 2026
Merged

incognitojam merged 2 commits into
mainfrom
test/mobile-message-image-grid

Conversation

@incognitojam

@incognitojam incognitojam commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

The mobile message image grid from #1175 had no tests, so it had no fork feature ledger entry, and upstream intake batch 49 (pingdotgg#23135) had to re-apply it by hand when it rebuilt ThreadFeed's message body.

This moves the grid's decisions out of ThreadFeed.tsx into a pure helper, messageImageGrid.ts, and tests them:

  • which layout a message gets: nothing, the large single image, or a grid of at most four tiles with a "+N" count of the rest;
  • the tile size: two columns around the gap, capped at 240px, never negative;
  • which user attachments go to the grid and which to the file list: images (including files with an image MIME type) always go to the grid, even when the text references them; other files the text references are left out of the list because they show as chips.

ThreadFeed renders the same views from the helper's result, so the grid behaves as before. The new mobile-message-image-grid ledger entry records the invariants, paths, and tests. It is marked review-needed with upstream status partial: upstream pingdotgg#27373, which the fork has not taken yet, moves user message images into a collage that shows every image with no tile limit or overflow count, while assistant images still stack. Intake of that PR needs to decide which layout the fork keeps.

Validation: compared the batch 49 version of ThreadFeed.tsx with the #1175 diff: the grid component, tile size, pending/sent/assistant call sites, and the grid/file-list split are all unchanged apart from the new body wrapper, whose px-3.5 padding matches the tile width calculation. The new tests cover each case in the list above.

Also checked on an Android emulator (Pixel 7, Android 17) against a dev server with synthetic fixture threads:

  • A user message with seven images and a PDF shows four square tiles with "+3" on the fourth, then the PDF in the file list, then the text. The assistant reply with two images shows a two-tile grid across the content width.
  • Tapping the "+3" tile opens the gallery at screen-4.png, and swiping goes on to screen-5.png, one of the hidden images.
  • A message whose text references three images shows them in the grid, with the file names still shown as chips in the text.

I didn't capture a message with a single referenced image on the emulator; the tests cover that it keeps the single layout.

Seven images: four tiles with +3, then the PDF and the text

The gallery opened from the +3 tile at screen-4.png

Three images the text references, shown in the grid with chips in the text


Written by an agent (Claude Code, claude-opus-5-5).

Move the grid's tile selection and the split between grid images and
listed files into a pure helper, test it, and record the feature in the
fork feature ledger.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:L label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Upstream divergence

Both sides are compared with upstream at the in-order tip aaf4a901c4. Excludes .repos/ and pnpm-lock.yaml.

Measure Base This PR Change
Upstream files the fork changes 1,778 1,778 0
Lines changed in them 106,547 106,556 +9
Upstream files the fork removes 45 45 0
Fork-only files 773 775 +2
Fork-only lines 135,451 135,657 +206
Upstream files whose difference changes (1)
File Change Now differs by
apps/mobile/src/features/threads/ThreadFeed.tsx +9 454 lines

@incognitojam
incognitojam marked this pull request as ready for review November 1, 2026 20:03
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@incognitojam
incognitojam merged commit 7ec3c91 into main Nov 1, 2026
45 of 46 checks passed
@incognitojam
incognitojam deleted the test/mobile-message-image-grid branch November 1, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant