Repository navigation
Conversation
A :menu, :context-menu or :trailing-menu row can now carry an image
(an account's avatar, say) in place of its icon, cut to a circle or,
with image_shape "rounded", a rounded square. The icon shows while the
picture loads and stays if it fails. A row with checked has a tick, for
the option a menu has picked.
Core's NavAction already sends image. image_shape and checked go on the
element with setProp:
NavAction::make('me')->label('Simon')->icon(...)->image($avatar)
->toElement()->setProp('checked', true)
iOS: a SwiftUI Menu is a UIMenu underneath, which can't load or clip an
image itself. NativeUIMenuImages fetches the pictures as soon as the
pressable, button or row that opens the menu is on screen, cuts them to
shape at 24pt and hands the rows ready-made images. A checked row is a
Toggle, so iOS draws its own tick. The three copies of the row renderer
(pressable, button, list item) are now one, NativeUIMenuItem.
Android: renderAttachedMenuItem loads the picture with Coil, clipped to
shape, and puts a tick at the end of a checked row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Menu rows (
:menu,:context-menu,:trailing-menu) can now show a picture in place of their icon, and a tick.image: a remote URL, a device path or apublic/path, as for<native:image>. Core'sNavAction::image()already sends it.image_shape:circle(default) orrounded, a square with rounded corners.checked: a tick on the option the menu has picked.The icon shows while the picture loads and stays if it fails, so rows should keep one.
image_shapeandcheckedaren't onNavActionyet, so for now they go on the element:A
->checked()and->imageShape()onNavActionin core would be the nicer API later.iOS. A SwiftUI
Menuis a UIMenu underneath. It draws a snapshot of each row's image and can't load or clip one. SoNativeUIMenuImagesfetches the pictures as soon as the pressable, button or list row that opens the menu is on screen, cuts them to shape at 24pt and hands the rows ready-made images. They're kept in memory for the life of the app. A checked row is aToggle, so iOS draws its own tick in its own place. The three copies of the row renderer (pressable, button, list item) are now one,NativeUIMenuItem.Android.
renderAttachedMenuItem(shared by all three already) loads the picture with Coil, clipped to shape, and puts a primary-coloured tick at the end of a checked row. TalkBack hears the checked row as selected.What to check: a menu opened before its pictures have arrived shows icons; reopening it shows the pictures. I haven't seen a picture arrive while the menu was open on iOS.
Tests: 531 passed (new
MenuItemImageTest, andIosPressableMenuItemsTestfollows the moved row renderer).Screenshots
From the devnull app's Post as menu (NativePHP/dev-null-app, branch
feat/post-as-avatars), iPhone 18 Pro on iOS 27.0 and an API 35 emulator, against a local server.🤖 Generated with Claude Code