Repository navigation
fix(mobile): Providers rows fit on one line, with Turned off beside the name #34791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e418188
5f413cc
724a642
60f2bb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,22 +259,23 @@ function ProviderAccount({ | |
| const usesCredentials = | ||
| provider.driver === "antigravity" && | ||
| (provider.auth.type === "gemini-api-key" || provider.auth.type === "agent-platform"); | ||
| const status = | ||
| active || state?.phase === "failed" || state?.phase === "cancelled" | ||
| ? state.message | ||
| : !provider.enabled | ||
| ? gt("Turned off") | ||
| : signedIn | ||
| ? gt("Signed in") | ||
| : isDiscovering | ||
| ? gt("Discovering sign-in methods…") | ||
| : needsExternalSetup | ||
| ? gt("No in-app sign-in advertised. Follow the provider's docs to finish setup.") | ||
| : !provider.installed | ||
| ? gt("Not installed") | ||
| : usesCredentials | ||
| ? gt("Connect to load models") | ||
| : gt("Not signed in"); | ||
| const showsFlow = active || state?.phase === "failed" || state?.phase === "cancelled"; | ||
| const turnedOff = !showsFlow && !provider.enabled; | ||
| const status = showsFlow | ||
| ? state.message | ||
| : turnedOff | ||
| ? gt("Turned off") | ||
| : signedIn | ||
| ? gt("Signed in") | ||
| : isDiscovering | ||
| ? gt("Discovering sign-in methods…") | ||
| : needsExternalSetup | ||
| ? gt("No in-app sign-in advertised. Follow the provider's docs to finish setup.") | ||
| : !provider.installed | ||
| ? gt("Not installed") | ||
| : usesCredentials | ||
| ? gt("Connect to load models") | ||
| : gt("Not signed in"); | ||
| // A provider with several sign-in methods picks one from a menu on the same control. | ||
| const methodActions: MenuAction[] = methods.map((method) => ({ | ||
| id: `method:${method.id}`, | ||
|
|
@@ -432,10 +433,18 @@ function ProviderAccount({ | |
| className={ | ||
| stacked | ||
| ? "min-h-16 items-start gap-3 px-4 py-3" | ||
| : "min-h-16 flex-row items-center gap-3 px-4 py-3" | ||
| : turnedOff | ||
| ? "min-h-14 flex-row items-center gap-3 px-4 py-1.5" | ||
| : "min-h-16 flex-row items-center gap-3 px-4 py-3" | ||
| } | ||
| > | ||
| <ProviderAccountSummary key={email} name={name} status={status} email={email} /> | ||
| <ProviderAccountSummary | ||
| key={email} | ||
| name={name} | ||
| status={status} | ||
| email={email} | ||
| inline={turnedOff && !stacked} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apply the compact layout to other short statuses. If Cursor is enabled, installed and not signed in, Select the compact layout independently of the enabled state. Keep flows, long statuses, account emails and large text stacked.
|
||
| /> | ||
| {trailing} | ||
| </View> | ||
| {interaction?.type === "deviceCode" || | ||
|
|
@@ -543,16 +552,26 @@ function ProviderAccountSummary({ | |
| name, | ||
| status, | ||
| email, | ||
| inline, | ||
| }: { | ||
| readonly name: string; | ||
| readonly status: string | null | undefined; | ||
| readonly email: string | undefined; | ||
| /** Puts a short status beside the name, so the row is one line tall. */ | ||
| readonly inline: boolean; | ||
| }) { | ||
| const gt = useGT(); | ||
| const [revealed, setRevealed] = useState(false); | ||
| const layout = inline | ||
| ? "min-w-0 shrink grow flex-row items-center gap-3" | ||
| : "min-w-0 shrink grow gap-0.5"; | ||
| const content = ( | ||
| <> | ||
| <Text textRole="body" className="text-foreground" numberOfLines={1}> | ||
| <Text | ||
| textRole="body" | ||
| className={inline ? "min-w-0 shrink grow text-foreground" : "text-foreground"} | ||
| numberOfLines={1} | ||
| > | ||
| {name} | ||
| </Text> | ||
| <Text accessibilityLiveRegion="polite" textRole="footnote" className="text-foreground-muted"> | ||
|
|
@@ -565,7 +584,7 @@ function ProviderAccountSummary({ | |
| <View | ||
| accessible | ||
| accessibilityLabel={[name, status].filter(Boolean).join(", ")} | ||
| className="min-w-0 shrink grow gap-0.5" | ||
| className={layout} | ||
| > | ||
| {content} | ||
| </View> | ||
|
|
@@ -577,7 +596,7 @@ function ProviderAccountSummary({ | |
| accessibilityLabel={[name, status, revealed ? email : null].filter(Boolean).join(", ")} | ||
| accessibilityHint={revealed ? gt("Hides the account email") : gt("Reveals the account email")} | ||
| onPress={() => setRevealed((value) => !value)} | ||
| className="min-w-0 shrink grow gap-0.5" | ||
| className={layout} | ||
| > | ||
| {content} | ||
| </Pressable> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constrain the row status so a long translated status cannot crowd out the account name.
In the horizontal layout, the status
Texthas no shrink, width, or wrapping constraint. A long translated status can take most of the row width at large font scales. The account name then shrinks until it is truncated to a very narrow width. Give the statusmin-w-0 shrinkand a boundednumberOfLines, or switch to the stacked layout when the available width is small.