Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: Discord in command menu (#39836)

Danny White7ab45695087e
diff --git a/apps/docs/components/Navigation/NavigationMenu/MenuIcons.tsx b/apps/docs/components/Navigation/NavigationMenu/MenuIcons.tsx
index 7306d2c55a2..dd0667b1684 100644
--- a/apps/docs/components/Navigation/NavigationMenu/MenuIcons.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/MenuIcons.tsx
@@ -684,7 +684,7 @@ export function IconUI({ width = 16, height = 16, className }: HomeMenuIcon) {
height="14.72"
rx="1.92"
stroke="currentColor"
- stroke-width="1.28"
+ strokeWidth="1.28"
/>
<path
d="M8.56519 4.69238H9.74564V8.94966C9.74564 9.41632 9.63534 9.82678 9.41473 10.181C9.19625 10.5353 8.88867 10.8121 8.492 11.0115C8.09534 11.2087 7.63185 11.3074 7.10155 11.3074C6.56913 11.3074 6.10458 11.2087 5.70791 11.0115C5.31125 10.8121 5.00367 10.5353 4.78519 10.181C4.5667 9.82678 4.45746 9.41632 4.45746 8.94966V4.69238H5.63791V8.85102C5.63791 9.12253 5.69731 9.36435 5.81609 9.57647C5.937 9.7886 6.1067 9.95511 6.32519 10.076C6.54367 10.1948 6.80246 10.2542 7.10155 10.2542C7.40064 10.2542 7.65943 10.1948 7.87791 10.076C8.09852 9.95511 8.26822 9.7886 8.387 9.57647C8.50579 9.36435 8.56519 9.12253 8.56519 8.85102V4.69238Z"
diff --git a/apps/studio/components/interfaces/App/CommandMenu/Support.tsx b/apps/studio/components/interfaces/App/CommandMenu/Support.tsx
index 771bb9d39f7..d391af5edc0 100644
--- a/apps/studio/components/interfaces/App/CommandMenu/Support.tsx
+++ b/apps/studio/components/interfaces/App/CommandMenu/Support.tsx
@@ -1,4 +1,4 @@
-import { LifeBuoy } from 'lucide-react'
+import { LifeBuoy, Activity } from 'lucide-react'
import { useMemo } from 'react'
import { IS_PLATFORM } from 'common'
@@ -10,26 +10,26 @@ const useSupportCommands = () => {
const commands = useMemo(
() =>
[
- {
- id: 'support',
- name: 'Support',
- route: 'https://www.supabase.com/support',
- icon: () => <LifeBuoy />,
- },
{
id: 'system-status',
- name: 'System Status',
- value: 'Support: System Status',
+ name: 'View system status',
+ value: 'Support: View system status',
route: 'https://status.supabase.com',
+ icon: () => <Activity />,
+ },
+ {
+ id: 'discord-community',
+ name: 'Ask Discord community',
+ value: 'Support: Ask Discord community',
+ route: 'https://discord.supabase.com',
icon: () => <LifeBuoy />,
},
{
- id: 'github-discussions',
- name: 'GitHub Discussions',
- value: 'Support: GitHub Discussions',
- route: 'https://github.com/orgs/supabase/discussions',
+ id: 'support-team',
+ name: 'Contact support',
+ value: 'Support: Contact support',
+ route: 'https://www.supabase.com/support',
icon: () => <LifeBuoy />,
- defaultHidden: true,
},
] as Array<ICommand>,
[]
diff --git a/packages/ui-patterns/package.json b/packages/ui-patterns/package.json
index 5df8c48b9e3..3114adf3e37 100644
--- a/packages/ui-patterns/package.json
+++ b/packages/ui-patterns/package.json
@@ -486,6 +486,7 @@
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"@monaco-editor/react": "^4.6.0",
+ "@radix-ui/react-visually-hidden": "^1.1.3",
"@supabase/sql-to-rest": "^0.1.6",
"@supabase/supabase-js": "catalog:",
"@vitest/coverage-v8": "^3.0.9",
diff --git a/packages/ui-patterns/src/CommandMenu/api/CommandInput.tsx b/packages/ui-patterns/src/CommandMenu/api/CommandInput.tsx
index afa27b8361c..37b38e81450 100644
--- a/packages/ui-patterns/src/CommandMenu/api/CommandInput.tsx
+++ b/packages/ui-patterns/src/CommandMenu/api/CommandInput.tsx
@@ -124,7 +124,7 @@ const CommandInput = forwardRef<
onCompositionStart={() => setImeComposing(true)}
onCompositionEnd={() => setImeComposing(false)}
className={cn(
- 'flex h-11 w-full rounded-md bg-transparent px-4 py-7 outline-none',
+ 'flex h-11 w-full rounded-md bg-transparent px-2 py-7 outline-none',
'focus:shadow-none focus:ring-transparent',
'text-base text-foreground-light placeholder:text-foreground-muted disabled:cursor-not-allowed disabled:opacity-50 border-0',
className
diff --git a/packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx b/packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx
index 1c1238310ef..ed3f4848439 100644
--- a/packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx
+++ b/packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx
@@ -1,5 +1,5 @@
'use client'
-
+import { VisuallyHidden } from '@radix-ui/react-visually-hidden'
import { AlertTriangle, ArrowLeft, Command, Search } from 'lucide-react'
import type { HTMLAttributes, MouseEvent, PropsWithChildren, ReactElement, ReactNode } from 'react'
import { Children, cloneElement, forwardRef, isValidElement, useEffect, useMemo } from 'react'
@@ -7,14 +7,22 @@ import { ErrorBoundary } from 'react-error-boundary'
import { useBreakpoint } from 'common'
import useDragToClose from 'common/hooks/useDragToClose'
-import { Button, Command_Shadcn_, Dialog, DialogContent, cn } from 'ui'
+import {
+ Button,
+ Command_Shadcn_,
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogTitle,
+ cn,
+} from 'ui'
import { useCurrentPage, usePageComponent, usePopPage } from './hooks/pagesHooks'
import { useQuery, useSetQuery } from './hooks/queryHooks'
import { useCommandMenuTelemetryContext } from './hooks/useCommandMenuTelemetryContext'
import {
- useCommandMenuSize,
useCommandMenuOpen,
+ useCommandMenuSize,
useSetCommandMenuOpen,
useSetupCommandMenuTouchEvents,
} from './hooks/viewHooks'
@@ -252,6 +260,10 @@ function CommandMenu({ children, trigger }: CommandMenuProps) {
className: cn('overflow-hidden flex data-closed:delay-100'),
}}
>
+ <VisuallyHidden>
+ <DialogTitle>Command menu</DialogTitle>
+ <DialogDescription>Type a command or search</DialogDescription>
+ </VisuallyHidden>
<ErrorBoundary FallbackComponent={CommandError}>
<PageSwitch>{children}</PageSwitch>
</ErrorBoundary>
diff --git a/packages/ui-patterns/src/CommandMenu/prepackaged/Changelog.tsx b/packages/ui-patterns/src/CommandMenu/prepackaged/Changelog.tsx
index 2827eccd9f3..5ba4f161d9e 100644
--- a/packages/ui-patterns/src/CommandMenu/prepackaged/Changelog.tsx
+++ b/packages/ui-patterns/src/CommandMenu/prepackaged/Changelog.tsx
@@ -9,7 +9,7 @@ const useChangelogCommand = ({ enabled = true }: { enabled?: boolean } = {}) =>
[
{
id: 'changelog',
- name: 'Changelog',
+ name: 'View changelog',
route: BASE_PATH ? 'https://supabase.com/changelog' : '/changelog',
icon: () => <Inbox />,
},
diff --git a/packages/ui-patterns/src/CommandMenu/prepackaged/Support.tsx b/packages/ui-patterns/src/CommandMenu/prepackaged/Support.tsx
index b7d9bf3530c..9debed79e2f 100644
--- a/packages/ui-patterns/src/CommandMenu/prepackaged/Support.tsx
+++ b/packages/ui-patterns/src/CommandMenu/prepackaged/Support.tsx
@@ -1,4 +1,4 @@
-import { LifeBuoy } from 'lucide-react'
+import { LifeBuoy, Activity } from 'lucide-react'
import { useMemo } from 'react'
import { useRegisterCommands, useSetCommandMenuOpen, type ICommand } from '..'
@@ -10,25 +10,25 @@ const useSupportCommands = ({ enabled = true }: { enabled?: boolean } = {}) => {
const commands = useMemo(
() =>
[
- {
- id: 'support',
- name: 'Go to Support',
- value: 'Support: Go to Support',
- href: '/support',
- icon: () => <LifeBuoy />,
- },
{
id: 'system-status',
- name: 'Go to System Status',
- value: 'Support: Go to System Status',
+ name: 'View system status',
+ value: 'Support: View system status',
href: 'https://status.supabase.com',
+ icon: () => <Activity />,
+ },
+ {
+ id: 'discord-community',
+ name: 'Ask Discord community',
+ value: 'Support: Ask Discord community',
+ href: 'https://discord.supabase.com',
icon: () => <LifeBuoy />,
},
{
- id: 'github-discussions',
- name: 'Go to GitHub Discussions',
- value: 'Support: Go to GitHub Discussions',
- href: 'https://github.com/orgs/supabase/discussions',
+ id: 'support-team',
+ name: 'Contact support',
+ value: 'Support: Contact support',
+ href: '/support',
icon: () => <LifeBuoy />,
},
].map((command) => ({
diff --git a/packages/ui/src/components/shadcn/ui/command.tsx b/packages/ui/src/components/shadcn/ui/command.tsx
index 84cb0361bab..bcba65695ee 100644
--- a/packages/ui/src/components/shadcn/ui/command.tsx
+++ b/packages/ui/src/components/shadcn/ui/command.tsx
@@ -57,12 +57,12 @@ const CommandInput = React.forwardRef<
},
ref
) => (
- <div className={cn('flex items-center border-b px-3', wrapperClassName)} cmdk-input-wrapper="">
+ <div className={cn('flex items-center border-b px-4', wrapperClassName)} cmdk-input-wrapper="">
{showSearchIcon && <Search className="h-4 w-4 shrink-0 opacity-50" />}
<CommandPrimitive.Input
ref={ref}
className={cn(
- 'flex h-9 w-full rounded-md bg-transparent py-3 md:text-sm text outline-none placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50 border-none focus:ring-0',
+ 'flex h-9 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50 border-none focus:ring-0',
className
)}
{...props}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0201d52bb40..96df56680d2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2405,6 +2405,9 @@ importers:
'@monaco-editor/react':
specifier: ^4.6.0
+ '@radix-ui/react-visually-hidden':
+ specifier: ^1.1.3
'@supabase/sql-to-rest':
specifier: ^0.1.6