-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA][Cleanup] Always use constants for screen names #32430
[No QA][Cleanup] Always use constants for screen names #32430
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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