Move preferences from the database to a YAML config file

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Georg Bauer
2026-07-26 09:50:39 +02:00
parent 3f2c42513f
commit 5d441038bc
19 changed files with 571 additions and 964 deletions

View File

@@ -75,7 +75,7 @@ impl App {
self.conversation.clear();
self.composer.clear();
self.context_used = 0;
self.context_limit = self.preferences.context_tokens.max(0) as u32;
self.context_limit = self.config.generation.context_tokens.max(0) as u32;
self.tokens_per_second = None;
self.error = None;
}
@@ -113,15 +113,11 @@ impl App {
/// Selects a project and stores it as the one to reopen on the next launch.
pub(super) fn remember_project(&mut self, project_id: i32) {
self.selected_project = Some(project_id);
if self.preferences.last_project_id == Some(project_id) {
if self.config.interface.last_project_id == Some(project_id) {
return;
}
self.preferences.last_project_id = Some(project_id);
if let Some(database) = &mut self.database
&& let Err(error) = database.set_last_project(Some(project_id))
{
self.error = Some(error);
}
self.config.interface.last_project_id = Some(project_id);
self.store_config();
}
/// True when the sidebar row for this project's draft is the active chat.