diff --git a/Cargo.lock b/Cargo.lock index 2ef1775..fca2507 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,7 +163,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -338,7 +338,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -367,13 +367,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -390,8 +390,9 @@ dependencies = [ [[package]] name = "async-wsocket" -version = "0.12.0" -source = "git+https://github.com/yukibtc/async-wsocket?rev=5fba7927576064ac0698a4ee3df0d26e5cf726dd#5fba7927576064ac0698a4ee3df0d26e5cf726dd" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197c8c4d501d615e193e548ff0225925306b1f413a0f27f0b0952367ff25e41c" dependencies = [ "async-utility", "futures", @@ -503,7 +504,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -631,7 +632,7 @@ source = "git+https://github.com/kvark/blade?rev=b16f5c7bd873c7126f48c82c39e7ae6 dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -730,7 +731,7 @@ checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -799,16 +800,16 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.96", + "syn 2.0.97", "tempfile", "toml", ] [[package]] name = "cc" -version = "1.2.10" +version = "1.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" dependencies = [ "jobserver", "libc", @@ -877,7 +878,7 @@ dependencies = [ ] [[package]] -name = "chat" +name = "chat_state" version = "0.1.0" dependencies = [ "anyhow", @@ -956,7 +957,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -1038,7 +1039,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "indexmap", "rustc-hash 2.1.0", @@ -1109,7 +1110,7 @@ version = "0.1.0" dependencies = [ "anyhow", "app_state", - "chat", + "chat_state", "chrono", "common", "dirs 5.0.1", @@ -1313,7 +1314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -1338,13 +1339,13 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "proc-macro2", "quote", @@ -1411,7 +1412,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -1458,9 +1459,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" [[package]] name = "either" @@ -1515,7 +1516,7 @@ checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -1764,7 +1765,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -1887,7 +1888,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -2057,7 +2058,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "anyhow", "as-raw-xcb-connection", @@ -2144,7 +2145,7 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "proc-macro2", "quote", @@ -2154,7 +2155,7 @@ dependencies = [ [[package]] name = "gpui_tokio" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "gpui", "tokio", @@ -2359,7 +2360,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "anyhow", "bytes", @@ -2574,7 +2575,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -2684,7 +2685,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -2876,7 +2877,7 @@ checksum = "edbe595006d355eaf9ae11db92707d4338cd2384d16866131cc1afdbdd35d8d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -3021,7 +3022,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "anyhow", "bindgen", @@ -3158,8 +3159,9 @@ checksum = "e664971378a3987224f7a0e10059782035e89899ae403718ee07de85bec42afe" [[package]] name = "negentropy" -version = "0.4.3" -source = "git+https://github.com/rust-nostr/negentropy?rev=311013ce05dd3f670d9d9c444c09195837837271#311013ce05dd3f670d9d9c444c09195837837271" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0efe882e02d206d8d279c20eb40e03baf7cb5136a1476dc084a324fbc3ec42d" [[package]] name = "new_debug_unreachable" @@ -3198,8 +3200,8 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "nostr" -version = "0.38.0" -source = "git+https://github.com/rust-nostr/nostr#3c248e5fbb42f608110c33d4c8d470e479e361f3" +version = "0.39.0" +source = "git+https://github.com/rust-nostr/nostr#7366f8b44c5fee7e4281caafe9f95e1e399c6c7a" dependencies = [ "aes", "base64", @@ -3226,8 +3228,8 @@ dependencies = [ [[package]] name = "nostr-database" -version = "0.38.0" -source = "git+https://github.com/rust-nostr/nostr#3c248e5fbb42f608110c33d4c8d470e479e361f3" +version = "0.39.0" +source = "git+https://github.com/rust-nostr/nostr#7366f8b44c5fee7e4281caafe9f95e1e399c6c7a" dependencies = [ "flatbuffers", "nostr", @@ -3236,8 +3238,8 @@ dependencies = [ [[package]] name = "nostr-lmdb" -version = "0.38.0" -source = "git+https://github.com/rust-nostr/nostr#3c248e5fbb42f608110c33d4c8d470e479e361f3" +version = "0.39.0" +source = "git+https://github.com/rust-nostr/nostr#7366f8b44c5fee7e4281caafe9f95e1e399c6c7a" dependencies = [ "async-utility", "heed", @@ -3247,14 +3249,14 @@ dependencies = [ [[package]] name = "nostr-relay-pool" -version = "0.38.0" -source = "git+https://github.com/rust-nostr/nostr#3c248e5fbb42f608110c33d4c8d470e479e361f3" +version = "0.39.0" +source = "git+https://github.com/rust-nostr/nostr#7366f8b44c5fee7e4281caafe9f95e1e399c6c7a" dependencies = [ "async-utility", "async-wsocket", "atomic-destructor", "negentropy 0.3.1", - "negentropy 0.4.3", + "negentropy 0.5.0", "nostr", "nostr-database", "tokio", @@ -3263,8 +3265,8 @@ dependencies = [ [[package]] name = "nostr-sdk" -version = "0.38.0" -source = "git+https://github.com/rust-nostr/nostr#3c248e5fbb42f608110c33d4c8d470e479e361f3" +version = "0.39.0" +source = "git+https://github.com/rust-nostr/nostr#7366f8b44c5fee7e4281caafe9f95e1e399c6c7a" dependencies = [ "async-utility", "nostr", @@ -3344,7 +3346,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -3828,7 +3830,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -3863,7 +3865,7 @@ checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -3973,7 +3975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -4010,7 +4012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -4030,9 +4032,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quick-xml" -version = "0.36.2" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" dependencies = [ "memchr", ] @@ -4272,7 +4274,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "derive_refineable", ] @@ -4401,7 +4403,7 @@ dependencies = [ [[package]] name = "reqwest_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "anyhow", "bytes", @@ -4478,7 +4480,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.96", + "syn 2.0.97", "walkdir", ] @@ -4535,9 +4537,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.21" +version = "0.23.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" dependencies = [ "once_cell", "ring", @@ -4666,7 +4668,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -4751,7 +4753,7 @@ checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" [[package]] name = "semantic_version" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "anyhow", "serde", @@ -4780,7 +4782,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -4791,7 +4793,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -4824,7 +4826,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5064,7 +5066,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5076,7 +5078,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "arrayvec", "log", @@ -5201,9 +5203,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "5dabd04e3b9a8c3c03d5e743f5ef5e1207befc9de704d477f7198cc28049763e" dependencies = [ "proc-macro2", "quote", @@ -5236,7 +5238,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5367,7 +5369,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5378,7 +5380,7 @@ checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5499,7 +5501,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5576,15 +5578,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.7.0", ] [[package]] @@ -5633,7 +5635,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -5898,7 +5900,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "util" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#e1af35aa154ddc10faf4e9a5aac37ae543b1f6ac" +source = "git+https://github.com/zed-industries/zed#2f8237492641b4c97f61977a39f8a10225578a6d" dependencies = [ "anyhow", "async-fs", @@ -6079,7 +6081,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "wasm-bindgen-shared", ] @@ -6114,7 +6116,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6143,9 +6145,9 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" +checksum = "b7208998eaa3870dad37ec8836979581506e0c5c64c20c9e79e9d2a10d6f47bf" dependencies = [ "cc", "downcast-rs", @@ -6157,9 +6159,9 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.7" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" +checksum = "c2120de3d33638aaef5b9f4472bff75f07c56379cf76ea320bd3a3d65ecaf73f" dependencies = [ "bitflags 2.8.0", "rustix", @@ -6169,9 +6171,9 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.31.7" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b08bc3aafdb0035e7fe0fdf17ba0c09c268732707dca4ae098f60cb28c9e4c" +checksum = "a93029cbb6650748881a00e4922b076092a6a08c11e7fbdb923f064b23968c5d" dependencies = [ "rustix", "wayland-client", @@ -6205,9 +6207,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" dependencies = [ "proc-macro2", "quick-xml", @@ -6216,9 +6218,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" dependencies = [ "dlib", "log", @@ -6248,9 +6250,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.7" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ "rustls-pki-types", ] @@ -6332,7 +6334,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -6343,7 +6345,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -6526,9 +6528,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad699df48212c6cc6eb4435f35500ac6fd3b9913324f938aea302022ce19d310" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" dependencies = [ "memchr", ] @@ -6707,7 +6718,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "synstructure", ] @@ -6778,7 +6789,7 @@ dependencies = [ "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow", + "winnow 0.6.26", "xdg-home", "zbus_macros 5.3.1", "zbus_names 4.1.1", @@ -6794,7 +6805,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "zvariant_utils 2.1.0", ] @@ -6807,7 +6818,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "zbus_names 4.1.1", "zvariant 5.2.0", "zvariant_utils 3.1.0", @@ -6832,7 +6843,7 @@ checksum = "519629a3f80976d89c575895b05677cbc45eaf9f70d62a364d819ba646409cc8" dependencies = [ "serde", "static_assertions", - "winnow", + "winnow 0.6.26", "zvariant 5.2.0", ] @@ -6860,7 +6871,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -6880,7 +6891,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "synstructure", ] @@ -6901,7 +6912,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -6923,7 +6934,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -6974,7 +6985,7 @@ dependencies = [ "serde", "static_assertions", "url", - "winnow", + "winnow 0.6.26", "zvariant_derive 5.2.0", "zvariant_utils 3.1.0", ] @@ -6988,7 +6999,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "zvariant_utils 2.1.0", ] @@ -7001,7 +7012,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", "zvariant_utils 3.1.0", ] @@ -7013,7 +7024,7 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.97", ] [[package]] @@ -7026,6 +7037,6 @@ dependencies = [ "quote", "serde", "static_assertions", - "syn 2.0.96", - "winnow", + "syn 2.0.97", + "winnow 0.6.26", ] diff --git a/assets/icons/panel-left-open.svg b/assets/icons/panel-left-open.svg index 6f79cd1..bd9af3e 100644 --- a/assets/icons/panel-left-open.svg +++ b/assets/icons/panel-left-open.svg @@ -1,4 +1,3 @@ - - - + + diff --git a/assets/icons/panel-left.svg b/assets/icons/panel-left.svg index 6f79cd1..def688f 100644 --- a/assets/icons/panel-left.svg +++ b/assets/icons/panel-left.svg @@ -1,4 +1,3 @@ - - + diff --git a/assets/icons/panel-right-open.svg b/assets/icons/panel-right-open.svg new file mode 100644 index 0000000..0cf3c3c --- /dev/null +++ b/assets/icons/panel-right-open.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/panel-right.svg b/assets/icons/panel-right.svg new file mode 100644 index 0000000..f7278a5 --- /dev/null +++ b/assets/icons/panel-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 9b930c4..69e793d 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -13,7 +13,7 @@ ui = { path = "../ui" } common = { path = "../common" } state = { path = "../state" } app_state = { path = "../app_state" } -chat = { path = "../chat" } +chat_state = { path = "../chat_state" } gpui.workspace = true gpui_tokio.workspace = true diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 206d1db..6ac53d7 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -1,7 +1,7 @@ use app_state::registry::AppRegistry; use asset::Assets; use async_utility::task::spawn; -use chat::registry::ChatRegistry; +use chat_state::registry::ChatRegistry; use common::{ constants::{ ALL_MESSAGES_SUB_ID, APP_ID, APP_NAME, FAKE_SIG, KEYRING_SERVICE, NEW_MESSAGE_SUB_ID, diff --git a/crates/app/src/views/app.rs b/crates/app/src/views/app.rs index f701b81..871f23c 100644 --- a/crates/app/src/views/app.rs +++ b/crates/app/src/views/app.rs @@ -1,11 +1,14 @@ -use super::{chat::ChatPanel, onboarding::Onboarding, sidebar::Sidebar, welcome::WelcomePanel}; +use super::{ + chat, contacts, onboarding::Onboarding, profile, settings, sidebar::Sidebar, + welcome::WelcomePanel, +}; use app_state::registry::AppRegistry; -use chat::registry::ChatRegistry; +use chat_state::registry::ChatRegistry; use common::profile::NostrProfile; use gpui::{ actions, div, img, impl_internal_actions, px, AppContext, Axis, BorrowAppContext, Context, - Edges, Entity, InteractiveElement, IntoElement, ObjectFit, ParentElement, Render, Styled, - StyledImage, Window, + Entity, InteractiveElement, IntoElement, ObjectFit, ParentElement, Render, Styled, StyledImage, + Window, }; use serde::Deserialize; use state::get_client; @@ -13,24 +16,33 @@ use std::sync::Arc; use ui::{ button::{Button, ButtonVariants}, dock_area::{dock::DockPlacement, DockArea, DockItem}, - notification::NotificationType, popup_menu::PopupMenuExt, - ContextModal, Icon, IconName, Root, Sizable, TitleBar, + Icon, IconName, Root, Sizable, TitleBar, }; #[derive(Clone, PartialEq, Eq, Deserialize)] pub enum PanelKind { Room(u64), + Profile, + Contacts, + Settings, } #[derive(Clone, PartialEq, Eq, Deserialize)] pub struct AddPanel { - pub panel: PanelKind, - pub position: DockPlacement, + panel: PanelKind, + position: DockPlacement, +} + +impl AddPanel { + pub fn new(panel: PanelKind, position: DockPlacement) -> Self { + Self { panel, position } + } } // Dock actions impl_internal_actions!(dock, [AddPanel]); + // Account actions actions!(account, [OpenProfile, OpenContacts, OpenSettings, Logout]); @@ -53,9 +65,8 @@ impl AppView { pub fn new(account: NostrProfile, window: &mut Window, cx: &mut Context<'_, Self>) -> AppView { let dock = cx.new(|cx| DockArea::new(DOCK_AREA.id, Some(DOCK_AREA.version), window, cx)); let weak_dock = dock.downgrade(); - - let left = DockItem::panel(Arc::new(Sidebar::new(window, cx))); - let center = DockItem::split_with_sizes( + let left_panel = DockItem::panel(Arc::new(Sidebar::new(window, cx))); + let center_panel = DockItem::split_with_sizes( Axis::Vertical, vec![DockItem::tabs( vec![Arc::new(WelcomePanel::new(window, cx))], @@ -72,18 +83,8 @@ impl AppView { _ = weak_dock.update(cx, |view, cx| { view.set_version(DOCK_AREA.version, window, cx); - view.set_left_dock(left, Some(px(240.)), true, window, cx); - view.set_center(center, window, cx); - view.set_dock_collapsible( - Edges { - left: false, - ..Default::default() - }, - window, - cx, - ); - // TODO: support right dock? - // TODO: support bottom dock? + view.set_left_dock(left_panel, Some(px(240.)), true, window, cx); + view.set_center(center_panel, window, cx); }); AppView { account, dock } @@ -102,11 +103,20 @@ impl AppView { .object_fit(ObjectFit::Cover), ) .popup_menu(move |this, _, _cx| { - this.menu("Profile", Box::new(OpenProfile)) - .menu("Contacts", Box::new(OpenContacts)) - .menu("Settings", Box::new(OpenSettings)) - .separator() - .menu("Change account", Box::new(Logout)) + this.menu( + "Profile", + Box::new(AddPanel::new(PanelKind::Profile, DockPlacement::Right)), + ) + .menu( + "Contacts", + Box::new(AddPanel::new(PanelKind::Contacts, DockPlacement::Right)), + ) + .menu( + "Settings", + Box::new(AddPanel::new(PanelKind::Settings, DockPlacement::Center)), + ) + .separator() + .menu("Change account", Box::new(Logout)) }) } @@ -115,51 +125,37 @@ impl AppView { PanelKind::Room(id) => { if let Some(weak_room) = cx.global::().get_room(id, cx) { if let Some(room) = weak_room.upgrade() { - let panel = Arc::new(ChatPanel::new(room, window, cx)); + let panel = Arc::new(chat::init(room, window, cx)); self.dock.update(cx, |dock_area, cx| { dock_area.add_panel(panel, action.position, window, cx); }); - } else { - window.push_notification( - ( - NotificationType::Error, - "System error. Cannot open this chat room.", - ), - cx, - ); } } } + PanelKind::Profile => { + let panel = Arc::new(profile::init(window, cx)); + + self.dock.update(cx, |dock_area, cx| { + dock_area.add_panel(panel, action.position, window, cx); + }); + } + PanelKind::Contacts => { + let panel = Arc::new(contacts::init(window, cx)); + + self.dock.update(cx, |dock_area, cx| { + dock_area.add_panel(panel, action.position, window, cx); + }); + } + PanelKind::Settings => { + let panel = Arc::new(settings::init(window, cx)); + + self.dock.update(cx, |dock_area, cx| { + dock_area.add_panel(panel, action.position, window, cx); + }); + } }; } - fn on_profile_action( - &mut self, - _action: &OpenProfile, - _window: &mut Window, - _cx: &mut Context, - ) { - // TODO - } - - fn on_contacts_action( - &mut self, - _action: &OpenContacts, - _window: &mut Window, - _cx: &mut Context, - ) { - // TODO - } - - fn on_settings_action( - &mut self, - _action: &OpenSettings, - _window: &mut Window, - _cx: &mut Context, - ) { - // TODO - } - fn on_logout_action(&mut self, _action: &Logout, window: &mut Window, cx: &mut Context) { cx.update_global::(|this, cx| { cx.background_executor() @@ -210,8 +206,5 @@ impl Render for AppView { .children(modal_layer) .on_action(cx.listener(Self::on_panel_action)) .on_action(cx.listener(Self::on_logout_action)) - .on_action(cx.listener(Self::on_profile_action)) - .on_action(cx.listener(Self::on_contacts_action)) - .on_action(cx.listener(Self::on_settings_action)) } } diff --git a/crates/app/src/views/chat/mod.rs b/crates/app/src/views/chat/mod.rs index d30a6dc..57c8be9 100644 --- a/crates/app/src/views/chat/mod.rs +++ b/crates/app/src/views/chat/mod.rs @@ -1,5 +1,5 @@ use async_utility::task::spawn; -use chat::room::Room; +use chat_state::room::Room; use common::{ constants::IMAGE_SERVICE, utils::{compare, message_time, nip96_upload}, @@ -28,15 +28,19 @@ use ui::{ mod message; +pub fn init(room: Entity, window: &mut Window, cx: &mut App) -> Entity { + Chat::new(room, window, cx) +} + #[derive(Clone)] pub struct State { count: usize, items: Vec, } -pub struct ChatPanel { +pub struct Chat { // Panel - closeable: bool, + closable: bool, zoomable: bool, focus_handle: FocusHandle, // Chat Room @@ -52,7 +56,7 @@ pub struct ChatPanel { is_uploading: bool, } -impl ChatPanel { +impl Chat { pub fn new(model: Entity, window: &mut Window, cx: &mut App) -> Entity { let room = model.read(cx); let id = room.id.to_string().into(); @@ -84,7 +88,7 @@ impl ChatPanel { cx.subscribe_in( &input, window, - move |this: &mut ChatPanel, view, input_event, window, cx| { + move |this: &mut Chat, view, input_event, window, cx| { if let InputEvent::PressEnter = input_event { this.send_message(view.downgrade(), window, cx); } @@ -118,7 +122,7 @@ impl ChatPanel { let attaches = cx.new(|_| None); Self { - closeable: true, + closable: true, zoomable: true, focus_handle: cx.focus_handle(), room: model, @@ -425,7 +429,7 @@ impl ChatPanel { } } -impl Panel for ChatPanel { +impl Panel for Chat { fn panel_id(&self) -> SharedString { self.id.clone() } @@ -445,8 +449,8 @@ impl Panel for ChatPanel { self.name.clone().into_any_element() } - fn closeable(&self, _cx: &App) -> bool { - self.closeable + fn closable(&self, _cx: &App) -> bool { + self.closable } fn zoomable(&self, _cx: &App) -> bool { @@ -462,15 +466,15 @@ impl Panel for ChatPanel { } } -impl EventEmitter for ChatPanel {} +impl EventEmitter for Chat {} -impl Focusable for ChatPanel { +impl Focusable for Chat { fn focus_handle(&self, _: &App) -> FocusHandle { self.focus_handle.clone() } } -impl Render for ChatPanel { +impl Render for Chat { fn render(&mut self, _window: &mut Window, cx: &mut Context) -> impl IntoElement { v_flex() .size_full() diff --git a/crates/app/src/views/contacts/mod.rs b/crates/app/src/views/contacts/mod.rs new file mode 100644 index 0000000..7b7c925 --- /dev/null +++ b/crates/app/src/views/contacts/mod.rs @@ -0,0 +1,76 @@ +use gpui::{ + div, AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable, + IntoElement, ParentElement, Render, SharedString, Styled, Window, +}; +use ui::{ + button::Button, + dock_area::panel::{Panel, PanelEvent}, + popup_menu::PopupMenu, +}; + +pub fn init(window: &mut Window, cx: &mut App) -> Entity { + Contacts::new(window, cx) +} + +pub struct Contacts { + name: SharedString, + closable: bool, + zoomable: bool, + focus_handle: FocusHandle, +} + +impl Contacts { + pub fn new(_window: &mut Window, cx: &mut App) -> Entity { + cx.new(|cx| Self { + name: "Contacts".into(), + closable: true, + zoomable: true, + focus_handle: cx.focus_handle(), + }) + } +} + +impl Panel for Contacts { + fn panel_id(&self) -> SharedString { + "ContactPanel".into() + } + + fn title(&self, _cx: &App) -> AnyElement { + self.name.clone().into_any_element() + } + + fn closable(&self, _cx: &App) -> bool { + self.closable + } + + fn zoomable(&self, _cx: &App) -> bool { + self.zoomable + } + + fn popup_menu(&self, menu: PopupMenu, _cx: &App) -> PopupMenu { + menu.track_focus(&self.focus_handle) + } + + fn toolbar_buttons(&self, _window: &Window, _cx: &App) -> Vec