Add back button to model picker
This commit is contained in:
1 parent
918bc45ee0
commit
7c80500280
3 files changed
+23
-2
No files matched your search
@@ -240,6 +240,7 @@ class ModelSettings(ModalScreen[tuple[AIConfig, AIConfig] | None]):
|
||||
def compose(self) -> ComposeResult:
|
||||
with VerticalScroll(id="model-settings"):
|
||||
yield Static("[bold]Models and connections[/bold] • saved in sloppy.json")
|
||||
yield Button("Back (Esc)", id="back-models")
|
||||
yield Label("AI 1")
|
||||
yield Select([], id="ai1-select", allow_blank=True)
|
||||
yield Label("AI 2")
|
||||
@@ -290,6 +291,9 @@ class ModelSettings(ModalScreen[tuple[AIConfig, AIConfig] | None]):
|
||||
def on_button_pressed(self, event: Button.Pressed) -> None:
|
||||
from settings import model_from_settings, save_settings, store_model
|
||||
action = event.button.id
|
||||
if action == 'back-models':
|
||||
self.dismiss(None)
|
||||
return
|
||||
identifier = self.query_one('#connection-id', Input).value.strip()
|
||||
try:
|
||||
if action == 'save-model':
|
||||
@@ -493,6 +497,8 @@ class AIChatApp(App):
|
||||
|
||||
def _models_selected(self, models: tuple[AIConfig, AIConfig] | None) -> None:
|
||||
if models is None:
|
||||
if not self.messages:
|
||||
self.update_status("No conversation started. Press Ctrl+M to choose models.")
|
||||
return
|
||||
if self._is_running:
|
||||
self.notify("Saved selection applies to the next conversation")
|
||||
|
||||
Reference in new issue
Block a user