Repository navigation
Jakubkalinski0/Help panel overlays with TestTools modal - #66882
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp66882-android-hybrid-001.mp4Android: mWeb ChromeNA iOS: HybridApp66882-ios-hybrid-001.mp4iOS: mWeb SafariNA MacOS: Chrome / Safari66882-web-chrome-001.mp4MacOS: Desktop66882-desktop-001.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
Changes LGTM and works well too..
Approving to take this forward
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #66246 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
| // Close Side Panel on escape key press | ||
| useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ESCAPE, () => closeSidePanel(), {isActive: !isExtraLargeScreenWidth, shouldBubble: false}); | ||
| // Close Side Panel on debug key press i.e. opening the TestTools modal | ||
| useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.DEBUG, () => closeSidePanel(), {shouldBubble: true}); |
There was a problem hiding this comment.
Can we add a unit test for this case?
There was a problem hiding this comment.
Yeah, I will take care of that.
There was a problem hiding this comment.
After looking into this, I'm not sure if we should test this, especially since we've never tested any shortcuts before and this would be a first. Considering this, are you sure we want to do the unit test here?
There was a problem hiding this comment.
How difficult would it be to add a unit test for this case?
There was a problem hiding this comment.
It would require some unpleasant mocks. However, I think it would be more beneficial to conduct unit tests on the KeyboardShortcut (it configures a global keyboard event handler), as it is the underlying component that hasn't been tested anywhere yet. Testing KeyboardShortcut would be more valuable and worthwhile, since it is responsible for executing the core functionality used across various places, while useKeyboardShortcut only utilizes it.
There was a problem hiding this comment.
@marcochavezf Whats your opinion about this proposition?
There was a problem hiding this comment.
Oh I see, thanks for the explanation! @mountiny what are your thoughts about this case? Should we add unit tests for KeyboardShortcut here, should we create a new issue for that or :donothing: for now?
There was a problem hiding this comment.
I think this sounds quite complex at the moment and we could handle this next time. So do nothing for now
|
✋ 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/marcochavezf in version: 9.1.88-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.88-3 🚀
|
Explanation of Change
In this case where the problem was caused by the help side panel and not the TestTools.ts modal. To ensure it works properly the opening TestTools.ts modal with shortcut was tested with other right-docked modals open like AvatarCropModal.tsx, which responded well to the 'Cmd+D' command and closed accordingly, which assured me it was the help side panel responsible for the overlapping. The solution was straightforward, following the approach already used in HelpModal/index.tsx, where the side panel is closed directly in the HelpModal/index.tsx when the 'Cmd + D' shortcut is activated, similar to the shortcuts responsible for 'Escape', 'New chat', or 'Search' which also close the help side panel.
Fixed Issues
$ #66246
PROPOSAL: doesn't apply -> SWM engineer
Tests
Prerequisites:
Onyx.set('nvp_sidePanel', {})Reproduction steps:
Offline tests
SAME AS TESTS ^
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
SAME AS TESTS ^
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.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 and/or tagged@Expensify/designso 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
macOS_safari.mov
MacOS: Desktop
macOS_desktop.mov