Repository navigation
Keep poll labels readable over their bars on Android - #184
Merged
Merged
Conversation
On Android a poll's results hid each option's label behind its share bar, so "Help and advice" read as "and advice" and an option with a big share showed no label at all. iOS was fine. The bar is an absolute layer written before the label so it sits behind it. iOS draws layers in the order they're written, but NativePHP's Android FlexContainer draws every absolute child after the flow ones, whatever the order (NativePHP/mobile-air#712). The label row is now a partial drawn twice: an invisible copy in the flow that gives the option its height, and the copy you see as an absolute layer after the bar, so it's on top on both platforms. The option's a11y-label still stands in for everything inside it, so screen readers read each option once. A test checks the order and that the two copies draw the same thing, so they can't drift apart. Fixes NativePHP#174.
shanesmithdev
force-pushed
the
fix-android-poll-bars
branch
from
November 18, 2026 13:30
f2efce5 to
9ff4476
Compare
Contributor
Author
|
FYI @simonhamp |
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.
Status: Ready for review. Not blocked.
Fixes #174.
On Android, a poll's results hid each option's label behind its share bar: "Help and advice" read as "and advice", and an option with a big share showed no label at all. iOS was fine.
Each option is a box with the bar as an
absolutelayer, written before the label so it sits behind it. iOS draws layers in the order they're written. Android doesn't: NativePHP'sFlexContainer(ComposeFlexLayout.kt) composes every flow child first and then every absolute child over them, whatever the order. So on Android the bar always covered the label.I have also reported this upstream as NativePHP/mobile-air#712. EDGE has no
z-*to override it, and 4.8.0 andmainbehave the same.What changed
poll-option-label, drawn twice:opacity-0) in the flow, which gives the option its height, as the label always dida11y-labelalready stands in for everything inside it (accessibilityElement(children: .ignore)on iOS,clearAndSetSemanticson Android), so VoiceOver and TalkBack still read each option once.poll-bar-*,poll-sizer-*,poll-label-*), and the existing poll tests usepoll-bar-*instead ofchildren[0].Each result option has a row, two texts, a spacer and, for your vote, an icon more than before. A poll has at most four options, so it's a few views per poll. Once mobile-air#712 is fixed, this can go back to a single label row.
Screenshots
Android was taken on a phone (a Samsung, since the Android emulator can't run the app on an Apple M4 Mac) and iOS on an iPhone 17 Pro simulator. Android shows the fix. iOS looks the same before and after, as it should.
Testing
php artisan test --compactforCommitCardTest,PollVoteTest,ComposerPollTest,ComposerPreviewTestandScheduleCommitTest: 46 passed.flex-shrinkoff only its label, makes it fail.8e785a0's related commits) with shares from 0% to 84%.