mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
Allow to use the `pg-delta` capability for merge requests diffing. Feature flag it behind an auto opt-in flag. Must be merged after: https://github.com/supabase/platform/pull/29776 <img width="921" height="623" alt="Screenshot 2026-02-17 at 16 50 38" src="https://github.com/user-attachments/assets/bfe704e9-4137-45e1-b0b5-1cecce284d6e" /> Also updated the loading + final state of the diff view to: 1. Take all the height available - From: <img width="1894" height="893" alt="Screenshot 2026-02-16 at 20 46 15" src="https://github.com/user-attachments/assets/22ed8c72-2d9d-4b68-b315-6d40aefc0b3c" /> - To: <img width="1629" height="1396" alt="Screenshot 2026-02-16 at 20 57 26" src="https://github.com/user-attachments/assets/6e83c8e9-607d-4077-977e-046058ce3e44" /> 2. Show a proper loading state rather than just a plain grey skeleton - From: <img width="2232" height="1137" alt="Screenshot 2026-02-20 at 15 02 51" src="https://github.com/user-attachments/assets/0c924b04-d60f-49b5-a5a0-3bf1942bfdef" /> - To: <img width="2231" height="1129" alt="Screenshot 2026-02-20 at 15 05 46" src="https://github.com/user-attachments/assets/49751001-1818-4842-a0c8-b74683c2e9bc" />
99 lines
3.1 KiB
TypeScript
99 lines
3.1 KiB
TypeScript
import { LOCAL_STORAGE_KEYS, useFlag } from 'common'
|
|
|
|
type FeaturePreview = {
|
|
key: string
|
|
name: string
|
|
discussionsUrl?: string
|
|
isNew: boolean
|
|
/** If feature flag is only relevant for the hosted platform */
|
|
isPlatformOnly: boolean
|
|
/** If feature flag should be enabled by default for users, if not yet toggled before */
|
|
isDefaultOptIn: boolean
|
|
/** Visibility in the feature preview modal (For feature flagging a feature preview) */
|
|
enabled: boolean
|
|
}
|
|
|
|
export const useFeaturePreviews = (): FeaturePreview[] => {
|
|
const gitlessBranchingEnabled = useFlag('gitlessBranching')
|
|
const advisorRulesEnabled = useFlag('advisorRules')
|
|
const isUnifiedLogsPreviewAvailable = useFlag('unifiedLogs')
|
|
const tableEditorNewFilterBar = useFlag('tableEditorNewFilterBar')
|
|
const pgDeltaDiffEnabled = useFlag('pgdeltaDiff')
|
|
|
|
return [
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS,
|
|
name: 'New Logs interface',
|
|
discussionsUrl: 'https://github.com/orgs/supabase/discussions/37234',
|
|
enabled: isUnifiedLogsPreviewAvailable,
|
|
isNew: false,
|
|
isPlatformOnly: true,
|
|
isDefaultOptIn: false,
|
|
},
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_BRANCHING_2_0,
|
|
name: 'Branching via dashboard',
|
|
discussionsUrl: 'https://github.com/orgs/supabase/discussions/branching-2-0',
|
|
enabled: gitlessBranchingEnabled,
|
|
isNew: false,
|
|
isPlatformOnly: true,
|
|
isDefaultOptIn: false,
|
|
},
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES,
|
|
name: 'Disable Advisor rules',
|
|
discussionsUrl: undefined,
|
|
enabled: advisorRulesEnabled,
|
|
isNew: false,
|
|
isPlatformOnly: true,
|
|
isDefaultOptIn: false,
|
|
},
|
|
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_PG_DELTA_DIFF,
|
|
name: 'PG Delta Diff',
|
|
discussionsUrl: undefined,
|
|
isNew: true,
|
|
isPlatformOnly: true,
|
|
isDefaultOptIn: true,
|
|
enabled: pgDeltaDiffEnabled,
|
|
},
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_API_SIDE_PANEL,
|
|
name: 'Project API documentation',
|
|
discussionsUrl: 'https://github.com/orgs/supabase/discussions/18038',
|
|
enabled: true,
|
|
isNew: false,
|
|
isPlatformOnly: false,
|
|
isDefaultOptIn: false,
|
|
},
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS,
|
|
name: 'Column-level privileges',
|
|
discussionsUrl: 'https://github.com/orgs/supabase/discussions/20295',
|
|
enabled: true,
|
|
isNew: false,
|
|
isPlatformOnly: false,
|
|
isDefaultOptIn: false,
|
|
},
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_QUEUE_OPERATIONS,
|
|
name: 'Queue table operations',
|
|
discussionsUrl: 'https://github.com/orgs/supabase/discussions/42460',
|
|
enabled: true,
|
|
isNew: true,
|
|
isPlatformOnly: false,
|
|
isDefaultOptIn: false,
|
|
},
|
|
{
|
|
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_TABLE_FILTER_BAR,
|
|
name: 'New Table Filter Bar',
|
|
discussionsUrl: 'https://github.com/orgs/supabase/discussions/42461',
|
|
enabled: true,
|
|
isNew: true,
|
|
isPlatformOnly: false,
|
|
isDefaultOptIn: tableEditorNewFilterBar,
|
|
},
|
|
].sort((a, b) => Number(b.isNew) - Number(a.isNew))
|
|
}
|