fix(ui): unify gemini and agy safety warning banner

- collapse provider-specific warning variants into one shared card

- keep issue #509 as the single risk reference for both flows

- reuse cliproxy warning card space for Settings > Proxy pointer
This commit is contained in:
Tam Nhu Tran
2026-02-24 18:24:40 +07:00
parent 30dccb14fe
commit e22d331bf1
3 changed files with 22 additions and 24 deletions
@@ -1,4 +1,4 @@
import { AlertTriangle, ExternalLink } from 'lucide-react';
import { AlertTriangle, ExternalLink, Settings2 } from 'lucide-react';
import { Badge } from '@/components/ui/badge';
import { Checkbox } from '@/components/ui/checkbox';
import { Label } from '@/components/ui/label';
@@ -6,45 +6,36 @@ import { cn } from '@/lib/utils';
interface AccountSafetyWarningCardProps {
className?: string;
provider?: 'gemini' | 'agy';
showAcknowledgement?: boolean;
acknowledged?: boolean;
onAcknowledgedChange?: (value: boolean) => void;
disabled?: boolean;
showProxySettingsLink?: boolean;
}
export function AccountSafetyWarningCard({
className,
provider = 'gemini',
showAcknowledgement = false,
acknowledged = false,
onAcknowledgedChange,
disabled = false,
showProxySettingsLink = false,
}: AccountSafetyWarningCardProps) {
const isAgy = provider === 'agy';
const title = isAgy ? 'Antigravity OAuth Risk' : 'Account Safety Warning';
const subtitle = isAgy
? 'Issue #509 · Third-party OAuth ban risk'
: 'Issue #509 · Shared Gemini + AGY account risk';
const firstLine = isAgy ? (
const title = 'OAuth Account Safety Warning';
const subtitle = 'Issue #509 · Gemini + AGY OAuth risk';
const firstLine = (
<>
Antigravity OAuth currently has active ban/suspension patterns. Complete the responsibility
steps before running auth or starting <code className="font-mono">ccs agy</code>.
</>
) : (
<>
Using one Google account for both <code className="font-mono">ccs gemini</code> and{' '}
<code className="font-mono">ccs agy</code> can trigger account disable/ban.
Issue #509 documents suspension/ban reports tied to <code className="font-mono">ccs agy</code>{' '}
and shared-account usage between <code className="font-mono">ccs gemini</code> and{' '}
<code className="font-mono">ccs agy</code>.
</>
);
const secondLine = isAgy ? (
<>If you want to keep this account, do not continue unless you accept full responsibility.</>
) : (
<>If you want to keep Google AI access, do not continue this shared-account setup.</>
const secondLine = (
<>Continue only if you accept full responsibility for OAuth and account-access risk.</>
);
const issueUrl = 'https://github.com/kaitranntt/ccs/issues/509';
const issueLabel = 'Read issue #509';
const proxySettingsLabel = 'Gemini + AGY controls: Settings > Proxy';
return (
<section
@@ -94,6 +85,15 @@ export function AccountSafetyWarningCard({
{issueLabel}
<ExternalLink className="h-3.5 w-3.5" />
</a>
{showProxySettingsLink && (
<a
href="/settings?tab=proxy"
className="inline-flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-800 transition-colors hover:bg-amber-500/15 dark:text-amber-200"
>
<Settings2 className="h-3.5 w-3.5" />
{proxySettingsLabel}
</a>
)}
<span className="rounded-md border border-border/70 bg-muted/60 px-2.5 py-1 text-xs text-muted-foreground">
Applies to CLI and dashboard auth
</span>
@@ -347,7 +347,6 @@ export function AddAccountDialog({
{requiresSafetyAcknowledgement && !showAuthUI && (
<AccountSafetyWarningCard
provider="gemini"
showAcknowledgement
acknowledged={acknowledgedRisk}
onAcknowledgedChange={(value) => {
+1 -2
View File
@@ -248,7 +248,6 @@ export function CliproxyPage() {
.toLowerCase()
.trim();
const showAccountSafetyWarning = warningProvider === 'gemini' || warningProvider === 'agy';
const warningProviderType = warningProvider === 'agy' ? 'agy' : 'gemini';
const handleRefresh = () => {
queryClient.invalidateQueries({ queryKey: ['cliproxy'] });
@@ -396,7 +395,7 @@ export function CliproxyPage() {
{/* Right Panel */}
<div className="flex-1 flex flex-col min-w-0 bg-background">
{showAccountSafetyWarning && (
<AccountSafetyWarningCard provider={warningProviderType} className="mx-4 mt-4" />
<AccountSafetyWarningCard showProxySettingsLink className="mx-4 mt-4" />
)}
{selectedVariantData && parentAuthForVariant ? (