You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-10-13] [$175] Report Preview Buttons Are Not Split 50/50 #101797
Version Number: 9.4.91-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@shawnborton Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Navigate to a report that is displayed as a preview.
Locate the action buttons at the bottom of the report preview.
Observe the width and alignment of the buttons. (Submit and View)
Expected Result:
The two buttons should each occupy 50% of the available width, providing an evenly split layout.
Actual Result:
The green button expands to fill the available space, while the other button only takes up the width of its content and appears to hug the text.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
The two buttons are laid out in ReportPreviewActionButton.tsx:64-69, and the row is asymmetric: the primary button is wrapped in a View carrying styles.flex1, while viewButton is dropped into the same flexRow bare.
styles.flex1 resolves to flex-grow: 1; flex-shrink: 1; flex-basis: 0%, so the primary button claims all free space. The "View" button, built at ReportPreviewActionButton.tsx:25-32 with no style prop, falls back to flex: 0 1 auto and sizes to its text. Nothing else in the row constrains width — styles.reportPreviewActionRow only sets height: 40, and buttonMaxWidth only caps the row.
This is why the bug appears only when a primary action exists. The no-primary branch at ReportPreviewActionButton.tsx:61 uses a column container, so "View" stretches full width there and looks correct.
What changes do you think we should make in order to solve the problem?
Give the "View" button the same flex treatment as the primary one, in src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewActionButton.tsx: pass styles.flex1 as the style prop on the Button at line 26. Both children then resolve to flex: 1 1 0% and each gets (rowWidth − 8px gap) / 2.
style is the correct prop here — Button forwards it to the outermost OpacityView (Button.tsx:150-155), which is the flex child. Do not change the no-primary branch at line 61.
Supporting detail
Canonical 50/50 pattern already used elsewhere — a flexRow + gap2 container where every child Button carries style={styles.flex1} itself:
Why the primary button keeps its wrapper View.AnimatedSubmitButton accepts no style or wrapperStyle prop at all (AnimatedSubmitButton/index.tsx:24-46), so it only fills width because the parent View stretches it. Removing that wrapper to match the canonical pattern would break Submit and Approve.
Alternative considered: wrap viewButton in its own <View style={[styles.flex1]}>. Same visual result and symmetric with the primary, but it adds a node where the Button already exposes a working style prop.
Alternative rejected: setting a fixed width: '50%' on both. That fights the existing gap: 8 and overflows the row.
Side effect to check in QA: the primary button drops from roughly 75% to 50% of the row, so long labels such as "Pay $1,234.56 elsewhere" may now truncate — Button.Text defaults to numberOfLines={1} (ButtonText.tsx:23).
Not reproduced in a live session — the conclusion rests on reading the source plus the screenshots in the report, which match the predicted layout exactly.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101797) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
The fix gives the "View" button styles.flex1, matching the primary button, so the two buttons now split the row 50/50. I also added a unit test for the even split.
Verification
Web (dev NewDot): Approve is about 146px and View about 145px of a 301px row. Clicking View still opens the report.
Passed: the targeted Jest test (9/9), typecheck, lint-changed, and spell-changed.
Not run here: the React Compiler check, full npm test, and the Storybook smoke test.
Heads-up for QA: the primary button shrinks from about 75% to 50% of the row, so long labels (for example, "Pay $1,234.56 elsewhere") may truncate.
Deploy Blocker #103169 was identified to be related to this PR.
@parasharrajat this issue and/or PR mention a deploy blocker or a regression. Before the payment date, post one of the three options in step 20 of the C+ doc: it was a regression, it was not, or you did not review the offending PR. If you don't post, the default is to reduce payment.
Activity
MelvinBot commentedon Sep 21, 2026
Proposal
What is the root cause of that problem?
The two buttons are laid out in
ReportPreviewActionButton.tsx:64-69, and the row is asymmetric: the primary button is wrapped in aViewcarryingstyles.flex1, whileviewButtonis dropped into the sameflexRowbare.styles.flex1resolves toflex-grow: 1; flex-shrink: 1; flex-basis: 0%, so the primary button claims all free space. The "View" button, built atReportPreviewActionButton.tsx:25-32with nostyleprop, falls back toflex: 0 1 autoand sizes to its text. Nothing else in the row constrains width —styles.reportPreviewActionRowonly setsheight: 40, andbuttonMaxWidthonly caps the row.This is why the bug appears only when a primary action exists. The no-primary branch at
ReportPreviewActionButton.tsx:61uses a column container, so "View" stretches full width there and looks correct.Introduced by Navigate to the clicked expense in a multi-expense report preview (v2) (merged 2026-09-07), which added the second button to a row that previously held only one.
What changes do you think we should make in order to solve the problem?
Give the "View" button the same flex treatment as the primary one, in
src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewActionButton.tsx: passstyles.flex1as thestyleprop on theButtonat line 26. Both children then resolve toflex: 1 1 0%and each gets(rowWidth − 8px gap) / 2.styleis the correct prop here —Buttonforwards it to the outermostOpacityView(Button.tsx:150-155), which is the flex child. Do not change the no-primary branch at line 61.Supporting detail
Canonical 50/50 pattern already used elsewhere — a
flexRow+gap2container where every childButtoncarriesstyle={styles.flex1}itself:AuthorizeTransactionActions.tsx:26-48AddCardToDigitalWalletPage.tsx:194-211FilterDropdowns/ActionButtons.tsx:24-44Why the primary button keeps its wrapper
View.AnimatedSubmitButtonaccepts nostyleorwrapperStyleprop at all (AnimatedSubmitButton/index.tsx:24-46), so it only fills width because the parentViewstretches it. Removing that wrapper to match the canonical pattern would break Submit and Approve.Alternative considered: wrap
viewButtonin its own<View style={[styles.flex1]}>. Same visual result and symmetric with the primary, but it adds a node where theButtonalready exposes a workingstyleprop.Alternative rejected: setting a fixed
width: '50%'on both. That fights the existinggap: 8and overflows the row.Side effect to check in QA: the primary button drops from roughly 75% to 50% of the row, so long labels such as "Pay $1,234.56 elsewhere" may now truncate —
Button.Textdefaults tonumberOfLines={1}(ButtonText.tsx:23).Tests:
tests/ui/components/ReportPreviewActionButtonTest.tsx:127-137only inspects the outer container, so it will not catch this. Worth extending it to assert both children carryflex1.Not reproduced in a live session — the conclusion rests on reading the source plus the screenshots in the report, which match the predicted layout exactly.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101797)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)melvin-bot commentedon Sep 21, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
shawnborton commentedon Sep 21, 2026
Any thoughts on this one @wildan-m ?
melvin-bot commentedon Sep 24, 2026
@parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
parasharrajat commentedon Sep 25, 2026
@shawnborton Do you want me to go ahead with the fix?
parasharrajat commentedon Sep 26, 2026
@MelvinBot implement this #101797 (comment)
MelvinBot commentedon Sep 26, 2026
🤖 Draft PR created: Split report preview action buttons evenly
Please mark it as "Ready for review" when it is ready for review.
The fix gives the "View" button
styles.flex1, matching the primary button, so the two buttons now split the row 50/50. I also added a unit test for the even split.Verification
typecheck,lint-changed, andspell-changed.npm test, and the Storybook smoke test.Heads-up for QA: the primary button shrinks from about 75% to 50% of the row, so long labels (for example, "Pay $1,234.56 elsewhere") may truncate.
22 remaining items
melvin-bot commentedon Oct 12, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 12, 2026
Payment Summary
Resolving PRs:
Split report preview action buttons evenly #102349
Reviewer: @parasharrajat owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 15, 2026
@parasharrajat this issue and/or PR mention a deploy blocker or a regression. Before the payment date, post one of the three options in step 20 of the C+ doc: it was a regression, it was not, or you did not review the offending PR. If you don't post, the default is to reduce payment.
parasharrajat commentedon Oct 15, 2026
it was a regression.
mallenexpensify commentedon Oct 16, 2026
Payment Summary
Contributor+: @parasharrajat due $100 via NewDot