Skip to content

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

Chore/small fix vectors (#40693)

Joshen Limb3746282165e
diff --git a/apps/studio/components/interfaces/Storage/StorageMenuV2.tsx b/apps/studio/components/interfaces/Storage/StorageMenuV2.tsx
index 3e2a5b6b64b..7a86d184d62 100644
--- a/apps/studio/components/interfaces/Storage/StorageMenuV2.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageMenuV2.tsx
@@ -5,6 +5,7 @@ import {
useIsAnalyticsBucketsEnabled,
useIsVectorBucketsEnabled,
} from 'data/config/project-storage-config-query'
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { Badge, Menu } from 'ui'
import { BUCKET_TYPES } from './Storage.constants'
import { useStorageV2Page } from './Storage.utils'
@@ -13,38 +14,47 @@ export const StorageMenuV2 = () => {
const { ref } = useParams()
const page = useStorageV2Page()
+ const { storageAnalytics, storageVectors } = useIsFeatureEnabled([
+ 'storage:analytics',
+ 'storage:vectors',
+ ])
+
const isAnalyticsBucketsEnabled = useIsAnalyticsBucketsEnabled({ projectRef: ref })
const isVectorBucketsEnabled = useIsVectorBucketsEnabled({ projectRef: ref })
+ const bucketTypes = Object.entries(BUCKET_TYPES).filter(([key, config]) => {
+ if (key === 'analytics') return storageAnalytics
+ if (key === 'vectors') return storageVectors
+ return IS_PLATFORM || (!IS_PLATFORM && !config.platformOnly)
+ })
+
return (
<Menu type="pills" className="my-6 flex flex-grow flex-col">
<div className="space-y-6">
<div className="mx-3">
<Menu.Group title={<span className="uppercase font-mono">Manage</span>} />
- {Object.entries(BUCKET_TYPES)
- .filter(([_, config]) => IS_PLATFORM || (!IS_PLATFORM && !config.platformOnly))
- .map(([type, config]) => {
- const isSelected = page === type
- const isAlphaEnabled =
- (type === 'analytics' && isAnalyticsBucketsEnabled) ||
- (type === 'vectors' && isVectorBucketsEnabled)
+ {bucketTypes.map(([type, config]) => {
+ const isSelected = page === type
+ const isAlphaEnabled =
+ (type === 'analytics' && isAnalyticsBucketsEnabled) ||
+ (type === 'vectors' && isVectorBucketsEnabled)
- return (
- <Link key={type} href={`/project/${ref}/storage/${type}`}>
- <Menu.Item rounded active={isSelected}>
- <div className="flex items-center justify-between">
- <p className="truncate">{config.displayName}</p>
- {isAlphaEnabled && (
- <Badge variant="default" size="small">
- New
- </Badge>
- )}
- </div>
- </Menu.Item>
- </Link>
- )
- })}
+ return (
+ <Link key={type} href={`/project/${ref}/storage/${type}`}>
+ <Menu.Item rounded active={isSelected}>
+ <div className="flex items-center justify-between">
+ <p className="truncate">{config.displayName}</p>
+ {isAlphaEnabled && (
+ <Badge variant="default" size="small">
+ New
+ </Badge>
+ )}
+ </div>
+ </Menu.Item>
+ </Link>
+ )
+ })}
</div>
{IS_PLATFORM && (
diff --git a/apps/studio/data/config/project-storage-config-query.ts b/apps/studio/data/config/project-storage-config-query.ts
index 3a789af2ce7..3b460103e9b 100644
--- a/apps/studio/data/config/project-storage-config-query.ts
+++ b/apps/studio/data/config/project-storage-config-query.ts
@@ -3,7 +3,6 @@ import { useQuery } from '@tanstack/react-query'
import { useFlag } from 'common'
import { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { IS_PLATFORM } from 'lib/constants'
import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
@@ -55,15 +54,13 @@ export const useProjectStorageConfigQuery = <TData = ProjectStorageConfigData>(
})
export const useIsAnalyticsBucketsEnabled = ({ projectRef }: { projectRef?: string }) => {
- const { storageAnalytics } = useIsFeatureEnabled(['storage:analytics'])
const { data } = useProjectStorageConfigQuery({ projectRef })
const isIcebergCatalogEnabled = !!data?.features.icebergCatalog?.enabled
- return storageAnalytics && isIcebergCatalogEnabled
+ return isIcebergCatalogEnabled
}
export const useIsVectorBucketsEnabled = ({ projectRef }: { projectRef?: string }) => {
- const { storageVectors } = useIsFeatureEnabled(['storage:vectors'])
// [Joshen] Temp using feature flag - will need to shift to storage config like analytics bucket once ready
const isVectorBucketsEnabled = useFlag('storageAnalyticsVector')
- return storageVectors && isVectorBucketsEnabled
+ return isVectorBucketsEnabled
}
diff --git a/packages/common/enabled-features/enabled-features.json b/packages/common/enabled-features/enabled-features.json
index 5c5155fd653..e303f1b1ad7 100644
--- a/packages/common/enabled-features/enabled-features.json
+++ b/packages/common/enabled-features/enabled-features.json
@@ -122,7 +122,7 @@
"sdk:swift": true,
"storage:analytics": true,
- "storage:vectors": false,
+ "storage:vectors": true,
"search:fullIndex": true,