fix: delay in displaying comment length limit error#33848
Conversation
|
@abdulrahuman5196 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] |
| ); | ||
|
|
||
| const validateCommentMaxLength = useMemo(() => _.debounce(handleValueChange, 1500), [handleValueChange]); | ||
| const validateCommentMaxLength = useMemo(() => _.debounce(handleValueChange, 500, {leading: true}), [handleValueChange]); |
There was a problem hiding this comment.
@aswin-s I don't think we need to reduce the timeout. Any reason to do it?
There was a problem hiding this comment.
1.5 seconds feels a bit too much in my testing. It waits for 1.5 seconds after last invocation to trigger the check. 500ms felt like a safe middle ground. The issue gets fixed even without the change in timing.
There was a problem hiding this comment.
@abdulrahuman5196 Do you think it is safe to revert the timeout change?
There was a problem hiding this comment.
I think we should only do the computation once the user stops typing and gives a pause, since it could add computational overhead to compute the error sooner. That's why I assume we kept it at 1500 ms. I think for this PR, it should be fine to leave it as it is.
There was a problem hiding this comment.
@abdulrahuman5196 I've reverted the timeout change.
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-01-03.at.3.54.28.PM.mp4Android: mWeb ChromeScreen.Recording.2024-01-03.at.4.03.59.PM.mp4iOS: NativeScreen.Recording.2024-01-03.at.3.45.07.PM.mp4iOS: mWeb SafariScreen.Recording.2024-01-03.at.3.52.30.PM.mp4MacOS: Chrome / SafariScreen.Recording.2024-01-03.at.3.40.24.PM.mp4MacOS: DesktopScreen.Recording.2024-01-03.at.3.42.52.PM.mp4 |
abdulrahuman5196
left a comment
There was a problem hiding this comment.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @tylerkaraszewski
🎀 👀 🎀
C+ Reviewed
|
✋ 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/tylerkaraszewski in version: 1.4.22-0 🚀
|
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 1.4.22-0 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.22-6 🚀
|
Details
This PR fixes an issue where the error message for exceeding character limit in composer was delayed on first render.
Fixed Issues
$ #33612
PROPOSAL: #33612 (comment)
Tests
The maximum comment length is 10,000 charactersis only shown without any delay.Offline tests
The maximum comment length is 10,000 charactersis only shown without any delay.QA Steps
The maximum comment length is 10,000 charactersis only shown without any delay.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(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.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
android.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4