This commit is contained in:
Francesco Sansalvadore committed 2026-03-20 17:30:57 +01:00
1 parent 7a75e72ed0
commit a58eafdb6a
20 files changed
+44 -68

No files matched your search

+1 -5
View File
@@ -31,11 +31,7 @@ export const metadata: Metadata = {
icons: genFaviconData(BASE_PATH),
}
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body>
+1 -3
View File
@@ -24,9 +24,7 @@ export function V2ParamsProvider({
orgSlug: string | undefined
}) {
return (
<V2ParamsContext.Provider value={{ orgSlug, projectRef }}>
{children}
</V2ParamsContext.Provider>
<V2ParamsContext.Provider value={{ orgSlug, projectRef }}>{children}</V2ParamsContext.Provider>
)
}
@@ -17,4 +17,3 @@ export default function V2HomeLayout({ children }: { children: ReactNode }) {
</V2ParamsProvider>
)
}
@@ -8,4 +8,3 @@ export default async function V2OrgProjectPage({
const { projectRef } = await params
redirect(`/v2/project/${projectRef}`)
}
@@ -1,9 +1,5 @@
import { ProjectShell } from './ProjectShell'
export default function ProjectLayout({
children,
}: {
children: React.ReactNode
}) {
export default function ProjectLayout({ children }: { children: React.ReactNode }) {
return <ProjectShell>{children}</ProjectShell>
}
@@ -25,8 +25,7 @@ export default function V2ProjectDisambiguationPage() {
const { data: organizations = [], isPending: isLoadingOrgs } = useOrganizationsQuery()
const [selectedOrgSlug, setSelectedOrgSlug] = useState<string | undefined>(undefined)
const activeOrg =
organizations.find((o) => o.slug === selectedOrgSlug) ?? organizations[0]
const activeOrg = organizations.find((o) => o.slug === selectedOrgSlug) ?? organizations[0]
const [search, setSearch] = useState('')
@@ -65,7 +64,7 @@ export default function V2ProjectDisambiguationPage() {
</div>
) : (
organizations.map((org) => {
const isActive = org.slug === (activeOrg?.slug)
const isActive = org.slug === activeOrg?.slug
return (
<button
key={org.slug}
@@ -156,4 +156,4 @@ export const UserDropdownContent = () => {
)}
</>
)
}
}
+1 -1
View File
@@ -78,7 +78,7 @@ const OBS_GROUPS = [
id: 'obs-alerts',
label: 'Advisors',
items: [
{ href: 'alerts', label: 'Security' },
{ href: 'alerts', label: 'Security' },
{ href: 'alerts', label: 'Performance' },
],
},
+13 -14
View File
@@ -15,26 +15,25 @@ export function EditorFrame({ children }: { children: React.ReactNode }) {
// Any /data route (including the chooser at /data with no further segment)
const isDataActivity =
Boolean(projectRef) &&
Boolean(pathname?.includes('/data/') || pathname?.endsWith('/data'))
Boolean(projectRef) && Boolean(pathname?.includes('/data/') || pathname?.endsWith('/data'))
// Sub-routes deeper than /data (list + detail views) need overflow:hidden for grids
const isDataSubRoute =
Boolean(projectRef) &&
Boolean(
pathname?.includes('/data/tables') ||
pathname?.includes('/data/functions') ||
pathname?.includes('/data/types') ||
pathname?.includes('/data/roles') ||
pathname?.includes('/data/extensions') ||
pathname?.includes('/data/indexes') ||
pathname?.includes('/data/publications') ||
pathname?.includes('/data/users') ||
pathname?.includes('/data/providers') ||
pathname?.includes('/data/oauth-apps') ||
pathname?.includes('/data/buckets') ||
pathname?.includes('/data/edge-functions') ||
pathname?.includes('/data/channels')
pathname?.includes('/data/functions') ||
pathname?.includes('/data/types') ||
pathname?.includes('/data/roles') ||
pathname?.includes('/data/extensions') ||
pathname?.includes('/data/indexes') ||
pathname?.includes('/data/publications') ||
pathname?.includes('/data/users') ||
pathname?.includes('/data/providers') ||
pathname?.includes('/data/oauth-apps') ||
pathname?.includes('/data/buckets') ||
pathname?.includes('/data/edge-functions') ||
pathname?.includes('/data/channels')
)
const isHome =
@@ -17,7 +17,7 @@ export function getProjectBranchSelectorState(params: {
const { selectedBranch, isBranchingEnabled, selectedOrganization } = params
const isMainBranch = !isBranchingEnabled || selectedBranch?.is_default === true
const branchDisplayName = isBranchingEnabled ? selectedBranch?.name ?? 'main' : 'main'
const branchDisplayName = isBranchingEnabled ? (selectedBranch?.name ?? 'main') : 'main'
const selectedOrgInitial = selectedOrganization?.name?.trim().charAt(0).toUpperCase() ?? 'O'
const organizationHref = selectedOrganization?.slug
? `/org/${selectedOrganization.slug}`
@@ -82,7 +82,7 @@ export function ProjectBranchSelectorPopover({ onClose }: ProjectBranchSelectorP
branches && branches.length > 0
? mainBranch
? [mainBranch].concat(restOfBranches ?? [])
: restOfBranches ?? []
: (restOfBranches ?? [])
: [defaultMainBranch]
const branchList = isBranchingEnabled ? sortedBranches : [defaultMainBranch]
@@ -255,10 +255,7 @@ function ProjectColumn({
<>
<CommandSeparator_Shadcn_ />
<CommandGroup_Shadcn_>
<CommandItem_Shadcn_
className="cursor-pointer w-full"
onSelect={() => onClose()}
>
<CommandItem_Shadcn_ className="cursor-pointer w-full" onSelect={() => onClose()}>
<Link
href={`/new/${organizationSlug}`}
className="flex items-center gap-2 w-full"
+12 -2
View File
@@ -5,7 +5,15 @@ import { PanelLeftOpen } from 'lucide-react'
import { MobileSheetProvider } from 'components/layouts/Navigation/NavigationBar/MobileSheetContext'
import { LayoutSidebar } from 'components/layouts/ProjectLayout/LayoutSidebar'
import { usePathname } from 'next/navigation'
import { ResizableHandle, ResizablePanel, ResizablePanelGroup, SidebarProvider, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
SidebarProvider,
Tooltip,
TooltipContent,
TooltipTrigger,
} from 'ui'
import { LeftActivityBar } from './ActivityBar'
import { BrowserPanel } from './BrowserPanel'
@@ -57,7 +65,9 @@ export function Shell({ children }: { children: React.ReactNode }) {
<PanelLeftOpen className="h-4 w-4" strokeWidth={1.5} />
</button>
</TooltipTrigger>
<TooltipContent side="right" className="text-xs">Expand panel</TooltipContent>
<TooltipContent side="right" className="text-xs">
Expand panel
</TooltipContent>
</Tooltip>
</div>
)}
@@ -18,9 +18,7 @@ const AdvisorPanel = dynamic(() =>
const AIAssistant = dynamic(() =>
import('components/ui/AIAssistantPanel/AIAssistant').then((m) => m.AIAssistant)
)
const SqlPanel = dynamic(() =>
import('components/v2/SqlPanel').then((m) => m.SqlPanel)
)
const SqlPanel = dynamic(() => import('components/v2/SqlPanel').then((m) => m.SqlPanel))
export const V2LayoutSidebarProvider = ({ children }: PropsWithChildren) => {
const { projectRef } = useV2Params()
@@ -49,4 +47,3 @@ export const V2LayoutSidebarProvider = ({ children }: PropsWithChildren) => {
return <>{children}</>
}
@@ -37,4 +37,3 @@ export function StudioDataWorkspace({
return <RouteParamsOverrideProvider value={value}>{children}</RouteParamsOverrideProvider>
}
+1 -4
View File
@@ -22,10 +22,7 @@ export function useV2DataCounts(projectRef: string | undefined) {
{ projectRef, connectionString: conn, schema: 'public' },
{ enabled: Boolean(projectRef) }
)
const { data: usersCount } = useUsersCountQuery(
{ projectRef },
{ enabled: Boolean(projectRef) }
)
const { data: usersCount } = useUsersCountQuery({ projectRef }, { enabled: Boolean(projectRef) })
const { data: bucketsPages } = usePaginatedBucketsQuery(
{ projectRef },
{ enabled: Boolean(projectRef) }
@@ -2,12 +2,7 @@
import { useMemo } from 'react'
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
import {
Tabs_Shadcn_,
TabsContent_Shadcn_,
TabsList_Shadcn_,
TabsTrigger_Shadcn_,
} from 'ui'
import { Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
import { useV2Params } from '@/app/v2/V2ParamsContext'
import { StudioDataWorkspace } from '@/components/v2/data/StudioDataWorkspace'
@@ -41,7 +36,7 @@ const TABS: Array<{ key: string; label: string; content: NextPageWithLayout }> =
{ key: 'oauth-server', label: 'OAuth server', content: OAuthServerPage },
{ key: 'audit-logs', label: 'Audit logs', content: AuditLogsPage },
{ key: 'performance', label: 'Performance', content: PerformancePage },
]
]
const DEFAULT_TAB = TABS[0].key
@@ -52,7 +47,7 @@ export function V2AuthSettingsView() {
const { projectRef } = useV2Params()
const tabParam = searchParams?.get('tab')
const activeTab = TABS.some((t) => t.key === tabParam) ? tabParam ?? DEFAULT_TAB : DEFAULT_TAB
const activeTab = TABS.some((t) => t.key === tabParam) ? (tabParam ?? DEFAULT_TAB) : DEFAULT_TAB
const currentQuery = useMemo(
() => new URLSearchParams(searchParams?.toString() ?? ''),
@@ -86,7 +81,7 @@ export function V2AuthSettingsView() {
return (
<TabsContent_Shadcn_ key={tab.key} value={tab.key} className="m-0">
<div className="hidden" />
<Content dehydratedState={undefined} />
<Content dehydratedState={undefined} />
</TabsContent_Shadcn_>
)
})}
@@ -95,4 +90,3 @@ export function V2AuthSettingsView() {
</StudioDataWorkspace>
)
}
@@ -13,4 +13,3 @@ export function V2ComputeSettingsView() {
</StudioDataWorkspace>
)
}
@@ -70,4 +70,3 @@ export function V2GeneralSettingsView() {
</StudioDataWorkspace>
)
}
+3 -4
View File
@@ -97,7 +97,8 @@ const V2DashboardContext = createContext<V2DashboardState | null>(null)
export function V2DashboardProvider({ children }: { children: ReactNode }) {
const [dataTabs, setDataTabs] = useState<DataTab[]>([])
const [expandedGroups, setExpandedGroups] = useState<Record<string, boolean>>(defaultExpandedGroups)
const [expandedGroups, setExpandedGroups] =
useState<Record<string, boolean>>(defaultExpandedGroups)
const [rightPanel, setRightPanel] = useState<RightPanelType>(null)
const [recentItems, setRecentItems] = useState<RecentItem[]>([])
@@ -114,9 +115,7 @@ export function V2DashboardProvider({ children }: { children: ReactNode }) {
.map((x) => x as Partial<RecentItem>)
.filter(
(x) =>
typeof x.id === 'string' &&
typeof x.label === 'string' &&
typeof x.path === 'string'
typeof x.id === 'string' && typeof x.label === 'string' && typeof x.path === 'string'
)
.map((x) => ({
id: x.id as string,
@@ -23,4 +23,3 @@ export function RouteParamsOverrideProvider({
export function useRouteParamsOverride() {
return useContext(RouteParamsOverrideContext)
}