Skip to content

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

Cleanup types, add default menu items

Terry Suttonac27046d3444
diff --git a/packages/ui/src/components/Command/AiCommand.tsx b/packages/ui/src/components/Command/AiCommand.tsx
index 993ff42a773..0863698bd6f 100644
--- a/packages/ui/src/components/Command/AiCommand.tsx
+++ b/packages/ui/src/components/Command/AiCommand.tsx
@@ -121,7 +121,7 @@ function promptDataReducer(
interface IAiCommand {
query?: string
- setQuery?: () => void
+ setQuery?: (query: string) => void
page?: string
}
@@ -215,11 +215,11 @@ const AiCommand: FC<IAiCommand> = ({ query, setQuery, page }) => {
case COMMAND_ROUTES.AI_RLS_POLICY:
queryToSend = `Given this table schema:
-
- Schema STRIPE has tables:
+
+ Schema STRIPE has tables:
CHARGE with columns [ID, AMOUNT, CREATED, CURRENCY, CUSTOMER_ID]
CUSTOMER with columns [ID, NAME, CREATED, SHIPPING_ADDRESS_STATE]
-
+
\n\nAnswer with only an RLS policy in SQL, no other text: ${query}`
break
default:
@@ -477,10 +477,10 @@ const AiCommand: FC<IAiCommand> = ({ query, setQuery, page }) => {
<div className="flex gap-6">
<AiIconChat />
{/* <div
- className="w-7 h-7
-
+ className="w-7 h-7
+
bg-gradient-to-r from-purple-900 to-pink-900
-
+
rounded-lg border border-pink-400 flex items-center justify-center
shadow-sm
"
diff --git a/packages/ui/src/components/Command/Command.tsx b/packages/ui/src/components/Command/Command.tsx
index 29c7ea7ce28..2afb72f19f9 100644
--- a/packages/ui/src/components/Command/Command.tsx
+++ b/packages/ui/src/components/Command/Command.tsx
@@ -31,6 +31,8 @@ import { useCommandMenu } from './CommandMenuProvider'
import navItems from './command-nav-items.json'
import { NavItem } from './Command.types'
import { AiIcon } from './Command.icons'
+import { IconArrowRight } from '../Icon/icons/IconArrowRight'
+import { IconLifeBuoy } from '../Icon/icons/IconLifeBuoy'
export const COMMAND_ROUTES = {
AI_HOME: 'Supabase AI',
@@ -236,19 +238,38 @@ function CommandMenu({ actions }: { actions: IActions }) {
</span>
</CommandItem>
</CommandGroup>
+
+ <CommandGroup heading="Jump to">
+ {navItems.docsTools.map((item) => (
+ <CommandItem onSelect={() => router.push(item.url)}>
+ <IconArrowRight className="text-scale-900" />
+ <CommandLabel>
+ Go to <span className="font-bold"> {item.label}</span>
+ </CommandLabel>
+ </CommandItem>
+ ))}
+ </CommandGroup>
+
+ <CommandGroup heading="Support">
+ {navItems.docsSupport.map((item) => (
+ <CommandItem onSelect={() => router.push(item.url)}>
+ <IconLifeBuoy className="text-scale-900" />
+ <CommandLabel>
+ Go to <span className="font-bold"> {item.label}</span>
+ </CommandLabel>
+ </CommandItem>
+ ))}
+ </CommandGroup>
+
<CommandGroup heading="General">
- <CommandItem>
+ <CommandItem onSelect={() => router.push('https://supabase.com/changelog')}>
<IconInbox className="text-scale-900" />
- <CommandLabel>See what's new</CommandLabel>
+ <CommandLabel>Read the Changelog</CommandLabel>
</CommandItem>
<CommandItem onSelect={() => handleSetPages([...pages, 'Theme'], false)}>
<IconMonitor className="mr-2" />
Change theme
</CommandItem>
- <CommandItem>
- <IconCopy />
- Copy current page URL
- </CommandItem>
</CommandGroup>
<CommandGroup heading="Settings">
<CommandItem onSelect={() => handleSetPages([...pages, 'api-keys'], true)}>
@@ -272,23 +293,6 @@ function CommandMenu({ actions }: { actions: IActions }) {
<CommandShortcut>⌘S</CommandShortcut>
</CommandItem>
</CommandGroup>
- <CommandGroup heading="Settings2">
- <CommandItem>
- <User className="text-scale-900" />
- <CommandLabel>Profile2</CommandLabel>
- <CommandShortcut>⌘P</CommandShortcut>
- </CommandItem>
- <CommandItem>
- <CreditCard className="text-scale-900" />
- <CommandLabel>Billing2</CommandLabel>
- <CommandShortcut>⌘B</CommandShortcut>
- </CommandItem>
- <CommandItem>
- <Settings className="text-scale-900" />
- <CommandLabel>Settings2</CommandLabel>
- <CommandShortcut>⌘S</CommandShortcut>
- </CommandItem>
- </CommandGroup>
<ThemeOptions isSubItem />
<SearchableChildItems isSubItem />
diff --git a/packages/ui/src/components/Command/Command.utils.tsx b/packages/ui/src/components/Command/Command.utils.tsx
index 130146986d2..33323247975 100644
--- a/packages/ui/src/components/Command/Command.utils.tsx
+++ b/packages/ui/src/components/Command/Command.utils.tsx
@@ -25,6 +25,7 @@ Command.displayName = CommandPrimitive.displayName
interface CommandDialogProps extends ModalProps {
onKeyDown: KeyboardEventHandler<HTMLDivElement>
+ page?: number
}
const CommandDialog = ({ children, onKeyDown, page, ...props }: CommandDialogProps) => {
@@ -162,7 +163,7 @@ const CommandSeparator = React.forwardRef<
<CommandPrimitive.Separator
ref={ref}
className={cn(
- `h-px
+ `h-px
w-full
bg-scale-50
`,
@@ -188,13 +189,13 @@ const CommandItem = React.forwardRef<
backdrop-filter
backdrop-blur-md
- text-scale-1100 relative flex
-
- cursor-default select-none
- items-center rounded-md
- py-3 px-5 text-sm
+ text-scale-1100 relative flex
+
+ cursor-default select-none
+ items-center rounded-md
+ py-3 px-5 text-sm
transition-all
- outline-none
+ outline-none
aria-selected:bg-[#323232]
aria-selected:border-[#323232]
aria-selected:shadow-md
@@ -203,10 +204,10 @@ const CommandItem = React.forwardRef<
data-[disabled]:pointer-events-none data-[disabled]:opacity-50`
: `
py-3 px-2
- text-scale-1100
- relative flex
- cursor-default select-none items-center
- rounded-md text-sm outline-none
+ text-scale-1100
+ relative flex
+ cursor-default select-none items-center
+ rounded-md text-sm outline-none
aria-selected:bg-scale-400
@@ -214,8 +215,8 @@ const CommandItem = React.forwardRef<
aria-selected:backdrop-filter
aria-selected:backdrop-blur-md
- data-[disabled]:pointer-events-none
- data-[disabled]:opacity-50
+ data-[disabled]:pointer-events-none
+ data-[disabled]:opacity-50
`,
className
)}
diff --git a/packages/ui/src/components/Command/DocsSearch.tsx b/packages/ui/src/components/Command/DocsSearch.tsx
index 3e20fb44558..671d6578128 100644
--- a/packages/ui/src/components/Command/DocsSearch.tsx
+++ b/packages/ui/src/components/Command/DocsSearch.tsx
@@ -99,7 +99,7 @@ function promptDataReducer(
export interface DocsSearchProps {
query?: string
- setQuery?: () => void
+ setQuery?: (query: string) => void
page?: string
router: any
}
@@ -201,11 +201,11 @@ const DocsSearch = ({ query, setQuery, page, router }: DocsSearchProps) => {
strokeWidth={1.5}
className="
text-scale-900
- opacity-0
+ opacity-0
-left-4
group-aria-selected:scale-[101%]
group-aria-selected:opacity-100
- group-aria-selected:left-0
+ group-aria-selected:left-0
"
/>
)
@@ -214,16 +214,16 @@ const DocsSearch = ({ query, setQuery, page, router }: DocsSearchProps) => {
<div
className="
transition
- w-6 h-6
- bg-scale-100
+ w-6 h-6
+ bg-scale-100
group-aria-selected:scale-[105%]
group-aria-selected:bg-scale-1200
text-scale-1200
group-aria-selected:text-scale-100
- rounded flex
- items-center
+ rounded flex
+ items-center
justify-center
-
+
group-aria-selected:[&_svg]:scale-[103%]
"
{...props}
diff --git a/packages/ui/src/components/Command/command-nav-items.json b/packages/ui/src/components/Command/command-nav-items.json
index 514dac78116..baa5d762621 100644
--- a/packages/ui/src/components/Command/command-nav-items.json
+++ b/packages/ui/src/components/Command/command-nav-items.json
@@ -44,5 +44,41 @@
}
]
}
+ ],
+ "docsTools": [
+ {
+ "label": "Database",
+ "url": "https://supabase.com/docs/guides/database"
+ },
+ {
+ "label": "Auth",
+ "url": "https://supabase.com/docs/guides/auth/overview"
+ },
+ {
+ "label": "Edge Functions",
+ "url": "https://supabase.com/docs/guides/functions"
+ },
+ {
+ "label": "Realtime",
+ "url": "https://supabase.com/docs/guides/realtime"
+ },
+ {
+ "label": "Storage",
+ "url": "https://supabase.com/docs/guides/storage"
+ }
+ ],
+ "docsSupport": [
+ {
+ "label": "Support",
+ "url": "https://supabase.com/support"
+ },
+ {
+ "label": "System Status",
+ "url": "https://status.supabase.com/"
+ },
+ {
+ "label": "Github Discussions",
+ "url": "https://github.com/supabase/supabase/discussions"
+ }
]
}