Restore translation actions and flags after launch.
This commit is contained in:
@@ -6063,7 +6063,7 @@ impl BdsApp {
|
||||
self.import_editors.clear();
|
||||
self.chat_editors.clear();
|
||||
self.tags_view_state = None;
|
||||
self.settings_state = None;
|
||||
self.settings_state = Some(self.hydrate_settings_state());
|
||||
self.style_view_state = None;
|
||||
self.dashboard_state = None;
|
||||
self.site_validation_state = SiteValidationState::default();
|
||||
@@ -10759,6 +10759,7 @@ mod tests {
|
||||
let mut app = BdsApp::new_for_tests(db, project, temp.path().to_path_buf());
|
||||
app.sidebar_view = SidebarView::Posts;
|
||||
app.sidebar_visible = false;
|
||||
app.settings_state = None;
|
||||
|
||||
let _ = app.dispatch_menu_action(MenuAction::EditPreferences);
|
||||
|
||||
@@ -10773,6 +10774,33 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fresh_workspace_hydrates_saved_ai_configuration_for_quick_actions() {
|
||||
let (db, project, temp) = setup();
|
||||
ai::save_endpoint(
|
||||
db.conn(),
|
||||
&ai::AiEndpointConfig {
|
||||
kind: ai::AiEndpointKind::Airplane,
|
||||
url: "http://localhost:11434/v1".to_string(),
|
||||
model: "llama3.2".to_string(),
|
||||
api_key: None,
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let app = BdsApp::new_for_tests(db, project, temp.path().to_path_buf());
|
||||
let settings = app
|
||||
.settings_state
|
||||
.as_ref()
|
||||
.expect("fresh workspace must load persisted AI configuration");
|
||||
|
||||
assert_eq!(
|
||||
settings.airplane_ai.endpoint_url,
|
||||
"http://localhost:11434/v1"
|
||||
);
|
||||
assert_eq!(settings.airplane_ai.chat_model, "llama3.2");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_transport_loss_closes_an_open_remote_session() {
|
||||
assert!(remote_error_closes_connection("connection_lost"));
|
||||
|
||||
@@ -1275,6 +1275,7 @@ pub fn view(
|
||||
row![
|
||||
text(format!("{} {}", language.flag_emoji, language.name))
|
||||
.size(13)
|
||||
.shaping(Shaping::Advanced)
|
||||
.color(Color::WHITE),
|
||||
Space::with_width(Length::Fill),
|
||||
text(status)
|
||||
|
||||
Reference in New Issue
Block a user