Files
supabase/apps/studio/components/layouts/Navigation/NavigationBar/MobileNavigationBar.tsx
Mert YEREKAPAN 1ef80fec23 chore(studio): remove HeaderUpgradeButton experiment code (#46144)
## Summary

- Removes the `HeaderUpgradeButton` component, all call sites, and the
`HeaderUpgradeCtaClickedEvent` telemetry type. The GROWTH-615 header
upgrade CTA experiment ended on Apr 29.
- Fixes the `Flag key "headerUpgradeCta" does not exist in PostHog flag
store` console errors that were logging on every render. PostHog drops
disabled flags from `/feature-flags` responses, so the still-mounted
consumer logged a missing-flag warning continuously. Removing the
consumer lets the flag be safely disabled again.

Context: [Slack
thread](https://supabase.slack.com/archives/C07P3AU3J2D/p1779250648219089?thread_ts=1779166940.445709&cid=C07P3AU3J2D)

## Test plan

- [x] `pnpm dev:studio`, open the dashboard, confirm no
`headerUpgradeCta` warning in the browser console
- [x] Desktop header still renders correctly (the button was hidden
behind the `test` variant; visually nothing changes for users since
rollout was 100/0 control)
- [x] Mobile nav bar still renders with `UserDropdown` to the right of
the org/project selector

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Removed the upgrade call-to-action button from the navigation header
in both desktop and mobile layouts.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46144?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-20 10:38:04 +00:00

94 lines
3.8 KiB
TypeScript

import { useParams } from 'common'
import { ChevronLeft, Menu } from 'lucide-react'
import Link from 'next/link'
import { useState } from 'react'
import { Button, cn } from 'ui'
import { MobileSheetNav } from 'ui-patterns'
import { HomeIcon } from '../LayoutHeader/HomeIcon'
import { useMobileSheet } from './MobileSheetContext'
import { OrgSelector } from './OrgSelector'
import { ProjectBranchSelector } from './ProjectBranchSelector'
import { ConnectButton } from '@/components/interfaces/ConnectButton/ConnectButton'
import { LocalDropdown } from '@/components/interfaces/LocalDropdown'
import { SidebarContent } from '@/components/interfaces/Sidebar'
import { UserDropdown } from '@/components/interfaces/UserDropdown'
import { FloatingMobileToolbar } from '@/components/layouts/Navigation/FloatingMobileToolbar/FloatingMobileToolbar'
import { useOrganizationsQuery } from '@/data/organizations/organizations-query'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
import { IS_PLATFORM } from '@/lib/constants'
export const ICON_SIZE = 20
export const ICON_STROKE_WIDTH = 1.5
const MobileNavigationBar = ({
hideMobileMenu,
backToDashboardURL,
}: {
hideMobileMenu?: boolean
backToDashboardURL?: string
}) => {
const [isSheetOpen, setIsSheetOpen] = useState(false)
const { ref: projectRef, slug } = useParams()
const { data: selectedOrganization } = useSelectedOrganizationQuery()
const { isPending: isLoadingOrganizations } = useOrganizationsQuery()
const isProjectScope = !!projectRef
const showOrgSelection = slug || isLoadingOrganizations || (selectedOrganization && projectRef)
const { openMenu } = useMobileSheet()
return (
<div className="w-full flex flex-row md:hidden">
<nav
className={cn(
'group pr-3 pl-2 z-10 w-full h-12 gap-2',
'border-b bg-dash-sidebar border-default shadow-[0_0_30px_0_rgba(0,0,0,0.07)]',
'transition-width duration-200',
'hide-scrollbar flex flex-row items-center justify-between overflow-x-auto'
)}
>
<div className={cn('flex min-w-0 shrink items-center gap-2', !IS_PLATFORM && 'pl-2')}>
{backToDashboardURL && (
<div className="flex items-center justify-center ml-1 flex-0 md:hidden h-full aspect-square">
<Link
href={backToDashboardURL}
className="flex items-center justify-center bg-transparent! rounded-md min-w-[30px] w-[30px] h-[30px] border text-foreground-lighter hover:text-foreground transition-colors"
>
<ChevronLeft strokeWidth={1.5} size={16} />
</Link>
</div>
)}
{!IS_PLATFORM && <HomeIcon />}
{isProjectScope ? (
<>
<ProjectBranchSelector />
<ConnectButton iconOnly className="w-8 h-8" />
</>
) : IS_PLATFORM && showOrgSelection ? (
<OrgSelector />
) : (
<HomeIcon className="ml-1" />
)}
</div>
<div className="flex shrink-0 gap-2">
{IS_PLATFORM ? <UserDropdown /> : <LocalDropdown />}
{!hideMobileMenu && (
<Button
title="Menu dropdown button"
type="default"
className="flex lg:hidden border-default bg-surface-100/75 text-foreground-light rounded-md min-w-[30px] w-[30px] h-[30px] data-open:bg-overlay-hover/30"
icon={<Menu />}
onClick={() => openMenu()}
/>
)}
</div>
</nav>
<MobileSheetNav open={isSheetOpen} onOpenChange={setIsSheetOpen} data-state="expanded">
<SidebarContent />
</MobileSheetNav>
<FloatingMobileToolbar hideMobileMenu={hideMobileMenu} />
</div>
)
}
export default MobileNavigationBar