app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit 00711e6f3bb309936e2ad22c2a4aa3a60de6364e
parent 68c91889b21fdbd5570064dc3b684e12ff718299
Author: triesap <tyson@radroots.org>
Date:   Mon, 25 May 2026 01:51:04 +0000

app: remove obsolete sync warnings

Diffstat:
Mcrates/launchers/desktop/src/accounts.rs | 15++-------------
Mcrates/launchers/desktop/src/app.rs | 35++++++-----------------------------
Mcrates/launchers/desktop/src/runtime.rs | 48++----------------------------------------------
Mcrates/launchers/desktop/src/window.rs | 9++-------
4 files changed, 12 insertions(+), 95 deletions(-)

diff --git a/crates/launchers/desktop/src/accounts.rs b/crates/launchers/desktop/src/accounts.rs @@ -22,7 +22,6 @@ use thiserror::Error; pub struct DesktopAccountsBootstrap { pub accounts_manager: Option<RadrootsNostrAccountsManager>, - pub identity_projection: AppIdentityProjection, } #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -73,13 +72,9 @@ impl DesktopLocalIdentityImportRequest { pub fn bootstrap_desktop_accounts( paths: &AppSharedAccountsPaths, - sqlite_store: &AppSqliteStore, + _sqlite_store: &AppSqliteStore, ) -> Result<DesktopAccountsBootstrap, DesktopAccountsBootstrapError> { - bootstrap_desktop_accounts_with_availability( - paths, - sqlite_store, - secret_backend_availability()?, - ) + bootstrap_desktop_accounts_with_availability(paths, secret_backend_availability()?) } pub fn generate_local_account( @@ -173,7 +168,6 @@ pub fn reset_local_device_state( fn bootstrap_desktop_accounts_with_availability( paths: &AppSharedAccountsPaths, - sqlite_store: &AppSqliteStore, availability: RadrootsSecretBackendAvailability, ) -> Result<DesktopAccountsBootstrap, DesktopAccountsBootstrapError> { ensure_directory(paths.data_root.as_path())?; @@ -187,11 +181,8 @@ fn bootstrap_desktop_accounts_with_availability( availability, "radroots_app_encrypted_file", )?; - let identity_projection = identity_projection_from_manager(&accounts_manager, sqlite_store)?; - Ok(DesktopAccountsBootstrap { accounts_manager: Some(accounts_manager), - identity_projection, }) } @@ -418,10 +409,8 @@ mod tests { let paths = temp_shared_accounts_paths("blocked"); fs::create_dir_all(paths.data_root.as_path()).expect("data root should create"); fs::create_dir_all(paths.secrets_root.as_path()).expect("secrets root should create"); - let sqlite_store = AppSqliteStore::open(DatabaseTarget::InMemory).expect("sqlite store"); match bootstrap_desktop_accounts_with_availability( &paths, - &sqlite_store, unavailable_secret_backend_availability(), ) { Err(super::DesktopAccountsBootstrapError::Accounts(_)) => {} diff --git a/crates/launchers/desktop/src/app.rs b/crates/launchers/desktop/src/app.rs @@ -10,10 +10,7 @@ use tracing::{error, info}; use crate::menus::install_native_app_menu; use crate::runtime::{DesktopAppRuntime, DesktopAppRuntimeSummary}; -use crate::window::{ - PrimaryWindowTarget, SettingsPanelViewKey, home_window_options, open_home_window, - open_settings_window, primary_window_target, settings_window_options, -}; +use crate::window::{home_window_options, open_home_window}; #[derive(Debug, Error)] pub enum AppLaunchError { @@ -44,7 +41,6 @@ pub fn launch() -> Result<(), AppLaunchError> { } let runtime_summary = runtime.summary(); emit_runtime_events(&snapshot, &runtime_summary); - let launch_target = primary_window_target(&runtime_summary); let app = Application::new().with_assets(gpui_component_assets::Assets); @@ -63,32 +59,13 @@ pub fn launch() -> Result<(), AppLaunchError> { let snapshot = snapshot.clone(); let runtime = runtime.clone(); - let launch_target = launch_target; - let mut primary_window_options = match launch_target { - PrimaryWindowTarget::Home => home_window_options(cx), - PrimaryWindowTarget::SettingsAccount => settings_window_options(cx), - }; + let mut primary_window_options = home_window_options(cx); primary_window_options.app_id = Some(snapshot.host.app_identifier.clone()); cx.spawn(async move |cx| { - let open_result = match launch_target { - PrimaryWindowTarget::Home => { - cx.open_window(primary_window_options, |window, cx| { - window.activate_window(); - open_home_window(window, cx, runtime.clone()) - }) - } - PrimaryWindowTarget::SettingsAccount => { - cx.open_window(primary_window_options, |window, cx| { - window.activate_window(); - open_settings_window( - window, - cx, - runtime.clone(), - SettingsPanelViewKey::Account, - ) - }) - } - }; + let open_result = cx.open_window(primary_window_options, |window, cx| { + window.activate_window(); + open_home_window(window, cx, runtime.clone()) + }); if let Err(error) = open_result { error!( diff --git a/crates/launchers/desktop/src/runtime.rs b/crates/launchers/desktop/src/runtime.rs @@ -1162,6 +1162,7 @@ impl DesktopAppRuntimeState { Ok(state) } + #[cfg(test)] fn degraded(error: DesktopAppRuntimeBootstrapError) -> Self { Self::degraded_with_snapshot(error, default_runtime_snapshot()) } @@ -5917,27 +5918,6 @@ fn sanitize_pack_day_query( Ok((default_query, default_projection)) } -fn load_selected_account_reminder_context( - sqlite_store: &AppSqliteStore, - account_id: &str, - farm_id: FarmId, - today_projection: &TodayAgendaProjection, - canonical_orders_list: &OrdersListProjection, - pack_day_projection: &PackDayProjection, - selected_order_detail: Option<&OrderDetailProjection>, -) -> Result<DesktopSellerReminderContext, AppSqliteError> { - load_selected_account_reminder_context_with_options( - sqlite_store, - account_id, - farm_id, - today_projection, - canonical_orders_list, - pack_day_projection, - selected_order_detail, - true, - ) -} - fn load_selected_account_reminder_context_with_options( sqlite_store: &AppSqliteStore, account_id: &str, @@ -6831,17 +6811,7 @@ fn pending_sync_upsert(aggregate: SyncAggregateRef, payload_json: String) -> Pen ) } -fn pending_sync_delete(aggregate: SyncAggregateRef, payload_json: String) -> PendingSyncOperation { - let created_at = current_utc_timestamp(); - - PendingSyncOperation::new( - aggregate, - SyncOperationKind::Delete, - payload_json, - created_at, - ) -} - +#[cfg(test)] fn farm_sync_payload( farm_id: FarmId, display_name: &str, @@ -6861,20 +6831,6 @@ fn farm_sync_payload( .to_string() } -fn fulfillment_window_sync_payload( - fulfillment_window_id: FulfillmentWindowId, - farm_id: FarmId, - source: &str, -) -> String { - json!({ - "aggregate_kind": "fulfillment_window", - "fulfillment_window_id": fulfillment_window_id.to_string(), - "farm_id": farm_id.to_string(), - "source": source, - }) - .to_string() -} - fn order_sync_payload( order_id: OrderId, farm_id: FarmId, diff --git a/crates/launchers/desktop/src/window.rs b/crates/launchers/desktop/src/window.rs @@ -107,10 +107,10 @@ pub fn settings_titlebar_options() -> gpui::TitlebarOptions { } } +#[cfg(test)] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum PrimaryWindowTarget { Home, - SettingsAccount, } #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -120,6 +120,7 @@ pub enum HomeStage { FarmerWorkspace, } +#[cfg(test)] pub fn primary_window_target(_: &DesktopAppRuntimeSummary) -> PrimaryWindowTarget { PrimaryWindowTarget::Home } @@ -4978,12 +4979,6 @@ impl ProductEditorFormState { .map(|draft| draft != self.initial_draft) .unwrap_or(false) } - - fn publish_blockers(&self, cx: &App) -> Vec<ProductPublishBlocker> { - self.current_draft(cx) - .map(|draft| draft.publish_blockers()) - .unwrap_or_default() - } } struct StartupHomeView {