Add g+e keyboard shortcut for /explore (trending) (#38014)
This commit is contained in:
parent
f953d40289
commit
87004ddb96
@ -50,6 +50,9 @@ const hotkeyTest: Story['play'] = async ({ canvas, userEvent }) => {
|
|||||||
await userEvent.keyboard('gh');
|
await userEvent.keyboard('gh');
|
||||||
await confirmHotkey('goToHome');
|
await confirmHotkey('goToHome');
|
||||||
|
|
||||||
|
await userEvent.keyboard('ge');
|
||||||
|
await confirmHotkey('goToExplore');
|
||||||
|
|
||||||
await userEvent.keyboard('gn');
|
await userEvent.keyboard('gn');
|
||||||
await confirmHotkey('goToNotifications');
|
await confirmHotkey('goToNotifications');
|
||||||
|
|
||||||
@ -106,6 +109,9 @@ export const Default = {
|
|||||||
goToHome: () => {
|
goToHome: () => {
|
||||||
setMatchedHotkey('goToHome');
|
setMatchedHotkey('goToHome');
|
||||||
},
|
},
|
||||||
|
goToExplore: () => {
|
||||||
|
setMatchedHotkey('goToExplore');
|
||||||
|
},
|
||||||
goToNotifications: () => {
|
goToNotifications: () => {
|
||||||
setMatchedHotkey('goToNotifications');
|
setMatchedHotkey('goToNotifications');
|
||||||
},
|
},
|
||||||
|
|||||||
@ -118,6 +118,7 @@ const hotkeyMatcherMap = {
|
|||||||
openMedia: just('e'),
|
openMedia: just('e'),
|
||||||
onTranslate: just('t'),
|
onTranslate: just('t'),
|
||||||
goToHome: sequence('g', 'h'),
|
goToHome: sequence('g', 'h'),
|
||||||
|
goToExplore: sequence('g', 'e'),
|
||||||
goToNotifications: sequence('g', 'n'),
|
goToNotifications: sequence('g', 'n'),
|
||||||
goToLocal: sequence('g', 'l'),
|
goToLocal: sequence('g', 'l'),
|
||||||
goToFederated: sequence('g', 't'),
|
goToFederated: sequence('g', 't'),
|
||||||
|
|||||||
@ -134,6 +134,10 @@ class KeyboardShortcuts extends ImmutablePureComponent {
|
|||||||
<td><kbd>g</kbd>+<kbd>h</kbd></td>
|
<td><kbd>g</kbd>+<kbd>h</kbd></td>
|
||||||
<td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td>
|
<td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><kbd>g</kbd>+<kbd>e</kbd></td>
|
||||||
|
<td><FormattedMessage id='keyboard_shortcuts.explore' defaultMessage='to open trending timeline' /></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><kbd>g</kbd>+<kbd>n</kbd></td>
|
<td><kbd>g</kbd>+<kbd>n</kbd></td>
|
||||||
<td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td>
|
<td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td>
|
||||||
|
|||||||
@ -534,6 +534,10 @@ class UI extends PureComponent {
|
|||||||
this.props.history.push('/home');
|
this.props.history.push('/home');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleHotkeyGoToExplore = () => {
|
||||||
|
this.props.history.push('/explore');
|
||||||
|
};
|
||||||
|
|
||||||
handleHotkeyGoToNotifications = () => {
|
handleHotkeyGoToNotifications = () => {
|
||||||
this.props.history.push('/notifications');
|
this.props.history.push('/notifications');
|
||||||
};
|
};
|
||||||
@ -595,6 +599,7 @@ class UI extends PureComponent {
|
|||||||
moveToTop: this.handleMoveToTop,
|
moveToTop: this.handleMoveToTop,
|
||||||
back: this.handleHotkeyBack,
|
back: this.handleHotkeyBack,
|
||||||
goToHome: this.handleHotkeyGoToHome,
|
goToHome: this.handleHotkeyGoToHome,
|
||||||
|
goToExplore: this.handleHotkeyGoToExplore,
|
||||||
goToNotifications: this.handleHotkeyGoToNotifications,
|
goToNotifications: this.handleHotkeyGoToNotifications,
|
||||||
goToLocal: this.handleHotkeyGoToLocal,
|
goToLocal: this.handleHotkeyGoToLocal,
|
||||||
goToFederated: this.handleHotkeyGoToFederated,
|
goToFederated: this.handleHotkeyGoToFederated,
|
||||||
|
|||||||
@ -682,6 +682,7 @@
|
|||||||
"keyboard_shortcuts.direct": "Open private mentions column",
|
"keyboard_shortcuts.direct": "Open private mentions column",
|
||||||
"keyboard_shortcuts.down": "Move down in the list",
|
"keyboard_shortcuts.down": "Move down in the list",
|
||||||
"keyboard_shortcuts.enter": "Open post",
|
"keyboard_shortcuts.enter": "Open post",
|
||||||
|
"keyboard_shortcuts.explore": "Open trending timeline",
|
||||||
"keyboard_shortcuts.favourite": "Favorite post",
|
"keyboard_shortcuts.favourite": "Favorite post",
|
||||||
"keyboard_shortcuts.favourites": "Open favorites list",
|
"keyboard_shortcuts.favourites": "Open favorites list",
|
||||||
"keyboard_shortcuts.federated": "Open federated timeline",
|
"keyboard_shortcuts.federated": "Open federated timeline",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user