-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[TS migration] Migrate 'useThrottledButtonState.js' hook to TypeScript #28920
[TS migration] Migrate 'useThrottledButtonState.js' hook to TypeScript #28920
Conversation
* @returns {Array} | ||
*/ | ||
export default function useThrottledButtonState() { | ||
type ThrottledButtonState = [boolean, () => void]; |
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.
type ThrottledButtonState = [boolean, () => void]; | |
type ThrottledButtonState = [boolean, Dispatch<SetStateAction<boolean>>]; |
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.
@kubabutkiewicz when I apply your suggestion, I'm getting this tooltip:
Which is expecting a boolean value to be passed to that function. In reality though, this function doesn't accept any params. LMK your thoughts.
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.
ok, I thought we are returning the state setter from this hook but we are returning function which is just setting state to false
so nvm. LGTM
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.
LGMT
Reviewer Checklist
Screenshots/VideosWeb01_MacOS_Chrome.mp4Mobile Web - Chrome02_Android_Chrome.mp4Mobile Web - Safari03_iOS_Safari.mp4Desktop04_MacOS_Desktop.mp4iOS05_iOS_Native.mp4Android06_Android_Native.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.
LGTM.
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24936 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.80-0 🚀
|
@srikarparsi Not sure we can QA at our end. Is this internal? |
@MaciejSWM Not sure we can QA at our end. Is this internal? |
@kavimuru It's used by PressableWithDelayToggle so you can test it by:
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.80-3 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.81-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
Details
Fixed Issues
$ #24936
PROPOSAL:
Tests
shouldShowDownloadButton = false,
totrue
inHeaderInBackButton/index.js
. This will show a Download icon in the header, e.g. when you openSend message
screen. Click that icon. Icon should highlight and return back to normal thanks touseThrottledButtonState
after1800ms
. This will confirm that nothing breaks.Offline tests
Tests
QA Steps
Tests
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)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
Web
Screen.Recording.2023-10-05.at.17.01.48.mov
Mobile Web - Chrome
Screen.Recording.2023-10-05.at.17.13.17.mov
Mobile Web - Safari
Screen.Recording.2023-10-09.at.10.39.34.mov
Desktop
Screen.Recording.2023-10-05.at.17.02.09.mov
iOS
Screen.Recording.2023-10-09.at.10.39.03.mov
Android
Screen.Recording.2023-10-05.at.17.11.18.mov