mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 00:19:08 +00:00
Part 5 of 6: #52989 → #52990 → #52991 → #52992 → #52993 → #53138 Switches Studio navigation between Advisors and Issues with `issuesInbox`. With the flag off, the existing Advisors sidebar, pages, command menu entries, shortcuts, header panel, and contextual finding links remain available. With it on, these entry points show Issues and legacy Advisor URLs forward to the matching Issues category while preserving finding context. Direct Issues routes remain accessible in either state. The homepage section remains hidden when the flag is off. Telemetry event names are unchanged. ## How to test 1. Turn `issuesInbox` off: desktop and mobile navigation show Advisors, the header opens Advisor Center, and Security, Performance, and enabled Health Advisor pages remain usable. 2. Turn it on: navigation and the header show Issues. Legacy Advisor category URLs forward to matching Issues lists. 3. `G` then `V` opens the active variant. `V` then `S`, `P`, or `H` follows the active category links; shortcut reference labels match. 4. Table Editor finding links open the legacy finding when off and its issue when on. 5. Direct Issues routes remain usable with the flag off; the homepage section stays hidden. ## Validation - Broad navigation/layout/redirect/shortcut regression suite: 456 tests passed, retries disabled. - Focused suite: 181 tests passed with shuffle seed 52993, retries disabled. - Full Studio TypeScript, scoped ESLint, and changed-file Prettier pass. - Behavioral mutation probes detect broken flag guards, finding links, and redirect destinations; source restored afterward. [DEBUG-255](https://linear.app/supabase/issue/DEBUG-255/replace-advisor-terminology-with-issues-throughout-studio) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com>
45 lines
1.8 KiB
TypeScript
45 lines
1.8 KiB
TypeScript
import { useFlag, useParams } from 'common'
|
|
import Image from 'next/image'
|
|
|
|
import { useIsAdvisorRulesEnabled } from './FeaturePreviewContext'
|
|
import { InlineLink } from '@/components/ui/InlineLink'
|
|
import { BASE_PATH } from '@/lib/constants'
|
|
|
|
export const AdvisorRulesPreview = () => {
|
|
const { ref } = useParams()
|
|
const isIssuesInboxEnabled = useFlag('issuesInbox')
|
|
const isAdvisorRulesEnabled = useIsAdvisorRulesEnabled()
|
|
const overviewHref = isIssuesInboxEnabled
|
|
? `/project/${ref}/issues?category=security`
|
|
: `/project/${ref}/advisors/security`
|
|
const href = isAdvisorRulesEnabled ? `/project/${ref}/advisors/rules/security` : overviewHref
|
|
|
|
return (
|
|
<div>
|
|
<p className="text-sm text-foreground-light mb-4">
|
|
{isIssuesInboxEnabled
|
|
? 'Turn off specific checks or categories to stop them showing up in Issues or email notifications. This could be useful for checks that might not apply to your project.'
|
|
: 'Disable specific Advisor categories or rules to prevent them from showing up in Advisor reports or email notifications. This could be useful for rules that might not be applicable to your project.'}
|
|
</p>
|
|
<Image
|
|
src={`${BASE_PATH}/img/previews/advisor-rule-preview.png`}
|
|
width={1296}
|
|
height={900}
|
|
alt="api-docs-side-panel-preview"
|
|
className="rounded-sm border mb-4"
|
|
/>
|
|
<div className="space-y-2 mt-4!">
|
|
<p className="text-sm">Enabling this preview will:</p>
|
|
<ul className="list-disc pl-6 text-sm text-foreground-light space-y-1">
|
|
<li>
|
|
Allow you to disable advisor rules for your project from the{' '}
|
|
<InlineLink href={href}>
|
|
{isIssuesInboxEnabled ? 'Issues section.' : 'Advisors section.'}
|
|
</InlineLink>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|