fix(coding-agent): update provider auth guidance and defaults

This commit is contained in:
Mario Zechner
2026-04-24 00:55:14 +02:00
parent 2926f7e887
commit f2f03616ab
5 changed files with 69 additions and 17 deletions

View File

@@ -31,18 +31,20 @@ export class LoginDialogComponent extends Container implements Focusable {
providerId: string,
private onComplete: (success: boolean, message?: string) => void,
providerNameOverride?: string,
titleOverride?: string,
) {
super();
this.tui = tui;
const providerInfo = getOAuthProviders().find((p) => p.id === providerId);
const providerName = providerNameOverride || providerInfo?.name || providerId;
const title = titleOverride ?? `Login to ${providerName}`;
// Top border
this.addChild(new DynamicBorder());
// Title
this.addChild(new Text(theme.fg("accent", theme.bold(`Login to ${providerName}`)), 1, 0));
this.addChild(new Text(theme.fg("accent", theme.bold(title)), 1, 0));
// Dynamic content area
this.contentContainer = new Container();
@@ -147,6 +149,20 @@ export class LoginDialogComponent extends Container implements Focusable {
});
}
/**
* Show informational text without prompting for input.
*/
showInfo(lines: string[]): void {
this.contentContainer.clear();
this.contentContainer.addChild(new Spacer(1));
for (const line of lines) {
this.contentContainer.addChild(new Text(line, 1, 0));
}
this.contentContainer.addChild(new Spacer(1));
this.contentContainer.addChild(new Text(`(${keyHint("tui.select.cancel", "to close")})`, 1, 0));
this.tui.requestRender();
}
/**
* Show waiting message (for polling flows like GitHub Copilot)
*/

View File

@@ -93,7 +93,7 @@ export class ModelSelectorComponent extends Container implements Focusable {
this.scopeHintText = new Text(this.getScopeHintText(), 0, 0);
this.addChild(this.scopeHintText);
} else {
const hintText = "Only showing models with configured API keys (see README for details)";
const hintText = "Only showing models from configured providers. Use /login to add providers.";
this.addChild(new Text(theme.fg("warning", hintText), 0, 0));
}
this.addChild(new Spacer(1));