diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000000..86ca875bf8a --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,17 @@ +settings: + # Enables automatic reviewing of draft pull requests. + enable_draft_pr_reviews: true + # Disables generation of release notes. + disable_high_level_summary: true + # Comma separated list of keywords in the title that should be ignored. + ignored_pr_titles: "WIP" + # ISO Code for the review language. + review_language: "en" + # Disables review and other status comments. + disable_review_status: false + # Add walkthrough comment in a collapsible section. + collapse_walkthrough_comment: true + # Disable automatic code reviews for this repository. + disable_review: false + # If set to false, enables the "poem" feature. + disable_poem: true diff --git a/.github/workflows/build-dmg-universal.yml b/.github/workflows/build-dmg-universal.yml index f85cecffc27..143821f39a9 100644 --- a/.github/workflows/build-dmg-universal.yml +++ b/.github/workflows/build-dmg-universal.yml @@ -19,7 +19,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.70.0 + toolchain: 1.73.0 override: true components: rustfmt, clippy - name: Install Dependencies diff --git a/.github/workflows/build-release-linux.yml b/.github/workflows/build-release-linux.yml index fbb1ef4fade..98f2dbe1c98 100644 --- a/.github/workflows/build-release-linux.yml +++ b/.github/workflows/build-release-linux.yml @@ -23,7 +23,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.70.0 + toolchain: 1.73.0 override: true - run: cargo build --release -F production_mode - run: bash build_linux_installer.sh uplink ${{ github.ref_name }} amd64 diff --git a/.github/workflows/build-release-windows.yml b/.github/workflows/build-release-windows.yml index f2ebb39b29e..0b613ebef94 100644 --- a/.github/workflows/build-release-windows.yml +++ b/.github/workflows/build-release-windows.yml @@ -25,7 +25,7 @@ jobs: - name: Get rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: 1.70.0 + toolchain: 1.73.0 target: x86_64-pc-windows-msvc override: true diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 0b87f54d4cb..0c3853fa299 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -22,7 +22,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.70.0 + toolchain: 1.73.0 override: true components: rustfmt, clippy - run: cargo clippy --no-deps -- -D warnings diff --git a/.github/workflows/ui-test-automation.yml b/.github/workflows/ui-test-automation.yml index dc5468e860e..cb6454d3efa 100644 --- a/.github/workflows/ui-test-automation.yml +++ b/.github/workflows/ui-test-automation.yml @@ -13,31 +13,6 @@ env: CARGO_TERM_COLOR: always jobs: - build-ubuntu: - runs-on: ubuntu-latest - steps: - - name: Checkout App directory 🔖 - uses: actions/checkout@v3 - - - name: Get latest package list - run: sudo apt-get update - - - name: Install libwebkit2gtk - run: sudo apt-get install -y build-essential pkg-config libssl-dev libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev librust-alsa-sys-dev dpkg-dev gzip webkit2gtk-driver xvfb libxdo-dev - - - name: Set up cargo cache 🛠️ - uses: Swatinem/rust-cache@v2 - - - name: Install Rust 💿 - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.70.0 - override: true - - - name: Build executable 🖥️ - run: cargo build --release -F production_mode - build-mac: runs-on: macos-13 steps: @@ -50,7 +25,7 @@ jobs: - name: Install Rust 💿 uses: actions-rs/toolchain@v1 with: - toolchain: 1.70.0 + toolchain: 1.73.0 override: true components: rustfmt, clippy @@ -106,7 +81,7 @@ jobs: - name: Install Rust 💿 uses: actions-rs/toolchain@v1 with: - toolchain: 1.70.0 + toolchain: 1.73.0 override: true components: rustfmt, clippy @@ -475,14 +450,7 @@ jobs: publish-results: if: always() needs: - [ - build-ubuntu, - build-mac, - build-windows, - test-mac, - test-windows-chats, - test-windows, - ] + [build-mac, build-windows, test-mac, test-windows-chats, test-windows] runs-on: ubuntu-latest permissions: checks: write @@ -574,7 +542,6 @@ jobs: remove-artifacts: needs: [ - build-ubuntu, build-mac, build-windows, test-mac, diff --git a/Cargo.lock b/Cargo.lock index 8c75c1c84ff..6261d197426 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -490,7 +490,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -531,7 +531,20 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", +] + +[[package]] +name = "asynchronous-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", ] [[package]] @@ -687,9 +700,9 @@ dependencies = [ [[package]] name = "beetle-bitswap-next" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c91cc80543058cf7e1a27072f53ca11366872976bf21983f9c1be32870269" +checksum = "1719231242754281ba960aba3461969cb7b4ed347f899fa06e3bcf70d4fb5023" dependencies = [ "ahash", "anyhow", @@ -697,7 +710,7 @@ dependencies = [ "async-channel", "async-stream", "async-trait", - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "cid", "deadqueue", @@ -2608,18 +2621,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enum-as-inner" version = "0.6.0" @@ -3052,9 +3053,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" +checksum = "4a2b7bc3e71d5b3c6e1436bd600d88a7a9315b3589883018123646767ea2d522" dependencies = [ "futures-timer", "futures-util", @@ -3105,7 +3106,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite", "waker-fn", ] @@ -3172,7 +3173,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "pin-utils", "slab", ] @@ -3377,7 +3378,7 @@ dependencies = [ "glib", "libc", "once_cell", - "pin-project-lite 0.2.13", + "pin-project-lite", "smallvec", "thiserror", ] @@ -3895,6 +3896,52 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" +[[package]] +name = "hickory-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.8.5", + "socket2 0.5.5", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.1", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.11.0" @@ -4027,7 +4074,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -4067,7 +4114,7 @@ dependencies = [ "httparse", "httpdate", "itoa 1.0.9", - "pin-project-lite 0.2.13", + "pin-project-lite", "socket2 0.4.10", "tokio", "tower-service", @@ -4130,17 +4177,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -4789,9 +4825,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.52.4" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" +checksum = "67c4d7fa0c6098ed39b90780715be07b70046ee64570371147bdc771503a5d3c" dependencies = [ "bytes", "either", @@ -4830,9 +4866,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4842,11 +4878,12 @@ dependencies = [ [[package]] name = "libp2p-autonat" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e907be08be5e4152317a79d310a6f501a1b5c02a81dcb065dc865475bbae9498" +checksum = "d95151726170e41b591735bf95c42b888fe4aa14f65216a9fbf0edcc04510586" dependencies = [ "async-trait", + "asynchronous-codec 0.6.2", "futures", "futures-timer", "instant", @@ -4854,16 +4891,17 @@ dependencies = [ "libp2p-identity", "libp2p-request-response", "libp2p-swarm", - "log", "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", + "tracing", ] [[package]] name = "libp2p-connection-limits" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" +checksum = "f2af4b1e1a1d6c5005a59b42287c0a526bcce94d8d688e2e9233b18eb843ceb4" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4873,9 +4911,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" +checksum = "8b8b63f1df89173dc6c582c07abfc072acf2792ce1787363ab266e0a18882fac" dependencies = [ "either", "fnv", @@ -4883,7 +4921,6 @@ dependencies = [ "futures-timer", "instant", "libp2p-identity", - "log", "multiaddr", "multihash 0.19.1", "multistream-select", @@ -4896,54 +4933,57 @@ dependencies = [ "serde", "smallvec", "thiserror", + "tracing", "unsigned-varint", "void", ] [[package]] name = "libp2p-dcutr" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458dce197aa5347a7ec0634a4c1343c6dfbf75859ef34d51e92b0cc333fe7cc3" +checksum = "a4f7bb7fa2b9e6cad9c30a6f67e3ff5c1e4b658c62b6375e35861a85f9c97bf3" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "either", "futures", + "futures-bounded", "futures-timer", "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", + "lru 0.11.1", "quick-protobuf", "quick-protobuf-codec", "thiserror", + "tracing", "void", ] [[package]] name = "libp2p-dns" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" +checksum = "852f9ab7c3eba64b158a4d9ab00848b1d732fa9d3224aa0a75643756f98aa136" dependencies = [ "async-trait", "futures", + "hickory-resolver", "libp2p-core", "libp2p-identity", - "log", "parking_lot 0.12.1", "smallvec", - "trust-dns-resolver", + "tracing", ] [[package]] name = "libp2p-gossipsub" -version = "0.45.2" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f9624e2a843b655f1c1b8262b8d5de6f309413fca4d66f01bb0662429f84dc" +checksum = "201f0626acd8985fae7fdd318e86c954574b9eef2e5dec433936a19a0338393d" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "base64 0.21.5", "byteorder", "bytes", @@ -4957,7 +4997,6 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "prometheus-client", "quick-protobuf", "quick-protobuf-codec", @@ -4966,17 +5005,18 @@ dependencies = [ "serde", "sha2 0.10.8", "smallvec", + "tracing", "unsigned-varint", "void", ] [[package]] name = "libp2p-identify" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" +checksum = "0544703553921214556f7567278b4f00cdd5052d29b0555ab88290cbfe54d81c" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "either", "futures", "futures-bounded", @@ -4984,12 +5024,12 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", - "lru", + "lru 0.12.0", "quick-protobuf", "quick-protobuf-codec", "smallvec", "thiserror", + "tracing", "void", ] @@ -5020,12 +5060,12 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.44.6" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" +checksum = "91de4ab46f01286bf0a92d517b51b52b53b6f4d32a774a432ba1c49b39768043" dependencies = [ "arrayvec 0.7.4", - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "either", "fnv", @@ -5035,7 +5075,6 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "quick-protobuf", "quick-protobuf-codec", "rand 0.8.5", @@ -5043,6 +5082,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "thiserror", + "tracing", "uint", "unsigned-varint", "void", @@ -5050,30 +5090,30 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" +checksum = "68f273a551ee9d0a79695f75afaeafb1371459dec69c29555e8a73a35608e96a" dependencies = [ "data-encoding", "futures", + "hickory-proto", "if-watch", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", "socket2 0.5.5", "tokio", - "trust-dns-proto 0.22.0", + "tracing", "void", ] [[package]] name = "libp2p-metrics" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" +checksum = "7ac3c92d46c061d3564b660c143356de966a9ab17eb6bfa8d6819daa2ae49b28" dependencies = [ "instant", "libp2p-core", @@ -5085,34 +5125,14 @@ dependencies = [ "libp2p-ping", "libp2p-relay", "libp2p-swarm", - "once_cell", "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93959ed08b6caf9810e067655e25f1362098797fef7c44d3103e63dcb6f0fabe" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "libp2p-identity", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.8.5", - "smallvec", - "unsigned-varint", -] - [[package]] name = "libp2p-nat" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5f13d206a74071604a4931b9528c88383e9adfcf8e39f80ec4b1ed558784b9" +checksum = "ca76c3243804e69554e3c0f441d31add3b7a076de1ed1a931386229430711a8f" dependencies = [ "anyhow", "futures", @@ -5128,16 +5148,16 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.43.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" dependencies = [ + "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek 4.1.1", "futures", "libp2p-core", "libp2p-identity", - "log", "multiaddr", "multihash 0.19.1", "once_cell", @@ -5147,15 +5167,16 @@ dependencies = [ "snow", "static_assertions", "thiserror", + "tracing", "x25519-dalek 2.0.0", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" +checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" dependencies = [ "either", "futures", @@ -5164,16 +5185,16 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", + "tracing", "void", ] [[package]] name = "libp2p-quic" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" +checksum = "3635a185249a123cbb57e97495245acbbb0a5daeb4d1a7ac9748ad7f685e631e" dependencies = [ "bytes", "futures", @@ -5182,7 +5203,6 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-tls", - "log", "parking_lot 0.12.1", "quinn", "rand 0.8.5", @@ -5191,15 +5211,16 @@ dependencies = [ "socket2 0.5.5", "thiserror", "tokio", + "tracing", ] [[package]] name = "libp2p-relay" -version = "0.16.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bab06b10bbfb3936955965a01bd8db105b8675faabd55c88f94703feec318b" +checksum = "9a23501adbbc740711370466a34fae080316faf4fb28253419e0e5b705d5d5c1" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "either", "futures", @@ -5209,20 +5230,20 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "quick-protobuf", "quick-protobuf-codec", "rand 0.8.5", "static_assertions", "thiserror", + "tracing", "void", ] [[package]] name = "libp2p-relay-manager" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c759ddc6d6c5a54d8faab9694f2085faa311b6fd7d6f56e81139d74f71357a5" +checksum = "e3c35ec6fafe9d733664002b3ca8cbfe0520c4f86d7e920250f43258753269ba" dependencies = [ "anyhow", "futures", @@ -5236,12 +5257,12 @@ dependencies = [ [[package]] name = "libp2p-rendezvous" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00aec50ed436e23945cb842e0a7212b1a1504461d50310a5ba8c3bc0b4c17682" +checksum = "168a444a16f569771bcb48aa081a32724079156e64a730dd900276391ccb6385" dependencies = [ "async-trait", - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bimap", "futures", "futures-timer", @@ -5250,40 +5271,42 @@ dependencies = [ "libp2p-identity", "libp2p-request-response", "libp2p-swarm", - "log", "quick-protobuf", "quick-protobuf-codec", "rand 0.8.5", "thiserror", + "tracing", "void", ] [[package]] name = "libp2p-request-response" -version = "0.25.3" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" +checksum = "198a07e045ca23ad3cdb0f54ef3dfb5750056e63af06803d189b0393f865f461" dependencies = [ "async-trait", "cbor4ii", "futures", + "futures-bounded", + "futures-timer", "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "serde", "serde_json", "smallvec", + "tracing", "void", ] [[package]] name = "libp2p-swarm" -version = "0.43.7" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" +checksum = "643ce11d87db56387631c9757b61b83435b434f94dc52ec267c1666e560e78b0" dependencies = [ "either", "fnv", @@ -5293,23 +5316,22 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "log", "multistream-select", "once_cell", "rand 0.8.5", "smallvec", "tokio", + "tracing", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" +checksum = "9b27d257436d01433a21da8da7688c83dba35826726161a328ff0989cd7af2dd" dependencies = [ "heck", - "proc-macro-warning", "proc-macro2", "quote", "syn 2.0.38", @@ -5317,9 +5339,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" dependencies = [ "futures", "futures-timer", @@ -5327,22 +5349,22 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "log", "socket2 0.5.5", "tokio", + "tracing", ] [[package]] name = "libp2p-tls" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" +checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" dependencies = [ "futures", "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen 0.11.3", "ring 0.16.20", "rustls 0.21.8", "rustls-webpki", @@ -5353,50 +5375,50 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" +checksum = "963eb8a174f828f6a51927999a9ab5e45dfa9aa2aa5fed99aa65f79de6229464" dependencies = [ "futures", "futures-timer", "igd-next", "libp2p-core", "libp2p-swarm", - "log", "tokio", + "tracing", "void", ] [[package]] name = "libp2p-websocket" -version = "0.42.1" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3facf0691bab65f571bc97c6c65ffa836248ca631d631b7691ac91deb7fceb5f" +checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" dependencies = [ "either", "futures", "futures-rustls", "libp2p-core", "libp2p-identity", - "log", "parking_lot 0.12.1", - "quicksink", + "pin-project-lite", "rw-stream-sink", "soketto", + "tracing", "url", "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.44.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" +checksum = "751f4778f71bc3db1ccf2451e7f4484463fec7f00c1ac2680e39c8368c23aae8" dependencies = [ "futures", "libp2p-core", - "log", "thiserror", + "tracing", "yamux", ] @@ -5575,6 +5597,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" +[[package]] +name = "lru" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +dependencies = [ + "hashbrown 0.14.2", +] + [[package]] name = "lru" version = "0.12.0" @@ -6427,7 +6458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -6632,6 +6663,16 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923" +dependencies = [ + "base64 0.21.5", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.6.0" @@ -6810,12 +6851,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -6910,7 +6945,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.13", + "pin-project-lite", "windows-sys 0.48.0", ] @@ -7016,17 +7051,6 @@ version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" -[[package]] -name = "proc-macro-warning" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.38", -] - [[package]] name = "proc-macro2" version = "1.0.69" @@ -7038,9 +7062,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" +checksum = "510c4f1c9d81d556458f94c98f857748130ea9737bbd6053da497503b26ea63c" dependencies = [ "dtoa", "itoa 1.0.9", @@ -7101,7 +7125,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "quick-protobuf", "thiserror", @@ -7117,17 +7141,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "quicksink" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" -dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.12", -] - [[package]] name = "quinn" version = "0.10.2" @@ -7136,7 +7149,7 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "futures-io", - "pin-project-lite 0.2.13", + "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", @@ -7304,7 +7317,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ - "pem", + "pem 1.1.1", "ring 0.16.20", "time", "x509-parser 0.13.2", @@ -7317,7 +7330,19 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ - "pem", + "pem 1.1.1", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "rcgen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" +dependencies = [ + "pem 3.0.2", "ring 0.16.20", "time", "yasna", @@ -7412,7 +7437,7 @@ dependencies = [ "mime", "once_cell", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "rustls 0.21.8", "rustls-pemfile", "serde", @@ -7608,9 +7633,9 @@ dependencies = [ [[package]] name = "rust-ipfs" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22814fb2096bb6fd4c992f311072ada1713260f1ad932006e8943ba8550cfdb" +checksum = "307febc6eb6a4067f5611e912d03f72a0860103115d089f1dc82c8388dc31d0c" dependencies = [ "anyhow", "async-broadcast 0.5.1", @@ -7625,10 +7650,10 @@ dependencies = [ "fs2", "futures", "hash_hasher", + "hickory-resolver", "libipld", "libp2p", "libp2p-allow-block-list", - "libp2p-mplex", "libp2p-nat", "libp2p-relay-manager", "parking_lot 0.12.1", @@ -7645,7 +7670,6 @@ dependencies = [ "tokio-util", "tracing", "tracing-futures", - "trust-dns-resolver", "void", "wasm-timer", "zeroize", @@ -7653,9 +7677,9 @@ dependencies = [ [[package]] name = "rust-ipns" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbda370b3783c02dc30276ee675ae13c1d0e5c4d96a5cf1f8f294fd861453e75" +checksum = "85ec945b9b56af34e7de5ae6a792df64a4cf6079dc15f1d17a33e28a7cf4cc88" dependencies = [ "chrono", "cid", @@ -8957,7 +8981,7 @@ dependencies = [ "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.13", + "pin-project-lite", "signal-hook-registry", "socket2 0.5.5", "tokio-macros", @@ -9001,7 +9025,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] @@ -9017,7 +9041,7 @@ dependencies = [ "futures-sink", "futures-util", "hashbrown 0.14.2", - "pin-project-lite 0.2.13", + "pin-project-lite", "slab", "tokio", "tracing", @@ -9079,7 +9103,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.13", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -9116,78 +9140,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand 0.8.5", - "smallvec", - "socket2 0.4.10", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.0", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.1", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto 0.23.2", -] - [[package]] name = "try-lock" version = "0.2.4" @@ -9434,7 +9386,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", ] @@ -9523,7 +9475,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna", "percent-encoding", ] @@ -9623,7 +9575,7 @@ dependencies = [ [[package]] name = "warp" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=ac0dbefba738b240f69cfd1e2ca1822b89f43458#ac0dbefba738b240f69cfd1e2ca1822b89f43458" +source = "git+https://github.com/Satellite-im/Warp?rev=021d57041dce757d0a9f671400c50e906bc92d15#021d57041dce757d0a9f671400c50e906bc92d15" dependencies = [ "aes-gcm 0.10.3", "anyhow", @@ -9679,7 +9631,7 @@ dependencies = [ [[package]] name = "warp-blink-wrtc" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=ac0dbefba738b240f69cfd1e2ca1822b89f43458#ac0dbefba738b240f69cfd1e2ca1822b89f43458" +source = "git+https://github.com/Satellite-im/Warp?rev=021d57041dce757d0a9f671400c50e906bc92d15#021d57041dce757d0a9f671400c50e906bc92d15" dependencies = [ "anyhow", "async-stream", @@ -9710,7 +9662,7 @@ dependencies = [ [[package]] name = "warp-derive" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=ac0dbefba738b240f69cfd1e2ca1822b89f43458#ac0dbefba738b240f69cfd1e2ca1822b89f43458" +source = "git+https://github.com/Satellite-im/Warp?rev=021d57041dce757d0a9f671400c50e906bc92d15#021d57041dce757d0a9f671400c50e906bc92d15" dependencies = [ "paste", "quote", @@ -9720,7 +9672,7 @@ dependencies = [ [[package]] name = "warp-ipfs" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=ac0dbefba738b240f69cfd1e2ca1822b89f43458#ac0dbefba738b240f69cfd1e2ca1822b89f43458" +source = "git+https://github.com/Satellite-im/Warp?rev=021d57041dce757d0a9f671400c50e906bc92d15#021d57041dce757d0a9f671400c50e906bc92d15" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index 8db4434902d..9db4a71bcd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ codegen-units = 1 [workspace.package] version = "0.1.7" -rust-version = "1.70" +rust-version = "1.73" [workspace.dependencies] dioxus = { git = "https://github.com/satellite-im/dioxus", rev = "1dba57f39db8485ccdc03f3a6c11a6fcbb2f87f2" } @@ -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 = "ac0dbefba738b240f69cfd1e2ca1822b89f43458" } -warp-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "ac0dbefba738b240f69cfd1e2ca1822b89f43458" } -warp-blink-wrtc = { git = "https://github.com/Satellite-im/Warp", rev = "ac0dbefba738b240f69cfd1e2ca1822b89f43458" } +warp = { git = "https://github.com/Satellite-im/Warp", rev = "021d57041dce757d0a9f671400c50e906bc92d15" } +warp-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "021d57041dce757d0a9f671400c50e906bc92d15" } +warp-blink-wrtc = { git = "https://github.com/Satellite-im/Warp", rev = "021d57041dce757d0a9f671400c50e906bc92d15" } rfd = "0.11.3" mime = "0.3.16" serde = "1.0" diff --git a/common/locales/en-US/main.ftl b/common/locales/en-US/main.ftl index 1b018f93951..cf37adad674 100644 --- a/common/locales/en-US/main.ftl +++ b/common/locales/en-US/main.ftl @@ -41,7 +41,8 @@ uplink = Uplink .download-update = Download Update .date-time-format = %d/%m/%Y %I:%M %p .open-devtools = Open Console - + .clear-unreads = Clear Unreads + community = Community .invited = You're Invited! .join = Join @@ -318,8 +319,8 @@ media-player = Media Player remote-controls = Remote Controls .mute = Mute .unmute = Unmute - .listen = Listen (Coming Soon) - .silence = Silence (Coming Soon) + .listen = Listen + .silence = Silence .incoming-call = Incoming Transmission ... .outgoing-call = Outgoing Transmission ... .empty = Nobody is here diff --git a/common/src/lib.rs b/common/src/lib.rs index 0e7dff9c425..7009a7ba811 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -165,8 +165,8 @@ pub static WARP_CMD_CH: Lazy = Lazy::new(|| { // allows the UI to receive events to Warp // pretty sure the rx channel needs to be in a mutex in order for it to be a static mutable variable pub static WARP_EVENT_CH: Lazy = Lazy::new(|| { - let (tx, _) = broadcast::channel(128); - WarpEventChannels { tx } + let (tx, _rx) = broadcast::channel(8198); + WarpEventChannels { tx, _rx } }); pub const MAX_FILES_PER_MESSAGE: usize = 8; diff --git a/common/src/state/action.rs b/common/src/state/action.rs index 2b59509c8d4..5f82ec39456 100644 --- a/common/src/state/action.rs +++ b/common/src/state/action.rs @@ -194,6 +194,8 @@ pub enum Action<'a> { ClearUnreads(Uuid), #[display(fmt = "ClearActiveUnreads")] ClearActiveUnreads, + #[display(fmt = "ClearAllUnreads")] + ClearAllUnreads, #[display(fmt = "Config {_0}")] Config(ConfigAction), } diff --git a/common/src/state/call.rs b/common/src/state/call.rs index 989935a163d..b277096fe66 100644 --- a/common/src/state/call.rs +++ b/common/src/state/call.rs @@ -39,6 +39,8 @@ pub struct Call { pub participants: Vec, pub participants_joined: Vec, pub participants_speaking: HashMap, + pub participants_muted: Vec, + pub participants_deafened: Vec, pub self_muted: bool, pub call_silenced: bool, } @@ -197,6 +199,42 @@ impl CallInfo { Ok(()) } + pub fn participant_muted(&mut self, id: DID) -> anyhow::Result<()> { + let active_call = match self.active_call.as_mut() { + Some(c) => c, + None => bail!("call not in progress"), + }; + active_call.call.participant_muted(id); + Ok(()) + } + + pub fn participant_unmuted(&mut self, id: DID) -> anyhow::Result<()> { + let active_call = match self.active_call.as_mut() { + Some(c) => c, + None => bail!("call not in progress"), + }; + active_call.call.participant_unmuted(&id); + Ok(()) + } + + pub fn participant_deafened(&mut self, id: DID) -> anyhow::Result<()> { + let active_call = match self.active_call.as_mut() { + Some(c) => c, + None => bail!("call not in progress"), + }; + active_call.call.participant_deafened(id); + Ok(()) + } + + pub fn participant_undeafened(&mut self, id: DID) -> anyhow::Result<()> { + let active_call = match self.active_call.as_mut() { + Some(c) => c, + None => bail!("call not in progress"), + }; + active_call.call.participant_undeafened(&id); + Ok(()) + } + pub fn set_popout_window_id(&mut self, popout_window_id: WindowId) { if let Some(ac) = self.active_call.as_mut() { ac.popout_window_id = Some(popout_window_id); @@ -221,6 +259,8 @@ impl Call { participants_speaking: HashMap::new(), self_muted: false, call_silenced: false, + participants_deafened: vec![], + participants_muted: vec![], } } @@ -271,4 +311,24 @@ impl Call { fn unsilence_call(&mut self) { self.call_silenced = false; } + + fn participant_muted(&mut self, id: DID) { + if !self.participants_muted.contains(&id) { + self.participants_muted.push(id); + } + } + + fn participant_unmuted(&mut self, id: &DID) { + self.participants_muted.retain(|x| x != id); + } + + fn participant_deafened(&mut self, id: DID) { + if !self.participants_deafened.contains(&id) { + self.participants_deafened.push(id); + } + } + + fn participant_undeafened(&mut self, id: &DID) { + self.participants_deafened.retain(|x| x != id); + } } diff --git a/common/src/state/mod.rs b/common/src/state/mod.rs index 8075ab93df6..412f6bb3be2 100644 --- a/common/src/state/mod.rs +++ b/common/src/state/mod.rs @@ -260,6 +260,7 @@ impl State { self.clear_unreads(id); } } + Action::ClearAllUnreads => self.chats.all.values_mut().for_each(|c| c.clear_unreads()), Action::SetChatDraft(chat_id, value) => self.set_chat_draft(&chat_id, value), Action::ClearChatDraft(chat_id) => self.clear_chat_draft(&chat_id), Action::SetChatAttachments(chat_id, value) => { @@ -697,6 +698,29 @@ impl State { // todo: notify user log::info!("audio I/O device no longer available"); } + BlinkEventKind::ParticipantMuted { peer_id } => { + if let Err(e) = self.ui.call_info.participant_muted(peer_id) { + log::error!("{e}"); + } + } + BlinkEventKind::ParticipantUnmuted { peer_id } => { + if let Err(e) = self.ui.call_info.participant_unmuted(peer_id) { + log::error!("{e}"); + } + } + BlinkEventKind::ParticipantDeafened { peer_id } => { + if let Err(e) = self.ui.call_info.participant_deafened(peer_id) { + log::error!("{e}"); + } + } + BlinkEventKind::ParticipantUndeafened { peer_id } => { + if let Err(e) = self.ui.call_info.participant_undeafened(peer_id) { + log::error!("{e}"); + } + } + BlinkEventKind::AudioStreamError => { + // todo + } } } } @@ -1638,8 +1662,6 @@ impl State { pub fn update_identity(&mut self, id: DID, ident: identity::Identity) { if let Some(friend) = self.identities.get_mut(&id) { *friend = ident; - } else { - log::warn!("failed up update identity: {}", ident.username()); } } // identities are updated once a minute for friends. but if someone sends you a message, they should be seen as online. diff --git a/common/src/warp_runner/manager/commands/blink_commands.rs b/common/src/warp_runner/manager/commands/blink_commands.rs index ee5dd859aae..c5b83346fee 100644 --- a/common/src/warp_runner/manager/commands/blink_commands.rs +++ b/common/src/warp_runner/manager/commands/blink_commands.rs @@ -35,6 +35,14 @@ pub enum BlinkCmd { UnmuteSelf { rsp: oneshot::Sender>, }, + #[display(fmt = "SilenceCall")] + SilenceCall { + rsp: oneshot::Sender>, + }, + #[display(fmt = "UnsilenceCall")] + UnsilenceCall { + rsp: oneshot::Sender>, + }, #[display(fmt = "AdjustVolume")] AdjustVolume { user: DID, @@ -95,6 +103,12 @@ pub async fn handle_blink_cmd(cmd: BlinkCmd, blink: &mut Calling) { BlinkCmd::UnmuteSelf { rsp } => { let _ = rsp.send(blink.unmute_self().await); } + BlinkCmd::SilenceCall { rsp } => { + let _ = rsp.send(blink.silence_call().await); + } + BlinkCmd::UnsilenceCall { rsp } => { + let _ = rsp.send(blink.unsilence_call().await); + } BlinkCmd::AdjustVolume { user, volume, rsp } => { let _ = rsp.send(blink.set_peer_audio_gain(user, volume).await); } diff --git a/common/src/warp_runner/manager/commands/raygun_commands.rs b/common/src/warp_runner/manager/commands/raygun_commands.rs index 845ba9cdc56..468ea711aec 100644 --- a/common/src/warp_runner/manager/commands/raygun_commands.rs +++ b/common/src/warp_runner/manager/commands/raygun_commands.rs @@ -292,22 +292,18 @@ pub async fn handle_raygun_cmd( break result; } AttachmentKind::AttachedProgress(progress) => { - if WARP_EVENT_CH - .tx - .send(WarpEvent::Message( - MessageEvent::AttachmentProgress { - progress, - conversation_id: conv_id, - msg: PendingMessage::for_compare( - msg_clone, - &attachments, - ui_id, - ), - }, - )) - .is_err() - { - log::error!("failed to send warp_event"); + if let Err(e) = WARP_EVENT_CH.tx.send(WarpEvent::Message( + MessageEvent::AttachmentProgress { + progress, + conversation_id: conv_id, + msg: PendingMessage::for_compare( + msg_clone, + &attachments, + ui_id, + ), + }, + )) { + log::error!("failed to send warp_event: {e}"); } } } @@ -344,22 +340,18 @@ pub async fn handle_raygun_cmd( break result; } AttachmentKind::AttachedProgress(progress) => { - if WARP_EVENT_CH - .tx - .send(WarpEvent::Message( - MessageEvent::AttachmentProgress { - progress, - conversation_id: chat_id, - msg: PendingMessage::for_compare( - msg_clone, - &attachments, - ui_id, - ), - }, - )) - .is_err() - { - log::error!("failed to send warp_event"); + if let Err(e) = WARP_EVENT_CH.tx.send(WarpEvent::Message( + MessageEvent::AttachmentProgress { + progress, + conversation_id: chat_id, + msg: PendingMessage::for_compare( + msg_clone, + &attachments, + ui_id, + ), + }, + )) { + log::error!("failed to send warp_event: {e}"); } } } diff --git a/common/src/warp_runner/manager/events.rs b/common/src/warp_runner/manager/events.rs index 64dde6be7f4..adc4055285e 100644 --- a/common/src/warp_runner/manager/events.rs +++ b/common/src/warp_runner/manager/events.rs @@ -34,8 +34,8 @@ pub async fn handle_multipass_event( let warp_event_tx = WARP_EVENT_CH.tx.clone(); match ui_adapter::convert_multipass_event(evt, &mut warp.multipass, &mut warp.raygun).await { Ok(evt) => { - if warp_event_tx.send(WarpEvent::MultiPass(evt)).is_err() { - log::error!("failed to send warp_event"); + if let Err(e) = warp_event_tx.send(WarpEvent::MultiPass(evt)) { + log::error!("failed to send warp_event: {e}"); return Err(()); } } @@ -67,8 +67,8 @@ pub async fn handle_raygun_event( .await { Ok(evt) => { - if warp_event_tx.send(WarpEvent::RayGun(evt)).is_err() { - log::error!("failed to send warp_event"); + if let Err(e) = warp_event_tx.send(WarpEvent::RayGun(evt)) { + log::error!("failed to send warp_event: {e}"); return Err(()); } } @@ -91,8 +91,8 @@ pub async fn handle_message_event( let warp_event_tx = WARP_EVENT_CH.tx.clone(); match ui_adapter::convert_message_event(msg, &mut warp.multipass, &mut warp.raygun).await { Ok(evt) => { - if warp_event_tx.send(WarpEvent::Message(evt)).is_err() { - log::error!("failed to send warp_event"); + if let Err(e) = warp_event_tx.send(WarpEvent::Message(evt)) { + log::error!("failed to send warp_event: {e}"); return Err(()); } } @@ -139,22 +139,20 @@ pub async fn handle_warp_command( // todo: handle block events if let MultiPassCmd::Block { did, .. } = &cmd { if let Ok(ident) = did_to_identity(did, &warp.multipass).await { - if warp_event_tx - .send(WarpEvent::MultiPass(MultiPassEvent::Blocked(ident))) - .is_err() + if let Err(e) = + warp_event_tx.send(WarpEvent::MultiPass(MultiPassEvent::Blocked(ident))) { - log::error!("failed to send warp_event"); + log::error!("failed to send warp_event: {e}"); return Err(()); } } } if let MultiPassCmd::Unblock { did, .. } = &cmd { if let Ok(ident) = did_to_identity(did, &warp.multipass).await { - if warp_event_tx - .send(WarpEvent::MultiPass(MultiPassEvent::Unblocked(ident))) - .is_err() + if let Err(e) = + warp_event_tx.send(WarpEvent::MultiPass(MultiPassEvent::Unblocked(ident))) { - log::error!("failed to send warp_event"); + log::error!("failed to send warp_event: {e}"); return Err(()); } } diff --git a/common/src/warp_runner/mod.rs b/common/src/warp_runner/mod.rs index 8569d231870..eba64134cdf 100644 --- a/common/src/warp_runner/mod.rs +++ b/common/src/warp_runner/mod.rs @@ -48,6 +48,7 @@ pub struct WarpCmdChannels { pub struct WarpEventChannels { pub tx: WarpEventTx, + pub _rx: tokio::sync::broadcast::Receiver, } type Account = Box; @@ -174,6 +175,7 @@ async fn handle_login(notify: Arc) { Ok(w) => w, Err(e) => { log::error!("warp init failed: {}", e); + let _ = rsp.send(Err(e)); return; } }; diff --git a/docs/architecture.md b/docs/architecture.md index b9122a5cbbb..11f6feb0c0f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -4,7 +4,7 @@ ## Background - The Uplink repository consists of two `Cargo` projects: `kit` (a library) and `uplink` (the executable). -- Uplink relies on [Warp](https://github.com/Satellite-im/Warp) and [Dioxus](https://github.com/DioxusLabs/dioxus). It is assumed the reader is familiar with the [Dioxus Documentation](https://dioxuslabs.com/guide/). +- Uplink relies on [Warp](https://github.com/Satellite-im/Warp) and [Dioxus](https://github.com/DioxusLabs/dioxus). It is assumed the reader is familiar with the [Dioxus Documentation](https://dioxuslabs.com/learn/0.4). - At a high level, Warp sends messages (it does much more), while Uplink is just the UI. Sending and receiving messages is asynchronous, and Uplink has a separate module to handle this: `warp_runner`. All the data for the Uplink UI is contained in a `State` struct. Changing the `State` struct drives the UI. When `warp_runner` handles an event from the `Warp`, `State` is modified, and the entire UI is re-rendered. ## Running the Application diff --git a/docs/new-dev.md b/docs/new-dev.md index 0b80045129b..fb22ca2f6a4 100644 --- a/docs/new-dev.md +++ b/docs/new-dev.md @@ -4,11 +4,11 @@ This document contains some useful resources for anyone wishing to contribute to ## Quick Start -1. Get a TL;DR about Satellite and Uplink from [the doc](docs/what.md) +1. Get a TL;DR about Satellite and Uplink from [the doc](https://github.com/Satellite-im/Uplink/blob/dev/docs/architecture.md) 2. Ensure you run physical and automated tests before submitting a PR for review. We work really hard to have no regressions even if a new feature may be "more important". -3. Review both open and closed [issues](https://github.com/ssatellite-im/Uplink/issues), there may be others working on a similar feature. +3. Review both open and closed [issues](https://github.com/satellite-im/Uplink/issues), there may be others working on a similar feature. 4. Be aware that unless you explicitly state otherwise, contributions you make to this project will be under the licensing rights of the original author's, Satellite.im's, specified license terms (to be outlined in the repository). diff --git a/kit/src/components/nav/mod.rs b/kit/src/components/nav/mod.rs index 825f449cd37..c73c9384fd0 100644 --- a/kit/src/components/nav/mod.rs +++ b/kit/src/components/nav/mod.rs @@ -1,9 +1,13 @@ use dioxus::prelude::*; +use uuid::Uuid; -use crate::elements::{ - button::Button, - tooltip::{ArrowPosition, Tooltip}, - Appearance, +use crate::{ + components::context_menu::ContextMenu, + elements::{ + button::Button, + tooltip::{ArrowPosition, Tooltip}, + Appearance, + }, }; use common::icons::outline::Shape as Icon; pub type To = &'static str; @@ -16,6 +20,7 @@ pub struct Route<'a> { pub with_badge: Option, pub loading: Option, pub child: Option>, + pub context_items: Option>, } impl Default for Route<'_> { @@ -27,6 +32,7 @@ impl Default for Route<'_> { with_badge: None, loading: None, child: None, + context_items: None, } } } @@ -98,7 +104,8 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { let active = use_state(cx, || get_active(&cx)); let bubble = cx.props.bubble.unwrap_or_default(); let tooltip_direction = cx.props.tooltip_direction.unwrap_or(ArrowPosition::Bottom); - + // For some reason if you dont do this the first render will not have a context menu + let uuid = use_ref(cx, || Uuid::new_v4().to_string()); cx.render(rsx!( div { aria_label: "button-nav", @@ -109,6 +116,7 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { let badge = get_badge(route); let key: String = route.name.clone(); let name: String = route.name.clone(); + let name2: String = name.to_lowercase(); let aria_label: String = route.name.clone(); // todo: don't show the tooltip if bubble is true let tooltip = if cx.props.bubble.is_some() { @@ -120,7 +128,7 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { })) }; - rsx!( + let btn = rsx!( div { position: "relative", display: "inline-grid", @@ -141,7 +149,18 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { }, route.child.as_ref() } - ) + ); + match route.context_items.as_ref() { + None => btn, + Some(items) => { + rsx!(ContextMenu{ + id: format!("route-{}-{}", name2, uuid.read()), + key: "{name2}-{uuid.read()}", + items: items.clone(), + btn + }) + } + } }) } )) diff --git a/kit/src/elements/textarea/update_char_counter.js b/kit/src/elements/textarea/update_char_counter.js index 8eff5ffea0c..1c7bd4cafc9 100644 --- a/kit/src/elements/textarea/update_char_counter.js +++ b/kit/src/elements/textarea/update_char_counter.js @@ -5,5 +5,4 @@ function countGraphemeClusters(input) { var text = "$TEXT" var count = countGraphemeClusters(text) -console.log("sergegr ", text, count) document.getElementById('$UUID-char-counter').innerText = count; \ No newline at end of file diff --git a/kit/src/elements/tooltip/style.scss b/kit/src/elements/tooltip/style.scss index d1e1764d867..7af69e06d53 100644 --- a/kit/src/elements/tooltip/style.scss +++ b/kit/src/elements/tooltip/style.scss @@ -30,6 +30,9 @@ margin-top: var(--border-radius); top: 100%; } +.tooltip-arrow-top-right { + right: 0; +} .tooltip-arrow-bottom, .tooltip-arrow-bottom-left, .tooltip-arrow-bottom-right { diff --git a/kit/src/layout/modal/style.scss b/kit/src/layout/modal/style.scss index 56de2621900..95b6afb65b9 100644 --- a/kit/src/layout/modal/style.scss +++ b/kit/src/layout/modal/style.scss @@ -9,7 +9,7 @@ left: 0; bottom: 0; right: 0; - background: rgba(0,0,0, 0.9); + background: var(--background-modal); .close-btn { position: absolute; @@ -32,7 +32,8 @@ z-index: 1001; position: relative; overflow: hidden; - + margin: 0 var(--gap-less); + &:hover { .close-btn { visibility: visible; diff --git a/kit/src/style.scss b/kit/src/style.scss index 34ed0c7ffe9..18d79ef5dff 100644 --- a/kit/src/style.scss +++ b/kit/src/style.scss @@ -250,6 +250,7 @@ pre code { --background: #000000; --background-light: var(--secondary-light); --background-dark: #161a21; + --background-modal: rgba(0,0,0, 0.9); --success: #1dd1a1; --success-light: #00c29c; --info: #1B9CFC; diff --git a/ui/build.rs b/ui/build.rs index 6353eaf787e..912986b514a 100644 --- a/ui/build.rs +++ b/ui/build.rs @@ -12,9 +12,9 @@ fn main() -> Result<(), Box> { let version = rustc_version::version().unwrap(); if cfg!(feature = "production_mode") { - // the command: `rustup install 1.70.0` will ensure that the compiler matches - if version.major != 1 || version.minor != 70 || version.patch != 0 { - panic!("rustc version != 1.70.0"); + // the command: `rustup install 1.73.0` will ensure that the compiler matches + if version.major != 1 || version.minor != 73 || version.patch != 0 { + panic!("rustc version != 1.73.0"); } } diff --git a/ui/docs/testing/uplink-checklist.md b/ui/docs/testing/uplink-checklist.md index 789e7718495..697a6a12442 100644 --- a/ui/docs/testing/uplink-checklist.md +++ b/ui/docs/testing/uplink-checklist.md @@ -67,6 +67,7 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Clicking *Settings* button should take User to the *Settings* Page. - [ ] User should be able to click+drag Pop-out player anywhere on the screen. +- [ ] When getting a call, a ringtone is heard. ## **Visual & UX Checklist** @@ -113,7 +114,7 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Timestamps should update in chat and sidebar. (now, then goes by minutes-hours-days) - [ ] Clicking *Phone* icon should open call modal. - [ ] Chat should close if the User blocks the friend they are in the current chat with. -- [ ] Typing indicator appears (if User has that extension toggled on). +- [ ] Typing indicator appears when user is typing. - [ ] Usernames are both displayed in the call modal. - [ ] Friends Username/Profile Pic/Status should be displayed at the top of the active chat. - [ ] Tooltip should appear for *Call* button. @@ -123,6 +124,50 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] User can reply to a message by right+clicking and selecting in the context menu. - [ ] User can react to a message by right+clicking and selecting in the context menu. - [ ] User should enter chat at the bottom with the most recent messages. +- [ ] Sending a DID will generate a quick profile card within the chat. +- [ ] When on a call, call controls should display in the sidebar. +- [ ] User should not have any conversations limit in the chat list. +- [ ] Sending specific ASCII emojis such as : joy : will convert into the emoji. +- [ ] When user scrolls we fetch messages on demand and we show a scroll to bottom option to scroll all to the bottom. +- [ ] The scroll to bottom option should not display if there are no messages after that. +- [ ] Groups should not have a online indicator. +- [ ] Download icon when sending a image should only appear when hovering the image. +- [ ] User is able to drag and drop files and image within the chat. +- [ ] When a chat has unreads, a unread indicator is displayed in the chat icon in the sidebar and the chat itself in the chat list. +- [ ] User is able to scroll, change chat, go again to the previous chat and scroll will appear in the same scroll position. +- [ ] User can send max 8 files per message. +- [ ] User is able to paste images or files from the clipboard. + +## Supported markdown + +Italics +- [ ] `*x*` +- [ ] `_x_` + +Bold +- [ ] `**x**` +- [ ] `__x__` + +Strikethrough +- [ ] `~~x~~` + +Code +- [ ] `int a = 0;` +- [ ] ```int a = 0;``` +- [ ] multiline code + ``` + int a = 0; + int b = 0; + ``` +- [ ] multiline code with a language + ```rust + let a = 0; + let b = 0; + ``` +Headings +- [ ] `# heading title` +- [ ] `## heading title` +- [ ] `##### heading title` ### Calling & Video @@ -135,7 +180,11 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Call should expand when User enters *Fullscreen*. - [ ] Pop-Out player should appear when the user enables it. - [ ] While Pop-out is enabled original call should display *Media Detached*. - +- [ ] While on call, silence option will display and when used will cut off the audio from the other user. +- [ ] User volum option should only be displayed if user activated the experimental settings. +- [ ] While on a call, recording option appears and if user clicks on it, saves a file on recordings folder within the .uplink folder. +- [ ] There is an indicator for when a user is speaking in a call and username will be enlarged and highlighted. +- [ ] ### **Friends** **Friends List** @@ -205,6 +254,9 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Progress Bar should show the actual amount of Files uploaded. - [ ] Free Space should appear at the top of the Files Page. - [ ] Total Space should appear at the top of the Files Page. +- [ ] Going to files and right-click, share should not appear if user has no chats. +- [ ] User is able to send a file from within files section in the app and from the computer to various chats. +- [ ] User is able to drag and drop files within files section. ### Settings @@ -217,6 +269,9 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Clicking *Edit* should display the username and status input fields. - [ ] Error message should appear when the User tries to type a username or status message longer than 32 characters. - [ ] Error message should appear when the User attempts to save a username or status with less than 4 characters. +- [ ] User can upload and crop a banner image. +- [ ] User can upload and crop a profile image. +- [ ] User can move the image within the crop. **General** @@ -225,7 +280,9 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Clicking *Clear Themes* should set the theme back to default. - [ ] UI should change accordingly when the User sets a new theme. - [ ] User should be able to change the language by selecting from the Language Dropdown menu. - +- [ ] When you go to settings and go to other part of the app, going again to settings should be on the same section where you were previously. +- [ ] Window size is remembered and reloaded on app start + **Privacy** - [ ] Clicking *Backup Phrase* in the *Privacy* tab should backup Users account phrase. @@ -258,7 +315,11 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Clicking the Tablet dev tool should resize the window to replicate a Tablet. - [ ] Clicking the Desktop dev tool should resize the window to the original Desktop view. - [ ] Clicking the fullscreen dev tool should resize the window to take up the entire screen. - +- [ ] Only show developer settings after clicking version number 10 times + +**Licenses** +- [ ] It displays the licenses we have and a button that opens the license as well. + ### Sidebar **Basics** @@ -280,3 +341,5 @@ Tests marked with `[NYI] Not Yet Implemented` need not pass. - [ ] Tooltip should appear when hovering the cursor over *Settings Page* icon. - [ ] User can search within Settings by clicking on Settings Search Bar. - [ ] Call controls should appear in Sidebar when User enters a call. +- [ ] Clear unreads should not appear when there are no unreads. +- [ ] Sidebar should not display when there are no favorites or chats or anything unless is dev features are activated. diff --git a/ui/extra/themes/light.scss b/ui/extra/themes/light.scss index 76a1e989e47..bdaca066fc3 100644 --- a/ui/extra/themes/light.scss +++ b/ui/extra/themes/light.scss @@ -54,6 +54,7 @@ --background: white; --background-light: color-mix(in srgb, var(--background) 50%, #bebebe); --background-dark: color-mix(in srgb, var(--background) 85%, black); + --background-modal: rgba(224, 224, 224, 0.9); --success: #17b7ba; --success-light: #079a7c; --warning: #df9d10; diff --git a/ui/src/components/media/calling.rs b/ui/src/components/media/calling.rs index ba4d126ee62..f2088f0100b 100644 --- a/ui/src/components/media/calling.rs +++ b/ui/src/components/media/calling.rs @@ -45,6 +45,8 @@ enum CallDialogCmd { AdjustVolume(Box, f32), RecordCall, StopRecording, + SilenceCall, + UnsilenceCall, } enum PendingCallDialogCmd { @@ -189,6 +191,44 @@ fn ActiveCallControl(cx: Scope) -> Element { } } } + CallDialogCmd::SilenceCall => { + let (tx, rx) = oneshot::channel(); + if let Err(e) = + warp_cmd_tx.send(WarpCmd::Blink(BlinkCmd::SilenceCall { rsp: tx })) + { + log::error!("failed to send blink command: {e}"); + continue; + } + + match rx.await { + Ok(_) => { + // disaster waiting to happen if State ever gets out of sync with blink. + state.write().mutate(Action::ToggleSilence); + } + Err(e) => { + log::error!("warp_runner failed to silence call: {e}"); + } + } + } + CallDialogCmd::UnsilenceCall => { + let (tx, rx) = oneshot::channel(); + if let Err(e) = + warp_cmd_tx.send(WarpCmd::Blink(BlinkCmd::UnsilenceCall { rsp: tx })) + { + log::error!("failed to send blink command: {e}"); + continue; + } + + match rx.await { + Ok(_) => { + // disaster waiting to happen if State ever gets out of sync with blink. + state.write().mutate(Action::ToggleSilence); + } + Err(e) => { + log::error!("warp_runner failed to unsilence call: {e}"); + } + } + } CallDialogCmd::RecordCall => { let (tx, rx) = oneshot::channel(); let time = Local::now().format("%d-%m-%Y_%H-%M-%S").to_string(); @@ -386,10 +426,7 @@ fn ActiveCallControl(cx: Scope) -> Element { } )), onpress: move |_| { - //TODO this only tells the state to update the current silence value. - //It doesn't actually do anything yet - state.write().ui.toggle_silenced(); - + if call.call_silenced { ch.send(CallDialogCmd::UnsilenceCall); } else { ch.send(CallDialogCmd::SilenceCall); } } }, (!outgoing).then(||{ diff --git a/ui/src/layouts/chats/presentation/sidebar/search.rs b/ui/src/layouts/chats/presentation/sidebar/search.rs index 0a3fffdb24b..a7dad761479 100644 --- a/ui/src/layouts/chats/presentation/sidebar/search.rs +++ b/ui/src/layouts/chats/presentation/sidebar/search.rs @@ -108,10 +108,11 @@ pub fn search_friends<'a>(cx: Scope<'a, SearchProps<'a>>) -> Element<'a> { div { padding_right: "32px", aria_label: "search-result-blocked-user", + display: "flex", IconElement { size: 40, fill: "var(--text-color-muted)", - icon: Icon::NoSymbol, + icon: Icon::UserBlocked, }, } ) @@ -273,11 +274,12 @@ pub fn search_friends<'a>(cx: Scope<'a, SearchProps<'a>>) -> Element<'a> { rsx!( div { padding_right: "32px", + display: "flex", aria_label: "search-result-blocked-user-in-group", IconElement { size: 40, fill: "var(--text-color-muted)", - icon: Icon::NoSymbol, + icon: Icon::UserBlocked, }, } ) diff --git a/ui/src/layouts/chats/style.scss b/ui/src/layouts/chats/style.scss index 2b29dcd74dd..79466081da4 100644 --- a/ui/src/layouts/chats/style.scss +++ b/ui/src/layouts/chats/style.scss @@ -243,6 +243,10 @@ padding-left: 16px; padding-bottom: 4px; margin-bottom: 4px; + div { + margin-top: auto; + margin-bottom: auto; + } #profile-image { margin: var(--gap-less); //TODO(Lucas): Look to it, should be width: var(--height-input); @@ -548,9 +552,6 @@ animation: none; } } -.tooltip-arrow-top-right { - margin-right: 50px; -} #compose { .typing-indicator { width: 100%; diff --git a/ui/src/layouts/storage/files_layout/mod.rs b/ui/src/layouts/storage/files_layout/mod.rs index 8d8f3eb951d..f7b4f83ef42 100644 --- a/ui/src/layouts/storage/files_layout/mod.rs +++ b/ui/src/layouts/storage/files_layout/mod.rs @@ -177,7 +177,7 @@ pub fn FilesLayout(cx: Scope<'_>) -> Element<'_> { aria_label: "upload-file".into(), tooltip: cx.render(rsx!( Tooltip { - arrow_position: ArrowPosition::Top, + arrow_position: ArrowPosition::TopRight, text: get_local_text("files.upload"), } )), diff --git a/ui/src/logger/mod.rs b/ui/src/logger/mod.rs index a4ec88870ff..d12aa7ad9e1 100644 --- a/ui/src/logger/mod.rs +++ b/ui/src/logger/mod.rs @@ -19,6 +19,7 @@ use std::collections::HashSet; use std::collections::VecDeque; use std::fs::OpenOptions; use std::io::prelude::*; +use std::path::PathBuf; use tokio::sync::mpsc; use warp::sync::RwLock; @@ -48,7 +49,7 @@ impl std::fmt::Display for Log { pub struct Logger { file_tx: Option>, file_thread: Option>, - log_file: String, + log_file: PathBuf, // holds the last `max_logs` in memory, unless `save_to_file` is true. when `save_to_file` is set to true, `log_entries` are written to disk. log_entries: VecDeque, subscribers: Vec>, @@ -108,8 +109,8 @@ impl crate::log::Log for LogGlue { return; } - let msg = format!("{}", record.args()); - LOGGER.write().log(record.level(), &msg); + let msg = record.args(); + LOGGER.write().log(record.level(), &msg.to_string()); } fn flush(&self) {} @@ -117,12 +118,7 @@ impl crate::log::Log for LogGlue { impl Logger { fn load() -> Self { - let logger_path = STATIC_ARGS.logger_path.to_string_lossy().to_string(); - let _ = OpenOptions::new() - .create(true) - .append(true) - .open(&logger_path); - + let logger_path = STATIC_ARGS.logger_path.clone(); Self { file_tx: None, file_thread: None, @@ -169,7 +165,7 @@ impl Logger { // keeping a running log of entries probably won't help identify a crash if the log is filled with trace logs. self.log_entries.push_back(new_log.clone()); - if self.log_entries.len() >= self.max_logs { + if self.log_entries.len() > self.max_logs { self.log_entries.pop_front(); } } @@ -203,13 +199,19 @@ impl Logger { return; } + if let Some(path) = self.log_file.parent() { + if !path.is_dir() { + let _ = std::fs::create_dir_all(path); + } + } + let file = OpenOptions::new() .append(true) .create(true) .open(&self.log_file) .unwrap(); - let (tx, rx) = std::sync::mpsc::sync_channel(10); + let (tx, rx) = std::sync::mpsc::sync_channel(100); let thread = std::thread::spawn(move || log_thread(file, rx)); self.file_thread = Some(thread); @@ -276,26 +278,14 @@ pub fn set_write_to_stdout(b: bool) { } pub fn load_debug_log() -> Vec { - let raw_file = match std::fs::read_to_string(&STATIC_ARGS.logger_path) { - Ok(l) => l, - Err(e) => { - log::error!("failed to read debug.log: {}", e); - return vec![]; - } - }; - - let mut in_memory: Vec<_> = LOGGER + //Note: We shouldnt read from the file since it may be too big or contain irrelevant information related to uplink + // unless we have a specific file related to uplink/dioxus logging, in which case we should read only the last few lines + LOGGER .read() .log_entries .iter() .map(|x| x.to_string()) - .collect(); - - raw_file - .lines() - .map(|x| x.to_string()) - .chain(in_memory.drain(..)) - .collect::>() + .collect() } // this is kind of a hack. but Colorize adds characters to a string which display differently in the debug_logger and the terminal. diff --git a/ui/src/main.rs b/ui/src/main.rs index 15776605f80..63b6bac5f0d 100644 --- a/ui/src/main.rs +++ b/ui/src/main.rs @@ -1114,6 +1114,15 @@ fn AppNav<'a>( unreads.to_string(), })) }), + context_items: (unreads > 0).then(|| { + cx.render(rsx!(ContextItem { + aria_label: "clear-unreads".into(), + text: get_local_text("uplink.clear-unreads"), + onpress: move |_| { + state.write().mutate(Action::ClearAllUnreads); + } + },)) + }), ..UIRoute::default() }; let settings_route = UIRoute {