Migrate Button ro ButtonComposed (batch 10) - #98861
Conversation
Follow-up cleanup after the 9 batch PRs: migrates 44 leftover files that appeared after the original 282-file census, plus BaseWidgetItem's buttonProps public API and its 14 callers. Adds accessibilityLabel support to ButtonIcon to preserve NumberWithSymbolForm's icon labels.
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@ZhenjaHorbach should be ready for a review, I'll change that buttonProps -> buttonVariant part later, after Vit's opinion |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@Guccio163 |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
…-fork into Guccio163/button/afterBatchesCleanup
Every real caller only ever spread buttonProps to set a single variant, so replace the generic Partial<ButtonProps> prop-spread with a typed buttonVariant prop instead.
|
@ZhenjaHorbach I just applied changes proposed in this comment |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-08-20.11.44.54.movAndroid: mWeb Chrome2026-08-20.11.37.23.moviOS: HybridApp2026-08-20.11.40.56.moviOS: mWeb Safari2026-08-20.11.39.19.movMacOS: Chrome / Safari2026-08-20.11.33.36.mov |
|
Overall, the changes look good 2026-08-20.11.30.44.mov |
|
@ZhenjaHorbach thanks, I'll do it soon; BTW since we are targeting button wrappers to use |
|
Yeah |
@ZhenjaHorbach I can't measure this Button's horizontal paddings on staging/prod because I don't have Concierge pass, but I checked that dev correctly applies styles
In default size (medium) it should have 12px on the left and 16px on the right - Left is from paddingHorizontal 12px, Right is from paddingHorizontal 12px+4px ButtonText paddingHorizontal, gap is fine too. I verified that BookCallButton doesn't receive custom styles anywhere, so it should be like it's now 👍 |
I think it's a bit of a different case Now on dev, we have 12 horizontal padding And n staging, we have 16 horizontal padding But now checked different places, and 12 px is okay |
mountiny
left a comment
There was a problem hiding this comment.
@ZhenjaHorbach @Guccio163 I think we should make sure it matches production
I suppose now it matches the similar buttons that have the same paddings @Expensify/design And we have similar buttons where we also use 12
|
|
When using icon + text it should be asymmetric 12px on icon's side and 16px on text's, just as on the last screenshot (right 4px coming from Text component). On your screenshot with avatar instead of icon, text doesn't add said padding, because there is normal Text instead of Button.Text used (custom children). In this scenario I would fix text-side padding to be 16px and either treat Avatar like a normal icon and leave the 12px or (since it looks like it's bigger than medium icon) also bump avatar-side padding to the 16px, just like bigger icons (in bigger buttons) receive. WDYT @ZhenjaHorbach @mountiny ? |
In my opinion, the avatar should use the same styles as the icon |
|
Agree, I would think we'd just reuse the same styles for simplicity's sake. |
Good call, I think I would go with that logic too. Overall good catch though, since text-side padding is 100% wrong |
Thanks @shawnborton, I'll fix it right away and we'll see if it looks right 👌 |
|
Looks good 👍 |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|











Explanation of Change
This is an extra, 10th batch in the ongoing effort to migrate all direct usages (import Button from '@components/Button') to the new composed ButtonComposed, allowing the old Button component to eventually be deprecated. This PR migrates 44 leftover files that appeared after the original 282-file census, plus BaseWidgetItem's buttonProps public API and its 14 callers. Adds accessibilityLabel support to ButtonIcon to preserve NumberWithSymbolForm's icon labels.
Moreover this PR changes BaseWidgetItem API proposed in this comment, from buttonProps to buttonVariant as only
buttonVarianthas been passed in this prop.Fixed Issues
$ #98878
PROPOSAL:
Tests
For every migrated button, verify that behaviour is unchanged from before the migration:
success= green,danger= red, default = grey.isLoading).pressOnEnter, pressing Enter still submits exactly once.ref— where arefis forwarded, its consumer still works: popovers open anchored to the button, not pinned to a window corner.Below are test steps for testing a representative migrated Button use-case: BaseWidgetItem:
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-08-18.at.14.16.18.mov