[Glitch] Add g+e keyboard shortcut for /explore (trending)

Port 87004ddb96 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Antoine Cellerier
2026-03-02 14:49:28 +01:00
committed by Claire
parent 1b92ac0729
commit 739c35811e
3 changed files with 10 additions and 0 deletions

View File

@@ -119,6 +119,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

@@ -142,6 +142,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

@@ -580,6 +580,10 @@ class UI extends PureComponent {
this.props.history.push('/home');
};
handleHotkeyGoToExplore = () => {
this.props.history.push('/explore');
};
handleHotkeyGoToNotifications = () => {
this.props.history.push('/notifications');
};
@@ -648,6 +652,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,