Misc cleanup + clear language model provider API key editors when API keys are submitted (#38165)

Followup to #38163 along with some other misc cleanups

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2025-09-15 05:08:38 +00:00
committed by GitHub
parent 98edf1bf0b
commit 634ae72cad
10 changed files with 128 additions and 151 deletions
+6
View File
@@ -9,6 +9,7 @@ use component::{example_group, single_example};
use editor::{Editor, EditorElement, EditorStyle};
use gpui::{App, Entity, FocusHandle, Focusable, FontStyle, Hsla, TextStyle};
use settings::Settings;
use std::sync::Arc;
use theme::ThemeSettings;
use ui::prelude::*;
@@ -101,6 +102,11 @@ impl SingleLineInput {
pub fn text(&self, cx: &App) -> String {
self.editor().read(cx).text(cx)
}
pub fn set_text(&self, text: impl Into<Arc<str>>, window: &mut Window, cx: &mut App) {
self.editor()
.update(cx, |editor, cx| editor.set_text(text, window, cx))
}
}
impl Render for SingleLineInput {