update messaging relays panel
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m41s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m46s
Rust / build (macos-latest, stable) (push) Has been cancelled
Rust / build (windows-latest, stable) (push) Has been cancelled
Rust / build (macos-latest, stable) (pull_request) Has been cancelled
Rust / build (windows-latest, stable) (pull_request) Has been cancelled

This commit is contained in:
2026-02-23 19:23:56 +07:00
parent 2ec98e14d0
commit ebf0e86828
2 changed files with 246 additions and 217 deletions

190
Cargo.lock generated
View File

@@ -220,9 +220,9 @@ dependencies = [
[[package]] [[package]]
name = "ashpd" name = "ashpd"
version = "0.12.2" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "522dc9bec59923af17c43c5911cdabbacdb32ed4f955e83ecf592855618b20b5" checksum = "33a3c86f3fd70c0ffa500ed189abfa90b5a52398a45d5dc372fcc38ebeb7a645"
dependencies = [ dependencies = [
"async-fs", "async-fs",
"async-net", "async-net",
@@ -349,7 +349,7 @@ dependencies = [
"futures-lite 2.6.1", "futures-lite 2.6.1",
"parking", "parking",
"polling", "polling",
"rustix 1.1.3", "rustix 1.1.4",
"slab", "slab",
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
@@ -391,7 +391,7 @@ dependencies = [
"cfg-if", "cfg-if",
"event-listener 5.4.1", "event-listener 5.4.1",
"futures-lite 2.6.1", "futures-lite 2.6.1",
"rustix 1.1.3", "rustix 1.1.4",
] ]
[[package]] [[package]]
@@ -417,7 +417,7 @@ dependencies = [
"cfg-if", "cfg-if",
"futures-core", "futures-core",
"futures-io", "futures-io",
"rustix 1.1.3", "rustix 1.1.4",
"signal-hook-registry", "signal-hook-registry",
"slab", "slab",
"windows-sys 0.61.2", "windows-sys 0.61.2",
@@ -862,7 +862,7 @@ checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"polling", "polling",
"rustix 1.1.3", "rustix 1.1.4",
"slab", "slab",
"tracing", "tracing",
] ]
@@ -874,7 +874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
dependencies = [ dependencies = [
"calloop", "calloop",
"rustix 1.1.3", "rustix 1.1.4",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
] ]
@@ -1192,7 +1192,7 @@ dependencies = [
[[package]] [[package]]
name = "collections" name = "collections"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"rustc-hash 2.1.1", "rustc-hash 2.1.1",
@@ -1443,9 +1443,9 @@ dependencies = [
[[package]] [[package]]
name = "core-graphics2" name = "core-graphics2"
version = "0.4.1" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e4583956b9806b69f73fcb23aee05eb3620efc282972f08f6a6db7504f8334d" checksum = "4416167a69126e617f8d0a214af0e3c1dbdeffcb100ddf72dcd1a1ac9893c146"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"block", "block",
@@ -1467,16 +1467,16 @@ dependencies = [
[[package]] [[package]]
name = "core-video" name = "core-video"
version = "0.4.3" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d45e71d5be22206bed53c3c3cb99315fc4c3d31b8963808c6bc4538168c4f8ef" checksum = "139679cc63eb9504bdbe37e37874b0247136177655f0008588781e90863afa62"
dependencies = [ dependencies = [
"block", "block",
"core-foundation 0.10.0", "core-foundation 0.10.0",
"core-graphics2", "core-graphics2",
"io-surface", "io-surface",
"libc", "libc",
"metal 0.29.0", "metal",
] ]
[[package]] [[package]]
@@ -1640,7 +1640,7 @@ dependencies = [
[[package]] [[package]]
name = "derive_refineable" name = "derive_refineable"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2417,7 +2417,7 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
dependencies = [ dependencies = [
"rustix 1.1.3", "rustix 1.1.4",
"windows-link 0.2.1", "windows-link 0.2.1",
] ]
@@ -2577,7 +2577,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui" name = "gpui"
version = "0.2.2" version = "0.2.2"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-task", "async-task",
@@ -2610,7 +2610,7 @@ dependencies = [
"lyon", "lyon",
"mach2", "mach2",
"media", "media",
"metal 0.29.0", "metal",
"naga", "naga",
"num_cpus", "num_cpus",
"objc", "objc",
@@ -2651,7 +2651,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_linux" name = "gpui_linux"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"as-raw-xcb-connection", "as-raw-xcb-connection",
@@ -2699,7 +2699,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_macos" name = "gpui_macos"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-task", "async-task",
@@ -2725,7 +2725,7 @@ dependencies = [
"log", "log",
"mach2", "mach2",
"media", "media",
"metal 0.29.0", "metal",
"objc", "objc",
"parking_lot", "parking_lot",
"pathfinder_geometry", "pathfinder_geometry",
@@ -2741,7 +2741,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_macros" name = "gpui_macros"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
@@ -2752,7 +2752,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_platform" name = "gpui_platform"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"gpui", "gpui",
"gpui_linux", "gpui_linux",
@@ -2763,7 +2763,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_tokio" name = "gpui_tokio"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"gpui", "gpui",
@@ -2774,7 +2774,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_wgpu" name = "gpui_wgpu"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytemuck", "bytemuck",
@@ -2793,7 +2793,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_windows" name = "gpui_windows"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collections", "collections",
@@ -3037,7 +3037,7 @@ dependencies = [
[[package]] [[package]]
name = "http_client" name = "http_client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-compression", "async-compression",
@@ -3062,7 +3062,7 @@ dependencies = [
[[package]] [[package]]
name = "http_client_tls" name = "http_client_tls"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"rustls", "rustls",
"rustls-platform-verifier", "rustls-platform-verifier",
@@ -3151,7 +3151,7 @@ dependencies = [
"tokio", "tokio",
"tower-service", "tower-service",
"tracing", "tracing",
"windows-registry 0.5.3", "windows-registry 0.6.1",
] ]
[[package]] [[package]]
@@ -3503,9 +3503,9 @@ dependencies = [
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.86" version = "0.3.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d36139f1c97c42c0c86a411910b04e48d4939a0376e6e0f989420cbdee0120e5" checksum = "c7e709f3e3d22866f9c25b3aff01af289b18422cc8b4262fb19103ee80fe513d"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"wasm-bindgen", "wasm-bindgen",
@@ -3664,9 +3664,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.11.0" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]] [[package]]
name = "litemap" name = "litemap"
@@ -3843,7 +3843,7 @@ dependencies = [
[[package]] [[package]]
name = "media" name = "media"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bindgen", "bindgen",
@@ -3851,7 +3851,7 @@ dependencies = [
"core-video", "core-video",
"ctor", "ctor",
"foreign-types 0.5.0", "foreign-types 0.5.0",
"metal 0.29.0", "metal",
"objc", "objc",
] ]
@@ -3888,21 +3888,6 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "metal"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21"
dependencies = [
"bitflags 2.11.0",
"block",
"core-graphics-types 0.1.3",
"foreign-types 0.5.0",
"log",
"objc",
"paste",
]
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.33.0" version = "0.33.0"
@@ -4102,7 +4087,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
[[package]] [[package]]
name = "nostr" name = "nostr"
version = "0.44.1" version = "0.44.1"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373" source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [ dependencies = [
"aes", "aes",
"base64", "base64",
@@ -4127,7 +4112,7 @@ dependencies = [
[[package]] [[package]]
name = "nostr-connect" name = "nostr-connect"
version = "0.44.0" version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373" source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [ dependencies = [
"async-utility", "async-utility",
"futures-core", "futures-core",
@@ -4140,7 +4125,7 @@ dependencies = [
[[package]] [[package]]
name = "nostr-database" name = "nostr-database"
version = "0.44.0" version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373" source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [ dependencies = [
"btreecap", "btreecap",
"flatbuffers", "flatbuffers",
@@ -4152,7 +4137,7 @@ dependencies = [
[[package]] [[package]]
name = "nostr-gossip" name = "nostr-gossip"
version = "0.44.0" version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373" source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [ dependencies = [
"nostr", "nostr",
] ]
@@ -4160,7 +4145,7 @@ dependencies = [
[[package]] [[package]]
name = "nostr-lmdb" name = "nostr-lmdb"
version = "0.44.0" version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373" source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [ dependencies = [
"async-utility", "async-utility",
"flume", "flume",
@@ -4174,7 +4159,7 @@ dependencies = [
[[package]] [[package]]
name = "nostr-sdk" name = "nostr-sdk"
version = "0.44.1" version = "0.44.1"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373" source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [ dependencies = [
"async-utility", "async-utility",
"async-wsocket", "async-wsocket",
@@ -4648,7 +4633,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]] [[package]]
name = "perf" name = "perf"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"collections", "collections",
"serde", "serde",
@@ -4817,7 +4802,7 @@ dependencies = [
"concurrent-queue", "concurrent-queue",
"hermit-abi", "hermit-abi",
"pin-project-lite", "pin-project-lite",
"rustix 1.1.3", "rustix 1.1.4",
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
@@ -5323,7 +5308,7 @@ dependencies = [
[[package]] [[package]]
name = "refineable" name = "refineable"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"derive_refineable", "derive_refineable",
] ]
@@ -5428,7 +5413,7 @@ dependencies = [
[[package]] [[package]]
name = "reqwest_client" name = "reqwest_client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@@ -5483,7 +5468,7 @@ dependencies = [
[[package]] [[package]]
name = "rope" name = "rope"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"log", "log",
@@ -5588,14 +5573,14 @@ dependencies = [
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "1.1.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.11.0", "linux-raw-sys 0.12.1",
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
@@ -5745,7 +5730,7 @@ dependencies = [
[[package]] [[package]]
name = "scheduler" name = "scheduler"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"async-task", "async-task",
"backtrace", "backtrace",
@@ -6326,7 +6311,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]] [[package]]
name = "sum_tree" name = "sum_tree"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"log", "log",
@@ -6574,7 +6559,7 @@ dependencies = [
"fastrand 2.3.0", "fastrand 2.3.0",
"getrandom 0.4.1", "getrandom 0.4.1",
"once_cell", "once_cell",
"rustix 1.1.3", "rustix 1.1.4",
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
@@ -7284,7 +7269,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "util" name = "util"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-fs", "async-fs",
@@ -7322,7 +7307,7 @@ dependencies = [
[[package]] [[package]]
name = "util_macros" name = "util_macros"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"perf", "perf",
"quote", "quote",
@@ -7484,9 +7469,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.109" version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ff9c7baef35ac3c0e17d8bfc9ad75eb62f85a2f02bccc906699dadb0aa9c622" checksum = "ec1adf1535672f5b7824f817792b1afd731d7e843d2d04ec8f27e8cb51edd8ac"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@@ -7497,9 +7482,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.59" version = "0.4.61"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d24699cd39db9966cf6e2ef10d2f72779c961ad905911f395ea201c3ec9f545d" checksum = "fe88540d1c934c4ec8e6db0afa536876c5441289d7f9f9123d4f065ac1250a6b"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures-util", "futures-util",
@@ -7511,9 +7496,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.109" version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39455e84ad887a0bbc93c116d72403f1bb0a39e37dd6f235a43e2128a0c7f1fd" checksum = "19e638317c08b21663aed4d2b9a2091450548954695ff4efa75bff5fa546b3b1"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@@ -7521,9 +7506,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.109" version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dff4761f60b0b51fd13fec8764167b7bbcc34498ce3e52805fe1db6f2d56b6d6" checksum = "2c64760850114d03d5f65457e96fc988f11f01d38fbaa51b254e4ab5809102af"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"proc-macro2", "proc-macro2",
@@ -7534,9 +7519,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.109" version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6a171c53d98021a93a474c4a4579d76ba97f9517d871bc12e27640f218b6dd" checksum = "60eecd4fe26177cfa3339eb00b4a36445889ba3ad37080c2429879718e20ca41"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -7596,7 +7581,7 @@ checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9"
dependencies = [ dependencies = [
"cc", "cc",
"downcast-rs", "downcast-rs",
"rustix 1.1.3", "rustix 1.1.4",
"scoped-tls", "scoped-tls",
"smallvec", "smallvec",
"wayland-sys", "wayland-sys",
@@ -7609,7 +7594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec" checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"rustix 1.1.3", "rustix 1.1.4",
"wayland-backend", "wayland-backend",
"wayland-scanner", "wayland-scanner",
] ]
@@ -7620,7 +7605,7 @@ version = "0.31.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078" checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078"
dependencies = [ dependencies = [
"rustix 1.1.3", "rustix 1.1.4",
"wayland-client", "wayland-client",
"xcursor", "xcursor",
] ]
@@ -7688,9 +7673,9 @@ dependencies = [
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.86" version = "0.3.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668fa5d00434e890a452ab060d24e3904d1be93f7bb01b70e5603baa2b8ab23b" checksum = "9d6bb20ed2d9572df8584f6dc81d68a41a625cadc6f15999d649a70ce7e3597a"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@@ -7879,7 +7864,7 @@ dependencies = [
"libc", "libc",
"libloading", "libloading",
"log", "log",
"metal 0.33.0", "metal",
"naga", "naga",
"ndk-sys", "ndk-sys",
"objc", "objc",
@@ -8192,6 +8177,17 @@ dependencies = [
"windows-strings 0.4.2", "windows-strings 0.4.2",
] ]
[[package]]
name = "windows-registry"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
dependencies = [
"windows-link 0.2.1",
"windows-result 0.4.1",
"windows-strings 0.5.1",
]
[[package]] [[package]]
name = "windows-result" name = "windows-result"
version = "0.1.2" version = "0.1.2"
@@ -8718,7 +8714,7 @@ dependencies = [
"as-raw-xcb-connection", "as-raw-xcb-connection",
"gethostname", "gethostname",
"libc", "libc",
"rustix 1.1.3", "rustix 1.1.4",
"x11rb-protocol", "x11rb-protocol",
"xcursor", "xcursor",
] ]
@@ -8850,9 +8846,9 @@ dependencies = [
[[package]] [[package]]
name = "zbus" name = "zbus"
version = "5.13.2" version = "5.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfeff997a0aaa3eb20c4652baf788d2dfa6d2839a0ead0b3ff69ce2f9c4bdd1" checksum = "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc"
dependencies = [ dependencies = [
"async-broadcast", "async-broadcast",
"async-executor", "async-executor",
@@ -8870,7 +8866,7 @@ dependencies = [
"hex", "hex",
"libc", "libc",
"ordered-stream", "ordered-stream",
"rustix 1.1.3", "rustix 1.1.4",
"serde", "serde",
"serde_repr", "serde_repr",
"tracing", "tracing",
@@ -8885,9 +8881,9 @@ dependencies = [
[[package]] [[package]]
name = "zbus_macros" name = "zbus_macros"
version = "5.13.2" version = "5.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bbd5a90dbe8feee5b13def448427ae314ccd26a49cac47905cafefb9ff846f1" checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
@@ -9119,7 +9115,7 @@ dependencies = [
[[package]] [[package]]
name = "zlog" name = "zlog"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@@ -9136,7 +9132,7 @@ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
[[package]] [[package]]
name = "ztracing" name = "ztracing"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [ dependencies = [
"tracing", "tracing",
"tracing-subscriber", "tracing-subscriber",
@@ -9147,7 +9143,7 @@ dependencies = [
[[package]] [[package]]
name = "ztracing_macro" name = "ztracing_macro"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33" source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
[[package]] [[package]]
name = "zune-core" name = "zune-core"
@@ -9190,9 +9186,9 @@ dependencies = [
[[package]] [[package]]
name = "zvariant" name = "zvariant"
version = "5.9.2" version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b64ef4f40c7951337ddc7023dd03528a57a3ce3408ee9da5e948bd29b232c4" checksum = "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b"
dependencies = [ dependencies = [
"endi", "endi",
"enumflags2", "enumflags2",
@@ -9205,9 +9201,9 @@ dependencies = [
[[package]] [[package]]
name = "zvariant_derive" name = "zvariant_derive"
version = "5.9.2" version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "484d5d975eb7afb52cc6b929c13d3719a20ad650fea4120e6310de3fc55e415c" checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",

View File

@@ -4,9 +4,9 @@ use std::time::Duration;
use anyhow::{anyhow, Context as AnyhowContext, Error}; use anyhow::{anyhow, Context as AnyhowContext, Error};
use gpui::prelude::FluentBuilder; use gpui::prelude::FluentBuilder;
use gpui::{ use gpui::{
div, relative, uniform_list, AnyElement, App, AppContext, Context, Entity, EventEmitter, div, rems, AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable,
FocusHandle, Focusable, InteractiveElement, IntoElement, ParentElement, Render, SharedString, InteractiveElement, IntoElement, ParentElement, Render, SharedString, Styled, Subscription,
Styled, Subscription, Task, TextAlign, UniformList, Window, Task, TextAlign, Window,
}; };
use nostr_sdk::prelude::*; use nostr_sdk::prelude::*;
use smallvec::{smallvec, SmallVec}; use smallvec::{smallvec, SmallVec};
@@ -15,7 +15,10 @@ use theme::ActiveTheme;
use ui::button::{Button, ButtonVariants}; use ui::button::{Button, ButtonVariants};
use ui::dock_area::panel::{Panel, PanelEvent}; use ui::dock_area::panel::{Panel, PanelEvent};
use ui::input::{InputEvent, InputState, TextInput}; use ui::input::{InputEvent, InputState, TextInput};
use ui::{divider, h_flex, v_flex, IconName, Sizable, StyledExt}; use ui::{divider, h_flex, v_flex, Disableable, IconName, Sizable, StyledExt, WindowExtension};
const MSG: &str = "Messaging Relays are relays that hosted all your messages. \
Other users will find your relays and send messages to it.";
pub fn init(window: &mut Window, cx: &mut App) -> Entity<MessagingRelayPanel> { pub fn init(window: &mut Window, cx: &mut App) -> Entity<MessagingRelayPanel> {
cx.new(|cx| MessagingRelayPanel::new(window, cx)) cx.new(|cx| MessagingRelayPanel::new(window, cx))
@@ -29,44 +32,26 @@ pub struct MessagingRelayPanel {
/// Relay URL input /// Relay URL input
input: Entity<InputState>, input: Entity<InputState>,
/// Whether the panel is updating
updating: bool,
/// Error message /// Error message
error: Option<SharedString>, error: Option<SharedString>,
// All relays /// All relays
relays: HashSet<RelayUrl>, relays: HashSet<RelayUrl>,
// Event subscriptions /// Event subscriptions
_subscriptions: SmallVec<[Subscription; 1]>, _subscriptions: SmallVec<[Subscription; 1]>,
// Background tasks /// Background tasks
_tasks: SmallVec<[Task<()>; 1]>, tasks: Vec<Task<Result<(), Error>>>,
} }
impl MessagingRelayPanel { impl MessagingRelayPanel {
pub fn new(window: &mut Window, cx: &mut Context<Self>) -> Self { pub fn new(window: &mut Window, cx: &mut Context<Self>) -> Self {
let input = cx.new(|cx| InputState::new(window, cx).placeholder("wss://example.com")); let input = cx.new(|cx| InputState::new(window, cx).placeholder("wss://example.com"));
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
let mut subscriptions = smallvec![]; let mut subscriptions = smallvec![];
let mut tasks = smallvec![];
tasks.push(
// Load user's relays in the local database
cx.spawn_in(window, async move |this, cx| {
let result = cx
.background_spawn(async move { Self::load(&client).await })
.await;
if let Ok(relays) = result {
this.update(cx, |this, cx| {
this.relays.extend(relays);
cx.notify();
})
.ok();
}
}),
);
subscriptions.push( subscriptions.push(
// Subscribe to user's input events // Subscribe to user's input events
@@ -77,31 +62,54 @@ impl MessagingRelayPanel {
}), }),
); );
// Run at the end of current cycle
cx.defer_in(window, |this, window, cx| {
this.load(window, cx);
});
Self { Self {
name: "Update Messaging Relays".into(), name: "Update Messaging Relays".into(),
focus_handle: cx.focus_handle(), focus_handle: cx.focus_handle(),
input, input,
updating: false,
relays: HashSet::new(), relays: HashSet::new(),
error: None, error: None,
_subscriptions: subscriptions, _subscriptions: subscriptions,
_tasks: tasks, tasks: vec![],
} }
} }
async fn load(client: &Client) -> Result<Vec<RelayUrl>, Error> { fn load(&mut self, window: &mut Window, cx: &mut Context<Self>) {
let signer = client.signer().context("Signer not found")?; let nostr = NostrRegistry::global(cx);
let public_key = signer.get_public_key().await?; let client = nostr.read(cx).client();
let filter = Filter::new() let task: Task<Result<Vec<RelayUrl>, Error>> = cx.background_spawn(async move {
.kind(Kind::InboxRelays) let signer = client.signer().context("Signer not found")?;
.author(public_key) let public_key = signer.get_public_key().await?;
.limit(1);
if let Some(event) = client.database().query(filter).await?.first_owned() { let filter = Filter::new()
Ok(nip17::extract_owned_relay_list(event).collect()) .kind(Kind::InboxRelays)
} else { .author(public_key)
Err(anyhow!("Not found.")) .limit(1);
}
if let Some(event) = client.database().query(filter).await?.first_owned() {
Ok(nip17::extract_owned_relay_list(event).collect())
} else {
Err(anyhow!("Not found."))
}
});
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
let relays = task.await?;
// Update state
this.update(cx, |this, cx| {
this.relays.extend(relays);
cx.notify();
})?;
Ok(())
}));
} }
fn add(&mut self, window: &mut Window, cx: &mut Context<Self>) { fn add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
@@ -113,7 +121,7 @@ impl MessagingRelayPanel {
} }
if let Ok(url) = RelayUrl::parse(&value) { if let Ok(url) = RelayUrl::parse(&value) {
if !self.relays.insert(url) { if self.relays.insert(url) {
self.input.update(cx, |this, cx| { self.input.update(cx, |this, cx| {
this.set_value("", window, cx); this.set_value("", window, cx);
}); });
@@ -148,6 +156,11 @@ impl MessagingRelayPanel {
.detach(); .detach();
} }
fn set_updating(&mut self, updating: bool, cx: &mut Context<Self>) {
self.updating = updating;
cx.notify();
}
pub fn set_relays(&mut self, window: &mut Window, cx: &mut Context<Self>) { pub fn set_relays(&mut self, window: &mut Window, cx: &mut Context<Self>) {
if self.relays.is_empty() { if self.relays.is_empty() {
self.set_error("You need to add at least 1 relay", window, cx); self.set_error("You need to add at least 1 relay", window, cx);
@@ -156,99 +169,99 @@ impl MessagingRelayPanel {
let nostr = NostrRegistry::global(cx); let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client(); let client = nostr.read(cx).client();
let signer = nostr.read(cx).signer();
let Some(public_key) = signer.public_key() else {
window.push_notification("Public Key not found", cx);
return;
};
// Get user's write relays
let write_relays = nostr.read(cx).write_relays(&public_key, cx);
// Construct event tags
let tags: Vec<Tag> = self let tags: Vec<Tag> = self
.relays .relays
.iter() .iter()
.map(|relay| Tag::relay(relay.clone())) .map(|relay| Tag::relay(relay.clone()))
.collect(); .collect();
// Set updating state
self.set_updating(true, cx);
let task: Task<Result<(), Error>> = cx.background_spawn(async move { let task: Task<Result<(), Error>> = cx.background_spawn(async move {
let urls = write_relays.await;
// Construct nip17 event builder // Construct nip17 event builder
let builder = EventBuilder::new(Kind::InboxRelays, "").tags(tags); let builder = EventBuilder::new(Kind::InboxRelays, "").tags(tags);
let event = client.sign_event_builder(builder).await?; let event = client.sign_event_builder(builder).await?;
// Set messaging relays // Set messaging relays
client.send_event(&event).to_nip65().await?; client.send_event(&event).to(urls).await?;
Ok(()) Ok(())
}); });
cx.spawn_in(window, async move |this, cx| { self.tasks.push(cx.spawn_in(window, async move |this, cx| {
match task.await { match task.await {
Ok(_) => { Ok(_) => {
// TODO this.update_in(cx, |this, window, cx| {
this.set_updating(false, cx);
this.load(window, cx);
window.push_notification("Update successful", cx);
})?;
} }
Err(e) => { Err(e) => {
this.update_in(cx, |this, window, cx| { this.update_in(cx, |this, window, cx| {
this.set_error(e.to_string(), window, cx); this.set_error(e.to_string(), window, cx);
}) })?;
.ok();
} }
}; };
})
.detach(); Ok(())
}));
} }
fn render_list(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> UniformList { fn render_list_items(&mut self, cx: &mut Context<Self>) -> Vec<impl IntoElement> {
let relays = self.relays.clone(); let mut items = Vec::new();
let total = relays.len();
uniform_list( for url in self.relays.iter() {
"relays", items.push(
total, h_flex()
cx.processor(move |_v, range, _window, cx| { .id(SharedString::from(url.to_string()))
let mut items = Vec::new(); .group("")
.flex_1()
.w_full()
.h_8()
.px_2()
.justify_between()
.rounded(cx.theme().radius)
.bg(cx.theme().secondary_background)
.text_color(cx.theme().secondary_foreground)
.child(div().text_sm().child(SharedString::from(url.to_string())))
.child(
Button::new("remove_{ix}")
.icon(IconName::Close)
.xsmall()
.ghost()
.invisible()
.group_hover("", |this| this.visible())
.on_click({
let url = url.to_owned();
cx.listener(move |this, _ev, _window, cx| {
this.remove(&url, cx);
})
}),
),
)
}
for ix in range { items
let Some(url) = relays.iter().nth(ix) else {
continue;
};
items.push(
div()
.id(SharedString::from(url.to_string()))
.group("")
.w_full()
.h_9()
.py_0p5()
.child(
h_flex()
.px_2()
.flex()
.justify_between()
.rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background)
.child(
div().text_sm().child(SharedString::from(url.to_string())),
)
.child(
Button::new("remove_{ix}")
.icon(IconName::Close)
.xsmall()
.ghost()
.invisible()
.group_hover("", |this| this.visible())
.on_click({
let url = url.to_owned();
cx.listener(move |this, _ev, _window, cx| {
this.remove(&url, cx);
})
}),
),
),
)
}
items
}),
)
.h_full()
} }
fn render_empty(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { fn render_empty(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
h_flex() h_flex()
.mt_2()
.h_20() .h_20()
.justify_center() .justify_center()
.border_2() .border_2()
@@ -282,36 +295,48 @@ impl Focusable for MessagingRelayPanel {
impl Render for MessagingRelayPanel { impl Render for MessagingRelayPanel {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
v_flex() v_flex()
.size_full() .p_3()
.items_center() .gap_2()
.justify_center() .w_full()
.p_2()
.gap_10()
.child( .child(
div() div()
.text_center() .text_xs()
.font_semibold() .text_color(cx.theme().text_muted)
.line_height(relative(1.25)) .child(SharedString::from(MSG)),
.child(SharedString::from("Update Messaging Relays")),
) )
.child(divider(cx))
.child( .child(
v_flex() v_flex()
.w_112()
.gap_2() .gap_2()
.flex_1()
.w_full()
.text_sm() .text_sm()
.child(
div()
.text_xs()
.font_semibold()
.text_color(cx.theme().text_muted)
.child(SharedString::from("Relays:")),
)
.child( .child(
v_flex() v_flex()
.gap_1p5() .gap_1()
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
.w_full() .w_full()
.child(TextInput::new(&self.input).small()) .child(
TextInput::new(&self.input)
.small()
.bordered(false)
.cleanable(),
)
.child( .child(
Button::new("add") Button::new("add")
.icon(IconName::Plus) .icon(IconName::Plus)
.label("Add") .tooltip("Add relay")
.ghost() .ghost()
.size(rems(2.))
.on_click(cx.listener(move |this, _, window, cx| { .on_click(cx.listener(move |this, _, window, cx| {
this.add(window, cx); this.add(window, cx);
})), })),
@@ -328,17 +353,25 @@ impl Render for MessagingRelayPanel {
}), }),
) )
.map(|this| { .map(|this| {
if !self.relays.is_empty() { if self.relays.is_empty() {
this.child(self.render_list(window, cx))
} else {
this.child(self.render_empty(window, cx)) this.child(self.render_empty(window, cx))
} else {
this.child(
v_flex()
.gap_1()
.flex_1()
.w_full()
.children(self.render_list_items(cx)),
)
} }
}) })
.child(divider(cx))
.child( .child(
Button::new("submit") Button::new("submit")
.label("Update") .label("Update")
.primary() .primary()
.small()
.loading(self.updating)
.disabled(self.updating)
.on_click(cx.listener(move |this, _ev, window, cx| { .on_click(cx.listener(move |this, _ev, window, cx| {
this.set_relays(window, cx); this.set_relays(window, cx);
})), })),