Skip to content

[$250] Reports - The Add expense button in the create report empty state feels unnecessarily wide #82108

Closed

Description

@izarutskaya

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.17-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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):

Action Performed:

Prerequisites: Account with workspace

  1. Go to https://staging.new.expensify.com/
  2. Create empty report
  3. Go to Reports page > open empty report

Expected Result:

It could just hug the contents.

Actual Result:

The Add expense button feels unnecessarily wide.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Image Image

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @Valforte
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022021547886332387735
  • Upwork Job ID: 2021547886332387735
  • Last Price Increase: 2026-02-11

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 11, 2026
  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 11, 2026
  3. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 11, 2026
  4. melvin-bot commented on Feb 11, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)

  5. melvin-bot commented on Feb 11, 2026

    @melvin-bot

    Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  6. changed the title [-]Reports - The `Add expense` button in the create report empty state feels unnecessarily wide[/-] [+][$250] Reports - The `Add expense` button in the create report empty state feels unnecessarily wide[/+] on Feb 11, 2026
  7. melvin-bot commented on Feb 11, 2026

    @melvin-bot
  8. PiyushChandra17 commented on Feb 11, 2026

    @PiyushChandra17
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-02-11 11:54:31 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Reports - The Add expense button in the create report empty state feels unnecessarily wide

    What is the root cause of that problem?

    In EmptyStateComponent,

    The button is styled with styles.flex1, which causes it to expand to fill the available width. This is by design to support multiple buttons in a row (where flex1 distributes space evenly), but when there's only one button, it appears unnecessarily wide

    <View style={styles.flex1}>
    <EmptyStateComponent
    cardStyles={[styles.appBG]}
    cardContentStyles={[styles.pt5, styles.pb0]}
    headerMediaType={CONST.EMPTY_STATE_MEDIA.ANIMATION}
    headerMedia={LottieAnimations.GenericEmptyState}
    title={translate('search.moneyRequestReport.emptyStateTitle')}
    headerStyles={[styles.emptyStateMoneyRequestReport]}
    lottieWebViewStyles={styles.emptyStateFolderWebStyles}
    headerContentStyles={styles.emptyStateFolderWebStyles}
    minModalHeight={minModalHeight}
    buttons={
    canAddTransactionToReport
    ? [{buttonText: translate('iou.addExpense'), buttonAction: () => {}, success: true, isDisabled: false, dropDownOptions: addExpenseDropdownOptions}]
    : []
    }
    />
    </View>

    <View style={[styles.gap2, styles.mt5, !shouldUseNarrowLayout ? styles.flexRow : styles.flexColumn, styles.justifyContentCenter]}>
    {buttons?.map(({buttonText, buttonAction, success, icon, isDisabled, style, dropDownOptions}) =>
    dropDownOptions ? (
    <ButtonWithDropdownMenu
    key={buttonText}
    onPress={() => {}}
    shouldAlwaysShowDropdownMenu
    customText={buttonText}
    options={dropDownOptions}
    isSplitButton={false}
    style={[styles.flex1, style]}
    />
    ) : (
    <Button
    key={buttonText}
    success={success}
    onPress={buttonAction}
    text={buttonText}
    icon={icon}
    large
    isDisabled={isDisabled}
    style={[styles.flex1, style]}
    />
    ),
    )}
    </View>

    What changes do you think we should make in order to solve the problem?

    1. Only apply flex1 when there are multiple buttons - This would make single buttons auto-sized
    2. Add a max-width constraint for single buttons
    3. Center align single buttons with intrinsic width instead of stretching them

    What alternative solutions did you explore? (Optional)

    Result:

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  9. nkdengineer commented on Feb 11, 2026

    @nkdengineer
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The Add expense button feels unnecessarily wide.

    What is the root cause of that problem?

    The padding is small, so the button takes the full width

    cardContentStyles={[styles.pt5, styles.pb0]}

    <View style={[shouldUseNarrowLayout ? styles.p5 : styles.p8, cardContentStyles]}>

    What changes do you think we should make in order to solve the problem?

    Pass more padding to cardContentStyles. For example, styles.p10, we can adjust based on the suggestion from design team.

    cardContentStyles={[styles.pt5, styles.pb0, styles.p10]}
    

    cardContentStyles={[styles.pt5, styles.pb0]}

    Image

    What alternative solutions did you explore? (Optional)

    We can add more padding by passing style for button array here

    ? [{buttonText: translate('iou.addExpense'), buttonAction: () => {}, success: true, isDisabled: false, dropDownOptions: addExpenseDropdownOptions}]

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  10. yatin-italy commented on Feb 11, 2026

    @yatin-italy

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In the create-report empty state, the “Add expense” button stretches to full width and looks too wide, but it should size to its content.

    What is the root cause of that problem?

    In this implementation, src/components/EmptyStateComponent/index.tsx assumes every empty-state button should always use styles.flex1, and this forces buttons to expand to fill available width by default in the buttons?.map() rendering logic.

    What changes do you think we should make in order to solve the problem?

    Place of change: src/components/EmptyStateComponent/index.tsx (owner of empty-state layout).

    Behavior: Buttons size to their content unless the caller passes a style that overrides this (for example, style={styles.flex1} for full-width).

    Implementation: Remove the default styles.flex1 from both button branches in the buttons?.map() callback.

    Code changes:

    ButtonWithDropdownMenu (around line 124): change style={[styles.flex1, style]} to style={style}.

    Button (around line 134): change style={[styles.flex1, style]} to style={style}.

    Rationale:

    Fixing this in EmptyStateComponent keeps a single invariant for all empty states and avoids per-caller workarounds.

    The parent uses styles.justifyContentCenter, so removing flex1 still centers buttons.

    EmptyStateButton supports style, so callers that need full-width buttons can pass style={styles.flex1}.

    Risk and regression:

    Only the layout of empty-state buttons changes.

    Callers needing full-width buttons can pass style={styles.flex1}.

    Affected areas: all empty states that use EmptyStateComponent (Add Unreported Expense, workspace tags/categories/per diem, Expensify Card, Search, etc.). Most should benefit from content-sized buttons.

    What alternative solutions did you explore? (Optional)

    Fixing only in SearchMoneyRequestReportEmptyState (for example, passing style to override flex1) would be a caller-side workaround and would not improve other empty states.

    Conditionally applying flex1 based on button count would add complexity without clear benefit.

  11. webbygit commented on Feb 11, 2026

    @webbygit

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The "Add expense" button in the empty report state appears unnecessarily wide. The expected behavior is that the button should "hug the contents" rather than stretching across available space.

    What is the root cause of that problem?

    File: src/components/EmptyStateComponent/index.tsx
    Lines: 125 and 136

    The button components use styles.flex1 which causes them to expand to fill available width. While this is correct for multiple buttons (they should share space equally), a single button stretches unnecessarily.

    Current code:

    ButtonWithDropdownMenu (line 125):

    style={[styles.flex1, style]}

    Button (line 136):

    style={[styles.flex1, style]}

    What changes do you think we should make in order to solve the problem?

    Add styles.alignItemsCenter conditionally only for single buttons. This centers the button content while maintaining proper spacing behavior for multiple buttons.

    Implementation

    File: src/components/EmptyStateComponent/index.tsx

    Change line 125:

    style={[styles.flex1, style, buttons.length === 1 && styles.alignItemsCenter]}

    Change line 136:

    style={[styles.flex1, style, buttons.length === 1 && styles.alignItemsCenter]}

    Why This Works

    For single button: styles.alignItemsCenter centers content within flex container, making it appear compact
    For multiple buttons: No alignItemsCenter applied, so buttons expand to share available space equally

    This ensures:

    • Single button appears compact and centered
    • Multiple buttons continue to fill available space proportionally
    • Consistent behavior across both button types

    Result

    Single button: Appears compact and centered (hugs contents)
    Multiple buttons: Share space equally across full width
    All layouts: Works on both narrow and wide screens

    Image Image
  12. 38 remaining items

  13. melvin-bot commented on Apr 1, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @johncschuster, @Valforte, @webbygit, @shubham1206agra eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  14. shubham1206agra commented on Apr 6, 2026

    @shubham1206agra
    Contributor

    @mallenexpensify Can you handle payment here please? This is due immediately

  15. johncschuster commented on Apr 6, 2026

    @johncschuster
    Contributor

    Hi @shubham1206agra! I can help with this! I'm having a hard time finding the work associated with this. Can you help me? I'll get a payment summary going as soon as I've got that!

  16. shawnborton commented on Apr 6, 2026

    @shawnborton
    Contributor

    FWIW we ended up not having any work completed here because it was handled in an existing project/PR from another contributor.

  17. shubham1206agra commented on Apr 6, 2026

    @shubham1206agra
    Contributor

    @johncschuster I completed review in #83290 here but PR got closed due to another refactor made the same changes.

  18. mallenexpensify commented on Apr 7, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @webbygit paid $250 via Upwork
    Contributor+: @shubham1206agra due $250 via NewDot

    @webbygit please apply for the job then tag me in a post here so I can hire you.
    https://www.upwork.com/jobs/~022041527334143517526

    Our process states

    100% due to the contributor if they drafted a PR and requested a review.
    100% to C+ if they filled out the Reviewer Checklist and the completed checklist has tests in it.

  19. webbygit commented on Apr 7, 2026

    @webbygit
  20. mallenexpensify commented on Apr 7, 2026

    @mallenexpensify
    Contributor

    @webbygit can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022041527334143517526

    There were two applicants, I'm assuming your Vaibhav A. cuz you linked to the issue here.

  21. webbygit commented on Apr 7, 2026

    @webbygit

    @mallenexpensify Submitted.
    and yes that's me

  22. mallenexpensify commented on Apr 7, 2026

    @mallenexpensify
    Contributor

    @webbygit paid, summary updated above. Thx.

  23. JmillsExpensify commented on May 1, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @shubham1206agra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions