fix(tui): refresh API key placeholder when switching providers

When the user switches providers in the AI tab, the key Input now shows
"set" or "not set" based on what's actually stored in the vault for that
provider, and clears any in-progress key entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-05-19 00:10:31 +02:00
parent 0b0cd07330
commit bf29ffc7d8
+8
View File
@@ -149,6 +149,14 @@ class _AITab(VerticalScroll):
show_key = provider.requires_key
self.query_one("#ai-key-row").display = show_key
self.query_one("#ai-key-hint").display = show_key
if show_key:
try:
has_key = get_key(provider_id) is not None
except Exception:
has_key = False
key_input = self.query_one("#ai-key", Input)
key_input.placeholder = "set" if has_key else "not set"
key_input.value = ""
def action_save(self) -> None:
self._do_save()