Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,28 +163,30 @@ it('sends the address pasted from a browser on another computer to the host', as
it("names the account and why it's needed before the host knows its sign-in", async () => {
const owner = { kind: 'environment', environmentId: 'provider-unanswered' } as const
render(
<AntigravityProviderSignInArea
owner={owner}
label="this computer"
install={{
kind: 'active',
subject: { target: owner, runtimeId: null, agent: 'antigravity' },
removable: true,
snapshot: {
kind: 'known',
state: {
agent: 'antigravity',
revision: 1,
available: true,
version: '1.0.0',
installedVersion: '1.0.0',
installedCurrent: true,
source: 'managed',
operation: null
<TooltipProvider>
<AntigravityProviderSignInArea
owner={owner}
label="this computer"
install={{
kind: 'active',
subject: { target: owner, runtimeId: null, agent: 'antigravity' },
removable: true,
snapshot: {
kind: 'known',
state: {
agent: 'antigravity',
revision: 1,
available: true,
version: '1.0.0',
installedVersion: '1.0.0',
installedCurrent: true,
source: 'managed',
operation: null
}
}
}
}}
/>
}}
/>
</TooltipProvider>
)
await act(async () => undefined)
expect(screen.getByText('Account')).toBeTruthy()
Expand Down
43 changes: 33 additions & 10 deletions src/renderer/src/components/settings/AntigravityChatSignInRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useId, useState, useSyncExternalStore } from 'react'
import { Check, Copy } from 'lucide-react'
import { Check, Copy, Info } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useClipboardTextCopyFeedback } from '@/hooks/use-clipboard-text-copy-feedback'
import {
Expand Down Expand Up @@ -202,6 +202,26 @@ export function PastedAddressForm(props: {
)
}

/** Beside the sign-in button: users expect their agy CLI login to carry over to chats. */
export function AntigravityChatSignInInfo(): React.JSX.Element {
const label = translate('accounts.antigravity.chatSignInInfoLabel', 'About Antigravity sign-in')
return (
<Tooltip>
<TooltipTrigger asChild>
<Button size="icon-xs" variant="ghost" aria-label={label}>
<Info className="text-muted-foreground" />
</Button>
</TooltipTrigger>
<TooltipContent side="top" sideOffset={4} className="max-w-xs">
{translate(
'accounts.antigravity.chatSignInInfo',
"Antigravity chats have their own sign-in. Signing in to the agy CLI doesn't sign you in here."
)}
</TooltipContent>
</Tooltip>
)
}

/** One host's chat sign-in as both Settings layouts show it. `signedOut` is the line for a host
* that answered it is not signed in; `unanswered` stands in while it has nothing else to say, as a
* host learns its sign-in only when a chat starts or asks to sign in. */
Expand Down Expand Up @@ -325,15 +345,18 @@ export function AntigravityChatSignInRow(props: {
</Button>
</div>
) : (
<Button
size="xs"
// Signed in, the button only switches account, so it steps back from the primary.
variant={signIn.action === 'changeAccount' ? 'outline' : 'default'}
disabled={signIn.signInDisabled}
onClick={signIn.start}
>
{signIn.actionLabel}
</Button>
<div className="flex shrink-0 items-center gap-1">
<AntigravityChatSignInInfo />
Comment thread
coderabbitai[bot] marked this conversation as resolved.
<Button
size="xs"
// Signed in, the button only switches account, so it steps back from the primary.
variant={signIn.action === 'changeAccount' ? 'outline' : 'default'}
disabled={signIn.signInDisabled}
onClick={signIn.start}
>
{signIn.actionLabel}
</Button>
</div>
)}
</div>
{url && <PastedAddressForm pending={signIn.pending} send={signIn.send} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { RuntimeClientTarget } from '../../../../shared/runtime-client-targ
import { LoadingSpinner } from '../LoadingSpinner'
import { Button } from '../ui/button'
import {
AntigravityChatSignInInfo,
PastedAddressForm,
antigravityChatSignInBlocked,
useAntigravityChatSignInControls
Expand Down Expand Up @@ -85,15 +86,18 @@ export function AntigravityProviderSignInArea(props: {
</Button>
</div>
) : (
<Button
size="xs"
// Signed in, the button only switches account, so it steps back further.
variant={signIn.action === 'changeAccount' ? 'ghost' : 'outline'}
disabled={signIn.signInDisabled}
onClick={signIn.start}
>
{signIn.actionLabel}
</Button>
<div className="flex shrink-0 items-center gap-1">
<AntigravityChatSignInInfo />
<Button
size="xs"
// Signed in, the button only switches account, so it steps back further.
variant={signIn.action === 'changeAccount' ? 'ghost' : 'outline'}
disabled={signIn.signInDisabled}
onClick={signIn.start}
>
{signIn.actionLabel}
</Button>
</div>
)}
</div>
{url && <PastedAddressForm pending={signIn.pending} send={signIn.send} />}
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20092,6 +20092,8 @@
"chatTitle": "Antigravity chats",
"chatDescription": "Chats use their own Antigravity sign-in, separate from your agy account above. Sign in once on this device.",
"chatSignIn": "Sign in",
"chatSignInInfoLabel": "About Antigravity sign-in",
"chatSignInInfo": "Antigravity chats have their own sign-in. Signing in to the agy CLI doesn't sign you in here.",
"chatChangeAccount": "Change account",
"chatRetry": "Retry sign-in",
"chatCancel": "Cancel",
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -19694,6 +19694,8 @@
"chatTitle": "Chats de Antigravity",
"chatDescription": "Los chats usan su propio inicio de sesión de Antigravity, independiente de tu cuenta de agy de arriba. Inicia sesión una vez en este dispositivo.",
"chatSignIn": "Iniciar sesión",
"chatSignInInfoLabel": "Acerca del inicio de sesión de Antigravity",
"chatSignInInfo": "Los chats de Antigravity tienen su propio inicio de sesión. Iniciar sesión en la CLI de agy no inicia sesión aquí.",
"chatChangeAccount": "Cambiar de cuenta",
"chatRetry": "Reintentar inicio de sesión",
"chatCancel": "Cancelar",
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -19851,6 +19851,8 @@
"chatTitle": "Discussions Antigravity",
"chatDescription": "Les discussions utilisent leur propre connexion Antigravity, distincte de votre compte agy ci-dessus. Connectez-vous une seule fois sur cet appareil.",
"chatSignIn": "Se connecter",
"chatSignInInfoLabel": "À propos de la connexion Antigravity",
"chatSignInInfo": "Les chats Antigravity ont leur propre connexion. Se connecter à la CLI agy ne vous connecte pas ici.",
"chatChangeAccount": "Changer de compte",
"chatRetry": "Réessayer la connexion",
"chatCancel": "Annuler",
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -19851,6 +19851,8 @@
"chatTitle": "Antigravity チャット",
"chatDescription": "チャットは上の agy アカウントとは別の、独自の Antigravity サインインを使用します。このデバイスで一度サインインしてください。",
"chatSignIn": "サインイン",
"chatSignInInfoLabel": "Antigravity のサインインについて",
"chatSignInInfo": "Antigravity チャットには専用のサインインがあります。agy CLI にサインインしても、ここではサインインされません。",
"chatChangeAccount": "アカウントを変更",
"chatRetry": "サインインを再試行",
"chatCancel": "キャンセル",
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -19851,6 +19851,8 @@
"chatTitle": "Antigravity 채팅",
"chatDescription": "채팅은 위의 agy 계정과 별개인 자체 Antigravity 로그인을 사용합니다. 이 기기에서 한 번 로그인하세요.",
"chatSignIn": "로그인",
"chatSignInInfoLabel": "Antigravity 로그인 정보",
"chatSignInInfo": "Antigravity 채팅은 별도로 로그인합니다. agy CLI에 로그인해도 여기에는 로그인되지 않습니다.",
"chatChangeAccount": "계정 변경",
"chatRetry": "로그인 다시 시도",
"chatCancel": "취소",
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -19851,6 +19851,8 @@
"chatTitle": "Antigravity 聊天",
"chatDescription": "聊天使用自己的 Antigravity 登录,与上方的 agy 帐户分开。在此设备上登录一次即可。",
"chatSignIn": "登录",
"chatSignInInfoLabel": "关于 Antigravity 登录",
"chatSignInInfo": "Antigravity 聊天有单独的登录。登录 agy CLI 不会在这里登录。",
"chatChangeAccount": "更换帐户",
"chatRetry": "重试登录",
"chatCancel": "取消",
Expand Down
Loading