mirror of
https://github.com/supabase/supabase.git
synced 2026-06-08 10:33:55 +08:00
## Summary - Adds contextual `A + <letter>` chord shortcuts for jumping between Authentication sub-pages while `AuthLayout` is mounted, mirroring the existing database-nav chord pattern. - Wires the shared `LIST_PAGE_*` shortcuts (focus search, create new, reset filters, schema selector) onto the Auth list pages so they behave like the Database list pages. - Fills in the previously-missing `A + U` chord for the **Users** page so every entry in the Auth menu has a chord. Resolves [FE-3187](https://linear.app/supabase/issue/FE-3187/add-a-u-keyboard-shortcut-for-auth-users-page). ## Auth navigation chords Active anywhere under `/project/<ref>/auth/*`. Press `A` then the listed letter. | Page | Chord | | --- | --- | | Overview | `A` `O` | | Users | `A` `U` | | OAuth Apps | `A` `A` | | Email | `A` `E` | | Policies | `A` `P` | | Sign In / Providers | `A` `I` | | Passkeys | `A` `K` | | OAuth Server | `A` `V` | | Sessions | `A` `S` | | Rate Limits | `A` `R` | | Multi-Factor | `A` `M` | | URL Configuration | `A` `L` | | Attack Protection | `A` `T` | | Auth Hooks | `A` `H` | | Audit Logs | `A` `G` | | Performance | `A` `F` | ## Auth list-page shortcuts Each Auth list page opts into the shared `LIST_PAGE_*` registry — same chords as the Database list pages (`Shift+F`, `Shift+N`, `F` `C`, `O` `S`). Coverage matches the controls each page actually exposes: | List page | Search (`Shift+F`) | New (`Shift+N`) | Reset filters (`F` `C`) | Schema selector (`O` `S`) | | --- | :---: | :---: | :---: | :---: | | Custom Auth Providers | ✓ | ✓ | ✓ | — | | OAuth Apps | ✓ | ✓ | ✓ | — | | Policies | ✓ | — | ✓ | ✓ | | Auth Hooks | — | ✓ | — | — | | Redirect URLs | — | ✓ | — | — | | Third-Party Auth | — | ✓ | — | — | ## Test plan - [x] While anywhere under `/project/<ref>/auth/*`, every chord in the navigation table jumps to the corresponding page. - [x] On each list page in the second table, the marked shortcuts focus the search input / open the create flow / reset filters / open the schema picker as expected. - [x] Chords are not active outside of `/project/<ref>/auth/*` and do not trigger while typing in inputs (where `ignoreInputs` applies). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Global keyboard shortcuts for Auth pages: navigate auth sections, focus/search inputs, reset filters, and open "Add" flows (providers, OAuth apps, hooks, URLs, policies). * "Add" controls in lists respond to shortcuts and show appropriate disabled/tooltip states when unavailable. * Product menu and shortcuts reference now include an "Auth Navigation" section and per-item shortcut hints. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
146 lines
5.2 KiB
TypeScript
146 lines
5.2 KiB
TypeScript
import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'
|
|
import { RegistryDefinations } from '../types'
|
|
|
|
/**
|
|
* Contextual chords for jumping between Authentication sub-pages — `A + <letter>`.
|
|
*
|
|
* Active only while AuthLayout is mounted (i.e. the user is somewhere under
|
|
* `/project/<ref>/auth/*`). Mirrors the database-nav pattern: the leading `A`
|
|
* is layout-scoped so it doesn't burn a global key.
|
|
*/
|
|
export const AUTH_NAV_SHORTCUT_IDS = {
|
|
NAV_AUTH_OVERVIEW: 'nav.auth-overview',
|
|
NAV_AUTH_USERS: 'nav.auth-users',
|
|
NAV_AUTH_OAUTH_APPS: 'nav.auth-oauth-apps',
|
|
NAV_AUTH_EMAIL: 'nav.auth-email',
|
|
NAV_AUTH_POLICIES: 'nav.auth-policies',
|
|
NAV_AUTH_SIGN_IN: 'nav.auth-sign-in',
|
|
NAV_AUTH_PASSKEYS: 'nav.auth-passkeys',
|
|
NAV_AUTH_OAUTH_SERVER: 'nav.auth-oauth-server',
|
|
NAV_AUTH_SESSIONS: 'nav.auth-sessions',
|
|
NAV_AUTH_RATE_LIMITS: 'nav.auth-rate-limits',
|
|
NAV_AUTH_MFA: 'nav.auth-mfa',
|
|
NAV_AUTH_URL_CONFIGURATION: 'nav.auth-url-configuration',
|
|
NAV_AUTH_PROTECTION: 'nav.auth-protection',
|
|
NAV_AUTH_HOOKS: 'nav.auth-hooks',
|
|
NAV_AUTH_AUDIT_LOGS: 'nav.auth-audit-logs',
|
|
NAV_AUTH_PERFORMANCE: 'nav.auth-performance',
|
|
}
|
|
|
|
export type AuthNavShortcutId = (typeof AUTH_NAV_SHORTCUT_IDS)[keyof typeof AUTH_NAV_SHORTCUT_IDS]
|
|
|
|
export const authNavRegistry: RegistryDefinations<AuthNavShortcutId> = {
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OVERVIEW]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OVERVIEW,
|
|
label: 'Go to Overview',
|
|
sequence: ['A', 'O'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_USERS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_USERS,
|
|
label: 'Go to Users',
|
|
sequence: ['A', 'U'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_APPS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_APPS,
|
|
label: 'Go to OAuth Apps',
|
|
sequence: ['A', 'A'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_EMAIL]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_EMAIL,
|
|
label: 'Go to Email',
|
|
sequence: ['A', 'E'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_POLICIES]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_POLICIES,
|
|
label: 'Go to Policies',
|
|
sequence: ['A', 'P'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SIGN_IN]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SIGN_IN,
|
|
label: 'Go to Sign In / Providers',
|
|
sequence: ['A', 'I'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PASSKEYS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PASSKEYS,
|
|
label: 'Go to Passkeys',
|
|
sequence: ['A', 'K'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_SERVER]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_SERVER,
|
|
label: 'Go to OAuth Server',
|
|
sequence: ['A', 'V'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SESSIONS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SESSIONS,
|
|
label: 'Go to Sessions',
|
|
sequence: ['A', 'S'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_RATE_LIMITS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_RATE_LIMITS,
|
|
label: 'Go to Rate Limits',
|
|
sequence: ['A', 'R'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_MFA]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_MFA,
|
|
label: 'Go to Multi-Factor',
|
|
sequence: ['A', 'M'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_URL_CONFIGURATION]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_URL_CONFIGURATION,
|
|
label: 'Go to URL Configuration',
|
|
sequence: ['A', 'L'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PROTECTION]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PROTECTION,
|
|
label: 'Go to Attack Protection',
|
|
sequence: ['A', 'T'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_HOOKS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_HOOKS,
|
|
label: 'Go to Auth Hooks',
|
|
sequence: ['A', 'H'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_AUDIT_LOGS]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_AUDIT_LOGS,
|
|
label: 'Go to Audit Logs',
|
|
sequence: ['A', 'G'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
[AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PERFORMANCE]: {
|
|
id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PERFORMANCE,
|
|
label: 'Go to Performance',
|
|
sequence: ['A', 'F'],
|
|
showInSettings: false,
|
|
referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
|
|
},
|
|
}
|