Repository navigation
Show the environment badge in the top bar again - #106695
Conversation
|
@mananjadhav 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] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
cc @Expensify/design - I wonder if we should just put these little badges in line with the logo on web, and then inline with the page header on mobile? Rather than right below. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15b44112df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const error = environment !== CONST.ENVIRONMENT.STAGING && environment !== CONST.ENVIRONMENT.ADHOC; | ||
|
|
||
| const badgeEnvironmentStyle = StyleUtils.getEnvironmentBadgeStyle(success, error, adhoc); | ||
| const text = isInternalTestBuild() ? `v${pkg.version} PR:${CONST.PULL_REQUEST_NUMBER}` : ENVIRONMENT_SHORT_FORM[environment]; |
There was a problem hiding this comment.
Let the ad-hoc label expand to its content
On internal ad-hoc PR builds, this branch produces a long label such as v9.5.37-0 PR:106694, but the badge still receives styles.headerEnvBadge, which fixes its width at 22 px, while Badge renders the text with numberOfLines={1}. The version and PR number will therefore be truncated or overflow the small colored background, making the identifying information unreadable; use a content-sized style for internal-test builds instead of the fixed-width short-form badge.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yeah, the fixed width was there since before the badge was removed. Removed it in b08e9da, environmentBadge already has minWidth: 22 so the short labels look the same and the ad hoc one grows to fit.
That's where my head was going as well. |
|
@shawnborton not sure exactly what you mean, can you show me? Also does it matter much if this is only seen internally? No real customer uses dev/staging/adhoc builds. |
|
I see, want me to update it to match that? |
|
Yes, if you don't mind! I think it will feel a little nicer and let the designers sleep at night 🤣 |
|
ok pushed. @shawnborton please review. |
mananjadhav
left a comment
There was a problem hiding this comment.
One small comment on the style and also if we can add some test. The codecov job fails.
| left: -8, | ||
| height: 12, | ||
| width: 22, | ||
| paddingLeft: 4, |
There was a problem hiding this comment.
paddingLeft and paddingRight of 4 never show. environmentBadge is applied after this and sets paddingHorizontal: 7. Can we drop this then?
There was a problem hiding this comment.
I think it is the other way around, in RN (and react-native-web) the longhand paddingLeft/paddingRight win over paddingHorizontal no matter the order, so the 4 is what shows and the paddingHorizontal: 7 in environmentBadge is the one that never applies. The DEV badge renders 22px wide (its minWidth), with 7 it would be wider than that.
|
@shawnborton check it out, I think I did what you wanted? |
|
Nice, can't hurt to just send it and we can always adjust later. |
This comment has been minimized.
This comment has been minimized.
|
@iwiznia @shawnborton Don't you think for
|
trjExpensify
left a comment
There was a problem hiding this comment.
Customers* are going to love it! 👍
*Ionatan.
lol yeah, it's mostly so it's easier to know if a screenshot/video was taken from prod or staging. |
|
@shawnborton please check it out and merge if you are happy |
|
@dubielzyk-expensify I LOVE that blue app icon! We should totally make that the home screen icon for test flights too! Anyways, going to merge this as-is but follow ups are welcome 🤗 |
|
🚧 shawnborton 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! 🧪🧪
|
|
@iwiznia this isn't going to work so well with the flat nav UI:
Can you create a follow up to fix that? Not sure where is best to put it, or maybe we don't need all of that info and we an just say "Adhoc" like we used to? |
|
I also think we should have a toggle in the dev settings menu to hide the environment badge, this way if you are taking screenshots, it won't be there. |
|
Yeah I wonder if we can just say Adhoc and then have those values revealed on hover (alt tag or tooltip)? |
Daaaaang I love this too. Obviously it's going away with flat nav, but I 100% agree if there's an opportunity to use this internally we should haha. |
|
🚀 Deployed to staging by https://github.com/shawnborton in version: 9.5.40-0 🚀
|
|
No help site update needed — this PR only restores an environment badge in non-production builds and does not change any customer-facing workflow or make existing help content incorrect. |
|
@shawnborton @dubielzyk-expensify sent the follow up here #107183 (shows |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.40-1 🚀
Bundle Size Analysis (Sentry): |









Explanation of Change
Brings back the environment badge (
DEV,STG,QA,ADHOC), so it's easy to tell you are not on production. Following the design mocks, it shows inline after the Expensify logo in the flat navigation bar, and inline after the top bar title everywhere else (narrow layout, and the wide icon bar used without the flat nav beta and on tablets). The component and its style helper are the same ones deleted in 827a3bb, with a label added for QA and withoutpressable, since itsonPressdid nothing.Fixed Issues
$ #106694
PROPOSAL:
Tests
DEVbadge shows inline after the Expensify logo and not next to the page titleDEVbadge shows inline after the top bar title (Home, Inbox, Spend, Insights, Workspaces, Account)flatNavbeta), verify theDEVbadge shows inline after the page titleWide, flat navigation bar:

Narrow:

Wide, icon bar (I forced

useShouldUseFlatNavigationBarto return false locally to check this one):Ad hoc internal test builds show
v<version> PR:<number>instead, so I temporarily forced that label locally to check the badge grows to fit it (the PR number is empty in dev, and the color is red because the environment is still dev):Offline tests
No
QA Steps
STGbadge shows inline after the Expensify logo (wide) or after the top bar title (narrow)PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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