Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KNOWLEDGE_BASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ Press **?** to open the shortcut reference. Navigation shortcuts work outside te
| `⌘/Ctrl+K` or `/` | Search developers and commits. |
| `⌘/Ctrl+Enter` | Submit from the composer. |
| `⌘/Ctrl+Shift+P` | Toggle composer preview. |
| `g` then `l` / `e` / `p` / `s` | Go to your log / Trending / profile / settings. |
| `g` then `l` / `e` / `n` / `p` / `s` | Go to your log / Trending / notifications / profile / settings. |

Source: [shortcut reference](resources/js/components/keyboard-shortcuts-dialog.tsx).

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/keyboard-shortcuts-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const shortcuts = (keys: KeyLabels): Shortcut[] => [
{ keys: [keys.mod, keys.shift, 'P'], label: 'Preview (in the composer)' },
{ keys: ['g', 'l'], label: 'Go to your log' },
{ keys: ['g', 'e'], label: 'Go to trending' },
{ keys: ['g', 'n'], label: 'Go to notifications' },
{ keys: ['g', 'p'], label: 'Go to your profile' },
{ keys: ['g', 's'], label: 'Go to settings' },
{ keys: ['?'], label: 'Show this list' },
Expand Down
6 changes: 4 additions & 2 deletions resources/js/hooks/use-keyboard-shortcuts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { router } from '@inertiajs/react';
import { useEffect } from 'react';
import LogController from '@/actions/App/Http/Controllers/LogController';
import NotificationController from '@/actions/App/Http/Controllers/NotificationController';
import { signIn } from '@/lib/auth';
import { hasModKey } from '@/lib/keyboard';
import { show } from '@/routes/user';
Expand Down Expand Up @@ -72,7 +73,7 @@ function openFocusedCommit(): boolean {
}

/**
* Guests have no log, profile, or settings to go to, so those shortcuts take them to sign in.
* Guests have no log, notifications, profile, or settings to go to, so those shortcuts take them to sign in.
*/
export function useKeyboardShortcuts(
user: User | null,
Expand All @@ -87,10 +88,11 @@ export function useKeyboardShortcuts(

const goTo: Record<string, () => void> =
user === null || log === null
? { l: signIn, e: signIn, p: signIn, s: signIn }
? { l: signIn, e: signIn, n: signIn, p: signIn, s: signIn }
: {
l: () => router.visit(LogController.show(log)),
e: () => router.visit(LogController.show('trending')),
n: () => router.visit(NotificationController.index()),
p: () => router.visit(show(user)),
s: () => router.visit(edit()),
};
Expand Down