Allow choosing the model for draft sessions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
46d15cad39
commit
f00ffceb40
2 files changed
+26
-1
No files matched your search
+11
@@ -538,6 +538,7 @@ pub(crate) enum Message {
|
||||
DeleteProject(i32),
|
||||
CreateSession(i32),
|
||||
DraftProjectChanged(i32),
|
||||
DraftModelChanged(ModelChoice),
|
||||
SwitchGitBranch(String),
|
||||
ReasoningModeChanged(ReasoningMode),
|
||||
PermissionModeChanged(PermissionMode),
|
||||
@@ -1843,6 +1844,16 @@ impl App {
|
||||
}
|
||||
}
|
||||
Message::DraftProjectChanged(project_id) => self.move_draft_to_project(project_id),
|
||||
Message::DraftModelChanged(model) => {
|
||||
if self.selected_session.is_some() {
|
||||
self.error = Some("The model is fixed once a chat has started.".into());
|
||||
} else if self.active_chat_count() > 0 {
|
||||
self.error =
|
||||
Some("Stop all active generations before changing the model.".into());
|
||||
} else if let Err(error) = self.activate_model(model) {
|
||||
self.error = Some(error);
|
||||
}
|
||||
}
|
||||
Message::SwitchGitBranch(branch) => self.switch_git_branch(&branch),
|
||||
Message::ReasoningModeChanged(mode) => {
|
||||
if self.active_chat_count() > 0 {
|
||||
|
||||
+15
-1
@@ -337,6 +337,20 @@ impl App {
|
||||
.padding([2, 6])
|
||||
.into()
|
||||
};
|
||||
// A draft has no user message yet, so its model is still open.
|
||||
let model_control: Element<'_, Message> =
|
||||
if self.selected_session.is_none() && self.active_chat_count() == 0 {
|
||||
pick_list(
|
||||
model::installed_models(&models_path()),
|
||||
Some(self.config.model),
|
||||
Message::DraftModelChanged,
|
||||
)
|
||||
.text_size(12)
|
||||
.padding([2, 6])
|
||||
.into()
|
||||
} else {
|
||||
text(self.config.model.to_string()).size(12).into()
|
||||
};
|
||||
let vision_ready = self.config.model.supports_vision()
|
||||
&& model::engine_artifacts(self.config.model, false, &models_path())
|
||||
.vision
|
||||
@@ -399,7 +413,7 @@ impl App {
|
||||
.padding([2, 6]),
|
||||
reasoning_control,
|
||||
icon(ICON_MODEL, 16),
|
||||
text(self.config.model.to_string()).size(12),
|
||||
model_control,
|
||||
action,
|
||||
]
|
||||
.spacing(6)
|
||||
|
||||
Reference in new issue
Block a user