diff --git a/Cargo.lock b/Cargo.lock index 4d3732cb..ff03bcb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,7 +561,7 @@ dependencies = [ "num-traits", "pastey", "rayon", - "thiserror 2.0.20", + "thiserror 2.0.21", "v_frame", "y4m", ] @@ -987,9 +987,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.4.6" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3eb0f42d6c360dc3f8a821f6bf2fdea7f72bfd36b3076eb0e6d1e9e0752fff4" +checksum = "54413ede23c2daf518f35156dfde027feb2374004d63bd497f983c8db9c0e313" dependencies = [ "find-msvc-tools", "jobserver", @@ -1095,11 +1095,9 @@ dependencies = [ "futures", "gpui-pre", "itertools 0.13.0", - "linkify", "log", "nostr-sdk", "person", - "pulldown-cmark", "regex", "serde", "settings", @@ -1339,7 +1337,7 @@ dependencies = [ "hmac 0.12.1", "nostr", "nostr-sdk", - "rand 0.10.2", + "rand 0.10.3", "serde", "serde_json", "sha2 0.10.9", @@ -1788,6 +1786,46 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" +[[package]] +name = "defmt" +version = "0.3.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.1.1", +] + +[[package]] +name = "defmt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" +dependencies = [ + "defmt-parser", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror 2.0.21", +] + [[package]] name = "deranged" version = "0.5.8" @@ -1989,13 +2027,12 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.41" +version = "0.8.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5ef0006ac9ab233c38522f5ae99cae3625151de8f706cacee1cba4b8e2832a" +checksum = "8e985e0451871ad22fb8d2b6b076e2028a502a0d3950998c2c5c0a4f9b5d9679" dependencies = [ "cfg-if", "core_detect", - "multiversion", "multiversion_no_op", "rustversion", "scopeguard", @@ -2145,10 +2182,12 @@ dependencies = [ [[package]] name = "faster-hex" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7223ae2d2f179b803433d9c830478527e92b8117eab39460edae7f1614d9fb73" +checksum = "04839bdf9d8c10f66806fad16b852fc72aab80873aebc3cb69d85b4fa41543ed" dependencies = [ + "autocfg", + "defmt 0.3.100", "heapless 0.8.0", "serde", ] @@ -2190,9 +2229,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" +checksum = "ef25905e51abafe4dcea6c15fec58c57b601cdbd0ee53d22ea1d3016c587d39b" [[package]] name = "fixedbitset" @@ -2685,7 +2724,7 @@ dependencies = [ "hashbrown 0.16.1", "log", "presser", - "thiserror 2.0.20", + "thiserror 2.0.21", "windows 0.62.2", ] @@ -2711,14 +2750,16 @@ dependencies = [ [[package]] name = "gpui-base" -version = "0.6.1" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d45dcaaeac889bf1e7757db1beb26c9043c8ea3156651facc11c6be56bb6722" +checksum = "c9e904ee0d351f4e85b967e26ae986d3aa195a8d9d35fcd18184a2c40989694e" dependencies = [ "aho-corasick", "anyhow", + "ashpd", "async-channel", "chrono", + "data-url", "futures", "gpui-pre", "gpui-pre-macros", @@ -2742,13 +2783,14 @@ dependencies = [ "tracing", "unicode-segmentation", "web-time", + "windows 0.58.0", ] [[package]] name = "gpui-pre" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a9ca98fdcad06276de623c2f48ebd710f1e7724eebef2f2673c583e85dc8335" +checksum = "a0437c0b83e636a92bd1a39fa1d05fb632ae671289537497b35871ffbe231b84" dependencies = [ "accesskit", "anyhow", @@ -2774,7 +2816,6 @@ dependencies = [ "gpui-pre-sum-tree", "gpui-pre-util", "gpui-pre-util-macros", - "gpui-pre-ztracing", "heapless 0.9.3", "image", "inventory", @@ -2782,6 +2823,8 @@ dependencies = [ "log", "lyon", "num_cpus", + "objc2-core-foundation", + "objc2-core-video", "parking", "parking_lot", "pin-project", @@ -2801,8 +2844,7 @@ dependencies = [ "spin 0.10.1", "strum", "taffy", - "thiserror 2.0.20", - "tracing", + "thiserror 2.0.21", "ttf-parser", "url", "usvg", @@ -2816,9 +2858,9 @@ dependencies = [ [[package]] name = "gpui-pre-apple" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fc4da82c5c2dbb25443655cfbc4305a2e2d1380bc0b815e80664fdfbf4cfdb" +checksum = "3af534f0746eb9e014114bcc0ee00dc250c4b8d75df2e437180c403aa65649c1" dependencies = [ "anyhow", "block", @@ -2830,7 +2872,6 @@ dependencies = [ "etagere", "foreign-types", "gpui-pre", - "gpui-pre-collections", "image", "log", "metal", @@ -2841,9 +2882,9 @@ dependencies = [ [[package]] name = "gpui-pre-collections" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626a09f683ff6f3b2f708341bdcea9d479af5b14a6a2fccec9cff935ec0751b7" +checksum = "15e7a65204039187d1f4b3d4c2e0233eeac54d4acb0b13f9dc1a3b5adad26c1f" dependencies = [ "gpui-pre-util", "indexmap", @@ -2852,9 +2893,9 @@ dependencies = [ [[package]] name = "gpui-pre-derive-refineable" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d06116a2b857588f6ea7bfb447b3554ba985e780b5995ae47780252da152f3" +checksum = "79dfb4a05f3cd9893d7768dbf5dba1bbbe99cab7394e89b360ccb3b2bcb6b34e" dependencies = [ "proc-macro2", "quote", @@ -2863,9 +2904,9 @@ dependencies = [ [[package]] name = "gpui-pre-http-client" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d2071c582c1a0f71b8c7c00607a3b9cd18f81fb3510d41845db3447b2a11c9" +checksum = "cfd5a7542c77887a5aff997d78c95884119c8463409569b63fcf060956da1682" dependencies = [ "anyhow", "async-compression", @@ -2884,9 +2925,9 @@ dependencies = [ [[package]] name = "gpui-pre-http-client-tls" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b6f3936802580259d5af9bcb2ab37fb0d7002caeed449eaabb007c62aea7341" +checksum = "72aed510adb5e7723f8f57b9751007e3451d46a84edb59b92227178cf59cc19c" dependencies = [ "log", "rustls", @@ -2896,9 +2937,9 @@ dependencies = [ [[package]] name = "gpui-pre-linux" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b427589681ec1fed27951fd82edc70a7e288bb2487ede26dbbd07c2ce23d4f" +checksum = "aab655cda1d6dcd549ac869e8678babc84cf573ab6794a1fe1a39c6c70c60b48" dependencies = [ "accesskit", "accesskit_unix", @@ -2943,15 +2984,14 @@ dependencies = [ [[package]] name = "gpui-pre-macos" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806eac0cb5c0eebc0b032c6450c11d283264f9ac05754dda83fc80d0b86b4ee8" +checksum = "951d17e41a72067ad2d35c60e08a62e8ad7fa9400b41c802e26cfb459f6c05da" dependencies = [ "accesskit", "accesskit_macos", "anyhow", "async-task", - "block", "block2 0.6.2", "cocoa 0.26.1", "core-foundation 0.10.1", @@ -2965,17 +3005,17 @@ dependencies = [ "gpui-pre", "gpui-pre-apple", "gpui-pre-collections", - "gpui-pre-media", "gpui-pre-util", "image", "itertools 0.14.0", "libc", "log", "mach2", - "metal", "objc", "objc2 0.6.4", "objc2-app-kit 0.3.2", + "objc2-core-graphics", + "objc2-core-media", "objc2-foundation 0.3.2", "objc2-screen-capture-kit", "objc2-user-notifications", @@ -2991,9 +3031,9 @@ dependencies = [ [[package]] name = "gpui-pre-macros" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06139051bf1db51949bfbb4ee338208bd64b4c35340d8c1a6a8200744e28fe1" +checksum = "6324092b40ea8ec7c327a4a28427e366a489b4d5d23b5d1bd0243fc2f4ca7a9e" dependencies = [ "heck 0.5.0", "proc-macro-crate", @@ -3002,26 +3042,11 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "gpui-pre-media" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500acb13f818ff234021c1b9eae8592b0cbe017a64e26908c736b7421b1c6213" -dependencies = [ - "anyhow", - "bindgen", - "core-foundation 0.10.1", - "core-video", - "foreign-types", - "metal", - "objc", -] - [[package]] name = "gpui-pre-perf" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0973bbb02bf46940ac0861d9dce0fc03a3109634172b69108d1bc13fa29d76c" +checksum = "b94bff26ccd8105f6206144f8dab16a2dc02e7a68f39dada02cdf492f0afd940" dependencies = [ "gpui-pre-collections", "serde", @@ -3030,9 +3055,9 @@ dependencies = [ [[package]] name = "gpui-pre-platform" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b613512e29f1e7b825bfa7e50a447388ff1347044350a475e4c98a892a985c8d" +checksum = "8423d1e0a693d2f9f16c0326bb01b5e81ec0531854d596a18476934ac6880478" dependencies = [ "console_error_panic_hook", "gpui-pre", @@ -3044,9 +3069,9 @@ dependencies = [ [[package]] name = "gpui-pre-refineable" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428f23703ead5601618ffea73c137897b98a94ce8d30e257f22be947732dfbf9" +checksum = "93b4b0a8d296a3ee5beb1136bc48f8167a6028eb1e243b56851dcd8c9fc6d7a1" dependencies = [ "gpui-pre-derive-refineable", ] @@ -3103,9 +3128,9 @@ dependencies = [ [[package]] name = "gpui-pre-reqwest-client" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05d4e3d2eb2ab777597879e46047247447b9d93cef568e63d545c9deb1b3e57" +checksum = "8f32ccea5d1a7c8d2868d7b346c2c1f76aa3f86ec9e0575c4e7340af3afd9e9d" dependencies = [ "anyhow", "bytes", @@ -3121,9 +3146,9 @@ dependencies = [ [[package]] name = "gpui-pre-scheduler" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd1b7ff2e7bf43302ae982cd786a22c16c52e16682e67b66cfbe2cb2bc3a72d" +checksum = "ff7b10b3d2fc3fda24847a04436eca9531612c8414874a37ddc005f20e521e12" dependencies = [ "async-task", "backtrace", @@ -3138,9 +3163,9 @@ dependencies = [ [[package]] name = "gpui-pre-shared-string" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424a4dd6a570473d57acf1df2bfb9f3028d4b568abcaeb9252e0f13047b50c03" +checksum = "fe17f81bd98a0253140ea79f7f76442d7499bd8d17db302861af8e46c11d38df" dependencies = [ "schemars", "serde", @@ -3149,9 +3174,9 @@ dependencies = [ [[package]] name = "gpui-pre-sum-tree" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4855718e82630d29198b515d2b027361ef63dd19b6021cefe945789dcff82372" +checksum = "0a6d35e998a51d24248dad731de1f09d386cbbf46a04edde3b67f469b2ce3f16" dependencies = [ "gpui-pre-ztracing", "heapless 0.9.3", @@ -3162,9 +3187,9 @@ dependencies = [ [[package]] name = "gpui-pre-util" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e973148165346c0f9b3f5072b321d7c2f33807c93daea67fe298c005c0e0c2a8" +checksum = "6a026a30c578930d20974fd8c3d77de36223ac7ba193bd4259e7238929bc8806" dependencies = [ "anyhow", "log", @@ -3173,9 +3198,9 @@ dependencies = [ [[package]] name = "gpui-pre-util-macros" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f71f6212d3772a70988c7d64627c7284dec73c17992ac4f9f0cdfdd46cbb677" +checksum = "5cbf79627a6afc626d4e887dad9d2d92bb069413e8cc692ba3e90bff219eb7a9" dependencies = [ "gpui-pre-perf", "quote", @@ -3184,9 +3209,9 @@ dependencies = [ [[package]] name = "gpui-pre-web" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f0daada903f106be946d87e25f5bc85ad6cf60d6d82cb8f8aed945417a9c1a3" +checksum = "34be433b9fcb370b1fe9a1c7fe911f0eb6058791ef8167dcf6c5a5deb624975c" dependencies = [ "anyhow", "console_error_panic_hook", @@ -3213,9 +3238,9 @@ dependencies = [ [[package]] name = "gpui-pre-wgpu" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "640b666a16ddf9504e2eb3e7a997acb2b2adfaa7859925bdd36fc3acfd8f30a7" +checksum = "05515b32799b1767d69300921c1b562cd53104965211a0e8905acdc7aa18e693" dependencies = [ "anyhow", "bytemuck", @@ -3240,9 +3265,9 @@ dependencies = [ [[package]] name = "gpui-pre-windows" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c12c7d84ec422feb2f064117d572447998381e5c219fcad69fe19f10d0b7aaea" +checksum = "27662e65bfcf4445d2cccfad91f1570ec07f4b1b5de98400a9f207fd19c464cf" dependencies = [ "accesskit", "accesskit_windows", @@ -3269,9 +3294,9 @@ dependencies = [ [[package]] name = "gpui-pre-zlog" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98352858fac3d4d05b46d6014ad04bad313652a691d4e21dc55fa96fb4acb7cf" +checksum = "f3a5af0b734a391a84872eb770b3ee9830091ec2487b79d06371fe14eefb2b5d" dependencies = [ "anyhow", "chrono", @@ -3281,9 +3306,9 @@ dependencies = [ [[package]] name = "gpui-pre-ztracing" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d63a3c7276875b4d7e6d3961e92a138e9233e86a591bf318f2e54df4ad58102" +checksum = "a24cb19f78c5bc3aab8ddf1e8e0bd6b402fbcb9c7f112f64ddbedef8f8768a59" dependencies = [ "gpui-pre-zlog", "gpui-pre-ztracing-macro", @@ -3293,9 +3318,9 @@ dependencies = [ [[package]] name = "gpui-pre-ztracing-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e2a5ff79002223edfcfa76c6f9f79f4f60f6ec545ccc27832f12bd46348b39" +checksum = "a1bb25850ad31b88bbdef454afb93ec4cdb81f5e200ba5b3f1a0368111780d2c" [[package]] name = "gpui-updater-core" @@ -3307,7 +3332,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.9", - "thiserror 2.0.20", + "thiserror 2.0.21", "tracing", "ureq", ] @@ -3621,9 +3646,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.9" +version = "0.27.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" dependencies = [ "http", "hyper", @@ -3638,16 +3663,17 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bytes", "futures-channel", "futures-util", "http", "http-body", + "httparse", "hyper", "ipnet", "libc", @@ -3968,7 +3994,7 @@ dependencies = [ "jni-sys 0.4.1", "log", "simd_cesu8", - "thiserror 2.0.20", + "thiserror 2.0.21", "walkdir", "windows-link 0.2.1", ] @@ -4131,9 +4157,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6480ccc157a1389bb2e4891b24751b0f798ba640d22386f23143fbcc89da195a" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" dependencies = [ "libc", ] @@ -4224,9 +4250,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.18.4" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9840bcc50b71349309900da0ce7279aa336ae71d73250b07998932c7d97c25" +checksum = "ef9ac18847474e638e3702b76c65d4eb93428471a74778ef0f1be711717f89b5" [[package]] name = "lru-slab" @@ -4501,27 +4527,6 @@ dependencies = [ "pxfm", ] -[[package]] -name = "multiversion" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ca4bea16ffc3f443cf7d866912118196bfef4c6a1556ca00f9f9b00bb43f7c" -dependencies = [ - "multiversion-macros", -] - -[[package]] -name = "multiversion-macros" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d416831a7317ef4b08bee00b69cbbb9c8763da7959a7026244d6266869f9c83" -dependencies = [ - "proc-macro2", - "quote", - "rustversion", - "syn 3.0.6", -] - [[package]] name = "multiversion_no_op" version = "1.0.0" @@ -4550,7 +4555,7 @@ dependencies = [ "once_cell", "rustc-hash 1.1.0", "spirv", - "thiserror 2.0.20", + "thiserror 2.0.21", "unicode-ident", ] @@ -4617,8 +4622,8 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "nostr" -version = "0.45.4" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.5" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "aes", "base64 0.22.1", @@ -4630,7 +4635,7 @@ dependencies = [ "chacha20poly1305", "faster-hex", "opaquerr 0.2.0", - "rand 0.10.2", + "rand 0.10.3", "scrypt", "secp256k1", "serde", @@ -4643,8 +4648,8 @@ dependencies = [ [[package]] name = "nostr-blossom" -version = "0.45.0" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.1" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "base64 0.22.1", "bitcoin_hashes 1.2.0", @@ -4656,8 +4661,8 @@ dependencies = [ [[package]] name = "nostr-connect" -version = "0.45.1" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.2" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "async-utility", "futures-core", @@ -4670,8 +4675,8 @@ dependencies = [ [[package]] name = "nostr-database" -version = "0.45.1" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.2" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "nostr", "opaquerr 0.2.0", @@ -4679,8 +4684,8 @@ dependencies = [ [[package]] name = "nostr-gossip" -version = "0.45.0" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.1" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "nostr", "opaquerr 0.2.0", @@ -4688,8 +4693,8 @@ dependencies = [ [[package]] name = "nostr-gossip-memory" -version = "0.45.0" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.1" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "indexmap", "lru", @@ -4700,8 +4705,8 @@ dependencies = [ [[package]] name = "nostr-lmdb" -version = "0.45.2" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.3" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "async-utility", "flatbuffers", @@ -4715,8 +4720,8 @@ dependencies = [ [[package]] name = "nostr-memory" -version = "0.45.1" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.2" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "btreecap", "nostr", @@ -4726,8 +4731,8 @@ dependencies = [ [[package]] name = "nostr-sdk" -version = "0.45.2" -source = "git+https://github.com/rust-nostr/nostr#b230cecf9dbb38e0228e6fff4544ed9d261326fc" +version = "0.45.4" +source = "git+https://github.com/rust-nostr/nostr#01f1950c671b35f3d1186ca907373dd86ee3b336" dependencies = [ "async-utility", "async-wsocket", @@ -4739,7 +4744,7 @@ dependencies = [ "nostr-database", "nostr-gossip", "opaquerr 0.2.0", - "rand 0.10.2", + "rand 0.10.3", "tokio", "tokio-stream", "tracing", @@ -4990,6 +4995,28 @@ dependencies = [ "objc2-foundation 0.3.2", ] +[[package]] +name = "objc2-core-audio" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1eebcea8b0dbff5f7c8504f3107c68fc061a3eb44932051c8cf8a68d969c3b2" +dependencies = [ + "dispatch2", + "objc2 0.6.4", + "objc2-core-audio-types", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-core-audio-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a89f2ec274a0cf4a32642b2991e8b351a404d290da87bb6a9a9d8632490bd1c" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.4", +] + [[package]] name = "objc2-core-data" version = "0.2.2" @@ -5069,6 +5096,21 @@ dependencies = [ "objc2-foundation 0.3.2", ] +[[package]] +name = "objc2-core-media" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ec576860167a15dd9fce7fbee7512beb4e31f532159d3482d1f9c6caedf31d" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2 0.6.4", + "objc2-core-audio", + "objc2-core-audio-types", + "objc2-core-foundation", + "objc2-core-video", +] + [[package]] name = "objc2-core-text" version = "0.3.2" @@ -5193,8 +5235,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74b7c5390f477482f001bc354d6571a70db7e4f8d5288e860c45521fbce11394" dependencies = [ "block2 0.6.2", + "dispatch2", "objc2 0.6.4", "objc2-core-graphics", + "objc2-core-media", "objc2-foundation 0.3.2", ] @@ -5887,7 +5931,7 @@ dependencies = [ "rustc-hash 2.1.3", "rustls", "socket2", - "thiserror 2.0.20", + "thiserror 2.0.21", "tokio", "tracing", "web-time", @@ -5902,14 +5946,14 @@ dependencies = [ "bytes", "getrandom 0.4.3", "lru-slab", - "rand 0.10.2", + "rand 0.10.3", "rand_pcg", "ring", "rustc-hash 2.1.3", "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.20", + "thiserror 2.0.21", "tinyvec", "tracing", "web-time", @@ -5973,9 +6017,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" dependencies = [ "chacha20 0.10.2", "getrandom 0.4.3", @@ -6077,7 +6121,7 @@ dependencies = [ "rand 0.9.5", "rand_chacha 0.9.0", "simd_helpers", - "thiserror 2.0.20", + "thiserror 2.0.21", "v_frame", "wasm-bindgen", ] @@ -6475,9 +6519,9 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", @@ -6496,9 +6540,9 @@ dependencies = [ [[package]] name = "rustls-platform-verifier-android" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" [[package]] name = "rustls-webpki" @@ -7401,7 +7445,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed071c670382e85fc2f48ae706492d8c338f4f89bf72520d32f8abfe880aade" dependencies = [ - "thiserror 2.0.20", + "thiserror 2.0.21", "windows 0.61.3", "windows-version", ] @@ -7465,11 +7509,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.20", + "thiserror-impl 2.0.21", ] [[package]] @@ -7485,9 +7529,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", @@ -7933,7 +7977,7 @@ dependencies = [ "rustls", "rustls-pki-types", "sha1", - "thiserror 2.0.20", + "thiserror 2.0.21", "utf-8", ] @@ -7970,7 +8014,10 @@ dependencies = [ "gpui-pre", "instant", "itertools 0.13.0", + "linkify", "log", + "pulldown-cmark", + "regex", "serde", "smallvec", "smol", @@ -8004,9 +8051,9 @@ checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" [[package]] name = "unicode-id" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ba288e709927c043cbe476718d37be306be53fb1fafecd0dbe36d072be2580" +checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392" [[package]] name = "unicode-ident" @@ -8616,7 +8663,7 @@ dependencies = [ "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror 2.0.20", + "thiserror 2.0.21", "wgpu-core-deps-apple", "wgpu-core-deps-emscripten", "wgpu-core-deps-wasm", @@ -8705,7 +8752,7 @@ dependencies = [ "raw-window-metal", "renderdoc-sys", "smallvec", - "thiserror 2.0.20", + "thiserror 2.0.21", "wasm-bindgen", "wayland-sys", "web-sys", @@ -8790,6 +8837,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.61.3" @@ -8823,7 +8880,7 @@ checksum = "3a4df73e95feddb9ec1a7e9c2ca6323b8c97d5eeeff78d28f1eccdf19c882b24" dependencies = [ "parking_lot", "rayon", - "thiserror 2.0.20", + "thiserror 2.0.21", "windows 0.61.3", "windows-future 0.2.1", ] @@ -8858,6 +8915,19 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.61.2" @@ -8917,6 +8987,17 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "windows-implement" version = "0.60.2" @@ -8939,6 +9020,17 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "windows-interface" version = "0.59.3" @@ -9013,6 +9105,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-result" version = "0.3.4" @@ -9031,6 +9132,16 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-strings" version = "0.3.1" @@ -9721,18 +9832,18 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.57" +version = "0.8.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d35102a9f36d089ccae9e4c6802bc118be4487b80aaffc0ab4e0cf5ce92d2873" +checksum = "c17e8fafad82b542ff3717217ecdc736231b59e387768c9630123b4ce4d2db44" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.57" +version = "0.8.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c01f5ab44258da43cf276c74a2763db2ff3969c9c652c3f2de07041d0b2bc" +checksum = "595f56e044df4f46a0c9a626f65c3d99eb8488f7e8a8baa12dd76326d9710bf2" dependencies = [ "proc-macro2", "quote", diff --git a/assets/brand/bg1.jpg b/assets/brand/bg1.jpg new file mode 100644 index 00000000..b93eea22 Binary files /dev/null and b/assets/brand/bg1.jpg differ diff --git a/assets/brand/bg2.jpg b/assets/brand/bg2.jpg new file mode 100644 index 00000000..8f317235 Binary files /dev/null and b/assets/brand/bg2.jpg differ diff --git a/assets/brand/headline.png b/assets/brand/headline.png new file mode 100644 index 00000000..56b31520 Binary files /dev/null and b/assets/brand/headline.png differ diff --git a/assets/icons/arrow-down-circle.svg b/assets/icons/arrow-down-circle.svg new file mode 100644 index 00000000..fea6250e --- /dev/null +++ b/assets/icons/arrow-down-circle.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/hashtag.svg b/assets/icons/hashtag.svg new file mode 100644 index 00000000..2459408b --- /dev/null +++ b/assets/icons/hashtag.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/panel-left-open.svg b/assets/icons/panel-left-open.svg index 1281f6e3..62bae092 100644 --- a/assets/icons/panel-left-open.svg +++ b/assets/icons/panel-left-open.svg @@ -1,3 +1,3 @@ - + diff --git a/assets/icons/panel-left.svg b/assets/icons/panel-left.svg index 1c98d39b..6cac95c5 100644 --- a/assets/icons/panel-left.svg +++ b/assets/icons/panel-left.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/auto_update/src/lib.rs b/crates/auto_update/src/lib.rs index 92b4c63d..bf094871 100644 --- a/crates/auto_update/src/lib.rs +++ b/crates/auto_update/src/lib.rs @@ -31,7 +31,7 @@ fn uses_managed_updates() -> bool { // Allow opting out of in-app updates via an explicit environment variable. || std::env::var(COOP_UPDATE_EXPLANATION).is_ok() // The Snap package sets `COOP_BUNDLE_TYPE=snap` (see snapcraft.yaml.in). - || std::env::var(COOP_BUNDLE_TYPE).is_ok_and(|value| value == "snap") + || std::env::var(COOP_BUNDLE_TYPE).is_ok_and(|value | value == "snap") } /// Initialize the auto-update system. @@ -129,6 +129,11 @@ impl AutoUpdater { matches!(self.status, UpdateStatus::Idle) } + /// Whether the running version is the newest release, so the status line can be hidden. + pub fn up_to_date(&self) -> bool { + matches!(self.status, UpdateStatus::Idle | UpdateStatus::UpToDate) + } + /// Whether a verified update is installed and waiting for a restart. pub fn staged(&self) -> bool { matches!(self.status, UpdateStatus::Staged(_)) diff --git a/crates/chat/src/lib.rs b/crates/chat/src/lib.rs index d9b22462..1da7beaf 100644 --- a/crates/chat/src/lib.rs +++ b/crates/chat/src/lib.rs @@ -9,7 +9,7 @@ use fuzzy_matcher::FuzzyMatcher; use fuzzy_matcher::skim::SkimMatcherV2; use gpui::{ App, AppContext, Context, Entity, EventEmitter, Global, SharedString, Subscription, Task, - WeakEntity, Window, + WeakEntity, }; use instant::Duration; use nostr_sdk::prelude::*; @@ -37,15 +37,8 @@ impl Global for GlobalChatRegistry {} /// Chat event. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum ChatEvent { - /// An event to open a room by its ID - OpenRoom(u64), - /// An event to close a room by its ID - CloseRoom(u64), - /// An event to notify UI about a new chat request Ping, - /// No Inbox Relays found, the app is not ready to subscribe messages InboxRelayNotFound, - /// An error occurred Error(String), } @@ -543,34 +536,16 @@ impl ChatRegistry { cx.notify(); } - /// Emit an open room event. - /// - /// If the room is new, add it to the registry. - pub fn emit_room(&mut self, room: &Entity, window: &mut Window, cx: &mut Context) { - // Get the room's ID. + /// Track a room so it is listed and can be looked up by id. + pub fn track_room(&mut self, room: &Entity, cx: &mut Context) { let id = room.read(cx).id; - // If the room is new, add it to the registry and index. if let hash_map::Entry::Vacant(e) = self.room_index.entry(id) { let entity = room.to_owned(); e.insert(entity.clone()); + self.rooms.insert(0, entity); - } - - // Emit the open room event deferred to avoid re-entrant reads - cx.defer_in(window, move |_this, _window, cx| { - cx.emit(ChatEvent::OpenRoom(id)); - }); - } - - /// Close a room. - pub fn close_room(&mut self, id: u64, window: &mut Window, cx: &mut Context) { - if self.room_index.contains_key(&id) { - self.room_index.remove(&id); - self.rooms.retain(|r| r.read(cx).id != id); - cx.defer_in(window, move |_this, _window, cx| { - cx.emit(ChatEvent::CloseRoom(id)); - }); + cx.notify(); } } diff --git a/crates/chat_ui/Cargo.toml b/crates/chat_ui/Cargo.toml index 23c2f285..2eb07f81 100644 --- a/crates/chat_ui/Cargo.toml +++ b/crates/chat_ui/Cargo.toml @@ -23,7 +23,4 @@ futures.workspace = true log.workspace = true serde.workspace = true -linkify = "0.10.0" -pulldown-cmark = "0.13.1" regex = "1" - diff --git a/crates/chat_ui/src/lib.rs b/crates/chat_ui/src/lib.rs index c6a23955..a2c876d2 100644 --- a/crates/chat_ui/src/lib.rs +++ b/crates/chat_ui/src/lib.rs @@ -31,13 +31,11 @@ use ui::button::{Button, ButtonVariants}; use ui::dock::{Panel, PanelEvent}; use ui::input::{Input, InputEvent, InputState, Textarea, TextareaState}; use ui::menu::DropdownMenu; +use ui::message::{MessageRow, WelcomeMessage}; use ui::notification::Notification; use ui::scroll::Scrollbar; use ui::tooltip::Tooltip; -use ui::{ - Disableable, Icon, IconName, InteractiveElementExt, Sizable, StyledExt, WindowExtension, - h_flex, v_flex, -}; +use ui::{Disableable, Icon, IconName, Sizable, StyledExt, WindowExtension, h_flex, v_flex}; use crate::file::*; use crate::text::RenderedText; @@ -45,6 +43,10 @@ use crate::text::RenderedText; const REACTION_EMOJIS: &[&str] = &["👍", "👎", "😄", "🎉", "😕", "❤️", "🚀", "👀"]; const COMPACT_REACTION_EMOJIS: &[&str] = &["👍", "❤️", "👀"]; +/// Notice shown when a conversation has no messages, and above the message list. +const PRIVATE_NOTICE: &str = + "This conversation is private. Only members can see each other's messages."; + /// Regex matching strings that consist entirely of emoji characters, /// zero-width joiners, variation selectors, and keycap combiners. static EMOJI_RE: LazyLock = @@ -126,9 +128,8 @@ impl ChatPanel { let replies_to = cx.new(|_| HashSet::new()); let reports_by_id = Arc::new(RwLock::new(BTreeMap::new())); - // Define list of messages let messages = Vec::new(); - let list_state = ListState::new(messages.len(), ListAlignment::Bottom, px(1024.)); + let list_state = ListState::new(messages.len() + 1, ListAlignment::Bottom, px(1024.)); // Get room id and name let (id, name) = room @@ -577,7 +578,6 @@ impl ChatPanel { where E: Into, { - let old_len = self.messages.len(); let msg: Message = m.into(); if let Err(pos) = self.messages.binary_search(&msg) { @@ -586,7 +586,8 @@ impl ChatPanel { for (i, message) in self.messages.iter().enumerate().skip(pos) { self.message_index.insert(message.id, i); } - self.list_state.splice(old_len..old_len, 1); + let len = self.list_state.item_count(); + self.list_state.splice(len..len, 1); if scroll { self.list_state.scroll_to(ListOffset { @@ -657,7 +658,8 @@ impl ChatPanel { /// Scroll to a message by its ID fn scroll_to(&self, id: &EventId) { if let Some(ix) = self.messages.iter().position(|msg| &msg.id == id) { - self.list_state.scroll_to_reveal_item(ix); + // The welcome message occupies the first row, so message rows sit one ahead. + self.list_state.scroll_to_reveal_item(ix + 1); } } @@ -1051,10 +1053,19 @@ impl ChatPanel { cx.open_url(&content); } - fn render_announcement(&self, cx: &Context) -> AnyElement { - const MSG: &str = - "This conversation is private. Only members can see each other's messages."; + fn render_welcome(&self, cx: &Context) -> AnyElement { + WelcomeMessage::new("welcome") + .icon( + svg() + .path("brand/coop.svg") + .size_12() + .text_color(cx.theme().ghost_element_background_alt), + ) + .message(PRIVATE_NOTICE) + .into_any_element() + } + fn render_announcement(&self, cx: &Context) -> AnyElement { v_flex() .h_40() .w_full() @@ -1072,7 +1083,7 @@ impl ChatPanel { .size_12() .text_color(cx.theme().ghost_element_active), ) - .child(MSG) + .child(PRIVATE_NOTICE) .into_any_element() } @@ -1141,7 +1152,14 @@ impl ChatPanel { window: &mut Window, cx: &mut Context, ) -> AnyElement { - let file = self.messages.get(ix).and_then(|message| { + if ix == 0 { + return self.render_welcome(cx); + } + + // The welcome message occupies the first row, so message rows sit one ahead. + let index = ix - 1; + + let file = self.messages.get(index).and_then(|message| { let file = message.file.clone()?; (!self.decrypted_files.contains_key(&message.id) && file.is_image()) .then_some((message.id, file)) @@ -1151,14 +1169,14 @@ impl ChatPanel { self.load_file(id, file, cx); } - if let Some(message) = self.messages.get(ix) { + if let Some(message) = self.messages.get(index) { let persons = PersonRegistry::global(cx); - let show_author = self.is_group_start(ix); + let show_author = self.is_group_start(index); let text = self .rendered_texts_by_id .entry(message.id) .or_insert_with(|| { - RenderedText::new(&message.content, &message.mentions, &persons, true, cx) + text::rendered_text(&message.content, &message.mentions, &persons, true, cx) }) .element(ix.into(), window, cx); @@ -1188,68 +1206,38 @@ impl ChatPanel { // Hide avatar setting let hide_avatar = AppSettings::get_hide_avatar(cx); - div() - .id(ix) - .group("") - .relative() - .w_full() - .py_1() - .px_3() - .child( - div() - .flex() - .gap_3() - .when(!hide_avatar, |this| { - if show_author { - this.child( - Avatar::new(author.avatar()) - .seed(author.avatar_seed()) - .flex_shrink_0() - .relative() - .dropdown_menu(move |this, _window, _cx| { - this.menu("Public Key", Box::new(Command::Copy(pk))) - .menu("View Relays", Box::new(Command::Relays(pk))) - .separator() - .menu("View on njump.me", Box::new(Command::Njump(pk))) - }), - ) - } else { - this.child(div().flex_shrink_0().w(px(32.))) - } - }) - .child( - v_flex() - .flex_1() - .w_full() - .flex_initial() - .overflow_hidden() - .when(show_author, |this| { - this.child( - h_flex() - .gap_2() - .text_sm() - .text_color(cx.theme().text_placeholder) - .child(div().font_semibold().child(author.name())) - .child(message.created_at.to_human_time()) - .when(has_reports, |this| { - this.child(self.render_sent_reports(&id, cx)) - }), - ) - }) - .when(has_replies, |this| { - this.children(self.render_message_replies(replies, cx)) - }) - .when(message.file.is_none(), |this| this.child(rendered_text)) - .child(self.render_media(&message.media, cx)) - .when_some(message.file.as_ref(), |this, file| { - this.child(self.render_message_file(&id, file, cx)) - }) - .when(has_reactions, |this| { - this.child(self.render_reactions(&id, cx)) - }), - ), + MessageRow::new(ix) + .show_author(show_author) + .hide_avatar(hide_avatar) + .avatar( + Avatar::new(author.avatar()) + .seed(author.avatar_seed()) + .flex_shrink_0() + .relative() + .dropdown_menu(move |this, _window, _cx| { + this.menu("Public Key", Box::new(Command::Copy(pk))) + .menu("View Relays", Box::new(Command::Relays(pk))) + .separator() + .menu("View on njump.me", Box::new(Command::Njump(pk))) + }), ) - .child( + .author(author.name()) + .timestamp(message.created_at.to_human_time()) + .when(has_reports, |this| { + this.header_extra(self.render_sent_reports(&id, cx)) + }) + .when(has_replies, |this| { + this.children(self.render_message_replies(replies, cx)) + }) + .when(message.file.is_none(), |this| this.child(rendered_text)) + .child(self.render_media(&message.media, cx)) + .when_some(message.file.as_ref(), |this, file| { + this.child(self.render_message_file(&id, file, cx)) + }) + .when(has_reactions, |this| { + this.child(self.render_reactions(&id, cx)) + }) + .overlay( div() .group_hover("", |this| this.bg(cx.theme().element_active)) .absolute() @@ -1259,7 +1247,7 @@ impl ChatPanel { .h_full() .bg(cx.theme().border_transparent), ) - .child(self.render_actions(&id, &pk, cx)) + .overlay(self.render_actions(&id, &pk, cx)) .on_mouse_down( MouseButton::Middle, cx.listener(move |this, _, _window, cx| { @@ -1269,7 +1257,6 @@ impl ChatPanel { .on_double_click(cx.listener(move |this, _, _window, cx| { this.reply_to(&id, cx); })) - .hover(|this| this.bg(cx.theme().surface_background)) .into_any_element() } @@ -1983,12 +1970,13 @@ impl Panel for ChatPanel { let seed = this.display_image_seed(cx); h_flex() - .gap_1p5() + .gap_1() + .text_xs() .child(Avatar::new(picture).seed(seed).xsmall()) .child(label) .into_any_element() }) - .unwrap_or(div().child("Unknown").into_any_element()) + .unwrap_or(div().text_xs().child("Unknown").into_any_element()) } fn toolbar_buttons(&self, _window: &Window, _cx: &App) -> Vec