Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner
This commit is contained in:
@@ -7,6 +7,8 @@ pub mod schema;
|
||||
use std::fmt::Debug;
|
||||
use std::ops::Deref;
|
||||
|
||||
// Re-export galaxyui_core for use by macros.
|
||||
pub use galaxyui_core;
|
||||
// Re-export crates used by macro expansions in downstream crates.
|
||||
#[doc(hidden)]
|
||||
pub use inventory as _inventory;
|
||||
@@ -17,8 +19,6 @@ pub use schemars as _schemars;
|
||||
#[doc(hidden)]
|
||||
pub use settings_value as _settings_value;
|
||||
pub use settings_value::SettingsValue;
|
||||
// Re-export galaxyui_core for use by macros.
|
||||
pub use galaxyui_core;
|
||||
|
||||
/// Extracts the storage key (last segment after the final `.`) from a toml_path.
|
||||
///
|
||||
@@ -59,12 +59,12 @@ pub const fn toml_path_hierarchy(path: &str) -> Option<&str> {
|
||||
}
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use serde::Serialize;
|
||||
use serde::de::DeserializeOwned;
|
||||
use galaxy_features::FeatureFlag;
|
||||
use galaxyui_core::{AppContext, Entity, ModelContext};
|
||||
use galaxyui_extras::secure_storage::{self, AppContextExt as _};
|
||||
use galaxyui_extras::user_preferences::UserPreferences;
|
||||
use serde::Serialize;
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
/// A newtype wrapper for the public preferences backend.
|
||||
///
|
||||
|
||||
@@ -315,12 +315,11 @@ macro_rules! define_setting {
|
||||
&mut self,
|
||||
ctx: &mut $crate::galaxyui_core::ModelContext<Self::Group>,
|
||||
) -> anyhow::Result<()> {
|
||||
use $crate::ChangeEventReason;
|
||||
Self::clear_from_preferences(Self::preferences_for_setting(ctx))?;
|
||||
self.inner = self.validate(Self::default_value());
|
||||
self.is_explicitly_set = false;
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::Clear,
|
||||
change_event_reason: $crate::ChangeEventReason::Clear,
|
||||
}}));
|
||||
Ok(())
|
||||
}
|
||||
@@ -336,7 +335,7 @@ macro_rules! define_setting {
|
||||
self.inner = self.validate(new_value);
|
||||
self.is_explicitly_set = true;
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::CloudSync,
|
||||
change_event_reason: $crate::ChangeEventReason::CloudSync,
|
||||
}}));
|
||||
}
|
||||
Ok(())
|
||||
@@ -353,7 +352,7 @@ macro_rules! define_setting {
|
||||
self.inner = self.validate(new_value);
|
||||
self.is_explicitly_set = true;
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::LocalChange,
|
||||
change_event_reason: $crate::ChangeEventReason::LocalChange,
|
||||
}}));
|
||||
}
|
||||
Ok(())
|
||||
@@ -370,7 +369,7 @@ macro_rules! define_setting {
|
||||
self.inner = validated;
|
||||
self.is_explicitly_set = explicitly_set;
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::LocalChange,
|
||||
change_event_reason: $crate::ChangeEventReason::LocalChange,
|
||||
}}));
|
||||
}
|
||||
Ok(())
|
||||
@@ -585,7 +584,7 @@ macro_rules! implement_setting_for_enum {
|
||||
Self::clear_from_preferences(Self::preferences_for_setting(ctx))?;
|
||||
*self = self.validate(Self::default_value());
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::Clear,
|
||||
change_event_reason: $crate::ChangeEventReason::Clear,
|
||||
}}));
|
||||
Ok(())
|
||||
}
|
||||
@@ -600,7 +599,7 @@ macro_rules! implement_setting_for_enum {
|
||||
if self.value() != &new_value || changed_in_storage {
|
||||
*self = self.validate(new_value);
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::CloudSync,
|
||||
change_event_reason: $crate::ChangeEventReason::CloudSync,
|
||||
}}));
|
||||
}
|
||||
Ok(())
|
||||
@@ -616,7 +615,7 @@ macro_rules! implement_setting_for_enum {
|
||||
if self.value() != &new_value || changed_in_storage {
|
||||
*self = self.validate(new_value);
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::LocalChange,
|
||||
change_event_reason: $crate::ChangeEventReason::LocalChange,
|
||||
}}));
|
||||
}
|
||||
Ok(())
|
||||
@@ -632,7 +631,7 @@ macro_rules! implement_setting_for_enum {
|
||||
if self.value() != &validated {
|
||||
*self = validated;
|
||||
ctx.emit($crate::macros::concat_idents!(EventName = $group, ChangedEvent { EventName::$name {
|
||||
change_event_reason: ChangeEventReason::LocalChange,
|
||||
change_event_reason: $crate::ChangeEventReason::LocalChange,
|
||||
}}));
|
||||
}
|
||||
Ok(())
|
||||
@@ -856,7 +855,7 @@ macro_rules! generate_settings_event_fn {
|
||||
let value = serde_json::from_str::<serde_json::Value>(&value)
|
||||
.ok()
|
||||
.and_then(|json_val| {
|
||||
<$setting as $crate::Setting>::Value::from_file_value(&json_val)
|
||||
<<$setting as $crate::Setting>::Value as $crate::_settings_value::SettingsValue>::from_file_value(&json_val)
|
||||
})
|
||||
.or_else(|| serde_json::from_str(&value).ok());
|
||||
let Some(value) = value else {
|
||||
@@ -893,7 +892,7 @@ macro_rules! generate_settings_event_fn {
|
||||
let value = serde_json::from_str::<serde_json::Value>(&value)
|
||||
.ok()
|
||||
.and_then(|json_val| {
|
||||
<$setting as $crate::Setting>::Value::from_file_value(&json_val)
|
||||
<<$setting as $crate::Setting>::Value as $crate::_settings_value::SettingsValue>::from_file_value(&json_val)
|
||||
})
|
||||
.or_else(|| serde_json::from_str(&value).ok());
|
||||
let Some(value) = value else {
|
||||
@@ -910,7 +909,7 @@ macro_rules! generate_settings_event_fn {
|
||||
let parse =
|
||||
|s: &str| -> anyhow::Result<<$setting as $crate::Setting>::Value> {
|
||||
let json_val = serde_json::from_str::<serde_json::Value>(s)?;
|
||||
<$setting as $crate::Setting>::Value::from_file_value(&json_val)
|
||||
<<$setting as $crate::Setting>::Value as $crate::_settings_value::SettingsValue>::from_file_value(&json_val)
|
||||
.or_else(|| serde_json::from_str(s).ok())
|
||||
.ok_or_else(|| {
|
||||
anyhow!(
|
||||
|
||||
@@ -153,7 +153,7 @@ fn test_is_setting_syncable_on_current_platform() {
|
||||
}
|
||||
|
||||
mod reload_all_public_settings_tests {
|
||||
|
||||
use super::*;
|
||||
|
||||
define_settings_group!(ReloadTestSettings, settings: [
|
||||
public_flag: PublicFlag {
|
||||
@@ -443,6 +443,8 @@ mod reload_all_public_settings_tests {
|
||||
}
|
||||
|
||||
mod write_to_preferences_tests {
|
||||
use galaxyui_extras::user_preferences::toml_backed::TomlBackedUserPreferences;
|
||||
|
||||
use crate::*;
|
||||
|
||||
#[derive(
|
||||
@@ -533,9 +535,9 @@ mod write_to_preferences_tests {
|
||||
/// Option fields — reproduces the exact QuakeModeSettings scenario.
|
||||
#[test]
|
||||
fn test_no_spurious_write_with_hashmap_and_missing_options() {
|
||||
use galaxyui_extras::user_preferences::toml_backed::TomlBackedUserPreferences;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use galaxyui_extras::user_preferences::toml_backed::TomlBackedUserPreferences;
|
||||
|
||||
#[derive(
|
||||
Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, schemars::JsonSchema,
|
||||
@@ -598,7 +600,6 @@ mod write_to_preferences_tests {
|
||||
/// null-stripping and key-reordering happens.
|
||||
#[test]
|
||||
fn test_no_spurious_write_with_toml_backend() {
|
||||
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let file_path = dir.path().join("settings.toml");
|
||||
let (prefs, _) = TomlBackedUserPreferences::new(file_path.clone());
|
||||
|
||||
Reference in New Issue
Block a user