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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user