diff --git a/apps/studio/components/interfaces/Account/Preferences/TimezoneSettings.tsx b/apps/studio/components/interfaces/Account/Preferences/TimezoneSettings.tsx index bc21899f4ab..e7be5ec816a 100644 --- a/apps/studio/components/interfaces/Account/Preferences/TimezoneSettings.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/TimezoneSettings.tsx @@ -1,11 +1,10 @@ -import { useFlag } from 'common' -import { CheckIcon, ChevronsUpDown, Globe } from 'lucide-react' +import { CheckIcon, Globe } from 'lucide-react' import { useId, useMemo, useState } from 'react' import { - Button, Card, CardContent, cn, + ComboboxTrigger, Command, CommandEmpty, CommandGroup, @@ -35,11 +34,10 @@ import { useTrack } from '@/lib/telemetry/track' const AUTO_OPTION_VALUE = '__auto__' export const TimezoneSettings = () => { - const timezonePickerEnabled = useFlag('timezonePicker') - const { timezone, storedTimezone, setTimezone, isAutoDetected } = useTimezone() const track = useTrack() - const [open, setOpen] = useState(false) const listboxId = useId() + const [open, setOpen] = useState(false) + const { timezone, storedTimezone, setTimezone, isAutoDetected } = useTimezone() // Browser timezone is captured once and stays stable even when the user has // overridden the dashboard timezone — that's the value the "Auto detect" @@ -48,8 +46,6 @@ export const TimezoneSettings = () => { const triggerLabel = useMemo(() => findTimezoneByIana(timezone)?.text ?? timezone, [timezone]) - if (!timezonePickerEnabled) return null - const handleSelect = (nextStored: string) => { setTimezone(nextStored) const resolvedNext = nextStored || guessLocalTimezone() @@ -87,20 +83,19 @@ export const TimezoneSettings = () => { > - + diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AwsRegionSelector.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AwsRegionSelector.tsx index c957e302795..3f2a22231ee 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AwsRegionSelector.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AwsRegionSelector.tsx @@ -1,8 +1,8 @@ -import { Check, ChevronsUpDown } from 'lucide-react' +import { Check } from 'lucide-react' import { useId, useState } from 'react' import { - Button, cn, + ComboboxTrigger, Command, CommandEmpty, CommandGroup, @@ -62,19 +62,15 @@ export const AwsRegionSelector = ({ - + diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx b/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx index 6a40d086032..935cb9478d9 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx +++ b/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx @@ -1,8 +1,8 @@ -import { CheckIcon, ChevronsUpDown, Globe } from 'lucide-react' +import { CheckIcon, Globe } from 'lucide-react' import { useId, useState } from 'react' import { - Button, cn, + ComboboxTrigger, Command, CommandEmpty, CommandGroup, @@ -36,20 +36,22 @@ export const TimezoneSelection = ({
- + + + diff --git a/apps/studio/components/ui/FunctionSelector.tsx b/apps/studio/components/ui/FunctionSelector.tsx index 6fe750d8aad..16cb3979061 100644 --- a/apps/studio/components/ui/FunctionSelector.tsx +++ b/apps/studio/components/ui/FunctionSelector.tsx @@ -1,12 +1,13 @@ import { useParams } from 'common' import { uniqBy } from 'lodash' -import { Check, ChevronsUpDown, Plus } from 'lucide-react' +import { Check, Plus } from 'lucide-react' import { useState } from 'react' import { Alert, AlertDescription, AlertTitle, Button, + ComboboxTrigger, Command, CommandEmpty, CommandGroup, @@ -97,26 +98,22 @@ const FunctionSelector = ({ {isSuccess && ( - + diff --git a/apps/studio/components/ui/SchemaSelector.test.tsx b/apps/studio/components/ui/SchemaSelector.test.tsx index 20500671f37..68ac121a6a0 100644 --- a/apps/studio/components/ui/SchemaSelector.test.tsx +++ b/apps/studio/components/ui/SchemaSelector.test.tsx @@ -74,6 +74,14 @@ const renderAndOpenSelector = async () => { } describe('SchemaSelector', () => { + it('gives the combobox an accessible name for the selected schema', async () => { + mockProjectAndSchemas({ highAvailability: false }) + + customRender() + + expect(await screen.findByRole('combobox', { name: 'Schema public' })).toBeInTheDocument() + }) + it('hides the multigres schema on high availability projects', async () => { mockProjectAndSchemas({ highAvailability: true }) diff --git a/apps/studio/components/ui/SchemaSelector.tsx b/apps/studio/components/ui/SchemaSelector.tsx index 2fe48fd54b3..922f68308f5 100644 --- a/apps/studio/components/ui/SchemaSelector.tsx +++ b/apps/studio/components/ui/SchemaSelector.tsx @@ -1,11 +1,12 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' -import { Check, ChevronsUpDown, Plus } from 'lucide-react' +import { Check, Plus } from 'lucide-react' import { ComponentPropsWithoutRef, forwardRef, useMemo, useState } from 'react' import { Alert, AlertDescription, AlertTitle, Button, + ComboboxTrigger, Command, CommandEmpty, CommandGroup, @@ -138,29 +139,32 @@ export const SchemaSelector = forwardRef( {isSchemasSuccess && ( - + { ).toBeVisible() // Check schema selector is present - await expect(page.getByRole('button', { name: 'schema public' })).toBeVisible() + await expect(page.getByRole('combobox', { name: 'Schema public' })).toBeVisible() // Check search/filter input is present await expect(page.getByPlaceholder('Filter tables and policies')).toBeVisible() @@ -75,7 +75,7 @@ test.describe('RLS Policies', () => { await navigateToPoliciesPage(page, ref) // Click schema selector - await page.getByRole('button', { name: 'schema public' }).click() + await page.getByRole('combobox', { name: 'Schema public' }).click() // Select auth schema await page.getByRole('option', { name: 'auth' }).click() @@ -85,7 +85,7 @@ test.describe('RLS Policies', () => { await expect(page.getByRole('heading', { name: 'users', exact: true })).toBeVisible() // Switch back to public - await page.getByRole('button', { name: 'schema auth' }).click() + await page.getByRole('combobox', { name: 'Schema auth' }).click() await page.getByRole('option', { name: 'public', exact: true }).click() await page.waitForTimeout(1000) })