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>
A :menu, :context-menu or :trailing-menu row can now carry a subtitle,
a second, smaller line under its label, such as an account's handle
under its name. It goes on the element with setProp, like image_shape
and checked:
NavAction::make('me')->label('Simon')->icon(...)
->toElement()->setProp('subtitle', '@simon-hamp')
iOS: the row's title is a second Text after the label, which a SwiftUI
Menu draws as the row's subtitle (UIAction.subtitle underneath).
VoiceOver reads both.
Android: renderAttachedMenuItem puts the subtitle under the label in a
Column, in bodyMedium and onSurfaceVariant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NavAction is in core and has no subtitle method yet, so this gives apps a typed way to set the prop, and a class they can check for to tell whether the installed mobile-ui draws subtitles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
Core now has NavAction::subtitle() (NativePHP/mobile-air#740), so the stop-gap MenuItem::subtitle() helper goes. The renderers still read the same `subtitle` prop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A menu drops a second Text nested in a Label's title, so rows with a subtitle showed only their label. Put the texts and the picture or icon straight into the Button or Toggle instead. The menu reads that as title, subtitle and image for plain, icon, picture and ticked rows, and rows without a subtitle look the same as before. Checked on an iOS 26.2 simulator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp
added a commit
to NativePHP/mobile-air
that referenced
this pull request
Nov 24, 2026
A menu row can now carry a second, smaller line under its label, such
as an account's handle under its name:
NavAction::make('me')->label('Simon')->subtitle('@simon-hamp')
It's serialised as a `subtitle` prop, the same way `image` is, and
TopBarAction now accepts it as an attribute. Null or an empty string
clears it. mobile-ui's menus draw it (NativePHP/mobile-ui#228). Core's
own top-bar buttons and menus don't draw it yet.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 subtitle: a second, smaller line under the label. The devnull app wants it for its Post as menu, where "Simon (@simon-hamp)" wraps onto two lines. With this the row reads "Simon" with "@simon-hamp" underneath.This is stacked on #224 (menu row pictures and ticks), because it touches the same row renderers. Merge that first, or retarget this to
mainonce it's in.It depends on NativePHP/mobile-air#740, which adds
NavAction::subtitle()to core. Apps set it like any other row option:The renderers read the
subtitleprop, so without #740 nothing breaks; there's just no way to set it short of->toElement()->setProp('subtitle', ...). An earlier version of this PR had aMenuItem::subtitle()helper to work around the missing method. That's gone now.iOS.
NativeUIMenuItemputs the label, then the subtitle, then the picture or icon straight into the row's Button (or Toggle, for a ticked row). A SwiftUIMenudraws the secondTextas the row's subtitle (it'sUIAction.subtitleunderneath), for plain, icon, picture and checked rows alike. VoiceOver reads the label and then the subtitle.The rows used to wrap the text in a
Labelwith the picture or icon as its icon. A menu drops a secondTextinside aLabel's title, which is why the first version of this PR showed no subtitle on a phone. Without a subtitle the flat version draws the same row as theLabeldid. I checked all of this in a small SwiftUI app on an iOS 26.2 simulator, with and without subtitles, including a destructive row.Android.
renderAttachedMenuItemputs the label and subtitle in aColumn, the subtitle inbodyMediumandonSurfaceVariant. TalkBack reads both as part of the row. Rows without a subtitle are drawn as before.What to check: iOS picks the menu's width, so a long subtitle may still truncate. I haven't run the fixed version on a device yet.
Checks: Pest 536 passed against core at mobile-air#740 (
MenuItemSubtitleTest).swiftc -typecheck -wmoover mobile-air's NativeRender plusresources/iosgives the same 152 errors as #224's head, and a canary in the new code was caught. Kotlin: compilingContainerRenderers.ktintests/android(core's other files missing) gives the same 24 errors as #224's head, none in the new lines.🤖 Generated with Claude Code