Add g+e keyboard shortcut for /explore (trending) (#38014)

This commit is contained in:
Antoine Cellerier
2026-03-02 14:49:28 +01:00
committed by GitHub
parent f953d40289
commit 87004ddb96
5 changed files with 17 additions and 0 deletions

View File

@@ -50,6 +50,9 @@ const hotkeyTest: Story['play'] = async ({ canvas, userEvent }) => {
await userEvent.keyboard('gh');
await confirmHotkey('goToHome');
await userEvent.keyboard('ge');
await confirmHotkey('goToExplore');
await userEvent.keyboard('gn');
await confirmHotkey('goToNotifications');
@@ -106,6 +109,9 @@ export const Default = {
goToHome: () => {
setMatchedHotkey('goToHome');
},
goToExplore: () => {
setMatchedHotkey('goToExplore');
},
goToNotifications: () => {
setMatchedHotkey('goToNotifications');
},

View File

@@ -118,6 +118,7 @@ const hotkeyMatcherMap = {
openMedia: just('e'),
onTranslate: just('t'),
goToHome: sequence('g', 'h'),
goToExplore: sequence('g', 'e'),
goToNotifications: sequence('g', 'n'),
goToLocal: sequence('g', 'l'),
goToFederated: sequence('g', 't'),

View File

@@ -134,6 +134,10 @@ class KeyboardShortcuts extends ImmutablePureComponent {
<td><kbd>g</kbd>+<kbd>h</kbd></td>
<td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td>
</tr>
<tr>
<td><kbd>g</kbd>+<kbd>e</kbd></td>
<td><FormattedMessage id='keyboard_shortcuts.explore' defaultMessage='to open trending timeline' /></td>
</tr>
<tr>
<td><kbd>g</kbd>+<kbd>n</kbd></td>
<td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td>

View File

@@ -534,6 +534,10 @@ class UI extends PureComponent {
this.props.history.push('/home');
};
handleHotkeyGoToExplore = () => {
this.props.history.push('/explore');
};
handleHotkeyGoToNotifications = () => {
this.props.history.push('/notifications');
};
@@ -595,6 +599,7 @@ class UI extends PureComponent {
moveToTop: this.handleMoveToTop,
back: this.handleHotkeyBack,
goToHome: this.handleHotkeyGoToHome,
goToExplore: this.handleHotkeyGoToExplore,
goToNotifications: this.handleHotkeyGoToNotifications,
goToLocal: this.handleHotkeyGoToLocal,
goToFederated: this.handleHotkeyGoToFederated,

View File

@@ -682,6 +682,7 @@
"keyboard_shortcuts.direct": "Open private mentions column",
"keyboard_shortcuts.down": "Move down in the list",
"keyboard_shortcuts.enter": "Open post",
"keyboard_shortcuts.explore": "Open trending timeline",
"keyboard_shortcuts.favourite": "Favorite post",
"keyboard_shortcuts.favourites": "Open favorites list",
"keyboard_shortcuts.federated": "Open federated timeline",