first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+36 -44
View File
@@ -1,51 +1,38 @@
use std::{
collections::{HashMap, HashSet},
path::PathBuf,
sync::Arc,
};
use std::collections::{HashMap, HashSet};
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use cloud_object_models::JsonSerializer;
use lazy_static::lazy_static;
use settings::{Setting as _, SyncToCloud};
use galaxy_core::execution_mode::AppExecutionMode;
use galaxy_core::r#async::debounce;
use galaxy_core::settings::ChangeEventReason;
use galaxy_core::user_preferences::GetUserPreferences;
use galaxyui::r#async::Timer;
use galaxyui::{Entity, ModelContext, SingletonEntity};
use galaxyui::{Entity, ModelContext, ModelHandle, SingletonEntity};
use galaxyui_extras::user_preferences::toml_backed::TomlBackedUserPreferences;
use lazy_static::lazy_static;
use settings::{Setting as _, SyncToCloud};
use std::time::Duration;
use crate::{
auth::auth_state::AuthState,
cloud_object::{
model::{
generic_string_model::GenericStringObjectId, json_model::JsonSerializer,
persistence::CloudModel,
},
CloudObjectEventEntrypoint, GenericStringObjectFormat, JsonObjectType,
},
debounce::debounce,
drive::CloudObjectTypeAndId,
report_if_error,
server::{
cloud_objects::update_manager::{
GenericStringObjectInput, InitiatedBy, UpdateManager, UpdateManagerEvent,
},
ids::{ClientId, SyncId},
sync_queue::{SyncQueue, SyncQueueEvent},
},
settings::{
cloud_preferences::{CloudPreference, CloudPreferenceModel, Platform, Preference},
manager::SettingsManager,
},
workspaces::user_workspaces::UserWorkspaces,
use super::cloud_preferences::{CloudPreferencesSettings, CloudPreferencesSettingsChangedEvent};
use super::manager::SettingsEvent;
use super::PrivacySettings;
use crate::auth::auth_state::AuthState;
use crate::cloud_object::model::generic_string_model::GenericStringObjectId;
use crate::cloud_object::model::persistence::CloudModel;
use crate::cloud_object::{CloudObjectEventEntrypoint, GenericStringObjectFormat, JsonObjectType};
use crate::drive::CloudObjectTypeAndId;
use crate::report_if_error;
use crate::server::cloud_objects::update_manager::{
GenericStringObjectInput, InitiatedBy, UpdateManager, UpdateManagerEvent,
};
use galaxy_core::execution_mode::AppExecutionMode;
use super::{
cloud_preferences::{CloudPreferencesSettings, CloudPreferencesSettingsChangedEvent},
manager::SettingsEvent,
PrivacySettings,
use crate::server::ids::{ClientId, SyncId};
use crate::server::sync_queue::{SyncQueue, SyncQueueEvent};
use crate::settings::cloud_preferences::{
CloudPreference, CloudPreferenceModel, Platform, Preference,
};
use crate::settings::manager::SettingsManager;
use crate::workspaces::user_workspaces::UserWorkspaces;
/// Provides client ids for creating cloud preferences.
/// We define this as a trait so tests can track what client ids are created and use
@@ -216,7 +203,7 @@ impl CloudPreferencesSyncer {
// handle_initial_load. This prevents the CloudPreferencesUpdated event (which fires
// synchronously in on_changed_objects_fetched) from overwriting local settings
// before handle_initial_load has a chance to determine sync direction.
ctx.subscribe_to_model(&UpdateManager::handle(ctx), |syncer, event, ctx| {
ctx.subscribe_to_model(&UpdateManager::handle(ctx), |syncer, _, event, ctx| {
if let UpdateManagerEvent::CloudPreferencesUpdated { updated } = event {
// Defer cloud→local updates until `handle_initial_load`
// has determined the correct sync direction. The
@@ -243,7 +230,7 @@ impl CloudPreferencesSyncer {
);
ctx.subscribe_to_model(
&SettingsManager::handle(ctx),
|me, event, ctx| match event {
|me, _, event, ctx| match event {
SettingsEvent::LocalPreferencesUpdated { storage_key, .. } => {
me.handle_local_preference_updated(storage_key, ctx);
}
@@ -258,7 +245,7 @@ impl CloudPreferencesSyncer {
ctx.subscribe_to_model(&SyncQueue::handle(ctx), Self::handle_sync_queue_event);
ctx.subscribe_to_model(
&CloudPreferencesSettings::handle(ctx),
|me, event, ctx| match event {
|me, _, event, ctx| match event {
CloudPreferencesSettingsChangedEvent::IsSettingsSyncEnabled {
change_event_reason,
} => {
@@ -298,7 +285,12 @@ impl CloudPreferencesSyncer {
/// Handles SyncQueue success events by updating the stored
/// settings file hash when a cloud preference is successfully
/// created or updated on the server.
fn handle_sync_queue_event(&mut self, event: &SyncQueueEvent, ctx: &mut ModelContext<Self>) {
fn handle_sync_queue_event(
&mut self,
_: ModelHandle<SyncQueue>,
event: &SyncQueueEvent,
ctx: &mut ModelContext<Self>,
) {
let server_id = match event {
SyncQueueEvent::ObjectCreationSuccessful {
server_creation_info,