mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 16:04:03 +00:00
feat(coding-agent): show login status in OAuth provider selector
Display '✓ logged in' indicator next to providers where the user is already authenticated. This makes it clear at a glance whether you're using your Claude Pro/Max subscription.
This commit is contained in:
parent
7a1884f85c
commit
87b7343b00
1 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { Container, Spacer, Text } from "@mariozechner/pi-tui";
|
||||
import { getOAuthProviders, type OAuthProviderInfo } from "../oauth/index.js";
|
||||
import { loadOAuthCredentials } from "../oauth/storage.js";
|
||||
import { theme } from "../theme/theme.js";
|
||||
import { DynamicBorder } from "./dynamic-border.js";
|
||||
|
||||
|
|
@ -61,14 +62,19 @@ export class OAuthSelectorComponent extends Container {
|
|||
const isSelected = i === this.selectedIndex;
|
||||
const isAvailable = provider.available;
|
||||
|
||||
// Check if user is logged in for this provider
|
||||
const credentials = loadOAuthCredentials(provider.id);
|
||||
const isLoggedIn = credentials !== null;
|
||||
const statusIndicator = isLoggedIn ? theme.fg("success", " ✓ logged in") : "";
|
||||
|
||||
let line = "";
|
||||
if (isSelected) {
|
||||
const prefix = theme.fg("accent", "→ ");
|
||||
const text = isAvailable ? theme.fg("accent", provider.name) : theme.fg("dim", provider.name);
|
||||
line = prefix + text;
|
||||
line = prefix + text + statusIndicator;
|
||||
} else {
|
||||
const text = isAvailable ? ` ${provider.name}` : theme.fg("dim", ` ${provider.name}`);
|
||||
line = text;
|
||||
line = text + statusIndicator;
|
||||
}
|
||||
|
||||
this.listContainer.addChild(new Text(line, 0, 0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue