Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Chore/advisor panel all should not show no project notice (#43169)

Joshen Lim8d811b9837eb
diff --git a/apps/studio/components/layouts/AppLayout/AdvisorButton.tsx b/apps/studio/components/layouts/AppLayout/AdvisorButton.tsx
index 1b4787d0600..fa763f76209 100644
--- a/apps/studio/components/layouts/AppLayout/AdvisorButton.tsx
+++ b/apps/studio/components/layouts/AppLayout/AdvisorButton.tsx
@@ -12,7 +12,6 @@ export const AdvisorButton = ({ projectRef }: { projectRef?: string }) => {
const { toggleSidebar, activeSidebar } = useSidebarManagerSnapshot()
const { data: lints } = useProjectLintsQuery({ projectRef })
- const hasCriticalIssues = Array.isArray(lints) && lints.some((lint) => lint.level === 'ERROR')
const { data: notificationsData } = useNotificationsV2Query({
status: 'new',
@@ -23,6 +22,11 @@ export const AdvisorButton = ({ projectRef }: { projectRef?: string }) => {
return notificationsData?.pages.flatMap((page) => page) ?? []
}, [notificationsData?.pages])
const hasUnreadNotifications = notifications.some((x) => x.status === 'new')
+ const hasCriticalNotifications = notifications.some((x) => x.priority === 'Critical')
+
+ const hasCriticalIssues =
+ hasCriticalNotifications ||
+ (Array.isArray(lints) && lints.some((lint) => lint.level === 'ERROR'))
const isOpen = activeSidebar?.id === SIDEBAR_KEYS.ADVISOR_PANEL
diff --git a/apps/studio/components/ui/AdvisorPanel/AdvisorPanelBody.tsx b/apps/studio/components/ui/AdvisorPanel/AdvisorPanelBody.tsx
index a12326e2447..3b7b80860d3 100644
--- a/apps/studio/components/ui/AdvisorPanel/AdvisorPanelBody.tsx
+++ b/apps/studio/components/ui/AdvisorPanel/AdvisorPanelBody.tsx
@@ -1,10 +1,10 @@
-import { AlertTriangle, ChevronRight, Inbox } from 'lucide-react'
-
import { Lint } from 'data/lint/lint-query'
import { Notification } from 'data/notifications/notifications-v2-query'
+import { AlertTriangle, ChevronRight, Inbox } from 'lucide-react'
import { AdvisorSeverity, AdvisorTab } from 'state/advisor-state'
import { Badge, Button, cn } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns'
+
import type { AdvisorItem } from './AdvisorPanel.types'
import {
formatItemDate,
@@ -57,7 +57,7 @@ export const AdvisorPanelBody = ({
hasProjectRef = true,
}: AdvisorPanelBodyProps) => {
// Show notice if no project ref and trying to view project-specific tabs
- if (!hasProjectRef && activeTab !== 'messages') {
+ if (!hasProjectRef && activeTab !== 'messages' && activeTab !== 'all') {
return <NoProjectNotice />
}