-
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
perf: optimise transition on Desktop when click on start chat #33055
perf: optimise transition on Desktop when click on start chat #33055
Conversation
Since we are only using role property from the element, so it sounds better to store only the role property in the hook.
Doing so, re-render won't render the parent Button component
…y-App into hur/perf/desktop-start-chat-transition-lag
export default function useActiveElement() { | ||
const [active, setActive] = useState(document.activeElement); | ||
export default function useActiveElementRole() { | ||
const activeRoleRef = useRef(document.activeElement.role); |
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 have used ref here deliberately, since the role prop is being used to pass to the config in Button
and used in BaseSelectionList
for disabling enter shortcut.
I have tested it and it looks okay to me, but I will still want to test this thoroughly, so if the reviewer can help me state out the steps on how to test this thoroughly. 👍
@eVoloshchak 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.
Generating an AdHoc build so we can test a signed build.
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@Julesssss Can you tell why Desktop build is failing? OR is there a way I can test it on my local? I tried running |
Desktop build have been failing due to a github Action issue, maybe thats why 🤷 I'll re-run it now |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
…y-App into hur/perf/desktop-start-chat-transition-lag
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.
There's a bug on all platforms, skeleton UI is shown instead of contacts indefinitely. This is a conflict with latest changes from main, since these builds work correctly
Screen.Recording.2023-12-30.at.19.47.15.mov
@eVoloshchak is this a bug on this PR or on main already? |
@hurali97, only on this PR, |
@eVoloshchak Thanks, I will take a look at this and probably update by Monday, since we are off tomorrow. Just a quick question, as things stand the transition issue is fixed in this PR but we have this infinite loader issue now? |
…y-App into hur/perf/desktop-start-chat-transition-lag
@eVoloshchak The issue is now fixed. VE.mp4 |
@hurali97, awesome, works for me too |
…y-App into hur/perf/desktop-start-chat-transition-lag
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-01-10.at.00.14.13.movAndroid: mWeb ChromeScreen.Recording.2024-01-09.at.23.33.38.moviOS: NativeScreen.Recording.2024-01-09.at.23.36.59.moviOS: mWeb SafariScreen.Recording.2024-01-09.at.23.35.36.movMacOS: Chrome / SafariScreen.Recording.2024-01-09.at.23.32.42.movMacOS: DesktopScreen.Recording.2024-01-09.at.23.41.30.mov |
@hurali97, looking good, but missing test steps for the QA
|
…y-App into hur/perf/desktop-start-chat-transition-lag
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. |
[shouldDisableEnterShortcut], | ||
); | ||
|
||
useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, keyboardShortcutCallback, config); |
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.
Seems like regression came from this change.
Let's try to fix this before being deploy blocker.
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.
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, app deployed already and now this is deploy blocker.
I can do quick review if needed.
cc: @Julesssss
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.4.24-4 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.24-8 🚀
|
Details
This fixes the transition lag on Desktop, when user clicks on start chat.
Fixed Issues
$ #28916
PROPOSAL: #28916 (comment)
Tests
Open the desktop app
Click FAB button
Select Send message
Verify that the modal opens smoothly, without any lag or freezes
Verify that no errors appear in the JS console
Offline tests
QA Steps
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(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
android.mov
Android: mWeb Chrome
mWeb-android.mov
iOS: Native
ios.mov
iOS: mWeb Safari
mWeb-ios.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov