The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(studio): add organization shortcuts (#46356)
Danny Whiteb2b5cba287f1
diff --git a/apps/studio/components/interfaces/HomePageActions.tsx b/apps/studio/components/interfaces/HomePageActions.tsxindex d937e52e021..c83611a1732 100644--- a/apps/studio/components/interfaces/HomePageActions.tsx+++ b/apps/studio/components/interfaces/HomePageActions.tsx@@ -3,8 +3,9 @@ import { useDebounce } from '@uidotdev/usehooks'import { LOCAL_STORAGE_KEYS, useParams } from 'common'import { Grid, List, Loader2, Plus, Search, X } from 'lucide-react'import Link from 'next/link'+import { useRouter } from 'next/router'import { parseAsArrayOf, parseAsString, parseAsStringLiteral, useQueryState } from 'nuqs'-import { useEffect } from 'react'+import { useEffect, useRef } from 'react'import { Button, ToggleGroup, ToggleGroupItem } from 'ui'import { Input } from 'ui-patterns/DataInputs/Input'@@ -14,10 +15,14 @@ import {PROJECT_LIST_SORT_VALUES,type ProjectListSort,} from '@/components/interfaces/Home/ProjectList/ProjectListSort.utils'+import { Shortcut } from '@/components/ui/Shortcut'import { useOrgProjectsInfiniteQuery } from '@/data/projects/org-projects-infinite-query'import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'import { PROJECT_STATUS } from '@/lib/constants'+import { onSearchInputEscape } from '@/lib/keyboard'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'+import { useShortcut } from '@/state/shortcuts/useShortcut'interface HomePageActionsProps {slug?: string@@ -26,6 +31,7 @@ interface HomePageActionsProps {export const HomePageActions = ({ slug: _slug, hideNewProject = false }: HomePageActionsProps) => {const { slug: urlSlug } = useParams()+ const router = useRouter()const projectCreationEnabled = useIsFeatureEnabled('projects:create')const slug = _slug ?? urlSlug@@ -57,6 +63,12 @@ export const HomePageActions = ({ slug: _slug, hideNewProject = false }: HomePag{ placeholderData: keepPreviousData })+ const searchInputRef = useRef<HTMLInputElement>(null)++ useShortcut(SHORTCUT_IDS.ORG_PROJECTS_SEARCH, () => {+ searchInputRef.current?.focus()+ })+useEffect(() => {if (isSuccessFilterStatusStorage && !!slug) setFilterStatus(filterStatusStorage)}, [filterStatusStorage, isSuccessFilterStatusStorage, setFilterStatus, slug])@@ -69,12 +81,14 @@ export const HomePageActions = ({ slug: _slug, hideNewProject = false }: HomePag<div className="flex flex-wrap items-center justify-between gap-2 w-full"><div className="flex flex-col gap-2 min-w-0 flex-1 basis-full md:basis-auto sm:flex-row sm:flex-wrap sm:items-center"><Input+ ref={searchInputRef}placeholder="Search for a project"icon={<Search />}size="tiny"className="w-full sm:w-32 md:w-64"value={search}onChange={(event) => setSearch(event.target.value)}+ onKeyDown={onSearchInputEscape(search, (v) => setSearch(v))}actions={[search && (<Button@@ -134,9 +148,17 @@ export const HomePageActions = ({ slug: _slug, hideNewProject = false }: HomePag)}{projectCreationEnabled && !hideNewProject && (- <Button asChild icon={<Plus />} type="primary" size="tiny">- <Link href={`/new/${slug}`}>New project</Link>- </Button>+ <Shortcut+ id={SHORTCUT_IDS.ORG_PROJECTS_NEW}+ onTrigger={() => {+ if (slug) router.push(`/new/${slug}`)+ }}+ side="bottom"+ >+ <Button asChild icon={<Plus />} type="primary" size="tiny">+ <Link href={`/new/${slug}`}>New project</Link>+ </Button>+ </Shortcut>)}</div></div>diff --git a/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx b/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsxindex cfbba92202f..d5a2039b7d0 100644--- a/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx+++ b/apps/studio/components/interfaces/Organization/AuditLogs/AuditLogs.tsx@@ -30,6 +30,8 @@ import { useOrganizationsQuery } from '@/data/organizations/organizations-query'import { useOrgProjectsInfiniteQuery } from '@/data/projects/org-projects-infinite-query'import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'+import { useShortcut } from '@/state/shortcuts/useShortcut'const logsUpgradeError = 'upgrade to Team or Enterprise Plan to access audit logs.'@@ -124,6 +126,10 @@ export const AuditLogs = () => {const shouldShowLoadingState =(isLoading && fetchStatus !== 'idle') || isLoadingPermissions || isLoadingEntitlements+ useShortcut(SHORTCUT_IDS.ORG_AUDIT_LOGS_REFRESH, () => refetch(), {+ enabled: !isLoading && !isRefetching && canReadAuditLogs,+ })+// This feature depends on the subscription tier of the user.// The API limits the logs to maximum of 62 days and 5 minutes so when the page is// viewed for more than 5 minutes, the call parameters needs to be updated. This also works withdiff --git a/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx b/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsxindex 4b5cefdeffb..dadaf1cf727 100644--- a/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx+++ b/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx@@ -34,6 +34,8 @@ import {GITHUB_INTEGRATION_INSTALLATION_URL,GITHUB_INTEGRATION_REVOKE_AUTHORIZATION_URL,} from '@/lib/github'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'+import { useShortcut } from '@/state/shortcuts/useShortcut'type GitHubSectionProps = {canCreateGitHubConnection: boolean@@ -166,6 +168,10 @@ export const IntegrationSettings = () => {router.push('/project/_/settings/integrations')}, [router])+ useShortcut(SHORTCUT_IDS.ORG_INTEGRATIONS_ADD_CONNECTION, onAddGitHubConnection, {+ enabled: canCreateGitHubConnection,+ })+const onDeleteGitHubConnection = useCallback(async (connection: IntegrationProjectConnection) => {if (!org?.id) {diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsxindex 341ab20c308..bb26d0e0f0d 100644--- a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx+++ b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx@@ -35,10 +35,12 @@ import AlertError from '@/components/ui/AlertError'import { ButtonTooltip } from '@/components/ui/ButtonTooltip'import CopyButton from '@/components/ui/CopyButton'import NoPermission from '@/components/ui/NoPermission'+import { Shortcut } from '@/components/ui/Shortcut'import { AuthorizedApp, useAuthorizedAppsQuery } from '@/data/oauth/authorized-apps-query'import { OAuthAppCreateResponse } from '@/data/oauth/oauth-app-create-mutation'import { OAuthApp, useOAuthAppsQuery } from '@/data/oauth/oauth-apps-query'import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'// [Joshen] Note on nav UX// Kang Ming mentioned that it might be better to split Published Apps and Authorized Apps into 2 separate tabs@@ -159,21 +161,30 @@ export const OAuthApps = () => {</PageSectionDescription></PageSectionSummary><PageSectionAside>- <ButtonTooltip- disabled={!canCreateOAuthApps}- type="primary"- onClick={() => setShowPublishModal(true)}- tooltip={{- content: {- side: 'bottom',- text: !canCreateOAuthApps- ? 'You need additional permissions to create apps'- : undefined,- },+ <Shortcut+ id={SHORTCUT_IDS.ORG_OAUTH_APPS_PUBLISH}+ onTrigger={() => {+ if (canCreateOAuthApps) setShowPublishModal(true)}}+ side="bottom"+ tooltipOpen={showPublishModal ? false : undefined}>- Publish OAuth app- </ButtonTooltip>+ <ButtonTooltip+ disabled={!canCreateOAuthApps}+ type="primary"+ onClick={() => setShowPublishModal(true)}+ tooltip={{+ content: {+ side: 'bottom',+ text: !canCreateOAuthApps+ ? 'You need additional permissions to create apps'+ : undefined,+ },+ }}+ >+ Publish OAuth app+ </ButtonTooltip>+ </Shortcut></PageSectionAside></PageSectionMeta><PageSectionContent className="space-y-4">diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsxindex 93eab9e1e76..f16f8ff9c1d 100644--- a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx+++ b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx@@ -37,6 +37,7 @@ import { AuthorizeRequesterDetails } from '../AuthorizeRequesterDetails'import { OAuthSecrets } from '../OAuthSecrets/OAuthSecrets'import { ScopesPanel } from './Scopes'import { DocsButton } from '@/components/ui/DocsButton'+import { Shortcut } from '@/components/ui/Shortcut'import {OAuthAppCreateResponse,useOAuthAppCreateMutation,@@ -46,6 +47,7 @@ import type { OAuthApp } from '@/data/oauth/oauth-apps-query'import { DOCS_URL } from '@/lib/constants'import { isValidHttpUrl, uuidv4 } from '@/lib/helpers'import { uploadAttachment } from '@/lib/upload'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'export interface PublishAppSidePanelProps {visible: boolean@@ -422,9 +424,16 @@ export const PublishAppSidePanel = ({<Button type="default" disabled={isSubmitting} onClick={() => onClose()}>Cancel</Button>- <Button htmlType="submit" loading={isSubmitting} disabled={isSubmitting}>- Confirm- </Button>+ <Shortcut+ id={SHORTCUT_IDS.ORG_OAUTH_APPS_SUBMIT}+ onTrigger={() => form.handleSubmit(onSubmit)()}+ options={{ enabled: visible && !isSubmitting }}+ side="top"+ >+ <Button htmlType="submit" loading={isSubmitting} disabled={isSubmitting}>+ Confirm+ </Button>+ </Shortcut></div></div></SidePanel.Content>diff --git a/apps/studio/components/interfaces/Organization/PrivateApps/Apps/AppsList/AppsList.tsx b/apps/studio/components/interfaces/Organization/PrivateApps/Apps/AppsList/AppsList.tsxindex c65e410c13c..6f11361e133 100644--- a/apps/studio/components/interfaces/Organization/PrivateApps/Apps/AppsList/AppsList.tsx+++ b/apps/studio/components/interfaces/Organization/PrivateApps/Apps/AppsList/AppsList.tsx@@ -12,14 +12,17 @@ import { DeleteAppModal } from '../DeleteAppModal'import { ViewAppSheet } from '../ViewAppSheet/ViewAppSheet'import { AppsListLoading } from './AppsListLoading'import { AppsListTable } from './AppsListTable'+import { Shortcut } from '@/components/ui/Shortcut'import { usePlatformAppDeleteMutation } from '@/data/platform-apps/platform-app-delete-mutation'import { usePlatformAppInstallationDeleteMutation } from '@/data/platform-apps/platform-app-installation-delete-mutation'+import type { ShortcutId } from '@/state/shortcuts/registry'interface AppsListProps {onCreateApp: () => void+ createShortcutId?: ShortcutId}-export function AppsList({ onCreateApp }: AppsListProps) {+export function AppsList({ onCreateApp, createShortcutId }: AppsListProps) {const { apps, isLoading, slug, installations, removeInstallation, removeInstallationsByAppId } =usePrivateApps()@@ -72,9 +75,17 @@ export function AppsList({ onCreateApp }: AppsListProps) {title="No private apps yet"description="Create a private app to generate scoped access tokens for your organization.">- <Button type="primary" icon={<Plus size={14} />} onClick={onCreateApp}>- Create app- </Button>+ {createShortcutId ? (+ <Shortcut id={createShortcutId} onTrigger={onCreateApp} side="bottom">+ <Button type="primary" icon={<Plus size={14} />} onClick={onCreateApp}>+ Create app+ </Button>+ </Shortcut>+ ) : (+ <Button type="primary" icon={<Plus size={14} />} onClick={onCreateApp}>+ Create app+ </Button>+ )}</EmptyStatePresentational>) : (<AppsListTablediff --git a/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsxindex cb74bb90a7c..884a9c65035 100644--- a/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx+++ b/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx@@ -44,6 +44,7 @@ import { DiscardChangesConfirmationDialog } from '@/components/ui-patterns/Dialoimport { ButtonTooltip } from '@/components/ui/ButtonTooltip'import { DocsButton } from '@/components/ui/DocsButton'import { OrganizationProjectSelector } from '@/components/ui/OrganizationProjectSelector'+import { Shortcut } from '@/components/ui/Shortcut'import { UpgradePlanButton } from '@/components/ui/UpgradePlanButton'import { useOrganizationCreateInvitationMutation } from '@/data/organization-members/organization-invitation-create-mutation'import { useOrganizationRolesV2Query } from '@/data/organization-members/organization-roles-query'@@ -58,6 +59,7 @@ import { useConfirmOnClose } from '@/hooks/ui/useConfirmOnClose'import { DOCS_URL } from '@/lib/constants'import { MANAGED_BY } from '@/lib/constants/infrastructure'import { useProfile } from '@/lib/profile'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'export const InviteMemberButton = () => {const { slug } = useParams()@@ -244,25 +246,34 @@ export const InviteMemberButton = () => {return (<Dialog open={isOpen} onOpenChange={handleOpenChange}><DialogTrigger asChild>- <ButtonTooltip- type="primary"- disabled={!canInviteMembers}- icon={<UserPlus size={14} />}- className="pointer-events-auto grow md:grow-0"- onClick={() => setIsOpen(true)}- tooltip={{- content: {- side: 'bottom',- text: !organizationMembersCreationEnabled- ? 'Inviting members is currently disabled'- : !canInviteMembers- ? 'You need additional permissions to invite members to this organization'- : undefined,- },+ <Shortcut+ id={SHORTCUT_IDS.ORG_TEAM_INVITE}+ onTrigger={() => {+ if (canInviteMembers) setIsOpen(true)}}+ side="bottom"+ tooltipOpen={isOpen ? false : undefined}>- Invite members- </ButtonTooltip>+ <ButtonTooltip+ type="primary"+ disabled={!canInviteMembers}+ icon={<UserPlus size={14} />}+ className="pointer-events-auto grow md:grow-0"+ onClick={() => setIsOpen(true)}+ tooltip={{+ content: {+ side: 'bottom',+ text: !organizationMembersCreationEnabled+ ? 'Inviting members is currently disabled'+ : !canInviteMembers+ ? 'You need additional permissions to invite members to this organization'+ : undefined,+ },+ }}+ >+ Invite members+ </ButtonTooltip>+ </Shortcut></DialogTrigger><DialogContent size="medium"><DialogHeader>@@ -440,9 +451,16 @@ export const InviteMemberButton = () => {<Button type="default" onClick={confirmOnClose}>Cancel</Button>- <Button type="primary" htmlType="submit" loading={isInviting}>- {emailCount >= 2 ? 'Send invitations' : 'Send invitation'}- </Button>+ <Shortcut+ id={SHORTCUT_IDS.ORG_TEAM_INVITE_SUBMIT}+ onTrigger={() => form.handleSubmit(onInviteMember)()}+ options={{ enabled: isOpen && !isInviting }}+ side="top"+ >+ <Button type="primary" htmlType="submit" loading={isInviting}>+ {emailCount >= 2 ? 'Send invitations' : 'Send invitation'}+ </Button>+ </Shortcut></DialogFooter></form></Form>diff --git a/apps/studio/components/layouts/AccountLayout/AccountLayout.types.ts b/apps/studio/components/layouts/AccountLayout/AccountLayout.types.tsindex ebda937625c..b8393d286ea 100644--- a/apps/studio/components/layouts/AccountLayout/AccountLayout.types.ts+++ b/apps/studio/components/layouts/AccountLayout/AccountLayout.types.ts@@ -7,6 +7,7 @@ export type SidebarLink = {isActive?: booleansubitemsKey?: string // I dont think this is being used at allonClick?: () => Promise<void>+ shortcutId?: import('@/state/shortcuts/registry').ShortcutId}export type SidebarSection = {diff --git a/apps/studio/components/layouts/AccountLayout/AccountLayout.utils.ts b/apps/studio/components/layouts/AccountLayout/AccountLayout.utils.tsindex 3fd546d81b6..0bc60485f68 100644--- a/apps/studio/components/layouts/AccountLayout/AccountLayout.utils.ts+++ b/apps/studio/components/layouts/AccountLayout/AccountLayout.utils.ts@@ -18,6 +18,7 @@ export function toSubMenuSections(sections: SidebarSection[]): SubMenuSection[]key: l.key,label: l.label,href: l.href,+ shortcutId: l.shortcutId,})),})).filter((s) => s.key || s.heading)diff --git a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.test.ts b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.test.tsindex 5cfb64fa8ea..4022b3ee12e 100644--- a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.test.ts+++ b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.test.ts@@ -5,6 +5,7 @@ import {generateOrganizationSettingsSections,normalizeOrganizationSettingsPath,} from './OrganizationSettingsLayout'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'describe('generateOrganizationSettingsMenuItems', () => {it('includes webhooks entry for organization settings nav', () => {@@ -88,6 +89,45 @@ describe('OrganizationSettingsLayout helpers', () => {).toBe(true)})+ it('attaches shortcutId to each settings link', () => {+ const sections = generateOrganizationSettingsSections({+ slug: 'my-org',+ currentPath: '/org/my-org/general',+ showSecuritySettings: true,+ showSsoSettings: true,+ showLegalDocuments: true,+ showPlatformWebhooks: true,+ })++ const allLinks = sections.flatMap((s) => s.links)+ const linkByKey = (key: string) => allLinks.find((l) => l.key === key)++ expect(linkByKey('general')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_GENERAL)+ expect(linkByKey('security')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_SECURITY)+ expect(linkByKey('sso')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_SSO)+ expect(linkByKey('apps')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_APPS)+ expect(linkByKey('webhooks')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_WEBHOOKS)+ expect(linkByKey('audit')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_AUDIT)+ expect(linkByKey('documents')?.shortcutId).toBe(SHORTCUT_IDS.NAV_ORG_SETTINGS_DOCUMENTS)+ })++ it('omits feature-flagged links (and their shortcutIds) when flags are off', () => {+ const sections = generateOrganizationSettingsSections({+ slug: 'my-org',+ currentPath: '/org/my-org/general',+ showSecuritySettings: false,+ showSsoSettings: false,+ showLegalDocuments: false,+ })++ const allLinks = sections.flatMap((s) => s.links)+ const keys = allLinks.map((l) => l.key)++ expect(keys).not.toContain('security')+ expect(keys).not.toContain('sso')+ expect(keys).not.toContain('documents')+ })+it('keeps webhooks nav item active for nested endpoint routes', () => {const sections = generateOrganizationSettingsSections({slug: 'my-org',diff --git a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsxindex 3d09a22dd29..0c2a1cf5a14 100644--- a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx+++ b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx@@ -1,11 +1,15 @@import { useFlag, useParams } from 'common'-import { PropsWithChildren } from 'react'+import { PropsWithChildren, useMemo } from 'react'import { useIsPlatformWebhooksEnabled } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext'import type { SidebarSection } from '@/components/layouts/AccountLayout/AccountLayout.types'+import { toSubMenuSections } from '@/components/layouts/AccountLayout/AccountLayout.utils'import { WithSidebar } from '@/components/layouts/AccountLayout/WithSidebar'+import { ProductMenuShortcuts } from '@/components/ui/ProductMenu/ProductMenuShortcuts'+import { convertSectionsToProductMenu } from '@/components/ui/ProductMenu/SubMenu.utils'import { useCurrentPath } from '@/hooks/misc/useCurrentPath'import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'interface OrganizationSettingsMenuItemsProps {slug?: string@@ -102,6 +106,7 @@ export const generateOrganizationSettingsSections = ({key: 'general',label: 'General',href: `/org/${slug}/general`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_GENERAL,},...(showSecuritySettings? [@@ -109,6 +114,7 @@ export const generateOrganizationSettingsSections = ({key: 'security',label: 'Security',href: `/org/${slug}/security`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_SECURITY,},]: []),@@ -118,6 +124,7 @@ export const generateOrganizationSettingsSections = ({key: 'sso',label: 'SSO',href: `/org/${slug}/sso`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_SSO,},]: []),@@ -128,6 +135,7 @@ export const generateOrganizationSettingsSections = ({key: 'apps',label: 'OAuth Apps',href: `/org/${slug}/apps`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_APPS,},...(showPrivateApps? [@@ -135,6 +143,7 @@ export const generateOrganizationSettingsSections = ({key: 'private-apps',label: 'Private Apps',href: `/org/${slug}/private-apps`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_PRIVATE_APPS,},]: []),@@ -144,6 +153,7 @@ export const generateOrganizationSettingsSections = ({key: 'webhooks',label: 'Webhooks',href: `/org/${slug}/webhooks`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_WEBHOOKS,},]: []),@@ -154,6 +164,7 @@ export const generateOrganizationSettingsSections = ({key: 'audit',label: 'Audit Logs',href: `/org/${slug}/audit`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_AUDIT,},...(showLegalDocuments? [@@ -161,6 +172,7 @@ export const generateOrganizationSettingsSections = ({key: 'documents',label: 'Legal Documents',href: `/org/${slug}/documents`,+ shortcutId: SHORTCUT_IDS.NAV_ORG_SETTINGS_DOCUMENTS,},]: []),@@ -221,18 +233,26 @@ export function OrganizationSettingsLayout({ children }: PropsWithChildren) {showPrivateApps,})+ const orgSettingsMenu = useMemo(+ () => convertSectionsToProductMenu(toSubMenuSections(sections)),+ [sections]+ )+// Browser titles for org settings routes are set by OrganizationLayout.return (- <WithSidebar- title="Organization Settings"- sections={sections}- header={- <div className="border-default flex min-h-(--header-height) items-center border-b px-6">- <h4 className="text-lg">Settings</h4>- </div>- }- >- {children}- </WithSidebar>+ <>+ <ProductMenuShortcuts menu={orgSettingsMenu} />+ <WithSidebar+ title="Organization Settings"+ sections={sections}+ header={+ <div className="border-default flex min-h-(--header-height) items-center border-b px-6">+ <h4 className="text-lg">Settings</h4>+ </div>+ }+ >+ {children}+ </WithSidebar>+ </>)}diff --git a/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts b/apps/studio/components/ui/ProductMenu/ProductMenu.types.tsindex 54a8f3fcffc..21cf7fd36bf 100644--- a/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts+++ b/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts@@ -36,7 +36,7 @@ export interface ProductMenuGroupItem {export interface SubMenuSection {key: stringheading?: string- links: Array<{ key: string; label: string; href?: string }>+ links: Array<{ key: string; label: string; href?: string; shortcutId?: ShortcutId }>}export interface SubMenuProps {diff --git a/apps/studio/components/ui/ProductMenu/SubMenu.utils.ts b/apps/studio/components/ui/ProductMenu/SubMenu.utils.tsindex 2557c9091df..1c1038b7837 100644--- a/apps/studio/components/ui/ProductMenu/SubMenu.utils.ts+++ b/apps/studio/components/ui/ProductMenu/SubMenu.utils.ts@@ -8,6 +8,7 @@ export function convertSectionsToProductMenu(sections: SubMenuSection[]): Produckey: link.key,name: link.label,url: link.href ?? '#',+ shortcutId: link.shortcutId,})),}))}diff --git a/apps/studio/pages/org/[slug]/private-apps/index.tsx b/apps/studio/pages/org/[slug]/private-apps/index.tsxindex c730c0b066b..afe0981b672 100644--- a/apps/studio/pages/org/[slug]/private-apps/index.tsx+++ b/apps/studio/pages/org/[slug]/private-apps/index.tsx@@ -28,6 +28,8 @@ import {import { DefaultLayout } from '@/components/layouts/DefaultLayout'import OrganizationLayout from '@/components/layouts/OrganizationLayout'import { OrganizationSettingsLayout } from '@/components/layouts/ProjectLayout/OrganizationSettingsLayout'+import { Shortcut } from '@/components/ui/Shortcut'+import { SHORTCUT_IDS } from '@/state/shortcuts/registry'import type { NextPageWithLayout } from '@/types'function PrivateAppsContent() {@@ -58,18 +60,28 @@ function PrivateAppsContent() {</PageSectionSummary>{!isLoading && apps.length > 0 && (<PageSectionAside>- <Button- type="primary"- icon={<Plus size={14} />}- onClick={() => setShowCreate(true)}+ <Shortcut+ id={SHORTCUT_IDS.ORG_PRIVATE_APPS_CREATE}+ onTrigger={() => setShowCreate(true)}+ side="bottom"+ tooltipOpen={showCreate ? false : undefined}>- Create app- </Button>+ <Button+ type="primary"+ icon={<Plus size={14} />}+ onClick={() => setShowCreate(true)}+ >+ Create app+ </Button>+ </Shortcut></PageSectionAside>)}</PageSectionMeta><PageSectionContent>- <AppsList onCreateApp={() => setShowCreate(true)} />+ <AppsList+ onCreateApp={() => setShowCreate(true)}+ createShortcutId={SHORTCUT_IDS.ORG_PRIVATE_APPS_CREATE}+ /></PageSectionContent></PageSection></PageContainer>diff --git a/apps/studio/state/shortcuts/referenceGroups.ts b/apps/studio/state/shortcuts/referenceGroups.tsindex cbb34cca17b..86a8d1abb5b 100644--- a/apps/studio/state/shortcuts/referenceGroups.ts+++ b/apps/studio/state/shortcuts/referenceGroups.ts@@ -1,6 +1,13 @@export const SHORTCUT_REFERENCE_GROUPS = {GLOBAL_ACTIONS: 'global.actions',NAVIGATION_GLOBAL: 'navigation.global',+ NAVIGATION_ORG_SETTINGS: 'navigation.org-settings',+ ORG_PROJECTS: 'org.projects',+ ORG_TEAM: 'org.team',+ ORG_INTEGRATIONS: 'org.integrations',+ ORG_OAUTH_APPS: 'org.oauth-apps',+ ORG_PRIVATE_APPS: 'org.private-apps',+ ORG_AUDIT_LOGS: 'org.audit-logs',NAVIGATION_DATABASE: 'navigation.database',NAVIGATION_AUTH: 'navigation.auth',NAVIGATION_STORAGE: 'navigation.storage',@@ -16,6 +23,13 @@ export const SHORTCUT_REFERENCE_GROUPS = {export const SHORTCUT_REFERENCE_GROUP_LABELS: Record<string, string> = {[SHORTCUT_REFERENCE_GROUPS.GLOBAL_ACTIONS]: 'Global Actions',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL]: 'Global Navigation',+ [SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS]: 'Org Settings Navigation',+ [SHORTCUT_REFERENCE_GROUPS.ORG_PROJECTS]: 'Projects',+ [SHORTCUT_REFERENCE_GROUPS.ORG_TEAM]: 'Team',+ [SHORTCUT_REFERENCE_GROUPS.ORG_INTEGRATIONS]: 'Integrations',+ [SHORTCUT_REFERENCE_GROUPS.ORG_OAUTH_APPS]: 'OAuth Apps',+ [SHORTCUT_REFERENCE_GROUPS.ORG_PRIVATE_APPS]: 'Private Apps',+ [SHORTCUT_REFERENCE_GROUPS.ORG_AUDIT_LOGS]: 'Audit Logs',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_DATABASE]: 'Database Navigation',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH]: 'Auth Navigation',[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_STORAGE]: 'Storage Navigation',@@ -33,6 +47,13 @@ export const SHORTCUT_REFERENCE_GROUP_ORDER = ['shortcuts',SHORTCUT_REFERENCE_GROUPS.GLOBAL_ACTIONS,SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL,+ SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ SHORTCUT_REFERENCE_GROUPS.ORG_PROJECTS,+ SHORTCUT_REFERENCE_GROUPS.ORG_TEAM,+ SHORTCUT_REFERENCE_GROUPS.ORG_INTEGRATIONS,+ SHORTCUT_REFERENCE_GROUPS.ORG_OAUTH_APPS,+ SHORTCUT_REFERENCE_GROUPS.ORG_PRIVATE_APPS,+ SHORTCUT_REFERENCE_GROUPS.ORG_AUDIT_LOGS,SHORTCUT_REFERENCE_GROUPS.NAVIGATION_DATABASE,SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,'auth-users',diff --git a/apps/studio/state/shortcuts/registry.ts b/apps/studio/state/shortcuts/registry.tsindex 2387775e7a6..69ff004e2ef 100644--- a/apps/studio/state/shortcuts/registry.ts+++ b/apps/studio/state/shortcuts/registry.ts@@ -28,6 +28,13 @@ import {OBSERVABILITY_PAGE_SHORTCUT_IDS,observabilityPageRegistry,} from './registry/observability-page'+import { ORG_AUDIT_LOGS_SHORTCUT_IDS, orgAuditLogsRegistry } from './registry/org-audit-logs'+import { ORG_INTEGRATIONS_SHORTCUT_IDS, orgIntegrationsRegistry } from './registry/org-integrations'+import { ORG_OAUTH_APPS_SHORTCUT_IDS, orgOAuthAppsRegistry } from './registry/org-oauth-apps'+import { ORG_PRIVATE_APPS_SHORTCUT_IDS, orgPrivateAppsRegistry } from './registry/org-private-apps'+import { ORG_PROJECTS_SHORTCUT_IDS, orgProjectsRegistry } from './registry/org-projects'+import { ORG_SETTINGS_NAV_SHORTCUT_IDS, orgSettingsNavRegistry } from './registry/org-settings-nav'+import { ORG_TEAM_SHORTCUT_IDS, orgTeamRegistry } from './registry/org-team'import {PLATFORM_WEBHOOKS_SHORTCUT_IDS,platformWebhooksRegistry,@@ -99,6 +106,21 @@ export const SHORTCUT_IDS = {SHORTCUTS_OPEN_REFERENCE: 'shortcuts.open-reference',CONNECT_OPEN_SHEET: 'connect.open-sheet',+ // Org settings sub-page navigation chords+ ...ORG_SETTINGS_NAV_SHORTCUT_IDS,+ // Org OAuth Apps page shortcuts+ ...ORG_OAUTH_APPS_SHORTCUT_IDS,+ // Org Team page shortcuts+ ...ORG_TEAM_SHORTCUT_IDS,+ // Org Integrations page shortcuts+ ...ORG_INTEGRATIONS_SHORTCUT_IDS,+ // Org Projects page shortcuts+ ...ORG_PROJECTS_SHORTCUT_IDS,+ // Org Private Apps page shortcuts+ ...ORG_PRIVATE_APPS_SHORTCUT_IDS,+ // Org Audit Logs page shortcuts+ ...ORG_AUDIT_LOGS_SHORTCUT_IDS,+// Table editor shortcuts...TABLE_EDITOR_SHORTCUT_IDS,@@ -417,7 +439,7 @@ export const SHORTCUT_DEFINITIONS: Record<ShortcutId, ShortcutDefinition> = {[SHORTCUT_IDS.NAV_ORG_SETTINGS]: {id: SHORTCUT_IDS.NAV_ORG_SETTINGS,label: 'Go to Organization Settings',- sequence: ['G', 'O'],+ sequence: ['G', ','],showInSettings: false,referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL,},@@ -440,6 +462,21 @@ export const SHORTCUT_DEFINITIONS: Record<ShortcutId, ShortcutDefinition> = {options: { ignoreInputs: true },},+ // Org settings sub-page navigation chord registration+ ...orgSettingsNavRegistry,+ // Org OAuth Apps page shortcut registration+ ...orgOAuthAppsRegistry,+ // Org Team page shortcut registration+ ...orgTeamRegistry,+ // Org Integrations page shortcut registration+ ...orgIntegrationsRegistry,+ // Org Projects page shortcut registration+ ...orgProjectsRegistry,+ // Org Private Apps page shortcut registration+ ...orgPrivateAppsRegistry,+ // Org Audit Logs page shortcut registration+ ...orgAuditLogsRegistry,+// Table editor shortcut registration...tableEditorRegistry,diff --git a/apps/studio/state/shortcuts/registry/org-audit-logs.ts b/apps/studio/state/shortcuts/registry/org-audit-logs.tsnew file mode 100644index 00000000000..873ec8d58af--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-audit-logs.ts@@ -0,0 +1,19 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++export const ORG_AUDIT_LOGS_SHORTCUT_IDS = {+ ORG_AUDIT_LOGS_REFRESH: 'org.audit-logs-refresh',+} as const++export type OrgAuditLogsShortcutId =+ (typeof ORG_AUDIT_LOGS_SHORTCUT_IDS)[keyof typeof ORG_AUDIT_LOGS_SHORTCUT_IDS]++export const orgAuditLogsRegistry: RegistryDefinations<OrgAuditLogsShortcutId> = {+ [ORG_AUDIT_LOGS_SHORTCUT_IDS.ORG_AUDIT_LOGS_REFRESH]: {+ id: ORG_AUDIT_LOGS_SHORTCUT_IDS.ORG_AUDIT_LOGS_REFRESH,+ label: 'Refresh audit logs',+ sequence: ['Shift+R'],+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_AUDIT_LOGS,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+}diff --git a/apps/studio/state/shortcuts/registry/org-integrations.ts b/apps/studio/state/shortcuts/registry/org-integrations.tsnew file mode 100644index 00000000000..748350d4c16--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-integrations.ts@@ -0,0 +1,19 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++export const ORG_INTEGRATIONS_SHORTCUT_IDS = {+ ORG_INTEGRATIONS_ADD_CONNECTION: 'org.integrations-add-connection',+} as const++export type OrgIntegrationsShortcutId =+ (typeof ORG_INTEGRATIONS_SHORTCUT_IDS)[keyof typeof ORG_INTEGRATIONS_SHORTCUT_IDS]++export const orgIntegrationsRegistry: RegistryDefinations<OrgIntegrationsShortcutId> = {+ [ORG_INTEGRATIONS_SHORTCUT_IDS.ORG_INTEGRATIONS_ADD_CONNECTION]: {+ id: ORG_INTEGRATIONS_SHORTCUT_IDS.ORG_INTEGRATIONS_ADD_CONNECTION,+ label: 'Add project connection',+ sequence: ['Shift+N'],+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_INTEGRATIONS,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+}diff --git a/apps/studio/state/shortcuts/registry/org-oauth-apps.ts b/apps/studio/state/shortcuts/registry/org-oauth-apps.tsnew file mode 100644index 00000000000..f215701a6a4--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-oauth-apps.ts@@ -0,0 +1,27 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++export const ORG_OAUTH_APPS_SHORTCUT_IDS = {+ ORG_OAUTH_APPS_PUBLISH: 'org.oauth-apps-publish',+ ORG_OAUTH_APPS_SUBMIT: 'org.oauth-apps-submit',+} as const++export type OrgOAuthAppsShortcutId =+ (typeof ORG_OAUTH_APPS_SHORTCUT_IDS)[keyof typeof ORG_OAUTH_APPS_SHORTCUT_IDS]++export const orgOAuthAppsRegistry: RegistryDefinations<OrgOAuthAppsShortcutId> = {+ [ORG_OAUTH_APPS_SHORTCUT_IDS.ORG_OAUTH_APPS_PUBLISH]: {+ id: ORG_OAUTH_APPS_SHORTCUT_IDS.ORG_OAUTH_APPS_PUBLISH,+ label: 'Publish OAuth app',+ sequence: ['Shift+N'],+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_OAUTH_APPS,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [ORG_OAUTH_APPS_SHORTCUT_IDS.ORG_OAUTH_APPS_SUBMIT]: {+ id: ORG_OAUTH_APPS_SHORTCUT_IDS.ORG_OAUTH_APPS_SUBMIT,+ label: 'Confirm OAuth app',+ sequence: ['Mod+Enter'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_OAUTH_APPS,+ },+}diff --git a/apps/studio/state/shortcuts/registry/org-private-apps.ts b/apps/studio/state/shortcuts/registry/org-private-apps.tsnew file mode 100644index 00000000000..be1ebad5fc4--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-private-apps.ts@@ -0,0 +1,19 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++export const ORG_PRIVATE_APPS_SHORTCUT_IDS = {+ ORG_PRIVATE_APPS_CREATE: 'org.private-apps-create',+} as const++export type OrgPrivateAppsShortcutId =+ (typeof ORG_PRIVATE_APPS_SHORTCUT_IDS)[keyof typeof ORG_PRIVATE_APPS_SHORTCUT_IDS]++export const orgPrivateAppsRegistry: RegistryDefinations<OrgPrivateAppsShortcutId> = {+ [ORG_PRIVATE_APPS_SHORTCUT_IDS.ORG_PRIVATE_APPS_CREATE]: {+ id: ORG_PRIVATE_APPS_SHORTCUT_IDS.ORG_PRIVATE_APPS_CREATE,+ label: 'Create private app',+ sequence: ['Shift+N'],+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_PRIVATE_APPS,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+}diff --git a/apps/studio/state/shortcuts/registry/org-projects.ts b/apps/studio/state/shortcuts/registry/org-projects.tsnew file mode 100644index 00000000000..8354d56ccfc--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-projects.ts@@ -0,0 +1,28 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++export const ORG_PROJECTS_SHORTCUT_IDS = {+ ORG_PROJECTS_NEW: 'org.projects-new',+ ORG_PROJECTS_SEARCH: 'org.projects-search',+} as const++export type OrgProjectsShortcutId =+ (typeof ORG_PROJECTS_SHORTCUT_IDS)[keyof typeof ORG_PROJECTS_SHORTCUT_IDS]++export const orgProjectsRegistry: RegistryDefinations<OrgProjectsShortcutId> = {+ [ORG_PROJECTS_SHORTCUT_IDS.ORG_PROJECTS_NEW]: {+ id: ORG_PROJECTS_SHORTCUT_IDS.ORG_PROJECTS_NEW,+ label: 'New project',+ sequence: ['Shift+N'],+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_PROJECTS,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [ORG_PROJECTS_SHORTCUT_IDS.ORG_PROJECTS_SEARCH]: {+ id: ORG_PROJECTS_SHORTCUT_IDS.ORG_PROJECTS_SEARCH,+ label: 'Search projects',+ sequence: ['Shift+F'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_PROJECTS,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+}diff --git a/apps/studio/state/shortcuts/registry/org-settings-nav.ts b/apps/studio/state/shortcuts/registry/org-settings-nav.tsnew file mode 100644index 00000000000..df31254acb3--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-settings-nav.ts@@ -0,0 +1,90 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++/**+ * Contextual chords for jumping between Organization Settings sub-pages — `S + <letter>`.+ *+ * Active only while OrganizationSettingsLayout is mounted (i.e. the user is somewhere+ * under `/org/<slug>/general|security|sso|apps|...`). Mirrors the project-settings+ * pattern: `S` for Settings, scoped to the layout so it doesn't burn a global key.+ */+export const ORG_SETTINGS_NAV_SHORTCUT_IDS = {+ NAV_ORG_SETTINGS_GENERAL: 'nav.org-settings-general',+ NAV_ORG_SETTINGS_SECURITY: 'nav.org-settings-security',+ NAV_ORG_SETTINGS_SSO: 'nav.org-settings-sso',+ NAV_ORG_SETTINGS_APPS: 'nav.org-settings-apps',+ NAV_ORG_SETTINGS_PRIVATE_APPS: 'nav.org-settings-private-apps',+ NAV_ORG_SETTINGS_WEBHOOKS: 'nav.org-settings-webhooks',+ NAV_ORG_SETTINGS_AUDIT: 'nav.org-settings-audit',+ NAV_ORG_SETTINGS_DOCUMENTS: 'nav.org-settings-documents',+} as const++export type OrgSettingsNavShortcutId =+ (typeof ORG_SETTINGS_NAV_SHORTCUT_IDS)[keyof typeof ORG_SETTINGS_NAV_SHORTCUT_IDS]++export const orgSettingsNavRegistry: RegistryDefinations<OrgSettingsNavShortcutId> = {+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_GENERAL]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_GENERAL,+ label: 'Go to General',+ sequence: ['S', 'G'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_SECURITY]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_SECURITY,+ label: 'Go to Security',+ sequence: ['S', 'C'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_SSO]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_SSO,+ label: 'Go to SSO',+ sequence: ['S', 'S'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_APPS]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_APPS,+ label: 'Go to OAuth apps',+ sequence: ['S', 'A'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_PRIVATE_APPS]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_PRIVATE_APPS,+ label: 'Go to Private apps',+ sequence: ['S', 'P'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_WEBHOOKS]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_WEBHOOKS,+ label: 'Go to Webhooks',+ sequence: ['S', 'W'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_AUDIT]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_AUDIT,+ label: 'Go to Audit logs',+ sequence: ['S', 'L'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+ [ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_DOCUMENTS]: {+ id: ORG_SETTINGS_NAV_SHORTCUT_IDS.NAV_ORG_SETTINGS_DOCUMENTS,+ label: 'Go to Legal documents',+ sequence: ['S', 'D'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS,+ options: { ignoreInputs: true },+ },+}diff --git a/apps/studio/state/shortcuts/registry/org-shortcuts.test.ts b/apps/studio/state/shortcuts/registry/org-shortcuts.test.tsnew file mode 100644index 00000000000..ca9e04f0486--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-shortcuts.test.ts@@ -0,0 +1,84 @@+import { describe, expect, it } from 'vitest'++import { SHORTCUT_REFERENCE_GROUP_ORDER, SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { SHORTCUT_DEFINITIONS, SHORTCUT_IDS } from '../registry'++describe('Org settings nav shortcuts', () => {+ const navIds = [+ SHORTCUT_IDS.NAV_ORG_SETTINGS_GENERAL,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_SECURITY,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_SSO,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_APPS,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_PRIVATE_APPS,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_WEBHOOKS,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_AUDIT,+ SHORTCUT_IDS.NAV_ORG_SETTINGS_DOCUMENTS,+ ]++ it.each(navIds)('%s is registered with NAVIGATION_ORG_SETTINGS group', (id) => {+ expect(SHORTCUT_DEFINITIONS[id].referenceGroup).toBe(+ SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS+ )+ })++ it.each(navIds)('%s sequence starts with S', (id) => {+ const sequence = SHORTCUT_DEFINITIONS[id].sequence+ expect(Array.isArray(sequence) ? sequence[0] : sequence).toBe('S')+ })+})++describe('NAV_ORG_SETTINGS remap', () => {+ it('uses G , (matching project settings chord)', () => {+ const def = SHORTCUT_DEFINITIONS[SHORTCUT_IDS.NAV_ORG_SETTINGS]+ expect(def.sequence).toEqual(['G', ','])+ })+})++describe('Org action shortcuts', () => {+ it('ORG_OAUTH_APPS_PUBLISH is registered', () => {+ expect(SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_OAUTH_APPS_PUBLISH]).toBeDefined()+ expect(SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_OAUTH_APPS_PUBLISH].sequence).toEqual(['Shift+N'])+ })++ it('ORG_OAUTH_APPS_SUBMIT uses Mod+Enter and is hidden from settings', () => {+ const def = SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_OAUTH_APPS_SUBMIT]+ expect(def.sequence).toEqual(['Mod+Enter'])+ expect(def.showInSettings).toBe(false)+ })++ it('ORG_TEAM_INVITE is registered', () => {+ expect(SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_TEAM_INVITE].sequence).toEqual(['Shift+N'])+ })++ it('ORG_TEAM_INVITE_SUBMIT uses Mod+Enter and is hidden from settings', () => {+ const def = SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_TEAM_INVITE_SUBMIT]+ expect(def.sequence).toEqual(['Mod+Enter'])+ expect(def.showInSettings).toBe(false)+ })++ it('ORG_INTEGRATIONS_ADD_CONNECTION is registered', () => {+ expect(SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_INTEGRATIONS_ADD_CONNECTION].sequence).toEqual([+ 'Shift+N',+ ])+ })++ it('ORG_PROJECTS_NEW is registered', () => {+ expect(SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_PROJECTS_NEW].sequence).toEqual(['Shift+N'])+ })++ it('ORG_PROJECTS_SEARCH is registered', () => {+ expect(SHORTCUT_DEFINITIONS[SHORTCUT_IDS.ORG_PROJECTS_SEARCH].sequence).toEqual(['Shift+F'])+ })+})++describe('Reference group ordering', () => {+ it('NAVIGATION_ORG_SETTINGS appears after NAVIGATION_GLOBAL', () => {+ const globalIdx = SHORTCUT_REFERENCE_GROUP_ORDER.indexOf(+ SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL+ )+ const orgSettingsIdx = SHORTCUT_REFERENCE_GROUP_ORDER.indexOf(+ SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ORG_SETTINGS+ )+ expect(orgSettingsIdx).toBeGreaterThan(globalIdx)+ })+})diff --git a/apps/studio/state/shortcuts/registry/org-team.ts b/apps/studio/state/shortcuts/registry/org-team.tsnew file mode 100644index 00000000000..7a87bcaebb6--- /dev/null+++ b/apps/studio/state/shortcuts/registry/org-team.ts@@ -0,0 +1,26 @@+import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'+import { RegistryDefinations } from '../types'++export const ORG_TEAM_SHORTCUT_IDS = {+ ORG_TEAM_INVITE: 'org.team-invite',+ ORG_TEAM_INVITE_SUBMIT: 'org.team-invite-submit',+} as const++export type OrgTeamShortcutId = (typeof ORG_TEAM_SHORTCUT_IDS)[keyof typeof ORG_TEAM_SHORTCUT_IDS]++export const orgTeamRegistry: RegistryDefinations<OrgTeamShortcutId> = {+ [ORG_TEAM_SHORTCUT_IDS.ORG_TEAM_INVITE]: {+ id: ORG_TEAM_SHORTCUT_IDS.ORG_TEAM_INVITE,+ label: 'Invite members',+ sequence: ['Shift+N'],+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_TEAM,+ options: { ignoreInputs: true, registerInCommandMenu: true },+ },+ [ORG_TEAM_SHORTCUT_IDS.ORG_TEAM_INVITE_SUBMIT]: {+ id: ORG_TEAM_SHORTCUT_IDS.ORG_TEAM_INVITE_SUBMIT,+ label: 'Send invitation(s)',+ sequence: ['Mod+Enter'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.ORG_TEAM,+ },+}