The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(studio): add project settings shortcuts (#46352)
Danny White498d051d88b6
diff --git a/apps/studio/components/interfaces/APIKeys/CreateAPIKeyDialogs.test.tsx b/apps/studio/components/interfaces/APIKeys/CreateAPIKeyDialogs.test.tsxnew file mode 100644index 00000000000..15396d5e0e6--- /dev/null+++ b/apps/studio/components/interfaces/APIKeys/CreateAPIKeyDialogs.test.tsx@@ -0,0 +1,116 @@+import { render, screen } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import { beforeEach, describe, expect, it, vi } from 'vitest'++import { CreatePublishableAPIKeyDialog } from './CreatePublishableAPIKeyDialog'+import { CreateSecretAPIKeyDialog } from './CreateSecretAPIKeyDialog'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'++const { mockSetVisible, mockShortcut, mockUseQueryState } = vi.hoisted(() => ({+ mockSetVisible: vi.fn(),+ mockShortcut: vi.fn(({ children }: any) => <div data-testid="shortcut">{children}</div>),+ mockUseQueryState: vi.fn(),+}))++vi.mock('next/navigation', async () => {+ const actual = await vi.importActual<typeof import('next/navigation')>('next/navigation')+ return {+ ...actual,+ useParams: () => ({ ref: 'project-ref' }),+ }+})++vi.mock('nuqs', async () => {+ const actual = await vi.importActual<typeof import('nuqs')>('nuqs')+ return {+ ...actual,+ useQueryState: mockUseQueryState,+ }+})++vi.mock('@/components/ui/Shortcut', () => ({+ Shortcut: mockShortcut,+}))++vi.mock('@/data/api-keys/api-key-create-mutation', () => ({+ useAPIKeyCreateMutation: () => ({ mutate: vi.fn(), isPending: false }),+}))++describe('API key create dialogs', () => {+ beforeEach(() => {+ vi.clearAllMocks()+ mockUseQueryState.mockReturnValue(['', mockSetVisible])+ })++ it('registers and surfaces the publishable key shortcut on the visible trigger', async () => {+ const user = userEvent.setup()++ render(<CreatePublishableAPIKeyDialog />)++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.API_KEYS_NEW_PUBLISHABLE,+ onTrigger: expect.any(Function),+ side: 'bottom',+ }),+ undefined+ )++ await user.click(screen.getByRole('button', { name: 'New publishable key' }))++ expect(mockSetVisible).toHaveBeenCalledWith('publishable')+ })++ it('registers and surfaces the publishable key submit shortcut on the primary action', () => {+ mockUseQueryState.mockReturnValue(['publishable', mockSetVisible])++ render(<CreatePublishableAPIKeyDialog />)++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.API_KEYS_CREATE_PUBLISHABLE,+ onTrigger: expect.any(Function),+ options: { enabled: true },+ side: 'top',+ }),+ undefined+ )+ expect(screen.getByRole('button', { name: 'Create Publishable API key' })).toBeInTheDocument()+ })++ it('registers and surfaces the secret key shortcut on the visible trigger', async () => {+ const user = userEvent.setup()++ render(<CreateSecretAPIKeyDialog />)++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.API_KEYS_NEW_SECRET,+ onTrigger: expect.any(Function),+ side: 'bottom',+ }),+ undefined+ )++ await user.click(screen.getByRole('button', { name: 'New secret key' }))++ expect(mockSetVisible).toHaveBeenCalledWith('secret')+ })++ it('registers and surfaces the secret key submit shortcut on the primary action', () => {+ mockUseQueryState.mockReturnValue(['secret', mockSetVisible])++ render(<CreateSecretAPIKeyDialog />)++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.API_KEYS_CREATE_SECRET,+ onTrigger: expect.any(Function),+ options: { enabled: true },+ side: 'top',+ }),+ undefined+ )+ expect(screen.getByRole('button', { name: 'Create API key' })).toBeInTheDocument()+ })+})diff --git a/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx b/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsxindex 6fa3d38a5ab..0aff6d43928 100644--- a/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx+++ b/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx@@ -2,6 +2,7 @@ import { zodResolver } from '@hookform/resolvers/zod'import { Plus } from 'lucide-react'import { useParams } from 'next/navigation'import { parseAsString, useQueryState } from 'nuqs'+import { useRef } from 'react'import { SubmitHandler, useForm } from 'react-hook-form'import {Button,@@ -13,7 +14,6 @@ import {DialogSection,DialogSectionSeparator,DialogTitle,- DialogTrigger,Form,FormControl,FormField,@@ -22,7 +22,9 @@ import {import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'import * as z from 'zod'+import { Shortcut } from '@/components/ui/Shortcut'import { useAPIKeyCreateMutation } from '@/data/api-keys/api-key-create-mutation'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'const FORM_ID = 'create-publishable-api-key'const SCHEMA = z.object({@@ -37,6 +39,7 @@ export interface CreatePublishableAPIKeyDialogProps {export const CreatePublishableAPIKeyDialog = () => {const params = useParams()const projectRef = params?.ref as string+ const formRef = useRef<HTMLFormElement>(null)const [visible, setVisible] = useQueryState('new', parseAsString.withDefault(''))@@ -44,6 +47,7 @@ export const CreatePublishableAPIKeyDialog = () => {if (value) setVisible('publishable')else setVisible('')}+ const openDialog = () => setVisible('publishable')const defaultValues = { name: '', description: '' }@@ -76,11 +80,16 @@ export const CreatePublishableAPIKeyDialog = () => {return (<Dialog open={visible === 'publishable'} onOpenChange={onOpenChange}>- <DialogTrigger asChild>- <Button type="default" icon={<Plus />}>+ <Shortcut+ id={SHORTCUT_IDS.API_KEYS_NEW_PUBLISHABLE}+ onTrigger={openDialog}+ side="bottom"+ tooltipOpen={visible === 'publishable' ? false : undefined}+ >+ <Button type="default" icon={<Plus />} onClick={openDialog}>New publishable key</Button>- </DialogTrigger>+ </Shortcut><DialogContent><DialogHeader><DialogTitle>Create new publishable API key</DialogTitle>@@ -94,6 +103,7 @@ export const CreatePublishableAPIKeyDialog = () => {<DialogSection className="flex flex-col gap-4"><Form {...form}><form+ ref={formRef}className="flex flex-col gap-4"id={FORM_ID}onSubmit={form.handleSubmit(onSubmit)}@@ -132,9 +142,16 @@ export const CreatePublishableAPIKeyDialog = () => {</Form></DialogSection><DialogFooter>- <Button form={FORM_ID} htmlType="submit" loading={isCreatingAPIKey}>- Create Publishable API key- </Button>+ <Shortcut+ id={SHORTCUT_IDS.API_KEYS_CREATE_PUBLISHABLE}+ onTrigger={() => formRef.current?.requestSubmit()}+ options={{ enabled: visible === 'publishable' && !isCreatingAPIKey }}+ side="top"+ >+ <Button form={FORM_ID} htmlType="submit" loading={isCreatingAPIKey}>+ Create Publishable API key+ </Button>+ </Shortcut></DialogFooter></DialogContent></Dialog>diff --git a/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx b/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsxindex e8364a7def2..aea1fe5c20e 100644--- a/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx+++ b/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx@@ -2,6 +2,7 @@ import { zodResolver } from '@hookform/resolvers/zod'import { useParams } from 'common'import { Plus, ShieldCheck } from 'lucide-react'import { parseAsString, useQueryState } from 'nuqs'+import { useRef } from 'react'import { useForm, type SubmitHandler } from 'react-hook-form'import { toast } from 'sonner'import {@@ -17,7 +18,6 @@ import {DialogSection,DialogSectionSeparator,DialogTitle,- DialogTrigger,Form,FormControl,FormField,@@ -26,7 +26,9 @@ import {import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'import * as z from 'zod'+import { Shortcut } from '@/components/ui/Shortcut'import { useAPIKeyCreateMutation } from '@/data/api-keys/api-key-create-mutation'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'const NAME_SCHEMA = z.string()@@ -48,11 +50,13 @@ const SCHEMA = z.object({export const CreateSecretAPIKeyDialog = () => {const { ref: projectRef } = useParams()const [visible, setVisible] = useQueryState('new', parseAsString)+ const formRef = useRef<HTMLFormElement>(null)const onOpenChange = (value: boolean) => {if (value) setVisible('secret')else setVisible('')}+ const openDialog = () => setVisible('secret')const defaultValues = { name: '', description: '' }const form = useForm<z.infer<typeof SCHEMA>>({@@ -82,11 +86,16 @@ export const CreateSecretAPIKeyDialog = () => {return (<Dialog open={visible === 'secret'} onOpenChange={onOpenChange}>- <DialogTrigger asChild>- <Button type="default" className="mt-2" icon={<Plus />}>+ <Shortcut+ id={SHORTCUT_IDS.API_KEYS_NEW_SECRET}+ onTrigger={openDialog}+ side="bottom"+ tooltipOpen={visible === 'secret' ? false : undefined}+ >+ <Button type="default" className="mt-2" icon={<Plus />} onClick={openDialog}>New secret key</Button>- </DialogTrigger>+ </Shortcut><DialogContent><DialogHeader><DialogTitle>Create new secret API key</DialogTitle>@@ -101,6 +110,7 @@ export const CreateSecretAPIKeyDialog = () => {<DialogSection className="flex flex-col gap-4"><Form {...form}><form+ ref={formRef}className="flex flex-col gap-4"id={FORM_ID}onSubmit={form.handleSubmit(onSubmit)}@@ -160,9 +170,16 @@ export const CreateSecretAPIKeyDialog = () => {</Alert></DialogSection><DialogFooter>- <Button form={FORM_ID} htmlType="submit" loading={isCreatingAPIKey}>- Create API key- </Button>+ <Shortcut+ id={SHORTCUT_IDS.API_KEYS_CREATE_SECRET}+ onTrigger={() => formRef.current?.requestSubmit()}+ options={{ enabled: visible === 'secret' && !isCreatingAPIKey }}+ side="top"+ >+ <Button form={FORM_ID} htmlType="submit" loading={isCreatingAPIKey}>+ Create API key+ </Button>+ </Shortcut></DialogFooter></DialogContent></Dialog>diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.test.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.test.tsxnew file mode 100644index 00000000000..7ed2c4486b8--- /dev/null+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.test.tsx@@ -0,0 +1,50 @@+import { render, screen } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import { beforeEach, describe, expect, it, vi } from 'vitest'++import { ActionPanel } from './action-panel'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'++const { mockShortcut } = vi.hoisted(() => ({+ mockShortcut: vi.fn(({ children }: any) => <div data-testid="shortcut">{children}</div>),+}))++vi.mock('@/components/ui/Shortcut', () => ({+ Shortcut: mockShortcut,+}))++describe('ActionPanel', () => {+ beforeEach(() => {+ vi.clearAllMocks()+ })++ it('wraps the action button with a shortcut when one is provided', async () => {+ const user = userEvent.setup()+ const onClick = vi.fn()++ render(+ <ActionPanel+ title="Create standby key"+ description="Set up a new key."+ buttonLabel="Create Standby Key"+ onClick={onClick}+ loading={false}+ shortcutId={SHORTCUT_IDS.JWT_KEYS_CREATE_STANDBY}+ />+ )++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.JWT_KEYS_CREATE_STANDBY,+ onTrigger: onClick,+ side: 'bottom',+ options: { enabled: true },+ }),+ undefined+ )++ await user.click(screen.getByRole('button', { name: 'Create Standby Key' }))++ expect(onClick).toHaveBeenCalled()+ })+})diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.tsxindex b00802a8285..3dc6d2f5e44 100644--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.tsx+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/action-panel.tsx@@ -1,18 +1,31 @@import { ComponentProps, forwardRef } from 'react'import { Button, Card, CardDescription, CardHeader, CardTitle } from 'ui'+import { Shortcut } from '@/components/ui/Shortcut'+import type { ShortcutId } from '@/state/shortcuts/registry'+interface ActionPanelProps extends Omit<React.ComponentProps<typeof Card>, 'onClick' | 'type'> {title: stringdescription: stringbuttonLabel: ComponentProps<typeof Button>['children']- onClick: ComponentProps<typeof Button>['onClick']+ onClick: () => voidloading: ComponentProps<typeof Button>['loading']icon?: ComponentProps<typeof Button>['icon']type?: ComponentProps<typeof Button>['type']+ shortcutId?: ShortcutId}export const ActionPanel = forwardRef<HTMLDivElement, ActionPanelProps>(- ({ title, description, buttonLabel, onClick, loading, icon, type, ...props }, ref) => {+ (+ { title, description, buttonLabel, onClick, loading, icon, type, shortcutId, ...props },+ ref+ ) => {+ const button = (+ <Button onClick={onClick} loading={loading} icon={icon} type={type}>+ {buttonLabel}+ </Button>+ )+return (<CardclassName="first:rounded-b-none last:rounded-t-none shadow-none only:rounded-lg"@@ -25,9 +38,18 @@ export const ActionPanel = forwardRef<HTMLDivElement, ActionPanelProps>(<CardDescription className="max-w-xl">{description}</CardDescription></div><div className="flex lg:justify-end flex-">- <Button onClick={onClick} loading={loading} icon={icon} type={type}>- {buttonLabel}- </Button>+ {shortcutId ? (+ <Shortcut+ id={shortcutId}+ onTrigger={onClick}+ side="bottom"+ options={{ enabled: !loading }}+ >+ {button}+ </Shortcut>+ ) : (+ button+ )}</div></CardHeader></Card>diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.test.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.test.tsxnew file mode 100644index 00000000000..ea5443d2d26--- /dev/null+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.test.tsx@@ -0,0 +1,52 @@+import { render, screen } from '@testing-library/react'+import { Dialog, DialogContent } from 'ui'+import { beforeEach, describe, expect, it, vi } from 'vitest'++import { CreateKeyDialog } from './create-key-dialog'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'++const { mockShortcut } = vi.hoisted(() => ({+ mockShortcut: vi.fn(({ children }: any) => <div data-testid="shortcut">{children}</div>),+}))++vi.mock('@/components/ui/Shortcut', () => ({+ Shortcut: mockShortcut,+}))++vi.mock('@/data/jwt-signing-keys/jwt-signing-key-create-mutation', () => ({+ useJWTSigningKeyCreateMutation: () => ({ mutate: vi.fn(), isPending: false }),+}))++vi.mock('sonner', () => ({+ toast: {+ error: vi.fn(),+ success: vi.fn(),+ },+}))++describe('CreateKeyDialog', () => {+ beforeEach(() => {+ vi.clearAllMocks()+ })++ it('wraps the create standby key button with the submit shortcut', () => {+ render(+ <Dialog open>+ <DialogContent>+ <CreateKeyDialog projectRef="project-ref" onClose={vi.fn()} />+ </DialogContent>+ </Dialog>+ )++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.JWT_KEYS_SUBMIT_STANDBY,+ onTrigger: expect.any(Function),+ options: { enabled: true },+ side: 'top',+ }),+ undefined+ )+ expect(screen.getByRole('button', { name: 'Create standby key' })).toBeInTheDocument()+ })+})diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.tsxindex 11bc74966b9..95ab9af0a74 100644--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.tsx+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/create-key-dialog.tsx@@ -19,9 +19,11 @@ import {Textarea,} from 'ui'+import { Shortcut } from '@/components/ui/Shortcut'import { useJWTSigningKeyCreateMutation } from '@/data/jwt-signing-keys/jwt-signing-key-create-mutation'import { JWTAlgorithm } from '@/data/jwt-signing-keys/jwt-signing-keys-query'import { stringToBase64URL } from '@/lib/base64url'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'const RSA_JWK_REQUIRED_PROPERTIES = ['kty', 'n', 'e', 'p', 'q', 'd', 'dq', 'dp', 'qi']const EC_JWK_REQUIRED_PROPERTIES = ['kty', 'crv', 'x', 'y', 'd']@@ -228,13 +230,25 @@ export const CreateKeyDialog = ({</div></DialogSection><DialogFooter>- <Button- onClick={() => handleAddNewStandbyKey()}- disabled={isPendingMutation || !!privateKeyMessage}- loading={isPendingMutation}+ <Shortcut+ id={SHORTCUT_IDS.JWT_KEYS_SUBMIT_STANDBY}+ onTrigger={handleAddNewStandbyKey}+ options={{+ enabled:+ !isPendingMutation && !privateKeyMessage && (!isBYOK || privateKey.trim().length > 0),+ }}+ side="top">- Create standby key- </Button>+ <Button+ onClick={() => handleAddNewStandbyKey()}+ disabled={+ isPendingMutation || !!privateKeyMessage || (isBYOK && privateKey.trim().length === 0)+ }+ loading={isPendingMutation}+ >+ Create standby key+ </Button>+ </Shortcut></DialogFooter></>)diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsxindex 7cbae5e582b..43d1c21bff6 100644--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx@@ -48,6 +48,7 @@ import { useLegacyJWTSigningKeyCreateMutation } from '@/data/jwt-signing-keys/leimport { useLegacyJWTSigningKeyQuery } from '@/data/jwt-signing-keys/legacy-jwt-signing-key-query'import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'type DialogType = 'legacy' | 'create' | 'rotate' | 'key-details' | 'revoke' | 'delete'@@ -206,6 +207,7 @@ export const JWTSecretKeysTable = () => {loading={isPendingMutation}type="primary"icon={<Timer className="size-4" />}+ shortcutId={SHORTCUT_IDS.JWT_KEYS_CREATE_STANDBY}/>)}</>diff --git a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.test.tsx b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.test.tsxindex 4956d4a9bc4..a632e8d1523 100644--- a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.test.tsx+++ b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.test.tsx@@ -4,17 +4,18 @@ import type { ComponentProps } from 'react'import { beforeEach, describe, expect, it, vi } from 'vitest'import { LogDrainDestinationSheetForm } from './LogDrainDestinationSheetForm'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'import { render } from '@/tests/helpers'-const { trackMock, useFlagMock, useLogDrainsQueryMock, useParamsMock, useTrackMock } = vi.hoisted(- () => ({+const { mockShortcut, trackMock, useFlagMock, useLogDrainsQueryMock, useParamsMock, useTrackMock } =+ vi.hoisted(() => ({+ mockShortcut: vi.fn(({ children }: any) => <div data-testid="shortcut">{children}</div>),trackMock: vi.fn(),useFlagMock: vi.fn(),useLogDrainsQueryMock: vi.fn(),useParamsMock: vi.fn(),useTrackMock: vi.fn(),- })-)+ }))vi.mock(import('common'), async (importOriginal) => {const actual = await importOriginal()@@ -40,6 +41,10 @@ vi.mock('@/lib/telemetry/track', () => ({useTrack: useTrackMock,}))+vi.mock('@/components/ui/Shortcut', () => ({+ Shortcut: mockShortcut,+}))+vi.mock('sonner', () => ({toast: {error: vi.fn(),@@ -88,6 +93,23 @@ describe('LogDrainDestinationSheetForm', () => {expect(screen.getByDisplayValue('application/json')).toBeInTheDocument()})+ it('wraps the save button with the save destination shortcut while open', async () => {+ renderForm()++ await screen.findByRole('dialog')++ expect(mockShortcut).toHaveBeenCalledWith(+ expect.objectContaining({+ id: SHORTCUT_IDS.LOG_DRAINS_SAVE_DESTINATION,+ onTrigger: expect.any(Function),+ options: { enabled: true },+ side: 'top',+ }),+ undefined+ )+ expect(screen.getByRole('button', { name: 'Save destination' })).toBeInTheDocument()+ })+it('shows the protobuf content type header for OTLP create mode', async () => {renderForm({defaultValues: { type: 'otlp' },diff --git a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsxindex d4e94c0bdf8..7ea07ca59ee 100644--- a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx+++ b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx@@ -1,7 +1,7 @@import { zodResolver } from '@hookform/resolvers/zod'import { IS_PLATFORM, useFlag, useParams } from 'common'import Link from 'next/link'-import { ReactNode, useEffect, useMemo } from 'react'+import { ReactNode, useEffect, useMemo, useRef } from 'react'import { useForm } from 'react-hook-form'import { toast } from 'sonner'import {@@ -52,10 +52,12 @@ import {type LogDrainHeaderRow,} from './LogDrains.utils'import { TaxDisclaimer } from '@/components/interfaces/Billing/TaxDisclaimer'+import { Shortcut } from '@/components/ui/Shortcut'import { LogDrainData, useLogDrainsQuery } from '@/data/log-drains/log-drains-query'import { DOCS_URL } from '@/lib/constants'import { useTrack } from '@/lib/telemetry/track'import { httpEndpointUrlSchema } from '@/lib/validation/http-url'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'const FORM_ID = 'log-drain-destination-form'@@ -353,6 +355,7 @@ export function LogDrainDestinationSheetForm({})const track = useTrack()+ const formRef = useRef<HTMLFormElement>(null)const formValues = useMemo(() => {const config = (defaultValues?.config || {}) as any@@ -425,6 +428,7 @@ export function LogDrainDestinationSheetForm({<SheetSection className="px-0! pb-0!"><Form {...form}><form+ ref={formRef}id={FORM_ID}onSubmit={(e) => {e.preventDefault()@@ -1034,9 +1038,16 @@ export function LogDrainDestinationSheetForm({</span><TaxDisclaimer /></div>- <Button form={FORM_ID} loading={isLoading} htmlType="submit" type="primary">- Save destination- </Button>+ <Shortcut+ id={SHORTCUT_IDS.LOG_DRAINS_SAVE_DESTINATION}+ onTrigger={() => formRef.current?.requestSubmit()}+ options={{ enabled: open && !isLoading }}+ side="top"+ >+ <Button form={FORM_ID} loading={isLoading} htmlType="submit" type="primary">+ Save destination+ </Button>+ </Shortcut></SheetFooter></div></SheetContent>diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsxindex bd82ede3f2b..ffca1409686 100644--- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx+++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx@@ -4,6 +4,7 @@ import type { PropsWithChildren } from 'react'import { ProjectLayout } from '../ProjectLayout'import { useGenerateSettingsMenu } from './SettingsMenu.utils'import { ProductMenu } from '@/components/ui/ProductMenu'+import { ProductMenuShortcuts } from '@/components/ui/ProductMenu/ProductMenuShortcuts'import { withAuth } from '@/hooks/misc/withAuth'/**@@ -20,7 +21,12 @@ export const SettingsProductMenu = () => {const menu = useGenerateSettingsMenu()- return <ProductMenu page={page} menu={menu} />+ return (+ <>+ <ProductMenuShortcuts menu={menu} />+ <ProductMenu page={page} menu={menu} />+ </>+ )}interface SettingsLayoutProps {diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.selfhosted.test.tsx b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.selfhosted.test.tsxindex da0d4a6ae0c..86217131d7f 100644--- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.selfhosted.test.tsx+++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.selfhosted.test.tsx@@ -2,6 +2,9 @@ import { renderHook } from '@testing-library/react'import { describe, expect, it, vi } from 'vitest'import { useGenerateSettingsMenu } from './SettingsMenu.utils'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'++const getShortcutId = (item: unknown) => (item as { shortcutId?: string } | undefined)?.shortcutIdvi.mock('@/lib/constants', async () => {const actual = await vi.importActual<Record<string, unknown>>('@/lib/constants')@@ -40,6 +43,9 @@ describe('useGenerateSettingsMenu (self-hosted)', () => {const configGroup = result.current.find((group) => group.title === 'Configuration')expect(configGroup?.items.some((item) => item.key === 'log-drains')).toBe(true)+ expect(getShortcutId(configGroup?.items.find((item) => item.key === 'log-drains'))).toBe(+ SHORTCUT_IDS.NAV_PROJECT_SETTINGS_LOG_DRAINS+ )})it('does not include dashboard settings in self-hosted mode', () => {diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.test.tsx b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.test.tsxindex 5c6b9590a88..077fd882a4a 100644--- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.test.tsx+++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.test.tsx@@ -1,9 +1,12 @@import { renderHook } from '@testing-library/react'import { useFlag } from 'common'-import { describe, expect, it, vi } from 'vitest'+import { beforeEach, describe, expect, it, vi } from 'vitest'import { useGenerateSettingsMenu } from './SettingsMenu.utils'import { useIsPlatformWebhooksEnabled } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'++const getShortcutId = (item: unknown) => (item as { shortcutId?: string } | undefined)?.shortcutIdvi.mock('@/lib/constants', async () => {const actual = await vi.importActual<Record<string, unknown>>('@/lib/constants')@@ -37,6 +40,11 @@ vi.mock('@/components/interfaces/App/FeaturePreview/FeaturePreviewContext', () =}))describe('useGenerateSettingsMenu', () => {+ beforeEach(() => {+ vi.mocked(useFlag).mockReturnValue(false)+ vi.mocked(useIsPlatformWebhooksEnabled).mockReturnValue(true)+ })+it('includes webhooks when platformWebhooks feature is enabled', () => {vi.mocked(useIsPlatformWebhooksEnabled).mockReturnValue(true)@@ -88,4 +96,46 @@ describe('useGenerateSettingsMenu', () => {expect(configurationGroup?.items.some((item) => item.name === 'Dashboard')).toBe(false)})++ it('adds shortcuts to eligible configuration settings items', () => {+ vi.mocked(useFlag).mockReturnValue(true)++ const { result } = renderHook(() => useGenerateSettingsMenu())+ const configurationGroup = result.current.find((group) => group.title === 'Configuration')+ const shortcutByKey = new Map(+ configurationGroup?.items.map((item) => [item.key, getShortcutId(item)]) ?? []+ )++ expect(shortcutByKey.get('general')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_GENERAL)+ expect(shortcutByKey.get('compute-and-disk')).toBe(+ SHORTCUT_IDS.NAV_PROJECT_SETTINGS_COMPUTE_AND_DISK+ )+ expect(shortcutByKey.get('infrastructure')).toBe(+ SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INFRASTRUCTURE+ )+ expect(shortcutByKey.get('integrations')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INTEGRATIONS)+ expect(shortcutByKey.get('webhooks')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_WEBHOOKS)+ expect(shortcutByKey.get('api-keys')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_API_KEYS)+ expect(shortcutByKey.get('jwt')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_JWT_KEYS)+ expect(shortcutByKey.get('log-drains')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_LOG_DRAINS)+ expect(shortcutByKey.get('addons')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_ADDONS)+ expect(shortcutByKey.get('dashboard')).toBe(SHORTCUT_IDS.NAV_PROJECT_SETTINGS_DASHBOARD)+ })++ it('does not add settings shortcuts to external integration or billing items', () => {+ const { result } = renderHook(() => useGenerateSettingsMenu())+ const integrationGroup = result.current.find((group) => group.title === 'Integrations')+ const billingGroup = result.current.find((group) => group.title === 'Billing')++ expect(+ getShortcutId(integrationGroup?.items.find((item) => item.key === 'api'))+ ).toBeUndefined()+ expect(+ getShortcutId(integrationGroup?.items.find((item) => item.key === 'vault'))+ ).toBeUndefined()+ expect(+ getShortcutId(billingGroup?.items.find((item) => item.key === 'subscription'))+ ).toBeUndefined()+ expect(getShortcutId(billingGroup?.items.find((item) => item.key === 'usage'))).toBeUndefined()+ })})diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsxindex b1733741993..d53b85988f8 100644--- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx+++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx@@ -6,6 +6,7 @@ import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'import { IS_PLATFORM, PROJECT_STATUS } from '@/lib/constants'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'export const useGenerateSettingsMenu = () => {const { ref } = useParams()@@ -30,6 +31,7 @@ export const useGenerateSettingsMenu = () => {key: `log-drains`,url: `/project/${ref}/settings/log-drains`,items: [],+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_LOG_DRAINS,},],},@@ -45,6 +47,7 @@ export const useGenerateSettingsMenu = () => {key: 'general',url: `/project/${ref}/settings/general`,items: [],+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_GENERAL,},{name: 'Compute and Disk',@@ -52,6 +55,7 @@ export const useGenerateSettingsMenu = () => {url: `/project/${ref}/settings/compute-and-disk`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_COMPUTE_AND_DISK,},{name: 'Infrastructure',@@ -59,6 +63,7 @@ export const useGenerateSettingsMenu = () => {url: `/project/${ref}/settings/infrastructure`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INFRASTRUCTURE,},{@@ -67,6 +72,7 @@ export const useGenerateSettingsMenu = () => {url: `/project/${ref}/settings/integrations`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INTEGRATIONS,},...(platformWebhooksEnabled? [@@ -76,6 +82,7 @@ export const useGenerateSettingsMenu = () => {url: `/project/${ref}/settings/webhooks`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_WEBHOOKS,},]: []),@@ -86,6 +93,7 @@ export const useGenerateSettingsMenu = () => {url: `/project/${ref}/settings/api-keys`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_API_KEYS,},{name: 'JWT Keys',@@ -95,6 +103,7 @@ export const useGenerateSettingsMenu = () => {: `/project/${ref}/settings/jwt/signing-keys`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_JWT_KEYS,},{@@ -103,12 +112,14 @@ export const useGenerateSettingsMenu = () => {url: `/project/${ref}/settings/log-drains`,items: [],disabled: !isProjectActive,+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_LOG_DRAINS,},{name: 'Add-ons',key: 'addons',url: `/project/${ref}/settings/addons`,items: [],+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_ADDONS,},...(showDashboardPreferences? [@@ -117,6 +128,7 @@ export const useGenerateSettingsMenu = () => {key: 'dashboard',url: `/project/${ref}/settings/dashboard`,items: [],+ shortcutId: SHORTCUT_IDS.NAV_PROJECT_SETTINGS_DASHBOARD,},]: []),diff --git a/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.test.tsx b/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.test.tsxindex b9897d0f93b..88909bc2f93 100644--- a/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.test.tsx+++ b/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.test.tsx@@ -82,6 +82,14 @@ const ACTIVE_PLATFORM_WEBHOOKS_SHORTCUT_IDS = [SHORTCUT_IDS.PLATFORM_WEBHOOKS_COPY_PAYLOAD,] satisfies ShortcutId[]+const ACTIVE_PROJECT_SETTINGS_SHORTCUT_IDS = [+ ...ACTIVE_SHORTCUT_IDS,+ SHORTCUT_IDS.NAV_PROJECT_SETTINGS_GENERAL,+ SHORTCUT_IDS.API_KEYS_NEW_PUBLISHABLE,+ SHORTCUT_IDS.JWT_KEYS_CREATE_STANDBY,+ SHORTCUT_IDS.LOG_DRAINS_ADD_DESTINATION,+] satisfies ShortcutId[]+let sequenceIdCounter = 0const buildSequenceRegistration = (id: ShortcutId): SequenceRegistrationView => {@@ -261,6 +269,22 @@ describe('ShortcutsReferenceSheet', () => {expect(screen.queryByText('platform-webhooks')).not.toBeInTheDocument()})+ it('shows project settings navigation and action sections with human labels', async () => {+ renderShortcutsReferenceSheet(ACTIVE_PROJECT_SETTINGS_SHORTCUT_IDS)++ expect(await screen.findByText('Project Settings Navigation')).toBeInTheDocument()+ expect(screen.getByText('API Keys')).toBeInTheDocument()+ expect(screen.getByText('JWT Keys')).toBeInTheDocument()+ expect(screen.getByText('Log Drains')).toBeInTheDocument()+ expect(screen.getByText('Go to General')).toBeInTheDocument()+ expect(screen.getByText('New publishable key')).toBeInTheDocument()+ expect(screen.getByText('Create standby key')).toBeInTheDocument()+ expect(screen.getByText('Add destination')).toBeInTheDocument()+ expect(screen.queryByText('api-keys')).not.toBeInTheDocument()+ expect(screen.queryByText('jwt-keys')).not.toBeInTheDocument()+ expect(screen.queryByText('log-drains')).not.toBeInTheDocument()+ })+it('does not show inactive database shortcuts in search results', async () => {const user = userEvent.setup()diff --git a/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.tsx b/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.tsxindex 0e2f3012aa1..6fd06f477b2 100644--- a/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.tsx+++ b/apps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.tsx@@ -44,6 +44,7 @@ const GROUP_LABELS: Record<string, string> = {'action-bar': 'Actions','advisors-page': 'Advisors','ai-assistant': 'AI Assistant',+ 'api-keys': 'API Keys','auth-users': 'Auth Users','command-menu': 'Command Menu','data-table': 'Data Tables',@@ -54,6 +55,8 @@ const GROUP_LABELS: Record<string, string> = {'list-page': 'List pages','platform-webhooks': 'Platform Webhooks','logs-preview': 'Logs Explorer',+ 'jwt-keys': 'JWT Keys',+ 'log-drains': 'Log Drains',nav: 'Navigation','operation-queue': 'Operation Queue',results: 'Results',diff --git a/apps/studio/pages/project/[ref]/settings/log-drains.tsx b/apps/studio/pages/project/[ref]/settings/log-drains.tsxindex ac16e7686cc..1db356abac7 100644--- a/apps/studio/pages/project/[ref]/settings/log-drains.tsx+++ b/apps/studio/pages/project/[ref]/settings/log-drains.tsx@@ -1,7 +1,7 @@import { PermissionAction } from '@supabase/shared-types/out/constants'import { IS_PLATFORM, useFlag, useParams } from 'common'import { ChevronDown } from 'lucide-react'-import { cloneElement, useState } from 'react'+import { cloneElement, useState, type ReactElement } from 'react'import { toast } from 'sonner'import {Alert,@@ -25,6 +25,7 @@ import { PageLayout } from '@/components/layouts/PageLayout/PageLayout'import SettingsLayout from '@/components/layouts/ProjectSettingsLayout/SettingsLayout'import { ScaffoldContainer, ScaffoldSection } from '@/components/layouts/Scaffold'import { DocsButton } from '@/components/ui/DocsButton'+import { Shortcut } from '@/components/ui/Shortcut'import {LogDrainCreateVariables,useCreateLogDrainMutation,@@ -34,6 +35,7 @@ import { useUpdateLogDrainMutation } from '@/data/log-drains/update-log-drain-muimport { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'import { DOCS_URL } from '@/lib/constants'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'import type { NextPageWithLayout } from '@/types'const LogDrainsSettings: NextPageWithLayout = () => {@@ -103,6 +105,12 @@ const LogDrainsSettings: NextPageWithLayout = () => {setOpen(true)}+ function handleAddDestinationClick() {+ setSelectedLogDrain(null)+ setMode('create')+ setOpen(true)+ }+const content = (<ScaffoldSection isFullWidth id="log-drains" className="gap-6"><ScaffoldContainer className="flex flex-col gap-10" bottomPadding>@@ -197,18 +205,22 @@ const LogDrainsSettings: NextPageWithLayout = () => {<>{!(logDrains?.length === 0) && (<div className="flex items-center">- <Button- disabled={!hasAccessToLogDrains || !canManageLogDrains}- onClick={() => {- setSelectedLogDrain(null)- setMode('create')- setOpen(true)- }}- type="primary"- className="rounded-r-none px-3"+ <Shortcut+ id={SHORTCUT_IDS.LOG_DRAINS_ADD_DESTINATION}+ onTrigger={handleAddDestinationClick}+ options={{ enabled: hasAccessToLogDrains && canManageLogDrains }}+ side="bottom"+ tooltipOpen={open ? false : undefined}>- Add destination- </Button>+ <Button+ disabled={!hasAccessToLogDrains || !canManageLogDrains}+ onClick={handleAddDestinationClick}+ type="primary"+ className="rounded-r-none px-3"+ >+ Add destination+ </Button>+ </Shortcut><DropdownMenu><DropdownMenuTrigger asChild><Button@@ -259,7 +271,7 @@ const LogDrainsSettings: NextPageWithLayout = () => {return content}-LogDrainsSettings.getLayout = (page) => (+LogDrainsSettings.getLayout = (page: ReactElement) => (<DefaultLayout><SettingsLayout title="Log Drains">{page}</SettingsLayout></DefaultLayout>diff --git a/apps/studio/state/shortcuts/referenceGroups.ts b/apps/studio/state/shortcuts/referenceGroups.tsindex 8fcc8039372..cbb34cca17b 100644--- a/apps/studio/state/shortcuts/referenceGroups.ts+++ b/apps/studio/state/shortcuts/referenceGroups.ts@@ -9,6 +9,7 @@ export const SHORTCUT_REFERENCE_GROUPS = {NAVIGATION_REALTIME: 'navigation.realtime',NAVIGATION_OBSERVABILITY: 'navigation.observability',NAVIGATION_ADVISORS: 'navigation.advisors',+ NAVIGATION_PROJECT_SETTINGS: 'navigation.project-settings',NAVIGATION_INTEGRATIONS_DETAIL: 'navigation.integrations-detail',} as const@@ -23,6 +24,7 @@ export const SHORTCUT_REFERENCE_GROUP_LABELS: Record<string, string> = {[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_REALTIME]: 'Realtime Navigation',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_OBSERVABILITY]: 'Observability Navigation',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS]: 'Advisors Navigation',+ [SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS]: 'Project Settings Navigation',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_INTEGRATIONS_DETAIL]: 'Integration Tabs',}@@ -48,6 +50,10 @@ export const SHORTCUT_REFERENCE_GROUP_ORDER = ['observability-page',SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS,'advisors-page',+ SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ 'api-keys',+ 'jwt-keys',+ 'log-drains',SHORTCUT_REFERENCE_GROUPS.NAVIGATION_INTEGRATIONS_DETAIL,'logs-preview','nav',diff --git a/apps/studio/state/shortcuts/registry.ts b/apps/studio/state/shortcuts/registry.tsindex 6643be580ac..2387775e7a6 100644--- a/apps/studio/state/shortcuts/registry.ts+++ b/apps/studio/state/shortcuts/registry.ts@@ -1,6 +1,7 @@import { SHORTCUT_REFERENCE_GROUPS } from './referenceGroups'import { ADVISORS_NAV_SHORTCUT_IDS, advisorsNavRegistry } from './registry/advisors-nav'import { ADVISORS_PAGE_SHORTCUT_IDS, advisorsPageRegistry } from './registry/advisors-page'+import { API_KEYS_SHORTCUT_IDS, apiKeysRegistry } from './registry/api-keys'import { AUTH_NAV_SHORTCUT_IDS, authNavRegistry } from './registry/auth-nav'import { AUTH_USERS_SHORTCUT_IDS, authUsersRegistry } from './registry/auth-users'import { DATABASE_NAV_SHORTCUT_IDS, databaseNavRegistry } from './registry/database-nav'@@ -15,7 +16,9 @@ import {FUNCTIONS_OVERVIEW_SHORTCUT_IDS,functionsOverviewRegistry,} from './registry/functions-overview'+import { JWT_KEYS_SHORTCUT_IDS, jwtKeysRegistry } from './registry/jwt-keys'import { LIST_PAGE_SHORTCUT_IDS, listPageRegistry } from './registry/list-page'+import { LOG_DRAINS_SHORTCUT_IDS, logDrainsRegistry } from './registry/log-drains'import { LOGS_PREVIEW_SHORTCUT_IDS, logsPreviewRegistry } from './registry/logs-preview'import {OBSERVABILITY_NAV_SHORTCUT_IDS,@@ -29,6 +32,10 @@ import {PLATFORM_WEBHOOKS_SHORTCUT_IDS,platformWebhooksRegistry,} from './registry/platform-webhooks'+import {+ PROJECT_SETTINGS_NAV_SHORTCUT_IDS,+ projectSettingsNavRegistry,+} from './registry/project-settings-nav'import {REALTIME_INSPECTOR_SHORTCUT_IDS,realtimeInspectorRegistry,@@ -149,6 +156,12 @@ export const SHORTCUT_IDS = {// Platform Webhooks page shortcuts (org and project level)...PLATFORM_WEBHOOKS_SHORTCUT_IDS,++ // Project Settings sub-page navigation chords and page actions+ ...PROJECT_SETTINGS_NAV_SHORTCUT_IDS,+ ...API_KEYS_SHORTCUT_IDS,+ ...JWT_KEYS_SHORTCUT_IDS,+ ...LOG_DRAINS_SHORTCUT_IDS,} as const/**@@ -484,4 +497,10 @@ export const SHORTCUT_DEFINITIONS: Record<ShortcutId, ShortcutDefinition> = {// Platform Webhooks page shortcut registration...platformWebhooksRegistry,++ // Project Settings sub-page navigation and page action shortcut registration+ ...projectSettingsNavRegistry,+ ...apiKeysRegistry,+ ...jwtKeysRegistry,+ ...logDrainsRegistry,}diff --git a/apps/studio/state/shortcuts/registry/api-keys.ts b/apps/studio/state/shortcuts/registry/api-keys.tsnew file mode 100644index 00000000000..0371949b58f--- /dev/null+++ b/apps/studio/state/shortcuts/registry/api-keys.ts@@ -0,0 +1,39 @@+import { RegistryDefinations } from '../types'++export const API_KEYS_SHORTCUT_IDS = {+ API_KEYS_NEW_PUBLISHABLE: 'api-keys.new-publishable',+ API_KEYS_NEW_SECRET: 'api-keys.new-secret',+ API_KEYS_CREATE_PUBLISHABLE: 'api-keys.create-publishable',+ API_KEYS_CREATE_SECRET: 'api-keys.create-secret',+}++export type ApiKeysShortcutId = (typeof API_KEYS_SHORTCUT_IDS)[keyof typeof API_KEYS_SHORTCUT_IDS]++export const apiKeysRegistry: RegistryDefinations<ApiKeysShortcutId> = {+ [API_KEYS_SHORTCUT_IDS.API_KEYS_NEW_PUBLISHABLE]: {+ id: API_KEYS_SHORTCUT_IDS.API_KEYS_NEW_PUBLISHABLE,+ label: 'New publishable key',+ sequence: ['Shift+P'],+ showInSettings: false,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [API_KEYS_SHORTCUT_IDS.API_KEYS_NEW_SECRET]: {+ id: API_KEYS_SHORTCUT_IDS.API_KEYS_NEW_SECRET,+ label: 'New secret key',+ sequence: ['Shift+S'],+ showInSettings: false,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [API_KEYS_SHORTCUT_IDS.API_KEYS_CREATE_PUBLISHABLE]: {+ id: API_KEYS_SHORTCUT_IDS.API_KEYS_CREATE_PUBLISHABLE,+ label: 'Create publishable key',+ sequence: ['Mod+Enter'],+ showInSettings: false,+ },+ [API_KEYS_SHORTCUT_IDS.API_KEYS_CREATE_SECRET]: {+ id: API_KEYS_SHORTCUT_IDS.API_KEYS_CREATE_SECRET,+ label: 'Create secret key',+ sequence: ['Mod+Enter'],+ showInSettings: false,+ },+}diff --git a/apps/studio/state/shortcuts/registry/jwt-keys.ts b/apps/studio/state/shortcuts/registry/jwt-keys.tsnew file mode 100644index 00000000000..b5461b7ab72--- /dev/null+++ b/apps/studio/state/shortcuts/registry/jwt-keys.ts@@ -0,0 +1,24 @@+import { RegistryDefinations } from '../types'++export const JWT_KEYS_SHORTCUT_IDS = {+ JWT_KEYS_CREATE_STANDBY: 'jwt-keys.create-standby',+ JWT_KEYS_SUBMIT_STANDBY: 'jwt-keys.submit-standby',+}++export type JwtKeysShortcutId = (typeof JWT_KEYS_SHORTCUT_IDS)[keyof typeof JWT_KEYS_SHORTCUT_IDS]++export const jwtKeysRegistry: RegistryDefinations<JwtKeysShortcutId> = {+ [JWT_KEYS_SHORTCUT_IDS.JWT_KEYS_CREATE_STANDBY]: {+ id: JWT_KEYS_SHORTCUT_IDS.JWT_KEYS_CREATE_STANDBY,+ label: 'Create standby key',+ sequence: ['Shift+N'],+ showInSettings: false,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [JWT_KEYS_SHORTCUT_IDS.JWT_KEYS_SUBMIT_STANDBY]: {+ id: JWT_KEYS_SHORTCUT_IDS.JWT_KEYS_SUBMIT_STANDBY,+ label: 'Create standby key',+ sequence: ['Mod+Enter'],+ showInSettings: false,+ },+}diff --git a/apps/studio/state/shortcuts/registry/log-drains.ts b/apps/studio/state/shortcuts/registry/log-drains.tsnew file mode 100644index 00000000000..a96a7036b71--- /dev/null+++ b/apps/studio/state/shortcuts/registry/log-drains.ts@@ -0,0 +1,25 @@+import { RegistryDefinations } from '../types'++export const LOG_DRAINS_SHORTCUT_IDS = {+ LOG_DRAINS_ADD_DESTINATION: 'log-drains.add-destination',+ LOG_DRAINS_SAVE_DESTINATION: 'log-drains.save-destination',+}++export type LogDrainsShortcutId =+ (typeof LOG_DRAINS_SHORTCUT_IDS)[keyof typeof LOG_DRAINS_SHORTCUT_IDS]++export const logDrainsRegistry: RegistryDefinations<LogDrainsShortcutId> = {+ [LOG_DRAINS_SHORTCUT_IDS.LOG_DRAINS_ADD_DESTINATION]: {+ id: LOG_DRAINS_SHORTCUT_IDS.LOG_DRAINS_ADD_DESTINATION,+ label: 'Add destination',+ sequence: ['Shift+N'],+ showInSettings: false,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [LOG_DRAINS_SHORTCUT_IDS.LOG_DRAINS_SAVE_DESTINATION]: {+ id: LOG_DRAINS_SHORTCUT_IDS.LOG_DRAINS_SAVE_DESTINATION,+ label: 'Save destination',+ sequence: ['Mod+Enter'],+ showInSettings: false,+ },+}diff --git a/apps/studio/state/shortcuts/registry/project-settings-nav.ts b/apps/studio/state/shortcuts/registry/project-settings-nav.tsnew file mode 100644index 00000000000..eb941ed35e1--- /dev/null+++ b/apps/studio/state/shortcuts/registry/project-settings-nav.ts@@ -0,0 +1,98 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++/**+ * Contextual chords for jumping between Project Settings pages — `S + <letter>`.+ *+ * Active only while SettingsLayout is mounted. External settings-adjacent routes+ * such as Data API, Vault, Subscription, and Usage intentionally stay out of+ * this group.+ */+export const PROJECT_SETTINGS_NAV_SHORTCUT_IDS = {+ NAV_PROJECT_SETTINGS_GENERAL: 'nav.project-settings-general',+ NAV_PROJECT_SETTINGS_COMPUTE_AND_DISK: 'nav.project-settings-compute-and-disk',+ NAV_PROJECT_SETTINGS_INFRASTRUCTURE: 'nav.project-settings-infrastructure',+ NAV_PROJECT_SETTINGS_INTEGRATIONS: 'nav.project-settings-integrations',+ NAV_PROJECT_SETTINGS_WEBHOOKS: 'nav.project-settings-webhooks',+ NAV_PROJECT_SETTINGS_API_KEYS: 'nav.project-settings-api-keys',+ NAV_PROJECT_SETTINGS_JWT_KEYS: 'nav.project-settings-jwt-keys',+ NAV_PROJECT_SETTINGS_LOG_DRAINS: 'nav.project-settings-log-drains',+ NAV_PROJECT_SETTINGS_ADDONS: 'nav.project-settings-addons',+ NAV_PROJECT_SETTINGS_DASHBOARD: 'nav.project-settings-dashboard',+}++export type ProjectSettingsNavShortcutId =+ (typeof PROJECT_SETTINGS_NAV_SHORTCUT_IDS)[keyof typeof PROJECT_SETTINGS_NAV_SHORTCUT_IDS]++export const projectSettingsNavRegistry: RegistryDefinations<ProjectSettingsNavShortcutId> = {+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_GENERAL]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_GENERAL,+ label: 'Go to General',+ sequence: ['S', 'G'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_COMPUTE_AND_DISK]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_COMPUTE_AND_DISK,+ label: 'Go to Compute and Disk',+ sequence: ['S', 'C'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INFRASTRUCTURE]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INFRASTRUCTURE,+ label: 'Go to Infrastructure',+ sequence: ['S', 'I'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INTEGRATIONS]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_INTEGRATIONS,+ label: 'Go to Integrations',+ sequence: ['S', 'N'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_WEBHOOKS]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_WEBHOOKS,+ label: 'Go to Webhooks',+ sequence: ['S', 'W'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_API_KEYS]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_API_KEYS,+ label: 'Go to API Keys',+ sequence: ['S', 'K'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_JWT_KEYS]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_JWT_KEYS,+ label: 'Go to JWT Keys',+ sequence: ['S', 'J'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_LOG_DRAINS]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_LOG_DRAINS,+ label: 'Go to Log Drains',+ sequence: ['S', 'L'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_ADDONS]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_ADDONS,+ label: 'Go to Add-ons',+ sequence: ['S', 'A'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+ [PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_DASHBOARD]: {+ id: PROJECT_SETTINGS_NAV_SHORTCUT_IDS.NAV_PROJECT_SETTINGS_DASHBOARD,+ label: 'Go to Dashboard',+ sequence: ['S', 'D'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_PROJECT_SETTINGS,+ },+}