diff --git a/apps/studio/components/interfaces/App/FeaturePreview/AssistantV2Preview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/AssistantV2Preview.tsx deleted file mode 100644 index a10d9531f872b..0000000000000 --- a/apps/studio/components/interfaces/App/FeaturePreview/AssistantV2Preview.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import Image from 'next/image' - -import { useParams } from 'common' -import { Markdown } from 'components/interfaces/Markdown' -import { BASE_PATH } from 'lib/constants' -import { detectOS } from 'lib/helpers' - -export const AssistantV2Preview = () => { - const os = detectOS() - const { ref } = useParams() - - return ( -
-

- We're changing the way our AI Assistant integrates with the dashboard by making it shared - and accessible universally across the whole dashboard. This hopes to make using the - Assistant as a supporting tool more seamless while you build your project. -

- api-docs-side-panel-preview -

- The Assistant will also be automatically provided with contexts depending on where you are - in the dashboard to generate more relevant and higher quality outputs. You may also ask for - insights on your own data apart from help with SQL and Postgres! -

-

- We believe that this should further lower the barrier of working with databases especially - if you're not well acquainted with Postgres (yet!), so please do feel free to let us know - what you think in the attached GitHub discussion above! -

-
-

Enabling this preview will:

- -
-
- ) -} diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx index 03ef6fa224fe8..2d897e8b14e8b 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx @@ -5,16 +5,8 @@ import { LOCAL_STORAGE_KEYS } from 'lib/constants' import { EMPTY_OBJ } from 'lib/void' import { APISidePanelPreview } from './APISidePanelPreview' import { CLSPreview } from './CLSPreview' -import { AssistantV2Preview } from './AssistantV2Preview' export const FEATURE_PREVIEWS = [ - { - key: LOCAL_STORAGE_KEYS.UI_PREVIEW_ASSISTANT_V2, - name: 'Supabase AI Assistant V2', - content: , - discussionsUrl: undefined, - isNew: true, - }, { key: LOCAL_STORAGE_KEYS.UI_PREVIEW_API_SIDE_PANEL, name: 'Project API documentation', @@ -85,8 +77,3 @@ export const useIsColumnLevelPrivilegesEnabled = () => { const { flags } = useFeaturePreviewContext() return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS] } - -export const useIsAssistantV2Enabled = () => { - const { flags } = useFeaturePreviewContext() - return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_ASSISTANT_V2] -} diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx index 01c76d6799764..c04cdd98f6646 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx @@ -4,7 +4,6 @@ import { useEffect, useState } from 'react' import { useSendEventMutation } from 'data/telemetry/send-event-mutation' import { useFlag } from 'hooks/ui/useFlag' -import { LOCAL_STORAGE_KEYS } from 'lib/constants' import { TELEMETRY_EVENTS } from 'lib/constants/telemetry' import { useAppStateSnapshot } from 'state/app-state' import { Badge, Button, Modal, ScrollArea, cn } from 'ui' @@ -42,13 +41,6 @@ const FeaturePreviewModal = () => { label: selectedFeatureKey, value: isSelectedFeatureEnabled ? 'disabled' : 'enabled', }) - - if ( - selectedFeatureKey === LOCAL_STORAGE_KEYS.UI_PREVIEW_ASSISTANT_V2 && - isSelectedFeatureEnabled - ) { - snap.setAiAssistantPanel({ open: false }) - } } function handleCloseFeaturePreviewModal() { diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/QueryError.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/QueryError.tsx index 8faa934e5634f..0ac3fa00896d8 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/QueryError.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/QueryError.tsx @@ -72,7 +72,8 @@ const QueryError = ({ {open ? 'Hide error details' : 'Show error details'} - {!hasHipaaAddon && ( + {/* [Joshen] Temp hidden as new assistant doesnt support this. Current assistant's UX is not great too tbh so okay to hide this */} + {/* {!hasHipaaAddon && ( - )} + )} */} {formattedError.length > 0 ? ( diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx index f0c174e11e756..22c4bb7e25295 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx @@ -1,13 +1,14 @@ import type { PostgresPolicy } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { noop } from 'lodash' +import { Edit, MoreVertical, Trash } from 'lucide-react' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { DropdownMenuItemTooltip } from 'components/ui/DropdownMenuItemTooltip' import Panel from 'components/ui/Panel' import { useAuthConfigQuery } from 'data/auth/auth-config-query' import { useCheckPermissions } from 'hooks/misc/useCheckPermissions' -import { Edit, MoreVertical, Trash } from 'lucide-react' +import { useAppStateSnapshot } from 'state/app-state' import { Badge, Button, @@ -21,8 +22,6 @@ import { TooltipContent_Shadcn_, TooltipTrigger_Shadcn_, } from 'ui' -import { useIsAssistantV2Enabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' -import { useAppStateSnapshot } from 'state/app-state' import { generatePolicyCreateSQL } from './PolicyTableRow.utils' interface PolicyRowProps { @@ -39,7 +38,6 @@ const PolicyRow = ({ onSelectDeletePolicy = noop, }: PolicyRowProps) => { const { setAiAssistantPanel } = useAppStateSnapshot() - const isAssistantV2Enabled = useIsAssistantV2Enabled() const canUpdatePolicies = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'policies') const { project } = useProjectContext() @@ -106,39 +104,33 @@ const PolicyRow = ({ diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/PreviousRunsTab.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/PreviousRunsTab.tsx index 1beebad7e4d6c..8070ed705b99e 100644 --- a/apps/studio/components/interfaces/Integrations/CronJobs/PreviousRunsTab.tsx +++ b/apps/studio/components/interfaces/Integrations/CronJobs/PreviousRunsTab.tsx @@ -1,7 +1,7 @@ import { toString as CronToString } from 'cronstrue' import { List } from 'lucide-react' import Link from 'next/link' -import { UIEvent, useCallback, useMemo } from 'react' +import { UIEvent, useCallback, useEffect, useMemo } from 'react' import DataGrid, { Column, Row } from 'react-data-grid' import { useParams } from 'common' @@ -146,6 +146,7 @@ export const PreviousRunsTab = () => { data, isLoading: isLoadingCronJobRuns, fetchNextPage, + refetch, isFetching, } = useCronJobRunsInfiniteQuery( { @@ -156,6 +157,15 @@ export const PreviousRunsTab = () => { { enabled: !!currentJobState?.jobid, staleTime: 30 } ) + useEffect(() => { + // Refetch only the first page + const timerId = setInterval(() => { + refetch({ refetchPage: (_page, index) => index === 0 }) + }, 30000) + + return () => clearInterval(timerId) + }, [refetch]) + const handleScroll = useCallback( (event: UIEvent) => { if (isLoadingCronJobRuns || !isAtBottom(event)) return diff --git a/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx b/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx index 291a10951b7ae..185d58209a00d 100644 --- a/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx +++ b/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx @@ -110,7 +110,7 @@ const supabaseIntegrations: IntegrationDefinition[] = [ }, }, { - id: 'cron-jobs', + id: 'cron', type: 'postgres_extension' as const, requiredExtensions: ['pg_cron'], name: `Cron`, diff --git a/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx b/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx index 25dca6d4d0797..058cd56017f1e 100644 --- a/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx +++ b/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx @@ -103,7 +103,7 @@ export const AdvancedConfiguration = ({ form }: AdvancedConfigurationProps) => { type="warning" className="rounded-t-none [&>div]:text-xs" title="OrioleDB is not production ready" - description="Postgres with OrioleDB extension is currently in public alpha and not recommended for production usage yet." + description="Postgres with OrioleDB extension is currently in Public Alpha and not recommended for production usage yet." > { const [copied, setCopied] = useState(false) diff --git a/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx b/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx index e7bbd9dd31c1b..03c2156d57c0c 100644 --- a/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx +++ b/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx @@ -21,6 +21,7 @@ interface MessageProps { action?: React.ReactNode } +// [DEPRECATED] To delete const Message = memo(function Message({ name, role, diff --git a/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/index.tsx b/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/index.tsx index d27eebd1d8fcf..0424b2d477b84 100644 --- a/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/index.tsx +++ b/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/index.tsx @@ -51,6 +51,7 @@ interface AiAssistantPanelProps { onClose: () => void } +// [DEPRECATED] To delete export const AiAssistantPanel = ({ selectedMessage, existingSql, diff --git a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx index 08c0dfd01ff4b..4b05881848d0b 100644 --- a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx @@ -12,7 +12,6 @@ import { useAppStateSnapshot } from 'state/app-state' import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2' import { cn } from 'ui' import { Admonition } from 'ui-patterns' -import { useIsAssistantV2Enabled } from '../App/FeaturePreview/FeaturePreviewContext' import { untitledSnippetTitle } from './SQLEditor.constants' import type { IStandaloneCodeEditor } from './SQLEditor.types' import { createSqlSnippetSkeletonV2 } from './SQLEditor.utils' @@ -42,7 +41,6 @@ const MonacoEditor = ({ const project = useSelectedProject() const snapV2 = useSqlEditorV2StateSnapshot() - const isAssistantV2Enabled = useIsAssistantV2Enabled() const { setAiAssistantPanel } = useAppStateSnapshot() const [intellisenseEnabled] = useLocalStorageQuery( @@ -77,24 +75,22 @@ const MonacoEditor = ({ }, }) - if (isAssistantV2Enabled) { - editor.addAction({ - id: 'explain-code', - label: 'Explain Code', - contextMenuGroupId: 'operation', - contextMenuOrder: 1, - run: () => { - const selectedValue = (editorRef?.current as any) - .getModel() - .getValueInRange((editorRef?.current as any)?.getSelection()) - setAiAssistantPanel({ - open: true, - sqlSnippets: [selectedValue], - initialInput: 'Can you explain this section to me in more detail?', - }) - }, - }) - } + editor.addAction({ + id: 'explain-code', + label: 'Explain Code', + contextMenuGroupId: 'operation', + contextMenuOrder: 1, + run: () => { + const selectedValue = (editorRef?.current as any) + .getModel() + .getValueInRange((editorRef?.current as any)?.getSelection()) + setAiAssistantPanel({ + open: true, + sqlSnippets: [selectedValue], + initialInput: 'Can you explain this section to me in more detail?', + }) + }, + }) editor.onDidChangeCursorSelection(({ selection }) => { const noSelection = diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx index a958b2ffcb8f8..620c265b844d8 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx @@ -6,7 +6,6 @@ import dynamic from 'next/dynamic' import { useRouter } from 'next/router' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { toast } from 'sonner' -import { format } from 'sql-formatter' import { Separator } from '@ui/components/SidePanel/SidePanel' import { useParams } from 'common' @@ -35,14 +34,12 @@ import { useDatabaseSelectorStateSnapshot } from 'state/database-selector' import { isRoleImpersonationEnabled, useGetImpersonatedRole } from 'state/role-impersonation-state' import { getSqlEditorV2StateSnapshot, useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2' import { - AiIconAnimation, Button, DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, - ImperativePanelHandle, ResizableHandle, ResizablePanel, ResizablePanelGroup, @@ -52,9 +49,7 @@ import { cn, } from 'ui' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' -import { useIsAssistantV2Enabled } from '../App/FeaturePreview/FeaturePreviewContext' import { subscriptionHasHipaaAddon } from '../Billing/Subscription/Subscription.utils' -import { AiAssistantPanel } from './AiAssistantPanel' import AISchemaSuggestionPopover from './AISchemaSuggestionPopover' import { DiffActionBar } from './DiffActionBar' import { @@ -106,7 +101,6 @@ const SQLEditor = () => { const databaseSelectorState = useDatabaseSelectorStateSnapshot() const queryClient = useQueryClient() - const isAssistantV2Enabled = useIsAssistantV2Enabled() const { open } = appSnap.aiAssistantPanel const { mutate: formatQuery } = useFormatQueryMutation() @@ -121,26 +115,20 @@ const SQLEditor = () => { const editorRef = useRef(null) const monacoRef = useRef(null) const diffEditorRef = useRef(null) - const aiPanelRef = useRef(null) const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: organization?.slug }) const { data: databases, isSuccess: isSuccessReadReplicas } = useReadReplicasQuery({ projectRef: ref, }) - // Customers on HIPAA plans should not have access to Supabase AI - const hasHipaaAddon = subscriptionHasHipaaAddon(subscription) - - // [Joshen] This eventually needs to be in the app state - const [isAiOpen, setIsAiOpen] = useLocalStorageQuery(LOCAL_STORAGE_KEYS.SQL_EDITOR_AI_OPEN, true) - const isAssistantOpen = (!isAssistantV2Enabled && isAiOpen) || (isAssistantV2Enabled && open) - const [showPotentialIssuesModal, setShowPotentialIssuesModal] = useState(false) const [queryHasDestructiveOperations, setQueryHasDestructiveOperations] = useState(false) const [queryHasUpdateWithoutWhere, setQueryHasUpdateWithoutWhere] = useState(false) const isOptedInToAI = useOrgOptedIntoAi() const [selectedSchemas] = useSchemasForAi(project?.ref!) + // Customers on HIPAA plans should not have access to Supabase AI + const hasHipaaAddon = subscriptionHasHipaaAddon(subscription) const includeSchemaMetadata = isOptedInToAI || !IS_PLATFORM const [isAcceptDiffLoading, setIsAcceptDiffLoading] = useState(false) @@ -411,33 +399,11 @@ const SQLEditor = () => { try { const snippet = snapV2.snippets[id] const result = snapV2.results[id]?.[0] - if (isAssistantV2Enabled) { - appSnap.setAiAssistantPanel({ - open: true, - sqlSnippets: [snippet.snippet.content.sql.replace(sqlAiDisclaimerComment, '').trim()], - initialInput: `Help me to debug the attached sql snippet which gives the following error: \n\n${result.error.message}`, - }) - } else { - const { solution, sql } = await debugSql({ - sql: snippet.snippet.content.sql.replace(sqlAiDisclaimerComment, '').trim(), - errorMessage: result.error.message, - entityDefinitions, - }) - - const formattedSql = - sqlAiDisclaimerComment + - '\n\n' + - format(sql, { - language: 'postgresql', - keywordCase: 'lower', - }) - setDebugSolution(solution) - setSourceSqlDiff({ - original: snippet.snippet.content.sql, - modified: formattedSql, - }) - setSelectedDiffType(DiffType.Modification) - } + appSnap.setAiAssistantPanel({ + open: true, + sqlSnippets: [snippet.snippet.content.sql.replace(sqlAiDisclaimerComment, '').trim()], + initialInput: `Help me to debug the attached sql snippet which gives the following error: \n\n${result.error.message}`, + }) } catch (error: unknown) { // [Joshen] There's a tendency for the SQL debug to chuck a lengthy error message // that's not relevant for the user - so we prettify it here by avoiding to return the @@ -693,7 +659,7 @@ const SQLEditor = () => { direction="vertical" autoSaveId={LOCAL_STORAGE_KEYS.SQL_EDITOR_SPLIT_SIZE} > - {(isAssistantOpen || isDiffOpen) && !hasHipaaAddon && ( + {(open || isDiffOpen) && !hasHipaaAddon && ( { appSnap.setShowAiSettingsModal(true) @@ -729,41 +695,6 @@ const SQLEditor = () => { )}
- {!isAssistantV2Enabled && !isAiOpen && ( - { - if (isAssistantV2Enabled) { - const state = getSqlEditorV2StateSnapshot() - const snippet = state.snippets[id] - const editor = editorRef.current - const selection = editor?.getSelection() - const selectedValue = selection - ? editor?.getModel()?.getValueInRange(selection) - : undefined - const sql = snippet - ? (selectedValue || editorRef.current?.getValue()) ?? - snippet.snippet.content.sql - : selectedValue || editorRef.current?.getValue() - - appSnap.setAiAssistantPanel({ - open: true, - sqlSnippets: sql ? [sql] : [], - initialInput: sql - ? `Help me make a change to the attached sql snippet` - : '', - }) - } else { - aiPanelRef.current?.expand() - } - }} - > - - - )} - {isLoading ? (
@@ -895,28 +826,6 @@ const SQLEditor = () => { - - {!isAssistantV2Enabled && ( - <> - - setIsAiOpen(false)} - onExpand={() => setIsAiOpen(true)} - > - aiPanelRef.current?.collapse()} - /> - - - )} ) diff --git a/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx b/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx index d24b38bfa3f98..f1d5f67405e5d 100644 --- a/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx +++ b/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx @@ -165,7 +165,7 @@ export function LogsSidebarMenuV2() { items: [], }, { - name: 'Cron Jobs', + name: 'Cron', key: 'pg_cron', url: `/project/${ref}/logs/pgcron-logs`, items: [], diff --git a/apps/studio/components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsMenu.utils.tsx b/apps/studio/components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsMenu.utils.tsx index 85a9c5501b678..1811d28d2ad47 100644 --- a/apps/studio/components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsMenu.utils.tsx +++ b/apps/studio/components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsMenu.utils.tsx @@ -44,9 +44,9 @@ export const generateProjectIntegrationsMenu = ( ...(!!cronUiEnabled ? [ { - name: 'Cron Jobs', + name: 'Cron', key: 'cron-jobs', - url: `/project/${ref}/integrations/cron-jobs`, + url: `/project/${ref}/integrations/cron`, items: [], }, ] diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx index 6285bcc57619f..66cc136d93511 100644 --- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx +++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx @@ -1,7 +1,8 @@ -import { useParams } from 'common' import Link from 'next/link' import { useMemo } from 'react' +import { useParams } from 'common' +import AssistantButton from 'components/layouts/AppLayout/AssistantButton' import BranchDropdown from 'components/layouts/AppLayout/BranchDropdown' import EnableBranchingButton from 'components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton' import OrganizationDropdown from 'components/layouts/AppLayout/OrganizationDropdown' @@ -17,14 +18,11 @@ import BreadcrumbsView from './BreadcrumbsView' import { FeedbackDropdown } from './FeedbackDropdown' import HelpPopover from './HelpPopover' import NotificationsPopoverV2 from './NotificationsPopoverV2/NotificationsPopover' -import AssistantButton from 'components/layouts/AppLayout/AssistantButton' -import { useIsAssistantV2Enabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder = true }: any) => { const { ref: projectRef } = useParams() const selectedProject = useSelectedProject() const selectedOrganization = useSelectedOrganization() - const isAssistantV2Enabled = useIsAssistantV2Enabled() const isBranchingEnabled = selectedProject?.is_branch_enabled === true const { data: subscription } = useOrgSubscriptionQuery({ @@ -127,7 +125,7 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =
- {isAssistantV2Enabled && !!projectRef && ( + {!!projectRef && (
diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx index 256621653f96c..06089b1163eec 100644 --- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx +++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx @@ -1,4 +1,3 @@ -import { useParams } from 'common' import { Home, User } from 'icons' import { isUndefined } from 'lodash' import { Command, FileText, FlaskConical, Search, Settings } from 'lucide-react' @@ -7,10 +6,8 @@ import Link from 'next/link' import { useRouter } from 'next/router' import { useState } from 'react' -import { - useIsAPIDocsSidePanelEnabled, - useIsAssistantV2Enabled, -} from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' +import { useParams } from 'common' +import { useIsAPIDocsSidePanelEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' import { useProjectLintsQuery } from 'data/lint/lint-query' import { ProjectIndexPageLink } from 'data/prefetchers/project.$ref' import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' @@ -73,7 +70,6 @@ const NavigationBar = () => { const navLayoutV2 = useFlag('navigationLayoutV2') const isNewAPIDocsEnabled = useIsAPIDocsSidePanelEnabled() - const isFunctionsAssistantEnabled = useIsAssistantV2Enabled() const [userDropdownOpen, setUserDropdownOpenState] = useState(false) const [allowNavPanelToExpand] = useLocalStorageQuery( @@ -120,37 +116,7 @@ const NavigationBar = () => { ) } - const CommandButton = !isFunctionsAssistantEnabled ? ( - { - setCommandMenuOpen(true) - snap.setNavigationPanelOpen(false) - }} - type="text" - icon={} - rightText={ -
- {os === 'macos' || true ? ( // todo: issue with `os` and hydration fail - - ) : ( -

CTRL

- )} -

K

-
- } - > - Search -
- ) : ( + const CommandButton = ( window.removeEventListener('keydown', handler) // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isAssistantV2Enabled, open]) + }, [open]) return ( diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx index 45479064d21a5..186d457763a60 100644 --- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx +++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.tsx @@ -77,7 +77,7 @@ export const generateSettingsMenu = ( url: isProjectBuilding ? buildingUrl : `/project/${ref}/integrations/vault/overview`, items: [], rightIcon: , - label: 'BETA', + label: 'Alpha', }, ], }, diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts index bfca4e0614c49..efffcd60df183 100644 --- a/apps/studio/lib/constants/index.ts +++ b/apps/studio/lib/constants/index.ts @@ -33,7 +33,6 @@ export const LOCAL_STORAGE_KEYS = { UI_PREVIEW_NAVIGATION_LAYOUT: 'supabase-ui-preview-nav-layout', UI_PREVIEW_API_SIDE_PANEL: 'supabase-ui-api-side-panel', UI_PREVIEW_CLS: 'supabase-ui-cls', - UI_PREVIEW_ASSISTANT_V2: 'supabase-ui-assistant-v2', UI_ONBOARDING_NEW_PAGE_SHOWN: 'supabase-ui-onboarding-new-page-shown', SQL_SCRATCH_PAD_BANNER_ACKNOWLEDGED: 'supabase-sql-scratch-pad-banner-acknowledged', diff --git a/apps/studio/next.config.js b/apps/studio/next.config.js index 2b2f4e7a15ba7..2deaf3ead2e90 100644 --- a/apps/studio/next.config.js +++ b/apps/studio/next.config.js @@ -429,6 +429,11 @@ const nextConfig = { source: '/project/:ref/settings/vault/keys', destination: '/project/:ref/integrations/vault/keys', }, + { + permanent: true, + source: '/project/:ref/integrations/cron-jobs', + destination: '/project/:ref/integrations/cron', + }, ...(process.env.NEXT_PUBLIC_BASE_PATH?.length ? [ { diff --git a/apps/studio/pages/project/[ref]/auth/policies.tsx b/apps/studio/pages/project/[ref]/auth/policies.tsx index b6e38e3e40d31..2db8fb416a560 100644 --- a/apps/studio/pages/project/[ref]/auth/policies.tsx +++ b/apps/studio/pages/project/[ref]/auth/policies.tsx @@ -4,7 +4,6 @@ import { partition } from 'lodash' import { Search } from 'lucide-react' import { useState } from 'react' -import { useIsAssistantV2Enabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' import { AIPolicyEditorPanel } from 'components/interfaces/Auth/Policies/AIPolicyEditorPanel' import Policies from 'components/interfaces/Auth/Policies/Policies' import AuthLayout from 'components/layouts/AuthLayout/AuthLayout' @@ -20,7 +19,6 @@ import { useTablesQuery } from 'data/tables/tables-query' import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPermissions' import { useUrlState } from 'hooks/ui/useUrlState' import { PROTECTED_SCHEMAS } from 'lib/constants/schemas' -import { useAppStateSnapshot } from 'state/app-state' import type { NextPageWithLayout } from 'types' import { Input } from 'ui' @@ -66,8 +64,6 @@ const AuthPoliciesPage: NextPageWithLayout = () => { }>() const { schema = 'public', search: searchString = '' } = params const { project } = useProjectContext() - const isAssistantV2Enabled = useIsAssistantV2Enabled() - const { setAiAssistantPanel } = useAppStateSnapshot() const [selectedTable, setSelectedTable] = useState() const [showPolicyAiEditor, setShowPolicyAiEditor] = useState(false) diff --git a/apps/www/_blog/2024-12-01-orioledb-launch.mdx b/apps/www/_blog/2024-12-01-orioledb-launch.mdx index e07df745d5b65..63df6484446c0 100644 --- a/apps/www/_blog/2024-12-01-orioledb-launch.mdx +++ b/apps/www/_blog/2024-12-01-orioledb-launch.mdx @@ -28,7 +28,6 @@ This initial release is a Public Alpha and you should _not_ use it for Productio - The release is restricted to Free organizations. You will not be able to upgrade OrioleDB projects to larger instance sizes. If you want to run OrioleDB on a larger instance we suggest following the [Getting Started](https://www.orioledb.com/docs/usage/getting-started) guide on OrioleDB’s official website. - Index support is restricted to the Postgres default B-Tree index type. Other indexs like GIN/GiST/BRIN/Hash, and pgvector's HNSW/IVFFlat are not supported. -- No support for Supabase Realtime Postgres Changes. Realtime Broadcast and Presence will continue to work. ### Should you use it today? diff --git a/apps/www/_blog/2024-12-02-supabase-ai-assistant-v2.mdx b/apps/www/_blog/2024-12-02-supabase-ai-assistant-v2.mdx new file mode 100644 index 0000000000000..52258b76c352a --- /dev/null +++ b/apps/www/_blog/2024-12-02-supabase-ai-assistant-v2.mdx @@ -0,0 +1,109 @@ +--- +title: 'Supabase AI Assistant v2' +description: An evolution of how we approach AI within the Supabase dashboard +author: saxon_fletcher,joshenlim +image: launch-week-13/day-1-ai-assistant-v2/og.jpg +thumb: launch-week-13/day-1-ai-assistant-v2/thumb.jpg +categories: + - developers + - postgres +tags: + - AI + - postgres +date: '2024-12-02' +toc_depth: 3 +--- + +Today we are releasing Supabase Assistant v2 in the Dashboard - a global assistant with several new abilities: + +1. Postgres schema design +1. Data queries and charting +1. Error debugging +1. Postgres RLS Policies: create and edit +1. Postgres Functions: create and edit +1. Postgres Triggers: create and edit +1. SQL to `supabase-js` conversion + +
+