mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 08:17:11 +00:00
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:
@@ -1,4 +1,4 @@
|
|||||||
import { AlertTriangle, ExternalLink } from 'lucide-react';
|
import { AlertTriangle, ExternalLink, Settings2 } from 'lucide-react';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
@@ -6,45 +6,36 @@ import { cn } from '@/lib/utils';
|
|||||||
|
|
||||||
interface AccountSafetyWarningCardProps {
|
interface AccountSafetyWarningCardProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
provider?: 'gemini' | 'agy';
|
|
||||||
showAcknowledgement?: boolean;
|
showAcknowledgement?: boolean;
|
||||||
acknowledged?: boolean;
|
acknowledged?: boolean;
|
||||||
onAcknowledgedChange?: (value: boolean) => void;
|
onAcknowledgedChange?: (value: boolean) => void;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
showProxySettingsLink?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AccountSafetyWarningCard({
|
export function AccountSafetyWarningCard({
|
||||||
className,
|
className,
|
||||||
provider = 'gemini',
|
|
||||||
showAcknowledgement = false,
|
showAcknowledgement = false,
|
||||||
acknowledged = false,
|
acknowledged = false,
|
||||||
onAcknowledgedChange,
|
onAcknowledgedChange,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
|
showProxySettingsLink = false,
|
||||||
}: AccountSafetyWarningCardProps) {
|
}: AccountSafetyWarningCardProps) {
|
||||||
const isAgy = provider === 'agy';
|
const title = 'OAuth Account Safety Warning';
|
||||||
|
const subtitle = 'Issue #509 · Gemini + AGY OAuth risk';
|
||||||
const title = isAgy ? 'Antigravity OAuth Risk' : 'Account Safety Warning';
|
const firstLine = (
|
||||||
const subtitle = isAgy
|
|
||||||
? 'Issue #509 · Third-party OAuth ban risk'
|
|
||||||
: 'Issue #509 · Shared Gemini + AGY account risk';
|
|
||||||
const firstLine = isAgy ? (
|
|
||||||
<>
|
<>
|
||||||
Antigravity OAuth currently has active ban/suspension patterns. Complete the responsibility
|
Issue #509 documents suspension/ban reports tied to <code className="font-mono">ccs agy</code>{' '}
|
||||||
steps before running auth or starting <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>.
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
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.
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
const secondLine = isAgy ? (
|
const secondLine = (
|
||||||
<>If you want to keep this account, do not continue unless you accept full responsibility.</>
|
<>Continue only if you accept full responsibility for OAuth and account-access risk.</>
|
||||||
) : (
|
|
||||||
<>If you want to keep Google AI access, do not continue this shared-account setup.</>
|
|
||||||
);
|
);
|
||||||
const issueUrl = 'https://github.com/kaitranntt/ccs/issues/509';
|
const issueUrl = 'https://github.com/kaitranntt/ccs/issues/509';
|
||||||
const issueLabel = 'Read issue #509';
|
const issueLabel = 'Read issue #509';
|
||||||
|
const proxySettingsLabel = 'Gemini + AGY controls: Settings > Proxy';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
@@ -94,6 +85,15 @@ export function AccountSafetyWarningCard({
|
|||||||
{issueLabel}
|
{issueLabel}
|
||||||
<ExternalLink className="h-3.5 w-3.5" />
|
<ExternalLink className="h-3.5 w-3.5" />
|
||||||
</a>
|
</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">
|
<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
|
Applies to CLI and dashboard auth
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -347,7 +347,6 @@ export function AddAccountDialog({
|
|||||||
|
|
||||||
{requiresSafetyAcknowledgement && !showAuthUI && (
|
{requiresSafetyAcknowledgement && !showAuthUI && (
|
||||||
<AccountSafetyWarningCard
|
<AccountSafetyWarningCard
|
||||||
provider="gemini"
|
|
||||||
showAcknowledgement
|
showAcknowledgement
|
||||||
acknowledged={acknowledgedRisk}
|
acknowledged={acknowledgedRisk}
|
||||||
onAcknowledgedChange={(value) => {
|
onAcknowledgedChange={(value) => {
|
||||||
|
|||||||
@@ -248,7 +248,6 @@ export function CliproxyPage() {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.trim();
|
.trim();
|
||||||
const showAccountSafetyWarning = warningProvider === 'gemini' || warningProvider === 'agy';
|
const showAccountSafetyWarning = warningProvider === 'gemini' || warningProvider === 'agy';
|
||||||
const warningProviderType = warningProvider === 'agy' ? 'agy' : 'gemini';
|
|
||||||
|
|
||||||
const handleRefresh = () => {
|
const handleRefresh = () => {
|
||||||
queryClient.invalidateQueries({ queryKey: ['cliproxy'] });
|
queryClient.invalidateQueries({ queryKey: ['cliproxy'] });
|
||||||
@@ -396,7 +395,7 @@ export function CliproxyPage() {
|
|||||||
{/* Right Panel */}
|
{/* Right Panel */}
|
||||||
<div className="flex-1 flex flex-col min-w-0 bg-background">
|
<div className="flex-1 flex flex-col min-w-0 bg-background">
|
||||||
{showAccountSafetyWarning && (
|
{showAccountSafetyWarning && (
|
||||||
<AccountSafetyWarningCard provider={warningProviderType} className="mx-4 mt-4" />
|
<AccountSafetyWarningCard showProxySettingsLink className="mx-4 mt-4" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{selectedVariantData && parentAuthForVariant ? (
|
{selectedVariantData && parentAuthForVariant ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user