-
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
Fix: Dynamically update shortcuts list #28979
Conversation
# Conflicts: # src/components/KeyboardShortcutsModal.js # src/libs/KeyboardShortcut/index.js
This reverts commit 9197143.
@robertKozik 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] |
|
||
/** | ||
* Unsubscribe all shortcuts that were subscribed when the modal opened | ||
* Call only when modal DID close |
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.
Otherwise, the modal shortcuts (i.e. ESC
) would disappear while the modal hiding animation is still ongoing.
Reviewer Checklist
Screenshots/VideosWebweb.mov |
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 know this the approved proposal, but this solution seems janky still, and looks like something we'll eventually change, cause we don't want thing jumping after that modal is open imo. Given that, is there a reason we're showing the shortcuts only after they're registered (or whatever condition we're waiting for)? Can we simple list all the short cuts that will be available, and if the user uses CMD + C somewhere where that doesn't work, that's fine? |
@robertKozik What do you think of the above ^?
Seems like the team has already decided to implement it here: #29063. |
Should we close this then? |
Yes @cead22 I think we can't proceed further with this as now shortcuts modal became separate page |
Details
The shortcuts list was retrieved from a static file. Thus any changes from other files are not reflected. This PR creates a hook to dynamically update & retrieve it.
Fixed Issues
$ #27964
PROPOSAL: #27964 (comment)
Tests
3a. Large screens (Three-pane layout): Immediately after login and while the LHN is still skeleton, Press
CMD + J
to toggle Keyboard shortcuts modal3b. Small screens: Immediately after pressing a LHN item and while the chat is still skeleton, Press
CMD + J
to toggle Keyboard shortcuts modalCMD + C
shorcuts appear in the modalESC
ESC
does not disappear before modal is closedOffline tests
NA
QA Steps
3a. Large screens (Three-pane layout): Immediately after login and while the LHN is still skeleton, Press
CMD + J
to toggle Keyboard shortcuts modal3b. Small screens: Immediately after pressing a LHN item and while the chat is still skeleton, Press
CMD + J
to toggle Keyboard shortcuts modalCMD + C
shorcuts appear in the modalESC
ESC
does not disappear before modal is closedPR 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
shortcuts-web-compressed.mov
Mobile Web - Chrome
Screenrecording_20231010_001156.mp4
Mobile Web - Safari
shortcuts-safari-compressed.mov
Desktop
Screen.Recording.2023-10-10.at.00.29.47.mov
iOS
shortcuts-ios-compressed.mov
Android
Screenrecording_20231010_002359.mp4