Skip to content

Update badge styles#82210

Merged
puneetlath merged 44 commits intoExpensify:mainfrom
abzokhattab:refactor-badge-condensed-strong-variants
Mar 4, 2026
Merged

Update badge styles#82210
puneetlath merged 44 commits intoExpensify:mainfrom
abzokhattab:refactor-badge-condensed-strong-variants

Conversation

@abzokhattab
Copy link
Contributor

@abzokhattab abzokhattab commented Feb 12, 2026

Explanation of Change

  • Added isStrong and isCondensed props to Badge component
  • Introduced badge theme colors for backgrounds and text (light + dark)
  • Updated default badge to use filled background with rounded rectangle corners (8px regular, 6px condensed)
  • Report counters use Success style (regular size), FreeTrial badge uses condensed Success
  • Paid/Done action badges use report status colors
  • Badge sizes match Figma: regular 24px, condensed 16px

Fixed Issues

$ #81993
PROPOSAL:

Tests

  1. Create a new workspace from the "+" FAB or Workspaces page
  2. Validate the following badges
    • Workspaces page -> "Default" badge (gray, default style) on the workspace row
    • Workspace Settings > Invoices -> $0.00 badge (default style)
    • Workspace Settings > Accounting -> "Offer available!" badge (success, outlined - green bg with dark green text)
  3. Go to Workspace and enable Collect/Control plan
  4. Validate the following badges
    • Account Settings > Subscription -> "Trial: X days left!" badge (success, condensed)
    • Inbox LHN -> FreeTrial badge on the onboarding Concierge chat row (success, condensed)
    • Reports LHN -> Todo section appears (Submit, Approve, Pay, Export) - but with 0 counts, badges show empty string (no visible badge text)
  5. Submit an expense request to generate reports
  6. Validate the following badges
    • Reports LHN > Todo counters -> e.g. "Approve 1", "Pay 1" (success badges)
  7. Approve and pay reports to trigger status changes
  8. Validate the following badge
    • ActionCell -> "Paid" badge (report status colors)
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-02-22.at.22.40.42.mov
Android: mWeb Chrome
Screen.Recording.2026-02-22.at.22.43.33.mov
iOS: Native
Screen.Recording.2026-02-22.at.22.31.53.mov
iOS: mWeb Safari
Screen.Recording.2026-02-22.at.22.45.33.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-22.at.22.10.37.mov
image

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/components/Badge.tsx 100.00% <100.00%> (ø)
src/components/Domain/DomainsListRow.tsx 94.11% <100.00%> (+0.36%) ⬆️
src/components/ParentNavigationSubtitle.tsx 76.66% <ø> (ø)
...ectionListWithSections/Search/ActionCell/index.tsx 91.66% <ø> (ø)
...WithSections/Search/WithdrawalIDListItemHeader.tsx 0.00% <ø> (ø)
src/components/StatusBadge.tsx 100.00% <100.00%> (ø)
src/hooks/useSearchTypeMenu.tsx 70.12% <ø> (+70.12%) ⬆️
src/pages/Search/SearchTypeMenu.tsx 0.00% <ø> (ø)
src/pages/settings/InitialSettingsPage.tsx 0.00% <ø> (ø)
src/pages/workspace/WorkspacesListRow.tsx 98.21% <ø> (ø)
... and 17 more
... and 293 files with indirect coverage changes

@github-actions
Copy link
Contributor

🚧 @shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@shawnborton
Copy link
Contributor

Do you want me to start reviewing this yet? I see a lot of inconsistencies so far. Like we aren't using rounded border or bold text here:
CleanShot 2026-02-12 at 09 18 35@2x

And this badge isn't updated here:
CleanShot 2026-02-12 at 09 19 19@2x

Or here:
CleanShot 2026-02-12 at 09 19 28@2x

Or here:
CleanShot 2026-02-12 at 09 19 38@2x

@abzokhattab
Copy link
Contributor Author

@shawnborton yeah its still not ready for review. Thanks for the review.. i am covering all cases

@abzokhattab
Copy link
Contributor Author

update: i tackled most of the issues ... doing retesting

@shawnborton
Copy link
Contributor

Sounds good, let us know when you want us to do another adhoc build.

@abzokhattab abzokhattab changed the title Update badge styles [WIP] Update badge styles Feb 17, 2026
@abzokhattab
Copy link
Contributor Author

feel free to create another build hoc ... i have covered the mentioned cases here are the results so far:

Web Screenshots Screenshot 2026-02-18 at 00 55 54 Screenshot 2026-02-18 at 00 56 09 Screenshot 2026-02-18 at 00 56 55 Screenshot 2026-02-18 at 00 57 47 Screenshot 2026-02-18 at 00 58 06 Screenshot 2026-02-18 at 00 58 33 Screenshot 2026-02-18 at 01 01 42

@shawnborton
Copy link
Contributor

Hmm this doesn't look correct:
CleanShot 2026-02-18 at 07 55 43@2x

It should map to the new "Success" badge style here:
CleanShot 2026-02-18 at 07 56 10@2x

@shawnborton
Copy link
Contributor

Same thing here:
CleanShot 2026-02-18 at 07 56 27@2x

That badge style is not updated either...

@abzokhattab
Copy link
Contributor Author

abzokhattab commented Feb 19, 2026

@shawnborton For the paid tag shown in the action column in reports ... how should it look like

this is how it looks like in staging
image

vs current branch
image

but i want to double check as i dont feel confident about how it looks what do u think

@shawnborton
Copy link
Contributor

For that one, let's update it to use "Success with Icon":
CleanShot 2026-02-19 at 06 56 14@2x

@shawnborton
Copy link
Contributor

(also that should say 16px tall, not 20px tall - sorry about that!)

@github-actions
Copy link
Contributor

🚧 @shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #82210.

Android 🤖 iOS 🍎
❌ FAILED ❌ https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-57760b6-73d80f5-bbd60afc133cc4d899d6fd0e3734809d4f307068/index.html
The QR code can't be generated, because the Android build failed iOS
Web 🕸️
https://82210.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

@shawnborton
Copy link
Contributor

Some minor comments to address in the meantime... this is my fault, but let's use the default button color as the default badge color, right now I think we have them using rowHover which was my fault:
CleanShot 2026-02-19 at 07 58 02@2x

But then when the badge is indeed inside of an "active" LHN row, let's make the button use rowHover, like so:
CleanShot 2026-02-19 at 07 58 56@2x

@shawnborton
Copy link
Contributor

Something happened with the alignment of the workspaces table:
CleanShot 2026-02-19 at 08 00 03@2x

@shawnborton
Copy link
Contributor

The text color of the Success badge is incorrect:
CleanShot 2026-02-19 at 08 02 10@2x

From Figma, it should match the Paid badges we use:
CleanShot 2026-02-19 at 08 02 28@2x

@abzokhattab
Copy link
Contributor Author

Thanks for the feedback ... covering that now

<Badge
text={reportStatus}
isCondensed
badgeStyles={[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you end up changing this?

error?: boolean;

/** Whether badge uses strong (filled) style instead of outlined */
isStrong?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strong to me indicates bold. Why not isFilled if it's determining whether it is filled or not?

badgeSuccess?: boolean;

/** Whether the badge should use strong (filled) variant */
badgeStrong?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a bool, I think it should be isBadgeStrong. Also, same comment as above, isBadgeFilled makes more sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named it strong to align with the design terminology

the design call these variants "Success Strong" and "Danger Strong". As for the is prefix, I kept it consistent with the existing boolean props on Badge and MenuItem (success, error, pressable) which don't use is either.

should we still change it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'm fine leaving the strong ones then. I still think we should use correct nomenclature for booleans though. I think our past-selves did it wrong by not using proper naming for those props.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

badgeStrong?: boolean;

/** Whether the badge should use condensed (smaller) sizing */
badgeCondensed?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
badgeCondensed?: boolean;
isBadgeCondensed?: boolean;


sectionItems.push({
badgeText: getItemBadgeText(item.key, reportCounts),
badgeSuccess: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use is if boolean.

interactive
title={translate(item.translationPath)}
badgeStyle={styles.todoBadge}
badgeSuccess
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use is if boolean.

Comment on lines +92 to +94
badgeSuccess?: boolean;
badgeStrong?: boolean;
badgeCondensed?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use is if boolean. Also, same comment as above about strong.

The same Badge configuration (isCondensed, ml0, borderNone, custom background/text color)
was duplicated across ParentNavigationSubtitle, MoneyRequestReportPreviewContent,
StatusCell, and WithdrawalIDListItemHeader. Extract into a reusable StatusBadge wrapper.
puneetlath
puneetlath previously approved these changes Mar 3, 2026
@puneetlath
Copy link
Contributor

@abzokhattab typecheck failing.

@abzokhattab
Copy link
Contributor Author

yeah its unrelated to the changes ... we can wait until it gets fixed on main

@abzokhattab
Copy link
Contributor Author

there we go @puneetlath

@puneetlath
Copy link
Contributor

Looks like there are conflicts now.

@abzokhattab
Copy link
Contributor Author

done

@puneetlath puneetlath merged commit 273f278 into Expensify:main Mar 4, 2026
28 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🚧 @puneetlath has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2026

🚀 Deployed to staging by https://github.com/puneetlath in version: 9.3.32-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@mitarachim
Copy link

Deploy Blocker #84360 was identified to be related to this PR.

abzokhattab added a commit to abzokhattab/App that referenced this pull request Mar 6, 2026
- Add isHighlighted prop to MemberRightIcon to apply badgeDefaultActive
  style when the parent row is selected, preventing the badge from
  blending into the activeComponentBG highlight
- Map DONE action to reportStatusBadge.closed in BadgeActionCell so the
  Done action badge matches the Done status badge color (pink)
@abzokhattab abzokhattab mentioned this pull request Mar 6, 2026
51 tasks
abzokhattab added a commit to abzokhattab/App that referenced this pull request Mar 6, 2026
- Add ListItemFocusContext so InviteMemberListItem can propagate
  isFocused to rightElement children. MemberRightIcon consumes this
  context to apply badgeDefaultActive when the row is focused,
  preventing the badge from blending into the activeComponentBG
  highlight.
- Map DONE action to reportStatusBadge.closed in BadgeActionCell so the
  Done action badge matches the Done status badge color (pink).
@OSBotify OSBotify mentioned this pull request Mar 6, 2026
7 tasks
@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2026

🚀 Deployed to production by https://github.com/blimpich in version: 9.3.32-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants