[No QA][Cleanup] Always use constants for screen names#32430
[No QA][Cleanup] Always use constants for screen names#32430roryabraham merged 21 commits intoExpensify:mainfrom
Conversation
|
@cubuspl42 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] |
Reviewer Checklist
Screenshots/VideosWebconstant-screen-names-web.mp4Mobile Web - Chromeconstant-screen-names-android-web-compressed.mp4Mobile Web - Safariconstant-screen-names-ios-web.mp4DesktopiOSconstant-screen-names-ios.mp4Androidconstant-screen-names-android-compressed.mp4 |
jakub-trzebiatowski
left a comment
There was a problem hiding this comment.
I carefully checked the whole diff, searching for manual mistakes, but found none. Looks good.
|
Take it away @roryabraham! |
|
ON HOLD: let’s wait for AppNavigator PR to be merged first |
|
AppNavigator PR merged, looks like this can come off HOLD |
roryabraham
left a comment
There was a problem hiding this comment.
LGTM. I'm also wondering if we can leverage TS to ensure that this pattern is followed, such that if you try to add a screen name without putting it in SCREENS.ts, or try to reference it elsewhere in the navigation stack without using the constant, then tsc will complain.
|
At the moment, lint and TypeScript checks are failing (just sayin') |
|
@cubuspl42 Working on it! |
@roryabraham While TypeScript can enforce type safety and ensure that a valid key from SCREENS.ts is used, it can't differentiate between a string literal and a constant with the same value (both are of type string). Therefore, it won't throw an error if a string literal matching a valid key name is used, instead of referencing the SCREENS constant. For such a rule where constants are always used instead of literals, Eslint rule could achieve this. However, there isn't a built-in rule for this use-case + I believe it would be quite complex. The easiest and a little naive approach is to enforce this with code review, this can be easily picked by any internal/C+ just by looking at the code. |
|
@cubuspl42 All yours again! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.4.11-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.11-25 🚀
|
Details
This PR cleans the usage of screen names throughout the App. Always use constants for screen names in E/App (from SCREENS.ts).
Fixed Issues
$ #32141
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.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
anroid.webm
Android: mWeb Chrome
a-web.webm
iOS: Native
ios.mp4
iOS: mWeb Safari
i-web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov