Files
supabase/apps/studio/components/layouts/AdvisorsLayout/AdvisorsSidebarMenu.tsx
Joshen Lim 50eea124e7 Small tweaks to feature preview badge (#45409)
## Context

Small improvements from this PR:
https://github.com/supabase/supabase/pull/45373

- Fix feature preview badge alignment
  - Before:
<img width="341" height="75" alt="image"
src="https://github.com/user-attachments/assets/e6e2f727-fc75-4f70-b9cd-94d67aed8c5d"
/>
  - After:
<img width="365" height="64" alt="image"
src="https://github.com/user-attachments/assets/3d6e5e5d-c285-48f4-8f8f-251c23101e41"
/>
- Shift feature preview badge for policies into tester side panel
<img width="640" height="93" alt="image"
src="https://github.com/user-attachments/assets/3efb73a7-f7f5-4ae0-8560-d1e0ba989626"
/>
- Realised that advisor settings wasn't set up to be behind the feature
preview
  - Fixing that in this PR

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

## Summary by CodeRabbit

* **New Features**
  * Added preview badge indicator to the RLS Tester feature

* **Style**
* Improved spacing and layout alignment across authentication, database
access, webhook, logging, and advisor interface components
  * Enhanced badge component styling for better vertical alignment

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

39 lines
1.2 KiB
TypeScript

import { Badge, Button } from 'ui'
import { FeaturePreviewSidebarPanel } from '../../ui/FeaturePreviewSidebarPanel'
import { useGenerateAdvisorsMenu } from './AdvisorsMenu.utils'
import { SIDEBAR_KEYS } from '@/components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
import { ProductMenu } from '@/components/ui/ProductMenu'
import { useSidebarManagerSnapshot } from '@/state/sidebar-manager-state'
interface AdvisorsSidebarMenuProps {
page?: string
}
export function AdvisorsSidebarMenu({ page }: AdvisorsSidebarMenuProps) {
const menu = useGenerateAdvisorsMenu()
const { toggleSidebar } = useSidebarManagerSnapshot()
const handleOpenAdvisor = () => {
toggleSidebar(SIDEBAR_KEYS.ADVISOR_PANEL)
}
return (
<div className="pb-12 relative">
<FeaturePreviewSidebarPanel
className="mx-4 mt-4"
title="Moving to the toolbar"
description="Advisors are now available in the top toolbar for quicker access across the dashboard."
illustration={<Badge variant="success">New</Badge>}
actions={
<Button size="tiny" type="default" onClick={handleOpenAdvisor}>
Try it now
</Button>
}
/>
<ProductMenu page={page} menu={menu} />
</div>
)
}