From aa007c68fdfbe52cf664ab135db76ca1db3806bc Mon Sep 17 00:00:00 2001 From: XileHorizon <33043119+XileHorizon@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:45:13 -0500 Subject: [PATCH 1/5] task(icon): update video asset (#1768) --- icons/src/icons/outline/document-media.svg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/icons/src/icons/outline/document-media.svg b/icons/src/icons/outline/document-media.svg index bb7076300de..dae622d0072 100644 --- a/icons/src/icons/outline/document-media.svg +++ b/icons/src/icons/outline/document-media.svg @@ -1,4 +1,3 @@ - + - \ No newline at end of file From 7ce85054da1cad5025ad3600c173f70243e9c344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Gon=C3=A7alves=20Marchi?= Date: Thu, 25 Jan 2024 14:40:29 -0300 Subject: [PATCH 2/5] update(KeyBinds): Close inspector with same shortcut (#1761) --- common/locales/bs-BA/bs-BA.ftl | 2 +- common/locales/en-US/main.ftl | 2 +- common/locales/sr-RS/sr-RS.ftl | 2 +- common/src/state/default_keybinds.rs | 2 +- common/src/state/settings.rs | 4 +- .../components/settings/sub_pages/keybinds.rs | 6 +-- ui/src/lib.rs | 4 +- ui/src/utils/keyboard/mod.rs | 41 ++++++------------- .../utils/keyboard/shortcut_handlers/dev.rs | 8 +++- .../keyboard/shortcut_handlers/navigation.rs | 29 ++++--------- 10 files changed, 38 insertions(+), 62 deletions(-) diff --git a/common/locales/bs-BA/bs-BA.ftl b/common/locales/bs-BA/bs-BA.ftl index 24ecc06834b..4c0ef99d22b 100644 --- a/common/locales/bs-BA/bs-BA.ftl +++ b/common/locales/bs-BA/bs-BA.ftl @@ -296,7 +296,7 @@ settings-keybinds = Postavke Tipkovnih Prečaca .toggle-deafen = Uključi/isključi sve zvukove, uključujući mikrofon i slušalice. .conflicting-keybinds = Sukobljeni Tipkovni Prečaci. .change-keybind = Snimi novi tipkovni prečac - .open-dev-tools = Otvori Web Inspektora + .open-close-dev-tools = Otvori/Zatvori Web Inspektora .toggle-devmode = Uključi/isključi Razvojni Način .cancel-change-keybind = Odustani od snimanja diff --git a/common/locales/en-US/main.ftl b/common/locales/en-US/main.ftl index 0b608a3024d..871bdf2e481 100644 --- a/common/locales/en-US/main.ftl +++ b/common/locales/en-US/main.ftl @@ -296,7 +296,7 @@ settings-keybinds = Keybind Settings .toggle-deafen = Toggle turning off all sounds including your microphone and headphones. .conflicting-keybinds = Conflicting Keybind. .change-keybind = Record New keybind - .open-dev-tools = Open Web Inspector + .open-close-dev-tools = Open/Close Web Inspector .toggle-devmode = Toggle Developer Mode .cancel-change-keybind = Cancel Recording .hide-focus-uplink = Hide/Focus Uplink diff --git a/common/locales/sr-RS/sr-RS.ftl b/common/locales/sr-RS/sr-RS.ftl index 171077ac939..05439c291fc 100644 --- a/common/locales/sr-RS/sr-RS.ftl +++ b/common/locales/sr-RS/sr-RS.ftl @@ -296,7 +296,7 @@ settings-keybinds = Поставке тастатурских пречица .toggle-deafen = Промените искључивање свих звукова, укључујући микрофон и слушалице. .conflicting-keybinds = Сукоб тастатурских пречица. .change-keybind = Запиши нову тастатурску пречицу - .open-dev-tools = Отвори веб инспектор + .open-close-dev-tools = Отвори/Затвори веб инспектор .toggle-devmode = Промени режим програмера .cancel-change-keybind = Откажи записivanje diff --git a/common/src/state/default_keybinds.rs b/common/src/state/default_keybinds.rs index a1d0407cabf..3ca384a5dde 100644 --- a/common/src/state/default_keybinds.rs +++ b/common/src/state/default_keybinds.rs @@ -46,7 +46,7 @@ pub fn get_default_keybinds() -> Vec<(GlobalShortcut, Shortcut)> { )), ), ( - GlobalShortcut::OpenDevTools, + GlobalShortcut::OpenCloseDevTools, Shortcut::from(( vec![KeyCode::I], vec![ModifiersState::CONTROL, ModifiersState::SHIFT], diff --git a/common/src/state/settings.rs b/common/src/state/settings.rs index ac0d009de80..2fae911d18a 100644 --- a/common/src/state/settings.rs +++ b/common/src/state/settings.rs @@ -16,7 +16,7 @@ pub enum GlobalShortcut { ToggleDeafen, IncreaseFontSize, DecreaseFontSize, - OpenDevTools, + OpenCloseDevTools, ToggleDevmode, SetAppVisible, #[default] @@ -30,7 +30,7 @@ impl fmt::Display for GlobalShortcut { GlobalShortcut::ToggleDeafen => write!(f, "ToggleDeafen"), GlobalShortcut::IncreaseFontSize => write!(f, "IncreaseFontSize"), GlobalShortcut::DecreaseFontSize => write!(f, "DecreaseFontSize"), - GlobalShortcut::OpenDevTools => write!(f, "OpenDevTools"), + GlobalShortcut::OpenCloseDevTools => write!(f, "OpenCloseDevTools"), GlobalShortcut::ToggleDevmode => write!(f, "ToggleDevmode"), GlobalShortcut::SetAppVisible => write!(f, "SetAppVisible"), GlobalShortcut::Unknown => write!(f, "Unknown"), diff --git a/ui/src/components/settings/sub_pages/keybinds.rs b/ui/src/components/settings/sub_pages/keybinds.rs index 5e7b1054371..6744bec3a16 100644 --- a/ui/src/components/settings/sub_pages/keybinds.rs +++ b/ui/src/components/settings/sub_pages/keybinds.rs @@ -298,10 +298,10 @@ pub fn KeybindSettings(cx: Scope) -> Element { shortcut: GlobalShortcut::ToggleDeafen } KeybindSection { - id: format!("{:?}", GlobalShortcut::OpenDevTools), - section_label: get_local_text("settings-keybinds.open-dev-tools"), + id: format!("{:?}", GlobalShortcut::OpenCloseDevTools), + section_label: get_local_text("settings-keybinds.open-close-dev-tools"), bindings: bindings.clone(), - shortcut: GlobalShortcut::OpenDevTools + shortcut: GlobalShortcut::OpenCloseDevTools } KeybindSection { id: format!("{:?}", GlobalShortcut::ToggleDevmode), diff --git a/ui/src/lib.rs b/ui/src/lib.rs index e459f88ca93..0236b300a3f 100644 --- a/ui/src/lib.rs +++ b/ui/src/lib.rs @@ -202,7 +202,7 @@ fn app(cx: Scope) -> Element { is_on_auth_pages: true, on_global_shortcut: move |shortcut| { match shortcut { - GlobalShortcut::OpenDevTools => utils::keyboard::shortcut_handlers::dev::open_dev_tools(cx.scope), + GlobalShortcut::OpenCloseDevTools => utils::keyboard::shortcut_handlers::dev::open_close_dev_tools(cx.scope), GlobalShortcut::Unknown => log::error!("Unknown `Shortcut` called!"), _ => log::info!("Just Open Dev Tools shortcut works on Auth Pages!"), } @@ -251,7 +251,7 @@ fn app_layout(cx: Scope) -> Element { GlobalShortcut::ToggleDeafen => utils::keyboard::shortcut_handlers::audio::toggle_deafen(), GlobalShortcut::IncreaseFontSize => utils::keyboard::shortcut_handlers::font::increase_size(state.clone()), GlobalShortcut::DecreaseFontSize => utils::keyboard::shortcut_handlers::font::decrease_size(state.clone()), - GlobalShortcut::OpenDevTools => utils::keyboard::shortcut_handlers::dev::open_dev_tools(cx), + GlobalShortcut::OpenCloseDevTools => utils::keyboard::shortcut_handlers::dev::open_close_dev_tools(cx), GlobalShortcut::ToggleDevmode => utils::keyboard::shortcut_handlers::dev::toggle_devmode(state.clone()), GlobalShortcut::SetAppVisible => utils::keyboard::shortcut_handlers::navigation::set_app_visible(cx), GlobalShortcut::Unknown => log::error!("Unknown `Shortcut` called!") diff --git a/ui/src/utils/keyboard/mod.rs b/ui/src/utils/keyboard/mod.rs index a60f306b1f4..86ebacff7f8 100644 --- a/ui/src/utils/keyboard/mod.rs +++ b/ui/src/utils/keyboard/mod.rs @@ -4,28 +4,14 @@ use dioxus::prelude::*; use dioxus_desktop::use_global_shortcut; use dioxus_desktop::wry::application::keyboard::ModifiersState; use once_cell::sync::Lazy; -use std::{ - sync::Mutex, - time::{Duration, Instant}, -}; -pub mod shortcut_handlers; - -const NAVIGATE_AND_HIGHLIGHT_KEYBINDS: &str = include_str!("./navigate_and_highlight_keybinds.js"); +use warp::sync::RwLock; -// TODO: This fires once on key-down as well as key-up we should fix this in the future. -static LAST_CALLED: Lazy> = - Lazy::new(|| Mutex::new(Instant::now() - Duration::from_secs(1))); +pub mod shortcut_handlers; -fn debounced_callback(callback: F, debounce_duration: Duration) { - let mut last_called = LAST_CALLED.lock().unwrap(); - let now = Instant::now(); +static CALL_COUNT: Lazy> = Lazy::new(|| RwLock::new(0)); - if now.duration_since(*last_called) > debounce_duration { - callback(); - *last_called = now; - } -} +const NAVIGATE_AND_HIGHLIGHT_KEYBINDS: &str = include_str!("./navigate_and_highlight_keybinds.js"); #[derive(Props)] pub struct Props<'a> { @@ -142,20 +128,17 @@ fn RenderGlobalShortCuts<'a>(cx: Scope<'a, GlobalShortcutProps>) -> Element<'a> return None; } - let global_shortcut = cx.props.global_shortcut.clone(); - use_global_shortcut(cx, modifiers_and_keys.as_str(), { - to_owned![command_pressed, global_shortcut]; + to_owned![command_pressed]; move || { - if global_shortcut == GlobalShortcut::SetAppVisible { + *CALL_COUNT.write() += 1; + + if *CALL_COUNT.read() == 1 { command_pressed.with_mut(|i| *i = true); - } else { - debounced_callback( - || { - command_pressed.with_mut(|i| *i = true); - }, - Duration::from_millis(500), - ); + } + + if *CALL_COUNT.read() == 2 { + *CALL_COUNT.write() = 0; } } }); diff --git a/ui/src/utils/keyboard/shortcut_handlers/dev.rs b/ui/src/utils/keyboard/shortcut_handlers/dev.rs index b95ffab787c..9273fcc5608 100644 --- a/ui/src/utils/keyboard/shortcut_handlers/dev.rs +++ b/ui/src/utils/keyboard/shortcut_handlers/dev.rs @@ -2,9 +2,13 @@ use common::state::{action::ConfigAction, Action, State}; use dioxus::prelude::*; use dioxus_desktop::use_window; -pub fn open_dev_tools(cx: &ScopeState) { +pub fn open_close_dev_tools(cx: &ScopeState) { let window = use_window(cx); - window.webview.open_devtools(); + if window.webview.is_devtools_open() { + window.webview.close_devtools(); + } else { + window.webview.open_devtools(); + } } pub fn toggle_devmode(state: UseSharedState) { let devmode = state.read().configuration.developer.developer_mode; diff --git a/ui/src/utils/keyboard/shortcut_handlers/navigation.rs b/ui/src/utils/keyboard/shortcut_handlers/navigation.rs index 75b9504cba5..f4b3ca84296 100644 --- a/ui/src/utils/keyboard/shortcut_handlers/navigation.rs +++ b/ui/src/utils/keyboard/shortcut_handlers/navigation.rs @@ -1,28 +1,17 @@ use dioxus_core::ScopeState; use dioxus_desktop::use_window; -use once_cell::sync::Lazy; -use warp::sync::RwLock; - -static CALL_COUNT: Lazy> = Lazy::new(|| RwLock::new(0)); pub fn set_app_visible(cx: &ScopeState) { let window = use_window(cx); - *CALL_COUNT.write() += 1; - - if *CALL_COUNT.read() == 1 { - if !window.is_focused() && !window.is_minimized() { - window.set_focus(); - } else if !window.is_visible() || window.is_minimized() { - window.set_minimized(false); - window.set_visible(true); - window.set_focus(); - } else if window.is_visible() || !window.is_minimized() { - window.set_minimized(true); - window.set_visible(false); - } - } - if *CALL_COUNT.read() == 2 { - *CALL_COUNT.write() = 0; + if !window.is_focused() && !window.is_minimized() { + window.set_focus(); + } else if !window.is_visible() || window.is_minimized() { + window.set_minimized(false); + window.set_visible(true); + window.set_focus(); + } else if window.is_visible() || !window.is_minimized() { + window.set_minimized(true); + window.set_visible(false); } } From c534f88379cffd04fb9bdb201dae394c3aba6b78 Mon Sep 17 00:00:00 2001 From: Jeff Kristian Date: Thu, 25 Jan 2024 10:56:24 -0700 Subject: [PATCH 3/5] fix(keybindings): add js to force a blur on successful keybind change (#1753) --- .../components/settings/sub_pages/keybinds.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ui/src/components/settings/sub_pages/keybinds.rs b/ui/src/components/settings/sub_pages/keybinds.rs index 6744bec3a16..1b4397fdf1a 100644 --- a/ui/src/components/settings/sub_pages/keybinds.rs +++ b/ui/src/components/settings/sub_pages/keybinds.rs @@ -26,6 +26,16 @@ const AVOID_INPUT_ON_DIV: &str = r#" event.preventDefault(); });"#; +const UNFOCUS_DIV_ON_SUBMIT: &str = r#" + let currentDiv = document.getElementById("$UUID"); + let innerDiv = currentDiv.querySelector('.keybind-section-keys'); + if (innerDiv.classList.contains('recording')) { + innerDiv.addEventListener('keyup', function() { + innerDiv.blur(); + }); + } +"#; + #[derive(PartialEq, Props)] pub struct KeybindProps { pub keys: Vec, // TODO: This should be a Vec @@ -122,6 +132,18 @@ pub fn KeybindSection(cx: Scope) -> Element { let eval = use_eval(cx); let script = AVOID_INPUT_ON_DIV.replace("$UUID", keybind_section_id.as_str()); let _ = eval(&script); + let keybind_section_id_clone = keybind_section_id.clone(); + + use_effect(cx, is_recording, |is_recording| { + to_owned![eval]; + async move { + if *is_recording { + let unfocus_script = + UNFOCUS_DIV_ON_SUBMIT.replace("$UUID", keybind_section_id_clone.as_str()); + let _ = eval(&unfocus_script); + }; + } + }); let mut keybind_class = "keybind-section-keys".to_owned(); if **is_recording { From ab61e6e7e5eaaf5b54cb325d2bbcb3a0ee46a4db Mon Sep 17 00:00:00 2001 From: Darius Clark Date: Thu, 25 Jan 2024 16:15:08 -0500 Subject: [PATCH 4/5] chore(cargo): Update warp dependency (#1770) --- Cargo.lock | 17 +++++++++---- Cargo.toml | 9 ++++--- common/Cargo.toml | 2 ++ common/src/language/mod.rs | 2 +- common/src/notifications.rs | 2 +- common/src/sounds.rs | 2 +- common/src/state/configuration.rs | 2 +- common/src/state/mod.rs | 9 +++---- common/src/state/ui.rs | 2 +- common/src/state/utils.rs | 2 +- common/src/utils/clear_temp_files_dir.rs | 2 +- .../manager/commands/blink_commands.rs | 2 +- .../commands/constellation_commands.rs | 5 ++-- .../manager/commands/multipass_commands.rs | 3 ++- .../manager/commands/other_commands.rs | 5 +++- .../manager/commands/raygun_commands.rs | 3 ++- common/src/warp_runner/manager/events.rs | 3 ++- common/src/warp_runner/manager/mod.rs | 6 +++-- common/src/warp_runner/mod.rs | 24 +++++++------------ common/src/warp_runner/ui_adapter/mod.rs | 3 ++- .../warp_runner/ui_adapter/raygun_event.rs | 6 ++--- kit/Cargo.toml | 2 +- kit/src/components/message/mod.rs | 3 ++- kit/src/components/slide_selector/mod.rs | 2 +- kit/src/elements/textarea/mod.rs | 2 +- kit/src/layout/topbar/mod.rs | 2 +- native_extensions/emoji_selector/Cargo.toml | 1 + native_extensions/emoji_selector/src/lib.rs | 4 ++-- ui/Cargo.toml | 6 +++-- ui/src/components/friends/add.rs | 4 +++- ui/src/components/friends/blocked/mod.rs | 4 +++- ui/src/components/friends/friends_list/mod.rs | 3 ++- .../friends/incoming_requests/mod.rs | 4 +++- .../friends/outgoing_requests/mod.rs | 4 +++- ui/src/components/settings/sub_pages/about.rs | 2 +- .../settings/sub_pages/accessibility.rs | 2 +- ui/src/components/settings/sub_pages/audio.rs | 2 +- .../settings/sub_pages/developer.rs | 2 +- ui/src/components/settings/sub_pages/files.rs | 2 +- .../components/settings/sub_pages/general.rs | 2 +- .../components/settings/sub_pages/licenses.rs | 2 +- .../components/settings/sub_pages/messages.rs | 2 +- .../components/settings/sub_pages/privacy.rs | 2 +- .../settings/sub_pages/profile/mod.rs | 4 +++- .../chats/presentation/chat/controls.rs | 4 +++- .../chats/presentation/chat/edit_group.rs | 4 ++-- .../chats/presentation/chat/group_users.rs | 4 ++-- ui/src/layouts/chats/presentation/chat/mod.rs | 3 ++- .../presentation/chat/pinned_messages/mod.rs | 4 +++- .../layouts/chats/presentation/chat/topbar.rs | 4 +++- .../layouts/chats/presentation/chatbar/mod.rs | 4 +++- .../chats/presentation/messages/mod.rs | 3 ++- .../chats/presentation/quick_profile/mod.rs | 4 +++- .../presentation/sidebar/create_group.rs | 6 ++--- .../layouts/chats/presentation/sidebar/mod.rs | 3 ++- ui/src/layouts/friends.rs | 2 +- ui/src/layouts/log_in/enter_username.rs | 2 +- ui/src/layouts/log_in/entry_point.rs | 4 +++- ui/src/lib.rs | 2 +- ui/src/logger/mod.rs | 2 +- ui/src/utils/auto_updater.rs | 2 +- ui/src/utils/get_drag_event.rs | 2 +- ui/src/utils/keyboard/mod.rs | 2 +- ui/src/utils/mod.rs | 2 +- ui/src/webview_config.rs | 2 +- 65 files changed, 141 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 588fab467c0..febf36a1d10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1455,6 +1455,7 @@ dependencies = [ "notify-rust", "objc", "once_cell", + "parking_lot 0.12.1", "plot_icon", "rand 0.8.5", "regex", @@ -1466,6 +1467,7 @@ dependencies = [ "titlecase", "tokio", "tokio-util", + "tracing", "unic-langid", "uuid", "walkdir", @@ -2594,6 +2596,7 @@ dependencies = [ "kit", "once_cell", "regex", + "tracing", "uuid", "warp", ] @@ -4703,7 +4706,6 @@ dependencies = [ "glob", "humansize", "linkify", - "log", "mime", "once_cell", "pulldown-cmark", @@ -4714,6 +4716,7 @@ dependencies = [ "serde", "serde_json", "timeago", + "tracing", "unic-emoji-char", "unic-segment", "uuid", @@ -8494,7 +8497,7 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "shuttle" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=a92a3674cd1d2e700e5275beb606984160cb9532#a92a3674cd1d2e700e5275beb606984160cb9532" +source = "git+https://github.com/Satellite-im/Warp?rev=32f4c53fc462d53553a31762ecd12b4af9329a4a#32f4c53fc462d53553a31762ecd12b4af9329a4a" dependencies = [ "anyhow", "async-stream", @@ -9758,6 +9761,7 @@ dependencies = [ "once_cell", "open", "opener", + "parking_lot 0.12.1", "rand 0.8.5", "raw-window-handle", "regex", @@ -9772,6 +9776,7 @@ dependencies = [ "titlecase", "tokio", "tokio-util", + "tracing", "uuid", "walkdir", "warp", @@ -9893,7 +9898,7 @@ dependencies = [ [[package]] name = "warp" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=a92a3674cd1d2e700e5275beb606984160cb9532#a92a3674cd1d2e700e5275beb606984160cb9532" +source = "git+https://github.com/Satellite-im/Warp?rev=32f4c53fc462d53553a31762ecd12b4af9329a4a#32f4c53fc462d53553a31762ecd12b4af9329a4a" dependencies = [ "aes-gcm 0.10.3", "anyhow", @@ -9948,7 +9953,7 @@ dependencies = [ [[package]] name = "warp-blink-wrtc" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=a92a3674cd1d2e700e5275beb606984160cb9532#a92a3674cd1d2e700e5275beb606984160cb9532" +source = "git+https://github.com/Satellite-im/Warp?rev=32f4c53fc462d53553a31762ecd12b4af9329a4a#32f4c53fc462d53553a31762ecd12b4af9329a4a" dependencies = [ "anyhow", "async-stream", @@ -9965,6 +9970,7 @@ dependencies = [ "mp4", "once_cell", "opus", + "parking_lot 0.12.1", "rand 0.8.5", "rayon", "ringbuf", @@ -9980,7 +9986,7 @@ dependencies = [ [[package]] name = "warp-ipfs" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=a92a3674cd1d2e700e5275beb606984160cb9532#a92a3674cd1d2e700e5275beb606984160cb9532" +source = "git+https://github.com/Satellite-im/Warp?rev=32f4c53fc462d53553a31762ecd12b4af9329a4a#32f4c53fc462d53553a31762ecd12b4af9329a4a" dependencies = [ "anyhow", "async-recursion 1.0.5", @@ -9998,6 +10004,7 @@ dependencies = [ "image", "libipld", "mediatype", + "parking_lot 0.12.1", "rust-ipfs", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 65bdec5933f..94deb5828bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,9 +45,9 @@ arboard = "3.2" humansize = "2.1.3" uuid = { version = "1", features = ["serde", "v4"] } libloading = "0.7.4" -warp = { git = "https://github.com/Satellite-im/Warp", rev = "a92a3674cd1d2e700e5275beb606984160cb9532" } -warp-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "a92a3674cd1d2e700e5275beb606984160cb9532" } -warp-blink-wrtc = { git = "https://github.com/Satellite-im/Warp", rev = "a92a3674cd1d2e700e5275beb606984160cb9532" } +warp = { git = "https://github.com/Satellite-im/Warp", rev = "32f4c53fc462d53553a31762ecd12b4af9329a4a" } +warp-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "32f4c53fc462d53553a31762ecd12b4af9329a4a" } +warp-blink-wrtc = { git = "https://github.com/Satellite-im/Warp", rev = "32f4c53fc462d53553a31762ecd12b4af9329a4a" } rfd = "0.11.3" mime = "0.3.16" serde = "1.0" @@ -72,6 +72,9 @@ tempfile = "3.0.7" fdlimit = "0.2" once_cell = "1.17" +parking_lot = { version = "0.12" } +tracing = { version = "0.1" } +tracing-futures = { version = "0.2" } futures = "0.3" tokio = { version = "1", features = ["full"] } diff --git a/common/Cargo.toml b/common/Cargo.toml index 78c076c99fa..545c3135bf4 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -28,6 +28,8 @@ names = "0.14.0" titlecase = { workspace = true } substring = "1.4.5" plot_icon = "0.3.0" +tracing.workspace = true +parking_lot.workspace = true icons = { workspace = true } humansize = { workspace = true } zip = "0.6.4" diff --git a/common/src/language/mod.rs b/common/src/language/mod.rs index 7b7f9165922..4902cb39fb4 100644 --- a/common/src/language/mod.rs +++ b/common/src/language/mod.rs @@ -3,8 +3,8 @@ use std::collections::HashMap; use fluent_templates::{ fluent_bundle::FluentValue, once_cell::sync::Lazy, LanguageIdentifier, Loader, }; +use parking_lot::RwLock; use unic_langid::langid; -use warp::sync::RwLock; use crate::LOCALES; diff --git a/common/src/notifications.rs b/common/src/notifications.rs index 6875fe81677..55c9351866d 100644 --- a/common/src/notifications.rs +++ b/common/src/notifications.rs @@ -6,8 +6,8 @@ use super::sounds::{Play, Sounds}; use derive_more::Display; use notify_rust::Notification; use std::sync::Arc; +use tracing::log; use uuid::Uuid; -use warp::logging::tracing::log; use once_cell::sync::Lazy; use tokio::sync::{ diff --git a/common/src/sounds.rs b/common/src/sounds.rs index ece4d42a2f6..de8071ab62c 100644 --- a/common/src/sounds.rs +++ b/common/src/sounds.rs @@ -2,7 +2,7 @@ use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, }; -use warp::logging::tracing::log; +use tracing::log; pub enum Sounds { Notification, diff --git a/common/src/state/configuration.rs b/common/src/state/configuration.rs index b9a3aebe974..e3fb594e227 100644 --- a/common/src/state/configuration.rs +++ b/common/src/state/configuration.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use warp::logging::tracing::log; +use tracing::log; use crate::STATIC_ARGS; diff --git a/common/src/state/mod.rs b/common/src/state/mod.rs index c64aa749c42..e01f2d0770a 100644 --- a/common/src/state/mod.rs +++ b/common/src/state/mod.rs @@ -51,12 +51,9 @@ use std::{ time::{Duration, Instant}, }; use uuid::Uuid; -use warp::{ - crypto::DID, - logging::tracing::log, - multipass::identity::IdentityStatus, - raygun::{self}, -}; +use warp::{crypto::DID, multipass::identity::IdentityStatus, raygun}; + +use tracing::log; use self::call::Call; use self::pending_message::PendingMessage; diff --git a/common/src/state/ui.rs b/common/src/state/ui.rs index e6b3b303e3c..94e0223c44c 100644 --- a/common/src/state/ui.rs +++ b/common/src/state/ui.rs @@ -11,8 +11,8 @@ use std::{ collections::{hash_map, HashMap}, rc::Weak, }; +use tracing::log; use uuid::Uuid; -use warp::logging::tracing::log; use super::{call, notifications::Notifications}; diff --git a/common/src/state/utils.rs b/common/src/state/utils.rs index 8c687f11583..a612225f30b 100644 --- a/common/src/state/utils.rs +++ b/common/src/state/utils.rs @@ -4,8 +4,8 @@ use std::{ }; use titlecase::titlecase; +use tracing::log; use walkdir::WalkDir; -use warp::logging::tracing::log; use crate::{get_extras_dir, STATIC_ARGS}; diff --git a/common/src/utils/clear_temp_files_dir.rs b/common/src/utils/clear_temp_files_dir.rs index 6198f3f54b4..11e779e208c 100644 --- a/common/src/utils/clear_temp_files_dir.rs +++ b/common/src/utils/clear_temp_files_dir.rs @@ -1,5 +1,5 @@ use std::{fs, io}; -use warp::logging::tracing::log; +use tracing::log; use crate::STATIC_ARGS; diff --git a/common/src/warp_runner/manager/commands/blink_commands.rs b/common/src/warp_runner/manager/commands/blink_commands.rs index f22aab601b1..ff68d07b7bc 100644 --- a/common/src/warp_runner/manager/commands/blink_commands.rs +++ b/common/src/warp_runner/manager/commands/blink_commands.rs @@ -1,8 +1,8 @@ use derive_more::Display; use futures::channel::oneshot::{self}; use tokio::sync::mpsc::UnboundedReceiver; +use tracing::log; use uuid::Uuid; -use warp::logging::tracing::log; use warp::{ blink::{AudioDeviceConfig, AudioTestEvent}, crypto::DID, diff --git a/common/src/warp_runner/manager/commands/constellation_commands.rs b/common/src/warp_runner/manager/commands/constellation_commands.rs index aa28e1cbc4e..53993630f3e 100644 --- a/common/src/warp_runner/manager/commands/constellation_commands.rs +++ b/common/src/warp_runner/manager/commands/constellation_commands.rs @@ -29,10 +29,11 @@ use warp::{ ConstellationProgressStream, Progression, }, error::Error, - logging::tracing::log, - sync::RwLock, }; +use parking_lot::RwLock; +use tracing::log; + static DIRECTORIES_AVAILABLE_TO_BROWSE: Lazy>> = Lazy::new(|| RwLock::new(Vec::new())); diff --git a/common/src/warp_runner/manager/commands/multipass_commands.rs b/common/src/warp_runner/manager/commands/multipass_commands.rs index b250ec24c7c..53ea07ea488 100644 --- a/common/src/warp_runner/manager/commands/multipass_commands.rs +++ b/common/src/warp_runner/manager/commands/multipass_commands.rs @@ -7,13 +7,14 @@ use warp::{ constellation::file::FileType, crypto::DID, error::Error, - logging::tracing::log, multipass::{ self, identity::{self, Identifier, IdentityImage, IdentityStatus, IdentityUpdate}, }, }; +use tracing::log; + use crate::{ state::{self, Identity}, warp_runner::{ui_adapter::dids_to_identity, Account}, diff --git a/common/src/warp_runner/manager/commands/other_commands.rs b/common/src/warp_runner/manager/commands/other_commands.rs index d8b0a5a2b98..4ec373ee667 100644 --- a/common/src/warp_runner/manager/commands/other_commands.rs +++ b/common/src/warp_runner/manager/commands/other_commands.rs @@ -8,7 +8,10 @@ use zip::{result::ZipError, write::FileOptions}; use derive_more::Display; use futures::channel::oneshot; -use warp::{error, logging::tracing::log}; +use warp::error; + +use tracing::log; + #[derive(Display)] pub enum OtherCmd { #[display(fmt = "CompressFolder {{ src: {src:?}, dest: {dest:?} }} ")] diff --git a/common/src/warp_runner/manager/commands/raygun_commands.rs b/common/src/warp_runner/manager/commands/raygun_commands.rs index 7cd18f8dc04..85234d97992 100644 --- a/common/src/warp_runner/manager/commands/raygun_commands.rs +++ b/common/src/warp_runner/manager/commands/raygun_commands.rs @@ -11,13 +11,14 @@ use warp::{ constellation::ConstellationProgressStream, crypto::DID, error::Error, - logging::tracing::log, raygun::{ self, AttachmentEventStream, ConversationType, GroupSettings, Location, PinState, ReactionState, }, }; +use tracing::log; + use crate::{ state::{chats, identity, Friends}, warp_runner::{ diff --git a/common/src/warp_runner/manager/events.rs b/common/src/warp_runner/manager/events.rs index 778d7e377a0..c9f3e77070d 100644 --- a/common/src/warp_runner/manager/events.rs +++ b/common/src/warp_runner/manager/events.rs @@ -1,10 +1,11 @@ use warp::{ blink::BlinkEventKind, - logging::tracing::log, multipass::MultiPassEventKind, raygun::{MessageEventKind, RayGunEventKind}, }; +use tracing::log; + use crate::{ warp_runner::{ conv_stream, diff --git a/common/src/warp_runner/manager/mod.rs b/common/src/warp_runner/manager/mod.rs index 310773afc13..e912564e296 100644 --- a/common/src/warp_runner/manager/mod.rs +++ b/common/src/warp_runner/manager/mod.rs @@ -7,10 +7,12 @@ use std::sync::Arc; use tokio::sync::Notify; use warp::{ - blink::BlinkEventStream, logging::tracing::log, multipass::MultiPassEventStream, - raygun::RayGunEventStream, tesseract::Tesseract, + blink::BlinkEventStream, multipass::MultiPassEventStream, raygun::RayGunEventStream, + tesseract::Tesseract, }; +use tracing::log; + use super::{conv_stream, Account, Calling, Messaging, Storage}; use crate::WARP_CMD_CH; diff --git a/common/src/warp_runner/mod.rs b/common/src/warp_runner/mod.rs index d2698b46fe5..3eb9fd82f6c 100644 --- a/common/src/warp_runner/mod.rs +++ b/common/src/warp_runner/mod.rs @@ -1,15 +1,13 @@ //! Defines important types and structs, and spawns the main task for warp_runner - manager::run. use derive_more::Display; -use std::{ - collections::{HashMap, HashSet}, - sync::Arc, -}; +use std::sync::Arc; use tokio::sync::{ broadcast, mpsc::{UnboundedReceiver, UnboundedSender}, Mutex, Notify, }; +use tracing::log; use warp::{ blink::{ Blink::{self}, @@ -17,7 +15,6 @@ use warp::{ }, constellation::{file::FileType, Constellation}, error::Error, - logging::tracing::log, multipass::{self, IdentityImportOption, MultiPass}, raygun::RayGun, tesseract::Tesseract, @@ -353,16 +350,13 @@ impl From<&DiscoveryMode> for Discovery { addresses: vec![address.parse().expect("Valid multiaddr address")], }, }, - DiscoveryMode::Shuttle => Discovery::Shuttle { - addresses: HashMap::from_iter([( - "12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu" - .parse() - .expect("Valid id"), - HashSet::from_iter(["/ip4/104.236.194.35/tcp/34053" - .parse() - .expect("valid addr")]), - )]), - }, + DiscoveryMode::Shuttle => { + let addresses = Vec::from_iter(["/ip4/104.236.194.35/tcp/34053/p2p/12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu" + .parse() + .expect("valid addr")]); + + Discovery::Shuttle { addresses } + } DiscoveryMode::Disable => Discovery::None, } } diff --git a/common/src/warp_runner/ui_adapter/mod.rs b/common/src/warp_runner/ui_adapter/mod.rs index 7a928c51412..f67ca595bfe 100644 --- a/common/src/warp_runner/ui_adapter/mod.rs +++ b/common/src/warp_runner/ui_adapter/mod.rs @@ -23,11 +23,12 @@ use warp::{ constellation::file::File, crypto::DID, error::Error, - logging::tracing::log, multipass::identity::{Identifier, Platform}, raygun::{self, Conversation, MessageOptions}, }; +use tracing::log; + use super::{ manager::commands::identity_image_to_base64, FetchMessagesConfig, FetchMessagesResponse, }; diff --git a/common/src/warp_runner/ui_adapter/raygun_event.rs b/common/src/warp_runner/ui_adapter/raygun_event.rs index f9705f27506..f86338cc971 100644 --- a/common/src/warp_runner/ui_adapter/raygun_event.rs +++ b/common/src/warp_runner/ui_adapter/raygun_event.rs @@ -1,8 +1,8 @@ +use super::{super::conv_stream, init_conversation, ChatAdapter}; use derive_more::Display; +use tracing::log; use uuid::Uuid; -use warp::{error::Error, logging::tracing::log, raygun::RayGunEventKind}; - -use super::{super::conv_stream, init_conversation, ChatAdapter}; +use warp::{error::Error, raygun::RayGunEventKind}; #[allow(clippy::large_enum_variant)] #[derive(Display, Clone)] diff --git a/kit/Cargo.toml b/kit/Cargo.toml index f1d3825e5af..70eb24cf516 100644 --- a/kit/Cargo.toml +++ b/kit/Cargo.toml @@ -33,7 +33,7 @@ once_cell = { workspace = true } emojis = "0.5" unic-segment = "0.9" unic-emoji-char = "0.9" -log = { workspace = true } +tracing = { workspace = true } [dependencies.uuid] workspace = true diff --git a/kit/src/components/message/mod.rs b/kit/src/components/message/mod.rs index 8e70d309ec9..ee580465a01 100644 --- a/kit/src/components/message/mod.rs +++ b/kit/src/components/message/mod.rs @@ -19,9 +19,10 @@ use warp::error::Error; use warp::{ constellation::{file::File, Progression}, crypto::DID, - logging::tracing::log, }; +use tracing::log; + use common::icons::outline::Shape as Icon; use crate::components::context_menu::{ContextItem, ContextMenu, IdentityHeader}; diff --git a/kit/src/components/slide_selector/mod.rs b/kit/src/components/slide_selector/mod.rs index 77c6fb71680..444095145ab 100644 --- a/kit/src/components/slide_selector/mod.rs +++ b/kit/src/components/slide_selector/mod.rs @@ -1,6 +1,6 @@ use common::icons::outline::Shape; use dioxus::prelude::*; -use warp::logging::tracing::log; +use tracing::log; use crate::elements::button::Button; diff --git a/kit/src/elements/textarea/mod.rs b/kit/src/elements/textarea/mod.rs index dc4d9d2251d..f82a01dbdd0 100644 --- a/kit/src/elements/textarea/mod.rs +++ b/kit/src/elements/textarea/mod.rs @@ -8,8 +8,8 @@ use dioxus_html::input_data::keyboard_types::Modifiers; use once_cell::sync::Lazy; use regex::Regex; use serde::Deserialize; +use tracing::log; use uuid::Uuid; -use warp::logging::tracing::log; // "{\"Input\":\"((?:.|\n)*)\"}" static INPUT_REGEX: Lazy = diff --git a/kit/src/layout/topbar/mod.rs b/kit/src/layout/topbar/mod.rs index 9cd2282704a..15068c43f23 100644 --- a/kit/src/layout/topbar/mod.rs +++ b/kit/src/layout/topbar/mod.rs @@ -1,6 +1,6 @@ use common::icons; use dioxus::prelude::*; -use warp::logging::tracing::log; +use tracing::log; use crate::elements::{button::Button, Appearance}; diff --git a/native_extensions/emoji_selector/Cargo.toml b/native_extensions/emoji_selector/Cargo.toml index 7d02c3dce8a..9e479250e62 100644 --- a/native_extensions/emoji_selector/Cargo.toml +++ b/native_extensions/emoji_selector/Cargo.toml @@ -19,3 +19,4 @@ warp = { workspace = true} uuid = { workspace = true } futures = { workspace = true } regex = { workspace = true } +tracing.workspace = true \ No newline at end of file diff --git a/native_extensions/emoji_selector/src/lib.rs b/native_extensions/emoji_selector/src/lib.rs index e3f1284c843..417e91de2c7 100644 --- a/native_extensions/emoji_selector/src/lib.rs +++ b/native_extensions/emoji_selector/src/lib.rs @@ -15,9 +15,9 @@ use kit::{ }; use once_cell::sync::Lazy; use regex::Regex; +use tracing::log; use uuid::Uuid; -use warp::{logging::tracing::log, raygun::ReactionState}; - +use warp::raygun::ReactionState; // These two lines are all you need to use your Extension implementation as a shared library static EXTENSION: Lazy = Lazy::new(|| EmojiSelector {}); static EMOJI_REGEX: Lazy = Lazy::new(|| Regex::new(":[^:]{2,}:?$").unwrap()); diff --git a/ui/Cargo.toml b/ui/Cargo.toml index e10c15ee6ea..f1d6e3ad352 100644 --- a/ui/Cargo.toml +++ b/ui/Cargo.toml @@ -49,6 +49,8 @@ tempfile = { workspace = true } fdlimit = { workspace = true } once_cell = { workspace = true } +tracing.workspace = true +parking_lot.workspace = true futures = { workspace = true } tokio = { workspace = true, features = ["full"] } @@ -65,8 +67,8 @@ reqwest = { workspace = true, default-features = false, features = [ "stream", ] } log = { workspace = true } -env_logger = { version = "0.10"} -dotenv = {version = "0.15.0"} +env_logger = { version = "0.10" } +dotenv = { version = "0.15.0" } [features] default = ["dioxus-desktop/devtools"] diff --git a/ui/src/components/friends/add.rs b/ui/src/components/friends/add.rs index d2399dfb18e..cf7fc5b3759 100644 --- a/ui/src/components/friends/add.rs +++ b/ui/src/components/friends/add.rs @@ -14,8 +14,10 @@ use kit::elements::{ tooltip::Tooltip, }; +use warp::crypto::DID; use warp::error::Error; -use warp::{crypto::DID, logging::tracing::log}; + +use tracing::log; use common::icons::outline::Shape as Icon; use common::{ diff --git a/ui/src/components/friends/blocked/mod.rs b/ui/src/components/friends/blocked/mod.rs index b64df4f720a..c1578dd2f99 100644 --- a/ui/src/components/friends/blocked/mod.rs +++ b/ui/src/components/friends/blocked/mod.rs @@ -17,7 +17,9 @@ use kit::{ }, elements::label::Label, }; -use warp::{crypto::DID, error::Error, logging::tracing::log, multipass::identity::Relationship}; +use warp::{crypto::DID, error::Error, multipass::identity::Relationship}; + +use tracing::log; #[allow(non_snake_case)] pub fn BlockedUsers(cx: Scope) -> Element { diff --git a/ui/src/components/friends/friends_list/mod.rs b/ui/src/components/friends/friends_list/mod.rs index bcc4fbb448d..fb178bf2529 100644 --- a/ui/src/components/friends/friends_list/mod.rs +++ b/ui/src/components/friends/friends_list/mod.rs @@ -31,11 +31,12 @@ use common::{ use uuid::Uuid; use warp::{ crypto::DID, - logging::tracing::log, multipass::identity::Relationship, raygun::{self, ConversationType}, }; +use tracing::log; + use crate::{ components::friends::friend::{Friend, SkeletalFriend}, utils::build_participants, diff --git a/ui/src/components/friends/incoming_requests/mod.rs b/ui/src/components/friends/incoming_requests/mod.rs index 3b92a7cc6f4..48eeb639825 100644 --- a/ui/src/components/friends/incoming_requests/mod.rs +++ b/ui/src/components/friends/incoming_requests/mod.rs @@ -19,7 +19,9 @@ use kit::{ elements::label::Label, }; use warp::crypto::DID; -use warp::{logging::tracing::log, multipass::identity::Relationship}; +use warp::multipass::identity::Relationship; + +use tracing::log; enum ChanCmd { AcceptRequest(DID), diff --git a/ui/src/components/friends/outgoing_requests/mod.rs b/ui/src/components/friends/outgoing_requests/mod.rs index 3bbc56d4809..94348766378 100644 --- a/ui/src/components/friends/outgoing_requests/mod.rs +++ b/ui/src/components/friends/outgoing_requests/mod.rs @@ -17,7 +17,9 @@ use kit::{ }, elements::label::Label, }; -use warp::{crypto::DID, logging::tracing::log, multipass::identity::Relationship}; +use warp::{crypto::DID, multipass::identity::Relationship}; + +use tracing::log; #[allow(non_snake_case)] pub fn OutgoingRequests(cx: Scope) -> Element { diff --git a/ui/src/components/settings/sub_pages/about.rs b/ui/src/components/settings/sub_pages/about.rs index abeef9daaf8..54f2ffc1c82 100644 --- a/ui/src/components/settings/sub_pages/about.rs +++ b/ui/src/components/settings/sub_pages/about.rs @@ -8,7 +8,7 @@ use dioxus_desktop::use_window; use futures::StreamExt; use kit::elements::{button::Button, Appearance}; -use warp::logging::tracing::log; +use tracing::log; use crate::get_download_modal; use crate::utils::auto_updater::{DownloadProgress, DownloadState, SoftwareDownloadCmd}; diff --git a/ui/src/components/settings/sub_pages/accessibility.rs b/ui/src/components/settings/sub_pages/accessibility.rs index 82d2dec8bb7..601629510e0 100644 --- a/ui/src/components/settings/sub_pages/accessibility.rs +++ b/ui/src/components/settings/sub_pages/accessibility.rs @@ -2,7 +2,7 @@ use common::language::get_local_text; use common::state::{action::ConfigAction, Action, State}; use dioxus::prelude::*; use kit::elements::switch::Switch; -use warp::logging::tracing::log; +use tracing::log; use crate::components::settings::SettingSection; diff --git a/ui/src/components/settings/sub_pages/audio.rs b/ui/src/components/settings/sub_pages/audio.rs index a894f087dda..549961b00c2 100644 --- a/ui/src/components/settings/sub_pages/audio.rs +++ b/ui/src/components/settings/sub_pages/audio.rs @@ -9,8 +9,8 @@ use futures::{channel::oneshot, StreamExt}; use kit::elements::button::Button; use kit::elements::select::Select; use kit::elements::switch::Switch; +use tracing::log; use warp::blink::AudioTestEvent; -use warp::logging::tracing::log; use crate::components::settings::{SettingSection, SettingSectionSimple}; use common::state::{action::ConfigAction, Action, State}; diff --git a/ui/src/components/settings/sub_pages/developer.rs b/ui/src/components/settings/sub_pages/developer.rs index 6a3afb77474..b6b5f371525 100644 --- a/ui/src/components/settings/sub_pages/developer.rs +++ b/ui/src/components/settings/sub_pages/developer.rs @@ -16,7 +16,7 @@ use futures::channel::oneshot; use futures::StreamExt; use kit::elements::{button::Button, switch::Switch, Appearance}; use rfd::FileDialog; -use warp::logging::tracing::log; +use tracing::log; use crate::{components::settings::SettingSection, logger}; diff --git a/ui/src/components/settings/sub_pages/files.rs b/ui/src/components/settings/sub_pages/files.rs index 212713e32e5..8a2d92c986f 100644 --- a/ui/src/components/settings/sub_pages/files.rs +++ b/ui/src/components/settings/sub_pages/files.rs @@ -2,7 +2,7 @@ use common::language::get_local_text; use dioxus::prelude::*; #[allow(unused_imports)] use kit::elements::{button::Button, switch::Switch}; -use warp::logging::tracing::log; +use tracing::log; use crate::components::settings::SettingSection; diff --git a/ui/src/components/settings/sub_pages/general.rs b/ui/src/components/settings/sub_pages/general.rs index fb66c3017d0..a4c7a1b00bb 100644 --- a/ui/src/components/settings/sub_pages/general.rs +++ b/ui/src/components/settings/sub_pages/general.rs @@ -10,7 +10,7 @@ use kit::elements::button::Button; use kit::elements::tooltip::{ArrowPosition, Tooltip}; #[allow(unused_imports)] use kit::elements::{select::Select, switch::Switch}; -use warp::logging::tracing::log; +use tracing::log; use crate::components::settings::{SettingSection, SettingSectionSimple}; use crate::utils::get_font_sizes::FONT_SIZE_OPTIONS; diff --git a/ui/src/components/settings/sub_pages/licenses.rs b/ui/src/components/settings/sub_pages/licenses.rs index 095a9d3ed86..d12848bbddb 100644 --- a/ui/src/components/settings/sub_pages/licenses.rs +++ b/ui/src/components/settings/sub_pages/licenses.rs @@ -2,7 +2,7 @@ use common::icons::outline::Shape as Icon; use dioxus::prelude::*; use kit::elements::button::Button; use kit::elements::Appearance; -use warp::logging::tracing::log; +use tracing::log; use crate::components::settings::SettingSection; diff --git a/ui/src/components/settings/sub_pages/messages.rs b/ui/src/components/settings/sub_pages/messages.rs index ac4bae39dbb..9b5972fb39c 100644 --- a/ui/src/components/settings/sub_pages/messages.rs +++ b/ui/src/components/settings/sub_pages/messages.rs @@ -4,7 +4,7 @@ use common::{ }; use dioxus::prelude::*; use kit::elements::switch::Switch; -use warp::logging::tracing::log; +use tracing::log; use crate::components::settings::SettingSection; diff --git a/ui/src/components/settings/sub_pages/privacy.rs b/ui/src/components/settings/sub_pages/privacy.rs index 62afa0875c7..99be846f97f 100644 --- a/ui/src/components/settings/sub_pages/privacy.rs +++ b/ui/src/components/settings/sub_pages/privacy.rs @@ -3,7 +3,7 @@ use common::icons::outline::Shape as Icon; use common::language::get_local_text; use dioxus::prelude::*; use kit::elements::{button::Button, Appearance}; -use warp::logging::tracing::log; +use tracing::log; use crate::components::settings::SettingSection; diff --git a/ui/src/components/settings/sub_pages/profile/mod.rs b/ui/src/components/settings/sub_pages/profile/mod.rs index 6c53c731b4e..18946ea2662 100644 --- a/ui/src/components/settings/sub_pages/profile/mod.rs +++ b/ui/src/components/settings/sub_pages/profile/mod.rs @@ -25,8 +25,10 @@ use kit::elements::{ use kit::layout::modal::Modal; use mime::*; use rfd::FileDialog; +use warp::error::Error; use warp::multipass::identity::IdentityStatus; -use warp::{error::Error, logging::tracing::log}; + +use tracing::log; use crate::components::crop_image_tool::circle_format_tool::CropCircleImageModal; use crate::components::crop_image_tool::rectangle_format_tool::CropRectImageModal; diff --git a/ui/src/layouts/chats/presentation/chat/controls.rs b/ui/src/layouts/chats/presentation/chat/controls.rs index 5f425ef17e0..bf0dafa71e9 100644 --- a/ui/src/layouts/chats/presentation/chat/controls.rs +++ b/ui/src/layouts/chats/presentation/chat/controls.rs @@ -25,7 +25,9 @@ use common::{ use common::language::get_local_text; use uuid::Uuid; -use warp::{crypto::DID, logging::tracing::log, raygun::ConversationType}; +use warp::{crypto::DID, raygun::ConversationType}; + +use tracing::log; enum ControlsCmd { VoiceCall { diff --git a/ui/src/layouts/chats/presentation/chat/edit_group.rs b/ui/src/layouts/chats/presentation/chat/edit_group.rs index 0e6555f2265..b2db5367214 100644 --- a/ui/src/layouts/chats/presentation/chat/edit_group.rs +++ b/ui/src/layouts/chats/presentation/chat/edit_group.rs @@ -19,9 +19,9 @@ use kit::{ }, layout::topbar::Topbar, }; +use tracing::log; use uuid::Uuid; -use warp::{crypto::DID, logging::tracing::log}; - +use warp::crypto::DID; #[derive(PartialEq, Clone)] enum EditGroupAction { Add, diff --git a/ui/src/layouts/chats/presentation/chat/group_users.rs b/ui/src/layouts/chats/presentation/chat/group_users.rs index cfadc83fcf0..70e0c38715c 100644 --- a/ui/src/layouts/chats/presentation/chat/group_users.rs +++ b/ui/src/layouts/chats/presentation/chat/group_users.rs @@ -12,8 +12,8 @@ use kit::{ components::user_image::UserImage, elements::input::{Input, Options}, }; -use warp::{crypto::DID, logging::tracing::log}; - +use tracing::log; +use warp::crypto::DID; #[derive(Props, PartialEq)] pub struct Props { #[props(!optional)] diff --git a/ui/src/layouts/chats/presentation/chat/mod.rs b/ui/src/layouts/chats/presentation/chat/mod.rs index b56c5d8afae..b3a9c67a2a7 100644 --- a/ui/src/layouts/chats/presentation/chat/mod.rs +++ b/ui/src/layouts/chats/presentation/chat/mod.rs @@ -29,8 +29,9 @@ use common::state::{ui, Action, Identity, State}; use common::language::get_local_text; +use tracing::log; use uuid::Uuid; -use warp::{crypto::DID, logging::tracing::log}; +use warp::crypto::DID; #[allow(non_snake_case)] pub fn Compose(cx: Scope) -> Element { diff --git a/ui/src/layouts/chats/presentation/chat/pinned_messages/mod.rs b/ui/src/layouts/chats/presentation/chat/pinned_messages/mod.rs index 517deb211b2..924d5689c91 100644 --- a/ui/src/layouts/chats/presentation/chat/pinned_messages/mod.rs +++ b/ui/src/layouts/chats/presentation/chat/pinned_messages/mod.rs @@ -10,7 +10,9 @@ use dioxus::prelude::*; use futures::StreamExt; use kit::components::{embeds::file_embed::FileEmbed, message::ChatText, user_image::UserImage}; use uuid::Uuid; -use warp::{logging::tracing::log, raygun::PinState}; +use warp::raygun::PinState; + +use tracing::log; use crate::layouts::chats::{ data::{self, ChatData}, diff --git a/ui/src/layouts/chats/presentation/chat/topbar.rs b/ui/src/layouts/chats/presentation/chat/topbar.rs index 887dffd9252..cabade08912 100644 --- a/ui/src/layouts/chats/presentation/chat/topbar.rs +++ b/ui/src/layouts/chats/presentation/chat/topbar.rs @@ -14,7 +14,9 @@ use common::{ use common::language::get_local_text; use uuid::Uuid; -use warp::{logging::tracing::log, raygun::ConversationType}; +use warp::raygun::ConversationType; + +use tracing::log; use crate::{ layouts::chats::data::{get_input_options, ChatData, ChatProps}, diff --git a/ui/src/layouts/chats/presentation/chatbar/mod.rs b/ui/src/layouts/chats/presentation/chatbar/mod.rs index 6414ff585b3..78d7acba3c2 100644 --- a/ui/src/layouts/chats/presentation/chatbar/mod.rs +++ b/ui/src/layouts/chats/presentation/chatbar/mod.rs @@ -27,7 +27,9 @@ use once_cell::sync::Lazy; use regex::Regex; use rfd::FileDialog; use uuid::Uuid; -use warp::{crypto::DID, logging::tracing::log, raygun::Location}; +use warp::{crypto::DID, raygun::Location}; + +use tracing::log; const MAX_CHARS_LIMIT: usize = 1024; pub static EMOJI_REGEX: Lazy = Lazy::new(|| Regex::new(":[^:]{2,}:?$").unwrap()); diff --git a/ui/src/layouts/chats/presentation/messages/mod.rs b/ui/src/layouts/chats/presentation/messages/mod.rs index 72ed20e3c92..6ff13af5151 100644 --- a/ui/src/layouts/chats/presentation/messages/mod.rs +++ b/ui/src/layouts/chats/presentation/messages/mod.rs @@ -40,11 +40,12 @@ use uuid::Uuid; use warp::{ constellation::file::File, crypto::DID, - logging::tracing::log, multipass::identity::IdentityStatus, raygun::{self}, }; +use tracing::log; + use crate::{ components::emoji_group::EmojiGroup, layouts::{ diff --git a/ui/src/layouts/chats/presentation/quick_profile/mod.rs b/ui/src/layouts/chats/presentation/quick_profile/mod.rs index 164ffc79183..38398d1b160 100644 --- a/ui/src/layouts/chats/presentation/quick_profile/mod.rs +++ b/ui/src/layouts/chats/presentation/quick_profile/mod.rs @@ -22,7 +22,9 @@ use common::{ use common::language::get_local_text; use uuid::Uuid; -use warp::{crypto::DID, error::Error, logging::tracing::log}; +use warp::{crypto::DID, error::Error}; + +use tracing::log; use crate::{ components::{friends::friends_list::ShareFriendsModal, settings::sidebar::Page}, diff --git a/ui/src/layouts/chats/presentation/sidebar/create_group.rs b/ui/src/layouts/chats/presentation/sidebar/create_group.rs index a8ed1f6058d..05f6e8f9c5e 100644 --- a/ui/src/layouts/chats/presentation/sidebar/create_group.rs +++ b/ui/src/layouts/chats/presentation/sidebar/create_group.rs @@ -1,5 +1,6 @@ use std::collections::{BTreeMap, HashMap, HashSet}; +use crate::{layouts::chats::data::get_input_options, UplinkRoute}; use common::{ icons::outline::Shape as Icon, language::get_local_text, @@ -20,10 +21,9 @@ use kit::{ Appearance, }, }; +use tracing::log; use uuid::Uuid; -use warp::{crypto::DID, logging::tracing::log}; - -use crate::{layouts::chats::data::get_input_options, UplinkRoute}; +use warp::crypto::DID; #[derive(Props)] pub struct Props<'a> { diff --git a/ui/src/layouts/chats/presentation/sidebar/mod.rs b/ui/src/layouts/chats/presentation/sidebar/mod.rs index a2b5ee69da9..0e634e7d37a 100644 --- a/ui/src/layouts/chats/presentation/sidebar/mod.rs +++ b/ui/src/layouts/chats/presentation/sidebar/mod.rs @@ -34,10 +34,11 @@ use uuid::Uuid; use warp::raygun::ConversationType; use warp::{ crypto::DID, - logging::tracing::log, raygun::{self}, }; +use tracing::log; + use crate::components::media::calling::CallControl; use crate::layouts::chats::presentation::sidebar::create_group::CreateGroup; diff --git a/ui/src/layouts/friends.rs b/ui/src/layouts/friends.rs index 5bde2abe176..07a28d61959 100644 --- a/ui/src/layouts/friends.rs +++ b/ui/src/layouts/friends.rs @@ -21,7 +21,7 @@ use kit::{ layout::topbar::Topbar, }; use tokio::sync::broadcast::error::RecvError; -use warp::logging::tracing::log; +use tracing::log; #[derive(PartialEq, Clone)] pub enum FriendRoute { diff --git a/ui/src/layouts/log_in/enter_username.rs b/ui/src/layouts/log_in/enter_username.rs index 18874aeae2c..7c8d93b6619 100644 --- a/ui/src/layouts/log_in/enter_username.rs +++ b/ui/src/layouts/log_in/enter_username.rs @@ -15,7 +15,7 @@ use kit::elements::{ button::Button, input::{Input, Options, Validation}, }; -use warp::logging::tracing::log; +use tracing::log; use warp::multipass; use crate::AuthPages; diff --git a/ui/src/layouts/log_in/entry_point.rs b/ui/src/layouts/log_in/entry_point.rs index 3f1cb31a1d7..37efb95df34 100644 --- a/ui/src/layouts/log_in/entry_point.rs +++ b/ui/src/layouts/log_in/entry_point.rs @@ -20,7 +20,9 @@ use kit::{ tooltip::{ArrowPosition, Tooltip}, }, }; -use warp::{logging::tracing::log, multipass}; +use warp::multipass; + +use tracing::log; use common::icons::outline::Shape as Icon; use common::{ diff --git a/ui/src/lib.rs b/ui/src/lib.rs index 0236b300a3f..e6794f8220d 100644 --- a/ui/src/lib.rs +++ b/ui/src/lib.rs @@ -63,7 +63,7 @@ use dioxus_desktop::wry::application::event::Event as WryEvent; use dioxus_desktop::{use_wry_event_handler, DesktopService, PhysicalSize}; use tokio::sync::{mpsc, Mutex}; use tokio::time::{sleep, Duration}; -use warp::logging::tracing::log::{self}; +use tracing::log::{self}; use muda::AboutMetadata; use muda::Menu; diff --git a/ui/src/logger/mod.rs b/ui/src/logger/mod.rs index dbcd01edcd8..921e8b273ed 100644 --- a/ui/src/logger/mod.rs +++ b/ui/src/logger/mod.rs @@ -16,12 +16,12 @@ use colored::Colorize; use env_logger::Builder; use log::{self, Level, SetLoggerError}; use once_cell::sync::Lazy; +use parking_lot::RwLock; use std::fs::OpenOptions; use std::io::prelude::*; use std::path::PathBuf; use std::{collections::VecDeque, env}; use tokio::sync::mpsc; -use warp::sync::RwLock; use chrono::{DateTime, Local}; use common::STATIC_ARGS; diff --git a/ui/src/utils/auto_updater.rs b/ui/src/utils/auto_updater.rs index ac669179e91..2a2a836c5ac 100644 --- a/ui/src/utils/auto_updater.rs +++ b/ui/src/utils/auto_updater.rs @@ -12,7 +12,7 @@ use rfd::FileDialog; use serde::Deserialize; use tokio::io::AsyncWriteExt; use tokio::sync::mpsc; -use warp::logging::tracing::log; +use tracing::log; // these types exist to allow different parts of the app to share the same logic for managing software updates pub struct SoftwareUpdateCmd(pub mpsc::UnboundedReceiver); diff --git a/ui/src/utils/get_drag_event.rs b/ui/src/utils/get_drag_event.rs index 350aef6fc21..1d44847f7ca 100644 --- a/ui/src/utils/get_drag_event.rs +++ b/ui/src/utils/get_drag_event.rs @@ -1,6 +1,6 @@ use dioxus_desktop::wry::webview::FileDropEvent; use once_cell::sync::Lazy; -use warp::sync::RwLock; +use parking_lot::RwLock; pub fn get_drag_event() -> FileDropEvent { DRAG_EVENT.read().clone() diff --git a/ui/src/utils/keyboard/mod.rs b/ui/src/utils/keyboard/mod.rs index 86ebacff7f8..2b6aa12f2bd 100644 --- a/ui/src/utils/keyboard/mod.rs +++ b/ui/src/utils/keyboard/mod.rs @@ -5,7 +5,7 @@ use dioxus_desktop::use_global_shortcut; use dioxus_desktop::wry::application::keyboard::ModifiersState; use once_cell::sync::Lazy; -use warp::sync::RwLock; +use parking_lot::RwLock; pub mod shortcut_handlers; diff --git a/ui/src/utils/mod.rs b/ui/src/utils/mod.rs index 2ed4e44d3a0..807f86418ec 100644 --- a/ui/src/utils/mod.rs +++ b/ui/src/utils/mod.rs @@ -1,7 +1,7 @@ use common::{state, STATIC_ARGS}; use dioxus::prelude::{EvalError, UseEval}; use filetime::FileTime; -use warp::logging::tracing::log; +use tracing::log; use std::{fs, path::Path, rc::Rc}; diff --git a/ui/src/webview_config.rs b/ui/src/webview_config.rs index 868dd1f2f7e..82f1caaa98a 100644 --- a/ui/src/webview_config.rs +++ b/ui/src/webview_config.rs @@ -1,7 +1,7 @@ use crate::utils::get_drag_event::{BLOCK_CANCEL_DRAG_EVENT_FOR_LINUX, DRAG_EVENT}; use common::STATIC_ARGS; use dioxus_desktop::{wry::webview::FileDropEvent, Config}; -use warp::logging::tracing::log; +use tracing::log; pub(crate) fn webview_config() -> Config { let window = crate::window_builder::get_window_builder(true); From 5bc3646e0f7f4cae06b3f7000dc586e4407a33fa Mon Sep 17 00:00:00 2001 From: Darius Clark Date: Fri, 26 Jan 2024 14:29:11 -0500 Subject: [PATCH 5/5] chore(misc): Add env variable for list of addresses for shuttle discovery (#1772) --- common/src/warp_runner/mod.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/common/src/warp_runner/mod.rs b/common/src/warp_runner/mod.rs index 3eb9fd82f6c..85519f2c152 100644 --- a/common/src/warp_runner/mod.rs +++ b/common/src/warp_runner/mod.rs @@ -351,9 +351,22 @@ impl From<&DiscoveryMode> for Discovery { }, }, DiscoveryMode::Shuttle => { - let addresses = Vec::from_iter(["/ip4/104.236.194.35/tcp/34053/p2p/12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu" - .parse() - .expect("valid addr")]); + let env_addrs = std::env::var("SHUTTLE_ADDR_POINT") + .map(|val| { + val.split(',') + .filter_map(|addr_str| addr_str.parse::<_>().ok()) + .collect::>() + }) + .unwrap_or_default(); + + let addresses = match env_addrs.is_empty() { + true => Vec::from_iter(["/ip4/104.236.194.35/tcp/34053/p2p/12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu" + .parse() + .expect("valid addr")]), + false => env_addrs + }; + + log::debug!("shuttle addresses: {:?}", addresses); Discovery::Shuttle { addresses } }