From fd95fadc4d792f32c7523bd49fd4ac9d7c5aee63 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Tue, 19 Nov 2024 06:49:52 +0800 Subject: [PATCH 01/13] Add texthandler widget --- Cargo.lock | 470 +++++++++++++++++++++++++++++++++++++++++----- youtui/Cargo.toml | 1 + 2 files changed, 424 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 919b7ca..c5f1d6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,17 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "ahash" version = "0.8.11" @@ -159,7 +170,7 @@ version = "0.0.2" dependencies = [ "crossterm", "futures", - "ratatui", + "ratatui 0.28.1", "reqwest", "tokio", "tokio-stream", @@ -187,7 +198,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -246,7 +257,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -261,6 +272,18 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -312,7 +335,7 @@ dependencies = [ "cfg-if", "dashmap", "fast-float", - "hashbrown", + "hashbrown 0.14.5", "icu_normalizer", "indexmap", "intrusive-collections", @@ -347,7 +370,7 @@ dependencies = [ "boa_macros", "boa_profiler", "boa_string", - "hashbrown", + "hashbrown 0.14.5", "thin-vec", ] @@ -359,7 +382,7 @@ checksum = "72b779280420804c70da9043d152c84eb96e2f7c9e7d1ec3262decf59f9349df" dependencies = [ "boa_gc", "boa_macros", - "hashbrown", + "hashbrown 0.14.5", "indexmap", "once_cell", "phf 0.11.2", @@ -375,7 +398,7 @@ checksum = "25e0097fa69cde4c95f9869654004340fbbe2bcf3ce9189ba2a31a65ac40e0a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", "synstructure", ] @@ -417,12 +440,57 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "borsh" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "bytemuck" version = "1.16.1" @@ -440,7 +508,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -510,6 +578,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -520,6 +594,7 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "pure-rust-locales", "wasm-bindgen", "windows-targets 0.52.6", ] @@ -576,7 +651,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -802,7 +877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -812,7 +887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core 0.9.10", @@ -852,7 +927,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -872,7 +947,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", "unicode-xid", ] @@ -921,7 +996,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -939,6 +1014,12 @@ dependencies = [ "dtoa", ] +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ego-tree" version = "0.6.2" @@ -1045,6 +1126,23 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "format_num_pattern" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39657b084f99a6df45351bac3df5f764acc57e7191f90efd6acd51e3256070a6" +dependencies = [ + "log", + "memchr", + "pure-rust-locales", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futf" version = "0.1.5" @@ -1111,7 +1209,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -1179,7 +1277,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" dependencies = [ - "unicode-width", + "unicode-width 0.1.13", ] [[package]] @@ -1226,13 +1324,22 @@ dependencies = [ "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash", + "ahash 0.8.11", "allocator-api2", ] @@ -1271,7 +1378,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -1526,7 +1633,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -1556,9 +1663,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.5", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "inout" version = "0.1.3" @@ -1576,7 +1689,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" dependencies = [ "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -1612,6 +1725,12 @@ version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +[[package]] +name = "iset" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a096b38f6994f43c7d21a2e9ef90eb188d2f9fbba13202a3c9d23f7b550738" + [[package]] name = "itertools" version = "0.12.1" @@ -1767,7 +1886,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -1955,7 +2074,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -1994,7 +2113,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -2076,7 +2195,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -2238,7 +2357,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -2276,7 +2395,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -2361,6 +2480,26 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "publicsuffix" version = "2.2.3" @@ -2371,6 +2510,12 @@ dependencies = [ "psl-types", ] +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + [[package]] name = "quinn" version = "0.11.2" @@ -2427,6 +2572,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.8.5" @@ -2457,6 +2608,87 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rat-cursor" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44464d17bf92724ed4e4b8e021a2d62bbe057f1038f7df67605adb0786194f6" + +[[package]] +name = "rat-event" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f4f0725de17373e88067e2e325706722aa4cba27b890bd86c868f0abdf2525" +dependencies = [ + "crossterm", + "log", + "ratatui 0.29.0", +] + +[[package]] +name = "rat-focus" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e34058cff9dbf0ab0dff23c22f46f7f965aac2b9477b0cb483909f70c9f9485" +dependencies = [ + "crossterm", + "log", + "rat-event", + "rat-reloc", + "ratatui 0.29.0", +] + +[[package]] +name = "rat-reloc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a480d4006d6bcecae5c59898a966ae3950e7219a84782d0d223acf7e241107" +dependencies = [ + "log", + "ratatui 0.29.0", +] + +[[package]] +name = "rat-scrolled" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162480287554a136732ecbf52d6bc006b9e3498865e094aa2c6e31216f7ddbe5" +dependencies = [ + "crossterm", + "log", + "rat-event", + "rat-reloc", + "ratatui 0.29.0", +] + +[[package]] +name = "rat-text" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6894b93e449072a486a67bab87f41b92684feb7297a968e8535de6313cc4827b" +dependencies = [ + "chrono", + "crossterm", + "dyn-clone", + "format_num_pattern", + "iset", + "log", + "memchr", + "pure-rust-locales", + "rat-cursor", + "rat-event", + "rat-focus", + "rat-reloc", + "rat-scrolled", + "ratatui 0.29.0", + "ropey", + "rust_decimal", + "rust_decimal_macros", + "unicode-display-width", + "unicode-segmentation", + "unicode-width 0.2.0", +] + [[package]] name = "ratatui" version = "0.28.1" @@ -2476,7 +2708,28 @@ dependencies = [ "time", "unicode-segmentation", "unicode-truncate", - "unicode-width", + "unicode-width 0.1.13", +] + +[[package]] +name = "ratatui" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" +dependencies = [ + "bitflags 2.6.0", + "cassowary", + "compact_str", + "crossterm", + "indoc", + "instability", + "itertools 0.13.0", + "lru", + "paste", + "strum", + "unicode-segmentation", + "unicode-truncate", + "unicode-width 0.2.0", ] [[package]] @@ -2543,10 +2796,19 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16fe0a24af5daaae947294213d2fd2646fbf5e1fbacc1d4ba3e84b2393854842" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", "memchr", ] +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + [[package]] name = "reqwest" version = "0.12.7" @@ -2659,6 +2921,35 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rkyv" +version = "0.7.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "rodio" version = "0.20.1" @@ -2672,6 +2963,42 @@ dependencies = [ "symphonia", ] +[[package]] +name = "ropey" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" +dependencies = [ + "smallvec", + "str_indices", +] + +[[package]] +name = "rust_decimal" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rust_decimal_macros" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da991f231869f34268415a49724c6578e740ad697ba0999199d6f22b3949332c" +dependencies = [ + "quote", + "rust_decimal", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -2792,7 +3119,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b90460b31bfe1fc07be8262e42c665ad97118d4585869de9345a84d501a9eaf0" dependencies = [ - "ahash", + "ahash 0.8.11", "cssparser", "ego-tree", "getopts", @@ -2802,6 +3129,12 @@ dependencies = [ "tendril", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "security-framework" version = "2.11.1" @@ -2861,7 +3194,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -2973,6 +3306,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "siphasher" version = "0.3.11" @@ -3028,6 +3367,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "str_indices" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" + [[package]] name = "string_cache" version = "0.8.7" @@ -3079,7 +3424,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -3246,9 +3591,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -3272,7 +3617,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -3348,7 +3693,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -3446,7 +3791,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -3585,7 +3930,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -3640,7 +3985,7 @@ dependencies = [ "lazy_static", "log", "parking_lot 0.12.3", - "ratatui", + "ratatui 0.28.1", "tracing", "tracing-subscriber", ] @@ -3657,6 +4002,15 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +[[package]] +name = "unicode-display-width" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a43273b656140aa2bb8e65351fe87c255f0eca706b2538a9bd4a590a3490bf3" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "unicode-ident" version = "1.0.12" @@ -3686,7 +4040,7 @@ checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" dependencies = [ "itertools 0.13.0", "unicode-segmentation", - "unicode-width", + "unicode-width 0.1.13", ] [[package]] @@ -3695,6 +4049,12 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -3748,6 +4108,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" + [[package]] name = "valuable" version = "0.1.0" @@ -3812,7 +4178,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -3846,7 +4212,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4225,6 +4591,15 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + [[package]] name = "yansi" version = "0.5.1" @@ -4251,7 +4626,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", "synstructure", ] @@ -4268,7 +4643,8 @@ dependencies = [ "futures", "gag", "itertools 0.13.0", - "ratatui", + "rat-text", + "ratatui 0.28.1", "rodio", "serde", "serde_json", @@ -4349,7 +4725,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] [[package]] @@ -4369,7 +4745,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", "synstructure", ] @@ -4398,5 +4774,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.87", ] diff --git a/youtui/Cargo.toml b/youtui/Cargo.toml index 0a450a0..e98dbad 100644 --- a/youtui/Cargo.toml +++ b/youtui/Cargo.toml @@ -38,6 +38,7 @@ itertools = "0.13.0" tokio-stream = "0.1.16" async_cell = "0.2.2" bytes = "1.7.2" +rat-text = "0.29.0" [dependencies.rusty_ytdl] # version = "0.7.4" From f3e6c43b3b78bba1cffc406b3391912561973df2 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Tue, 19 Nov 2024 07:43:14 +0800 Subject: [PATCH 02/13] Modify TextHandler trait to account for rat-text --- youtui/src/app/component/actionhandler.rs | 45 +++++++------------ youtui/src/app/ui.rs | 10 ++--- youtui/src/app/ui/browser.rs | 8 ++-- .../app/ui/browser/artistalbums/albumsongs.rs | 42 +++++++++-------- .../ui/browser/artistalbums/artistsearch.rs | 6 +-- youtui/src/app/ui/logger.rs | 2 +- youtui/src/app/ui/playlist.rs | 2 +- 7 files changed, 51 insertions(+), 64 deletions(-) diff --git a/youtui/src/app/component/actionhandler.rs b/youtui/src/app/component/actionhandler.rs index cf62c72..b8f689e 100644 --- a/youtui/src/app/component/actionhandler.rs +++ b/youtui/src/app/component/actionhandler.rs @@ -1,5 +1,5 @@ use crate::app::keycommand::{CommandVisibility, DisplayableCommand, KeyCommand, Keymap}; -use crossterm::event::{KeyCode, KeyEvent, KeyModifiers, MouseEvent}; +use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseEvent}; use std::borrow::Cow; use ytmapi_rs::common::SearchSuggestion; @@ -72,38 +72,27 @@ pub trait KeyDisplayer { &'a self, ) -> Box> + 'a>; } -/// A component of the application that handles text entry. -// TODO: Cursor position and movement. +/// A component of the application that handles text entry, currently designed +/// to wrap rat_text::TextInputState. pub trait TextHandler { - // TODO: cursor manipulation - fn push_text(&mut self, c: char); - fn pop_text(&mut self); - // Assume internal representation is a String. - fn take_text(&mut self) -> String; - // Assume internal representation is a String and we'll simply replace it with - // text. Into may also work. - fn replace_text(&mut self, text: String); + /// Get a reference to the text. + fn get_text(&self) -> &str; + /// Clear text, returning false if it was already clear. + fn clear_text(&mut self) -> bool; + /// Replace all text + fn replace_text(&mut self, text: impl Into); + /// Text handling could be a subset of the component. Return true if the + /// text handling subset is active. fn is_text_handling(&self) -> bool; - fn handle_text_entry(&mut self, key_event: KeyEvent) -> bool { + /// Handle a crossterm event, returning true if an event was handled. + fn handle_event_repr(&mut self, event: &Event) -> bool; + /// Default behaviour is to only handle an event if is_text_handling() == + /// true. + fn handle_event(&mut self, event: &Event) -> bool { if !self.is_text_handling() { return false; } - // The only accepted modifier is shift - if pressing another set of modifiers, - // we won't handle it. Somewhere else should instead. - if !key_event.modifiers.is_empty() && key_event.modifiers != KeyModifiers::SHIFT { - return false; - } - match key_event.code { - KeyCode::Char(c) => { - self.push_text(c); - true - } - KeyCode::Backspace => { - self.pop_text(); - true - } - _ => false, - } + self.handle_event_repr(event) } } // A text handler that can receive suggestions diff --git a/youtui/src/app/ui.rs b/youtui/src/app/ui.rs index a971731..b1ef033 100644 --- a/youtui/src/app/ui.rs +++ b/youtui/src/app/ui.rs @@ -282,11 +282,11 @@ impl TextHandler for YoutuiWindow { WindowContext::Logs => self.logger.is_text_handling(), } } - fn take_text(&mut self) -> String { + fn get_text(&mut self) -> String { match self.context { - WindowContext::Browser => self.browser.take_text(), - WindowContext::Playlist => self.playlist.take_text(), - WindowContext::Logs => self.logger.take_text(), + WindowContext::Browser => self.browser.get_text(), + WindowContext::Playlist => self.playlist.get_text(), + WindowContext::Logs => self.logger.get_text(), } } fn replace_text(&mut self, text: String) { @@ -339,7 +339,7 @@ impl YoutuiWindow { self.playlist.handle_tick().await; } async fn handle_key_event(&mut self, key_event: crossterm::event::KeyEvent) { - if self.handle_text_entry(key_event) { + if self.handle_event(key_event) { return; } self.key_stack.push(key_event); diff --git a/youtui/src/app/ui/browser.rs b/youtui/src/app/ui/browser.rs index a7cff23..1c30757 100644 --- a/youtui/src/app/ui/browser.rs +++ b/youtui/src/app/ui/browser.rs @@ -138,10 +138,10 @@ impl TextHandler for Browser { InputRouting::Song => self.album_songs_list.is_text_handling(), } } - fn take_text(&mut self) -> String { + fn get_text(&mut self) -> String { match self.input_routing { - InputRouting::Artist => self.artist_list.take_text(), - InputRouting::Song => self.album_songs_list.take_text(), + InputRouting::Artist => self.artist_list.get_text(), + InputRouting::Song => self.album_songs_list.get_text(), } } fn replace_text(&mut self, text: String) { @@ -459,7 +459,7 @@ impl Browser { } async fn search(&mut self) { self.artist_list.close_search(); - let search_query = self.artist_list.search.take_text(); + let search_query = self.artist_list.search.get_text(); let handler = |this: &mut Self, results| match results { Ok(artists) => { diff --git a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs index de362cf..37669a9 100644 --- a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs +++ b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs @@ -14,6 +14,7 @@ use crate::app::{ use crate::error::Error; use crate::Result; use crossterm::event::{KeyCode, KeyModifiers}; +use rat_text::text_input::{handle_events, TextInputState}; use ratatui::widgets::TableState; use std::borrow::Cow; use tracing::warn; @@ -41,8 +42,7 @@ pub struct AlbumSongsPanel { #[derive(Clone)] pub struct FilterManager { filter_commands: Vec, - pub filter_text: String, - pub filter_cur: usize, + filter_text: TextInputState, pub shown: bool, keybinds: Vec>, } @@ -76,7 +76,6 @@ impl Default for FilterManager { fn default() -> Self { Self { filter_text: Default::default(), - filter_cur: 0, filter_commands: Default::default(), shown: Default::default(), keybinds: filter_keybinds(), @@ -85,26 +84,25 @@ impl Default for FilterManager { } impl TextHandler for FilterManager { - // XXX: This is copy/paste from SearchBlock, so can an interface be made for - // this? - fn push_text(&mut self, c: char) { - self.filter_text.push(c); - self.filter_cur += 1; - } - fn pop_text(&mut self) { - self.filter_text.pop(); - self.filter_cur = self.filter_cur.saturating_sub(1); - } fn is_text_handling(&self) -> bool { true } - fn take_text(&mut self) -> String { - self.filter_cur = 0; - std::mem::take(&mut self.filter_text) + fn get_text(&self) -> &str { + self.filter_text.text() } - fn replace_text(&mut self, text: String) { - self.filter_text = text; - self.move_cursor_to_end(); + fn replace_text(&mut self, text: impl Into) { + self.filter_text.set_text(text) + } + fn clear_text(&mut self) -> bool { + self.filter_text.clear() + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + match handle_events(&mut self.filter_text, true, event) { + rat_text::event::TextOutcome::Continue => false, + rat_text::event::TextOutcome::Unchanged => true, + rat_text::event::TextOutcome::Changed => true, + rat_text::event::TextOutcome::TextChanged => true, + } } } @@ -194,7 +192,7 @@ impl AlbumSongsPanel { })) } pub fn apply_filter(&mut self) { - let filter = self.filter.take_text(); + let filter = self.filter.get_text(); self.filter.shown = false; self.route = AlbumSongsInputRouting::List; let cmd = TableFilterCommand::All(crate::app::view::Filter::Contains( @@ -306,8 +304,8 @@ impl TextHandler for AlbumSongsPanel { self.filter.pop_text() } - fn take_text(&mut self) -> String { - self.filter.take_text() + fn get_text(&mut self) -> String { + self.filter.get_text() } fn replace_text(&mut self, text: String) { diff --git a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs index ad33c48..173a914 100644 --- a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs +++ b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs @@ -103,7 +103,7 @@ impl TextHandler for SearchBlock { fn is_text_handling(&self) -> bool { true } - fn take_text(&mut self) -> String { + fn get_text(&mut self) -> String { self.text_cur = 0; self.search_suggestions.clear(); std::mem::take(&mut self.search_contents) @@ -148,8 +148,8 @@ impl TextHandler for ArtistSearchPanel { fn is_text_handling(&self) -> bool { self.route == ArtistInputRouting::Search } - fn take_text(&mut self) -> String { - self.search.take_text() + fn get_text(&mut self) -> String { + self.search.get_text() } fn replace_text(&mut self, text: String) { self.search.replace_text(text) diff --git a/youtui/src/app/ui/logger.rs b/youtui/src/app/ui/logger.rs index c74ce4d..a3224a7 100644 --- a/youtui/src/app/ui/logger.rs +++ b/youtui/src/app/ui/logger.rs @@ -82,7 +82,7 @@ impl TextHandler for Logger { fn is_text_handling(&self) -> bool { false } - fn take_text(&mut self) -> String { + fn get_text(&mut self) -> String { Default::default() } fn replace_text(&mut self, _text: String) {} diff --git a/youtui/src/app/ui/playlist.rs b/youtui/src/app/ui/playlist.rs index c8c85a4..3e80f61 100644 --- a/youtui/src/app/ui/playlist.rs +++ b/youtui/src/app/ui/playlist.rs @@ -108,7 +108,7 @@ impl TextHandler for Playlist { fn is_text_handling(&self) -> bool { false } - fn take_text(&mut self) -> String { + fn get_text(&mut self) -> String { Default::default() } fn replace_text(&mut self, _text: String) {} From 2e64a7db8e5c842608d236b72575640fdd6e39a5 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Tue, 19 Nov 2024 07:58:34 +0800 Subject: [PATCH 03/13] Continue implementation --- youtui/src/app/ui.rs | 32 ++++++------- youtui/src/app/ui/browser.rs | 42 +++++++--------- .../app/ui/browser/artistalbums/albumsongs.rs | 26 ++++------ .../ui/browser/artistalbums/artistsearch.rs | 48 +++++++++---------- 4 files changed, 65 insertions(+), 83 deletions(-) diff --git a/youtui/src/app/ui.rs b/youtui/src/app/ui.rs index b1ef033..fb6a55e 100644 --- a/youtui/src/app/ui.rs +++ b/youtui/src/app/ui.rs @@ -261,20 +261,6 @@ impl Action for UIAction { } impl TextHandler for YoutuiWindow { - fn push_text(&mut self, c: char) { - match self.context { - WindowContext::Browser => self.browser.push_text(c), - WindowContext::Playlist => self.playlist.push_text(c), - WindowContext::Logs => self.logger.push_text(c), - } - } - fn pop_text(&mut self) { - match self.context { - WindowContext::Browser => self.browser.pop_text(), - WindowContext::Playlist => self.playlist.pop_text(), - WindowContext::Logs => self.logger.pop_text(), - } - } fn is_text_handling(&self) -> bool { match self.context { WindowContext::Browser => self.browser.is_text_handling(), @@ -282,20 +268,34 @@ impl TextHandler for YoutuiWindow { WindowContext::Logs => self.logger.is_text_handling(), } } - fn get_text(&mut self) -> String { + fn get_text(&self) -> &str { match self.context { WindowContext::Browser => self.browser.get_text(), WindowContext::Playlist => self.playlist.get_text(), WindowContext::Logs => self.logger.get_text(), } } - fn replace_text(&mut self, text: String) { + fn replace_text(&mut self, text: impl Into) { match self.context { WindowContext::Browser => self.browser.replace_text(text), WindowContext::Playlist => self.playlist.replace_text(text), WindowContext::Logs => self.logger.replace_text(text), } } + fn clear_text(&mut self) -> bool { + match self.context { + WindowContext::Browser => self.browser.clear_text(), + WindowContext::Playlist => self.playlist.clear_text(), + WindowContext::Logs => self.logger.clear_text(), + } + } + fn handle_event_repr(&mut self, event: &Event) -> bool { + match self.context { + WindowContext::Browser => self.browser.handle_event_repr(event), + WindowContext::Playlist => self.playlist.handle_event_repr(event), + WindowContext::Logs => self.logger.handle_event_repr(event), + } + } } impl YoutuiWindow { diff --git a/youtui/src/app/ui/browser.rs b/youtui/src/app/ui/browser.rs index 1c30757..6d7c192 100644 --- a/youtui/src/app/ui/browser.rs +++ b/youtui/src/app/ui/browser.rs @@ -112,44 +112,36 @@ impl Suggestable for Browser { } } impl TextHandler for Browser { - fn push_text(&mut self, c: char) { - match self.input_routing { - InputRouting::Artist => { - self.artist_list.push_text(c); - // Should be on artist_list instead? - self.fetch_search_suggestions(); - } - InputRouting::Song => self.album_songs_list.push_text(c), - } - } - fn pop_text(&mut self) { - match self.input_routing { - InputRouting::Artist => { - self.artist_list.pop_text(); - // Should be on artist_list instead? - self.fetch_search_suggestions(); - } - InputRouting::Song => self.album_songs_list.pop_text(), - } - } fn is_text_handling(&self) -> bool { match self.input_routing { InputRouting::Artist => self.artist_list.is_text_handling(), InputRouting::Song => self.album_songs_list.is_text_handling(), } } - fn get_text(&mut self) -> String { + fn get_text(&self) -> &str { match self.input_routing { InputRouting::Artist => self.artist_list.get_text(), InputRouting::Song => self.album_songs_list.get_text(), } } - fn replace_text(&mut self, text: String) { + fn replace_text(&mut self, text: impl Into) { match self.input_routing { InputRouting::Artist => self.artist_list.replace_text(text), InputRouting::Song => self.album_songs_list.replace_text(text), } } + fn clear_text(&mut self) -> bool { + match self.input_routing { + InputRouting::Artist => self.artist_list.clear_text(), + InputRouting::Song => self.album_songs_list.clear_text(), + } + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + match self.input_routing { + InputRouting::Artist => self.artist_list.handle_event_repr(event), + InputRouting::Song => self.album_songs_list.handle_event_repr(event), + } + } } impl DrawableMut for Browser { @@ -412,7 +404,7 @@ impl Browser { } }; if let Err(e) = self.async_tx.add_callback( - GetSearchSuggestions(self.artist_list.search.search_contents.clone()), + GetSearchSuggestions(self.artist_list.search.get_text().to_string()), handler, Some(Constraint::new_kill_same_type()), ) { @@ -459,7 +451,7 @@ impl Browser { } async fn search(&mut self) { self.artist_list.close_search(); - let search_query = self.artist_list.search.get_text(); + let search_query = self.artist_list.search.get_text().to_string(); let handler = |this: &mut Self, results| match results { Ok(artists) => { @@ -497,7 +489,7 @@ impl Browser { search_suggestions: Vec, search: String, ) { - if self.artist_list.search.search_contents == search { + if self.artist_list.search.get_text() == search { self.artist_list.search.search_suggestions = search_suggestions; self.artist_list.search.suggestions_cur = None; } diff --git a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs index 37669a9..072b55f 100644 --- a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs +++ b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs @@ -66,12 +66,6 @@ impl Default for SortManager { } } } -impl FilterManager { - fn move_cursor_to_end(&mut self) { - self.filter_cur = self.filter_text.len(); - } -} - impl Default for FilterManager { fn default() -> Self { Self { @@ -192,7 +186,7 @@ impl AlbumSongsPanel { })) } pub fn apply_filter(&mut self) { - let filter = self.filter.get_text(); + let filter = self.filter.get_text().to_string(); self.filter.shown = false; self.route = AlbumSongsInputRouting::List; let cmd = TableFilterCommand::All(crate::app::view::Filter::Contains( @@ -296,25 +290,21 @@ impl SongListComponent for AlbumSongsPanel { } impl TextHandler for AlbumSongsPanel { - fn push_text(&mut self, c: char) { - self.filter.push_text(c) - } - - fn pop_text(&mut self) { - self.filter.pop_text() - } - - fn get_text(&mut self) -> String { + fn get_text(&self) -> &str { self.filter.get_text() } - fn replace_text(&mut self, text: String) { self.filter.replace_text(text) } - fn is_text_handling(&self) -> bool { self.route == AlbumSongsInputRouting::Filter } + fn clear_text(&mut self) -> bool { + self.filter.clear_text() + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + self.filter.handle_event_repr(event) + } } impl Action for ArtistSongsAction { diff --git a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs index 173a914..e32a7c6 100644 --- a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs +++ b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs @@ -1,6 +1,7 @@ use std::borrow::Cow; use crossterm::event::KeyCode; +use rat_text::text_input::{handle_events, TextInputState}; use ratatui::widgets::ListState; use ytmapi_rs::{common::SearchSuggestion, parse::SearchResultArtist}; @@ -35,9 +36,8 @@ pub struct ArtistSearchPanel { #[derive(Default, Clone)] pub struct SearchBlock { - pub search_contents: String, + pub search_contents: TextInputState, pub search_suggestions: Vec, - pub text_cur: usize, pub suggestions_cur: Option, } @@ -92,25 +92,25 @@ impl Action for ArtistAction { } impl TextHandler for SearchBlock { - fn push_text(&mut self, c: char) { - self.search_contents.push(c); - self.text_cur += 1; - } - fn pop_text(&mut self) { - self.search_contents.pop(); - self.text_cur = self.text_cur.saturating_sub(1); - } fn is_text_handling(&self) -> bool { true } - fn get_text(&mut self) -> String { - self.text_cur = 0; - self.search_suggestions.clear(); - std::mem::take(&mut self.search_contents) + fn get_text(&self) -> &str { + self.search_contents.text() } - fn replace_text(&mut self, text: String) { - self.search_contents = text; - self.move_cursor_to_end(); + fn replace_text(&mut self, text: impl Into) { + self.search_contents.set_text(text); + } + fn clear_text(&mut self) -> bool { + self.search_contents.clear() + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + match handle_events(&mut self.filter_text, true, event) { + rat_text::event::TextOutcome::Continue => false, + rat_text::event::TextOutcome::Unchanged => true, + rat_text::event::TextOutcome::Changed => true, + rat_text::event::TextOutcome::TextChanged => true, + } } } @@ -139,21 +139,21 @@ impl SearchBlock { } impl TextHandler for ArtistSearchPanel { - fn push_text(&mut self, c: char) { - self.search.push_text(c); - } - fn pop_text(&mut self) { - self.search.pop_text(); - } fn is_text_handling(&self) -> bool { self.route == ArtistInputRouting::Search } - fn get_text(&mut self) -> String { + fn get_text(&self) -> &str { self.search.get_text() } fn replace_text(&mut self, text: String) { self.search.replace_text(text) } + fn clear_text(&mut self) -> bool { + self.search.clear_text() + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + self.search.handle_event_repr(&event) + } } impl Suggestable for ArtistSearchPanel { From 1f15beac567bda92e178681a1ab3e7799fa8c0cf Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Tue, 19 Nov 2024 21:14:40 +0800 Subject: [PATCH 04/13] Continue refactor --- youtui/src/app.rs | 2 +- youtui/src/app/ui.rs | 8 +++---- .../app/ui/browser/artistalbums/albumsongs.rs | 1 - youtui/src/app/ui/browser/draw.rs | 21 ++++++++++--------- youtui/src/app/ui/logger.rs | 10 ++++++--- youtui/src/app/ui/playlist.rs | 10 ++++++--- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/youtui/src/app.rs b/youtui/src/app.rs index 7911028..3d30c36 100644 --- a/youtui/src/app.rs +++ b/youtui/src/app.rs @@ -164,7 +164,7 @@ impl Youtui { async fn handle_event(&mut self, event: AppEvent) { match event { AppEvent::Tick => self.window_state.handle_tick().await, - AppEvent::Crossterm(e) => self.window_state.handle_event(e).await, + AppEvent::Crossterm(e) => self.window_state.handle_initial_event(e).await, AppEvent::QuitSignal => self.status = AppStatus::Exiting("Quit signal received".into()), } } diff --git a/youtui/src/app/ui.rs b/youtui/src/app/ui.rs index fb6a55e..51e9f20 100644 --- a/youtui/src/app/ui.rs +++ b/youtui/src/app/ui.rs @@ -328,7 +328,10 @@ impl YoutuiWindow { .apply(self) } // Splitting out event types removes one layer of indentation. - pub async fn handle_event(&mut self, event: crossterm::event::Event) { + pub async fn handle_initial_event(&mut self, event: crossterm::event::Event) { + if self.handle_event(&event) { + return; + } match event { Event::Key(k) => self.handle_key_event(k).await, Event::Mouse(m) => self.handle_mouse_event(m), @@ -339,9 +342,6 @@ impl YoutuiWindow { self.playlist.handle_tick().await; } async fn handle_key_event(&mut self, key_event: crossterm::event::KeyEvent) { - if self.handle_event(key_event) { - return; - } self.key_stack.push(key_event); self.global_handle_key_stack().await; } diff --git a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs index 072b55f..e99b6de 100644 --- a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs +++ b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs @@ -213,7 +213,6 @@ impl AlbumSongsPanel { if !shown { // We need to set cur back to 0 and clear text somewhere and I'd prefer to do // it at the time of showing, so it cannot be missed. - self.filter.filter_cur = 0; self.filter.filter_text.clear(); self.route = AlbumSongsInputRouting::Filter; } else { diff --git a/youtui/src/app/ui/browser/draw.rs b/youtui/src/app/ui/browser/draw.rs index 5c9ca54..95d46b7 100644 --- a/youtui/src/app/ui/browser/draw.rs +++ b/youtui/src/app/ui/browser/draw.rs @@ -7,6 +7,7 @@ use crate::app::view::{SortableTableView, TableView}; use crate::drawutils::{ below_left_rect, bottom_of_rect, ROW_HIGHLIGHT_COLOUR, SELECTED_BORDER_COLOUR, TEXT_COLOUR, }; +use rat_text::text_input::{TextInput, TextInputState}; use ratatui::{ prelude::{Constraint, Direction, Layout, Rect}, style::{Modifier, Style}, @@ -113,26 +114,26 @@ fn draw_filter_popup(f: &mut Frame, album_songs_panel: &AlbumSongsPanel, chunk: /// Draw a text input box // TODO: Shift to a more general module. -fn draw_text_box>(f: &mut Frame, title: S, contents: S, cur: usize, chunk: Rect) { +fn draw_text_box( + f: &mut Frame, + title: impl AsRef, + contents: &mut TextInputState, + chunk: Rect, +) { // TODO: Scrolling, if input larger than box. - let search_widget = Paragraph::new(contents.as_ref()).block( + let text_widget = TextInput::new().block( Block::default() .borders(Borders::ALL) .border_style(Style::default().fg(SELECTED_BORDER_COLOUR)) .title(title.as_ref()), ); - f.render_widget(search_widget, chunk); - f.set_cursor_position(( - (chunk.x + cur as u16 + 1).min(chunk.right().saturating_sub(2)), - chunk.y + 1, - )); + f.render_stateful_widget(text_widget, chunk, contents); } -fn draw_search_box(f: &mut Frame, browser: &Browser, chunk: Rect) { +fn draw_search_box(f: &mut Frame, browser: &mut Browser, chunk: Rect) { draw_text_box( f, "Search", - browser.artist_list.search.search_contents.as_str(), - browser.artist_list.search.text_cur, + &mut browser.artist_list.search.search_contents, chunk, ); } diff --git a/youtui/src/app/ui/logger.rs b/youtui/src/app/ui/logger.rs index a3224a7..c36370a 100644 --- a/youtui/src/app/ui/logger.rs +++ b/youtui/src/app/ui/logger.rs @@ -77,15 +77,19 @@ impl KeyRouter for Logger { } impl TextHandler for Logger { - fn push_text(&mut self, _c: char) {} - fn pop_text(&mut self) {} fn is_text_handling(&self) -> bool { false } - fn get_text(&mut self) -> String { + fn get_text(&self) -> &str { Default::default() } fn replace_text(&mut self, _text: String) {} + fn clear_text(&mut self) -> bool { + false + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + false + } } impl ActionHandler for Logger { diff --git a/youtui/src/app/ui/playlist.rs b/youtui/src/app/ui/playlist.rs index 3e80f61..ba5b2a2 100644 --- a/youtui/src/app/ui/playlist.rs +++ b/youtui/src/app/ui/playlist.rs @@ -103,15 +103,19 @@ impl KeyRouter for Playlist { } impl TextHandler for Playlist { - fn push_text(&mut self, _c: char) {} - fn pop_text(&mut self) {} fn is_text_handling(&self) -> bool { false } - fn get_text(&mut self) -> String { + fn get_text(&self) -> &str { Default::default() } fn replace_text(&mut self, _text: String) {} + fn clear_text(&mut self) -> bool { + false + } + fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + false + } } impl DrawableMut for Playlist { From 5f2ea89d266eee39dd1c5b43f9d51aae04c6e7c2 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Tue, 19 Nov 2024 21:59:12 +0800 Subject: [PATCH 05/13] edit deps --- youtui/Cargo.toml | 6 +++--- .../src/app/ui/browser/artistalbums/albumsongs.rs | 4 ++-- .../app/ui/browser/artistalbums/artistsearch.rs | 15 ++++++--------- youtui/src/app/ui/browser/draw.rs | 5 ++--- youtui/src/app/ui/logger.rs | 2 +- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/youtui/Cargo.toml b/youtui/Cargo.toml index e98dbad..05b20d5 100644 --- a/youtui/Cargo.toml +++ b/youtui/Cargo.toml @@ -17,7 +17,9 @@ rust-version = "1.79" clap = { version = "4.5.16", features = ["derive"] } crossterm = { version = "0.28.1", features = ["event-stream"] } futures = "0.3.30" -ratatui = { version = "0.28.0", features = ["all-widgets"] } +rat-text = "0.28.0" +ratatui = { version = "0.29.0", features = ["all-widgets"] } +tui-logger = { version = "0.12.0", features = ["tracing-support"] } serde = "1.0.209" serde_json = "1.0.127" tokio = "1.39.3" @@ -29,7 +31,6 @@ ytmapi-rs = { path = "../ytmapi-rs", version = "0.0.16", default-features = fals async-callback-manager = { path = "../async-callback-manager", version = "0.0.2" } tracing = "0.1.40" tracing-subscriber = "0.3.18" -tui-logger = { version = "0.12.0", features = ["tracing-support"] } directories = "5.0.1" toml = "0.8.19" # For intersperse feature. RFC in progress to bring to std @@ -38,7 +39,6 @@ itertools = "0.13.0" tokio-stream = "0.1.16" async_cell = "0.2.2" bytes = "1.7.2" -rat-text = "0.29.0" [dependencies.rusty_ytdl] # version = "0.7.4" diff --git a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs index e99b6de..382ac37 100644 --- a/youtui/src/app/ui/browser/artistalbums/albumsongs.rs +++ b/youtui/src/app/ui/browser/artistalbums/albumsongs.rs @@ -42,7 +42,7 @@ pub struct AlbumSongsPanel { #[derive(Clone)] pub struct FilterManager { filter_commands: Vec, - filter_text: TextInputState, + pub filter_text: TextInputState, pub shown: bool, keybinds: Vec>, } @@ -292,7 +292,7 @@ impl TextHandler for AlbumSongsPanel { fn get_text(&self) -> &str { self.filter.get_text() } - fn replace_text(&mut self, text: String) { + fn replace_text(&mut self, text: impl Into) { self.filter.replace_text(text) } fn is_text_handling(&self) -> bool { diff --git a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs index e32a7c6..d679f82 100644 --- a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs +++ b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs @@ -105,7 +105,7 @@ impl TextHandler for SearchBlock { self.search_contents.clear() } fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { - match handle_events(&mut self.filter_text, true, event) { + match handle_events(&mut self.search_contents, true, event) { rat_text::event::TextOutcome::Continue => false, rat_text::event::TextOutcome::Unchanged => true, rat_text::event::TextOutcome::Changed => true, @@ -127,15 +127,12 @@ impl SearchBlock { ); // Safe - clamped above // Clone is ok here as we want to duplicate the search suggestion. - self.search_contents = self.search_suggestions - [self.suggestions_cur.expect("Set to non-None value above")] - .get_text(); - self.move_cursor_to_end(); + self.search_contents.set_text( + self.search_suggestions[self.suggestions_cur.expect("Set to non-None value above")] + .get_text(), + ); } } - fn move_cursor_to_end(&mut self) { - self.text_cur = self.search_contents.len(); - } } impl TextHandler for ArtistSearchPanel { @@ -145,7 +142,7 @@ impl TextHandler for ArtistSearchPanel { fn get_text(&self) -> &str { self.search.get_text() } - fn replace_text(&mut self, text: String) { + fn replace_text(&mut self, text: impl Into) { self.search.replace_text(text) } fn clear_text(&mut self) -> bool { diff --git a/youtui/src/app/ui/browser/draw.rs b/youtui/src/app/ui/browser/draw.rs index 95d46b7..38ebb18 100644 --- a/youtui/src/app/ui/browser/draw.rs +++ b/youtui/src/app/ui/browser/draw.rs @@ -98,7 +98,7 @@ fn draw_sort_popup(f: &mut Frame, album_songs_panel: &AlbumSongsPanel, chunk: Re f.render_stateful_widget(list, popup_chunk, &mut state); } -fn draw_filter_popup(f: &mut Frame, album_songs_panel: &AlbumSongsPanel, chunk: Rect) { +fn draw_filter_popup(f: &mut Frame, album_songs_panel: &mut AlbumSongsPanel, chunk: Rect) { let title = "Filter"; // Hardocde dimensions of filter input. let popup_chunk = crate::drawutils::centered_rect(3, 22, chunk); @@ -106,8 +106,7 @@ fn draw_filter_popup(f: &mut Frame, album_songs_panel: &AlbumSongsPanel, chunk: draw_text_box( f, title, - album_songs_panel.filter.filter_text.as_ref(), - album_songs_panel.filter.filter_cur, + &mut album_songs_panel.filter.filter_text, popup_chunk, ); } diff --git a/youtui/src/app/ui/logger.rs b/youtui/src/app/ui/logger.rs index c36370a..8b5cda7 100644 --- a/youtui/src/app/ui/logger.rs +++ b/youtui/src/app/ui/logger.rs @@ -83,7 +83,7 @@ impl TextHandler for Logger { fn get_text(&self) -> &str { Default::default() } - fn replace_text(&mut self, _text: String) {} + fn replace_text(&mut self, _text: impl Into) {} fn clear_text(&mut self) -> bool { false } From 0d4d30cda7f2164f4f3332ce2a85d0f3423f800a Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Wed, 20 Nov 2024 07:11:09 +0800 Subject: [PATCH 06/13] Fix last issues --- Cargo.lock | 4 ++-- youtui/Cargo.toml | 2 +- youtui/src/app/ui/browser/draw.rs | 4 ++-- youtui/src/app/ui/playlist.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5f1d6b..f0f4cd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2705,7 +2705,6 @@ dependencies = [ "paste", "strum", "strum_macros", - "time", "unicode-segmentation", "unicode-truncate", "unicode-width 0.1.13", @@ -2727,6 +2726,7 @@ dependencies = [ "lru", "paste", "strum", + "time", "unicode-segmentation", "unicode-truncate", "unicode-width 0.2.0", @@ -4644,7 +4644,7 @@ dependencies = [ "gag", "itertools 0.13.0", "rat-text", - "ratatui 0.28.1", + "ratatui 0.29.0", "rodio", "serde", "serde_json", diff --git a/youtui/Cargo.toml b/youtui/Cargo.toml index 05b20d5..52e4226 100644 --- a/youtui/Cargo.toml +++ b/youtui/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.79" clap = { version = "4.5.16", features = ["derive"] } crossterm = { version = "0.28.1", features = ["event-stream"] } futures = "0.3.30" -rat-text = "0.28.0" +rat-text = "0.29.0" ratatui = { version = "0.29.0", features = ["all-widgets"] } tui-logger = { version = "0.12.0", features = ["tracing-support"] } serde = "1.0.209" diff --git a/youtui/src/app/ui/browser/draw.rs b/youtui/src/app/ui/browser/draw.rs index 38ebb18..bdde3e9 100644 --- a/youtui/src/app/ui/browser/draw.rs +++ b/youtui/src/app/ui/browser/draw.rs @@ -12,7 +12,7 @@ use ratatui::{ prelude::{Constraint, Direction, Layout, Rect}, style::{Modifier, Style}, text::{Line, Span}, - widgets::{Block, Borders, Clear, List, ListItem, ListState, Paragraph}, + widgets::{Block, Borders, Clear, List, ListItem, ListState}, Frame, }; use ytmapi_rs::common::{SuggestionType, TextRun}; @@ -57,7 +57,7 @@ pub fn draw_browser(f: &mut Frame, browser: &mut Browser, chunk: Rect, selected: draw_sort_popup(f, &browser.album_songs_list, layout[1]); } if browser.album_songs_list.filter.shown { - draw_filter_popup(f, &browser.album_songs_list, layout[1]); + draw_filter_popup(f, &mut browser.album_songs_list, layout[1]); } } diff --git a/youtui/src/app/ui/playlist.rs b/youtui/src/app/ui/playlist.rs index ba5b2a2..348beb6 100644 --- a/youtui/src/app/ui/playlist.rs +++ b/youtui/src/app/ui/playlist.rs @@ -109,7 +109,7 @@ impl TextHandler for Playlist { fn get_text(&self) -> &str { Default::default() } - fn replace_text(&mut self, _text: String) {} + fn replace_text(&mut self, _text: impl Into) {} fn clear_text(&mut self) -> bool { false } From 60340f561a19e51d74b70e952cf5b8402fec9621 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 07:27:02 +0800 Subject: [PATCH 07/13] Update crates, add cursor --- Cargo.lock | 6 +++--- youtui/Cargo.toml | 2 +- youtui/src/app/ui/browser/draw.rs | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0f4cd0..6fb507c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3976,16 +3976,16 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tui-logger" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f163885b0550ad9821f52700b6da2e0e249641722be4e2b615ee6c5010ec3e" +checksum = "bdf8f5ebd2c83a5176c69b150ea7f2a855ec8dc2a2774e7f198d1b50feda5745" dependencies = [ "chrono", "fxhash", "lazy_static", "log", "parking_lot 0.12.3", - "ratatui 0.28.1", + "ratatui 0.29.0", "tracing", "tracing-subscriber", ] diff --git a/youtui/Cargo.toml b/youtui/Cargo.toml index 52e4226..16d0f54 100644 --- a/youtui/Cargo.toml +++ b/youtui/Cargo.toml @@ -19,7 +19,7 @@ crossterm = { version = "0.28.1", features = ["event-stream"] } futures = "0.3.30" rat-text = "0.29.0" ratatui = { version = "0.29.0", features = ["all-widgets"] } -tui-logger = { version = "0.12.0", features = ["tracing-support"] } +tui-logger = { version = "0.14.0", features = ["tracing-support"] } serde = "1.0.209" serde_json = "1.0.127" tokio = "1.39.3" diff --git a/youtui/src/app/ui/browser/draw.rs b/youtui/src/app/ui/browser/draw.rs index bdde3e9..1dfcdda 100644 --- a/youtui/src/app/ui/browser/draw.rs +++ b/youtui/src/app/ui/browser/draw.rs @@ -8,6 +8,7 @@ use crate::drawutils::{ below_left_rect, bottom_of_rect, ROW_HIGHLIGHT_COLOUR, SELECTED_BORDER_COLOUR, TEXT_COLOUR, }; use rat_text::text_input::{TextInput, TextInputState}; +use rat_text::HasScreenCursor; use ratatui::{ prelude::{Constraint, Direction, Layout, Rect}, style::{Modifier, Style}, @@ -127,6 +128,9 @@ fn draw_text_box( .title(title.as_ref()), ); f.render_stateful_widget(text_widget, chunk, contents); + if let Some(cursor_pos) = contents.screen_cursor() { + f.set_cursor_position(cursor_pos) + }; } fn draw_search_box(f: &mut Frame, browser: &mut Browser, chunk: Rect) { draw_text_box( From 1dd8f06d2d8906e2205615ac0e60c00f061b2373 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 07:49:49 +0800 Subject: [PATCH 08/13] Try to implement search suggestions for textinput widget --- Cargo.lock | 696 ++++++++++-------- async-callback-manager/Cargo.toml | 12 +- json-crawler/Cargo.toml | 4 +- youtui/Cargo.toml | 12 +- youtui/src/app/ui/browser.rs | 38 +- .../ui/browser/artistalbums/artistsearch.rs | 65 +- ytmapi-rs/Cargo.toml | 14 +- 7 files changed, 456 insertions(+), 385 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6fb507c..b4cafdd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aes" @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "alsa" @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -120,36 +120,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -170,7 +170,7 @@ version = "0.0.2" dependencies = [ "crossterm", "futures", - "ratatui 0.28.1", + "ratatui", "reqwest", "tokio", "tokio-stream", @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.11" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "flate2", "futures-core", @@ -215,23 +215,23 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -357,7 +357,7 @@ dependencies = [ "static_assertions", "tap", "thin-vec", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -519,9 +519,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cassowary" @@ -549,12 +549,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.6" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -622,9 +623,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -632,9 +633,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -644,9 +645,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -656,9 +657,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "claxon" @@ -668,9 +669,9 @@ checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" @@ -698,18 +699,18 @@ dependencies = [ [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" dependencies = [ "proc-macro2", "quote", @@ -729,12 +730,13 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" +checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9" dependencies = [ "cookie", - "idna 0.5.0", + "document-features", + "idna", "log", "publicsuffix", "serde", @@ -756,9 +758,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "coreaudio-rs" @@ -880,6 +882,41 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.87", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -999,6 +1036,15 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + [[package]] name = "dtoa" version = "1.0.9" @@ -1034,9 +1080,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1071,9 +1117,9 @@ checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "filedescriptor" @@ -1082,15 +1128,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7199d965852c3bac31f779ef99cbb4537f80e952e2d6aa0ffeb30cce00f4f46e" dependencies = [ "libc", - "thiserror", + "thiserror 1.0.69", "winapi", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1102,6 +1148,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1155,9 +1207,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1170,9 +1222,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1180,15 +1232,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1197,15 +1249,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -1214,21 +1266,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1277,7 +1329,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" dependencies = [ - "unicode-width 0.1.13", + "unicode-width 0.1.14", ] [[package]] @@ -1295,9 +1347,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -1307,9 +1359,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -1343,6 +1395,17 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "heck" version = "0.5.0" @@ -1417,15 +1480,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1443,9 +1506,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", @@ -1477,9 +1540,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -1490,7 +1553,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -1636,34 +1698,41 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" -version = "0.3.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "idna" -version = "0.5.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.1", ] [[package]] @@ -1684,10 +1753,14 @@ dependencies = [ [[package]] name = "instability" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" +checksum = "b829f37dead9dc39df40c2d3376c179fdfd2ac771f53f55d3c30dc096a3c0c6e" dependencies = [ + "darling", + "indoc", + "pretty_assertions", + "proc-macro2", "quote", "syn 2.0.87", ] @@ -1715,15 +1788,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "iset" @@ -1766,7 +1839,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -1779,18 +1852,18 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -1828,9 +1901,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libloading" @@ -1839,7 +1912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -1864,6 +1937,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.12" @@ -1882,11 +1961,11 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.1", ] [[package]] @@ -1957,18 +2036,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", @@ -2005,7 +2084,7 @@ dependencies = [ "log", "ndk-sys", "num_enum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2127,9 +2206,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -2168,15 +2247,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -2206,9 +2285,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2271,7 +2350,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.7", "smallvec", "windows-targets 0.52.6", ] @@ -2378,31 +2457,11 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2412,9 +2471,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "pollster" @@ -2436,9 +2495,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -2448,9 +2510,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", @@ -2467,9 +2529,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -2502,11 +2564,11 @@ dependencies = [ [[package]] name = "publicsuffix" -version = "2.2.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" +checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" dependencies = [ - "idna 0.3.0", + "idna", "psl-types", ] @@ -2518,56 +2580,61 @@ checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "rustls", - "thiserror", + "socket2", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash 2.0.0", "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2622,7 +2689,7 @@ checksum = "d5f4f0725de17373e88067e2e325706722aa4cba27b890bd86c868f0abdf2525" dependencies = [ "crossterm", "log", - "ratatui 0.29.0", + "ratatui", ] [[package]] @@ -2635,7 +2702,7 @@ dependencies = [ "log", "rat-event", "rat-reloc", - "ratatui 0.29.0", + "ratatui", ] [[package]] @@ -2645,7 +2712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45a480d4006d6bcecae5c59898a966ae3950e7219a84782d0d223acf7e241107" dependencies = [ "log", - "ratatui 0.29.0", + "ratatui", ] [[package]] @@ -2658,7 +2725,7 @@ dependencies = [ "log", "rat-event", "rat-reloc", - "ratatui 0.29.0", + "ratatui", ] [[package]] @@ -2680,7 +2747,7 @@ dependencies = [ "rat-focus", "rat-reloc", "rat-scrolled", - "ratatui 0.29.0", + "ratatui", "ropey", "rust_decimal", "rust_decimal_macros", @@ -2689,27 +2756,6 @@ dependencies = [ "unicode-width 0.2.0", ] -[[package]] -name = "ratatui" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" -dependencies = [ - "bitflags 2.6.0", - "cassowary", - "compact_str", - "crossterm", - "instability", - "itertools 0.13.0", - "lru", - "paste", - "strum", - "strum_macros", - "unicode-segmentation", - "unicode-truncate", - "unicode-width 0.1.13", -] - [[package]] name = "ratatui" version = "0.29.0" @@ -2743,9 +2789,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -2758,7 +2804,7 @@ checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2811,9 +2857,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "async-compression", "base64", @@ -2872,7 +2918,7 @@ dependencies = [ "http", "reqwest", "serde", - "thiserror", + "thiserror 1.0.69", "tower-service", ] @@ -3019,9 +3065,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.6.0", "errno", @@ -3032,9 +3078,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "once_cell", "ring", @@ -3046,25 +3092,27 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -3073,9 +3121,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -3100,11 +3148,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3150,9 +3198,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -3179,18 +3227,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -3199,9 +3247,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -3217,7 +3265,7 @@ checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" dependencies = [ "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3649,14 +3697,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3678,18 +3727,38 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", @@ -3767,9 +3836,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -3828,9 +3897,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -3884,32 +3953,11 @@ dependencies = [ "winnow 0.6.18", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -3985,7 +4033,7 @@ dependencies = [ "lazy_static", "log", "parking_lot 0.12.3", - "ratatui 0.29.0", + "ratatui", "tracing", "tracing-subscriber", ] @@ -3996,12 +4044,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-display-width" version = "0.3.0" @@ -4013,24 +4055,15 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-truncate" @@ -4040,14 +4073,14 @@ checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" dependencies = [ "itertools 0.13.0", "unicode-segmentation", - "unicode-width 0.1.13", + "unicode-width 0.1.14", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" @@ -4057,9 +4090,9 @@ checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "untrusted" @@ -4069,12 +4102,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] @@ -4128,9 +4161,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -4159,19 +4192,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4184,9 +4218,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4196,9 +4230,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4206,9 +4240,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4219,9 +4253,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-timer" @@ -4240,9 +4274,19 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -4250,9 +4294,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -4383,6 +4427,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -4602,9 +4655,9 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" @@ -4644,7 +4697,7 @@ dependencies = [ "gag", "itertools 0.13.0", "rat-text", - "ratatui 0.29.0", + "ratatui", "rodio", "serde", "serde_json", @@ -4684,7 +4737,7 @@ dependencies = [ "serde", "serde_json", "serde_qs", - "thiserror", + "thiserror 1.0.69", "tokio", "url", "urlencoding", @@ -4714,6 +4767,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] diff --git a/async-callback-manager/Cargo.toml b/async-callback-manager/Cargo.toml index 694c4ee..91b6591 100644 --- a/async-callback-manager/Cargo.toml +++ b/async-callback-manager/Cargo.toml @@ -10,19 +10,19 @@ repository = "https://github.com/nick42d/youtui" readme = "README.md" [dependencies] -futures = "0.3.30" -reqwest = "0.12.7" -tokio = { version = "1.40.0", default-features = false, features = ["macros"] } +futures = "0.3.31" +reqwest = "0.12.9" +tokio = { version = "1.41.1", default-features = false, features = ["macros"] } tracing = "0.1.40" # For Then combinator tokio-stream = "0.1.16" [dev-dependencies] tokio-stream = "0.1.16" -tokio = { version = "1.40.0", features = ["full"] } -ratatui = "0.28.1" +tokio = { version = "1.41.1", features = ["full"] } +ratatui = "0.29.0" crossterm = { version = "0.28.1", features = ["event-stream"] } -reqwest = { version = "0.12.7", features = [ +reqwest = { version = "0.12.9", features = [ "http2", "charset", "rustls-tls" diff --git a/json-crawler/Cargo.toml b/json-crawler/Cargo.toml index 1a9715f..d387eb9 100644 --- a/json-crawler/Cargo.toml +++ b/json-crawler/Cargo.toml @@ -10,8 +10,8 @@ repository = "https://github.com/nick42d/youtui" readme = "README.md" [dependencies] -serde = "1.0.209" -serde_json = "1.0.127" +serde = "1.0.215" +serde_json = "1.0.133" [lints] workspace = true diff --git a/youtui/Cargo.toml b/youtui/Cargo.toml index 16d0f54..9704c08 100644 --- a/youtui/Cargo.toml +++ b/youtui/Cargo.toml @@ -14,15 +14,15 @@ categories = ["multimedia::audio"] rust-version = "1.79" [dependencies] -clap = { version = "4.5.16", features = ["derive"] } +clap = { version = "4.5.21", features = ["derive"] } crossterm = { version = "0.28.1", features = ["event-stream"] } -futures = "0.3.30" +futures = "0.3.31" rat-text = "0.29.0" ratatui = { version = "0.29.0", features = ["all-widgets"] } tui-logger = { version = "0.14.0", features = ["tracing-support"] } -serde = "1.0.209" -serde_json = "1.0.127" -tokio = "1.39.3" +serde = "1.0.215" +serde_json = "1.0.133" +tokio = "1.41.1" gag = "1.0.0" ytmapi-rs = { path = "../ytmapi-rs", version = "0.0.16", default-features = false, features = [ "rustls-tls", @@ -38,7 +38,7 @@ toml = "0.8.19" itertools = "0.13.0" tokio-stream = "0.1.16" async_cell = "0.2.2" -bytes = "1.7.2" +bytes = "1.8.0" [dependencies.rusty_ytdl] # version = "0.7.4" diff --git a/youtui/src/app/ui/browser.rs b/youtui/src/app/ui/browser.rs index 6d7c192..0708f37 100644 --- a/youtui/src/app/ui/browser.rs +++ b/youtui/src/app/ui/browser.rs @@ -257,7 +257,7 @@ impl Browser { ) -> Self { Self { callback_tx: ui_tx, - artist_list: ArtistSearchPanel::new(), + artist_list: ArtistSearchPanel::new(callback_manager), album_songs_list: AlbumSongsPanel::new(), input_routing: InputRouting::Artist, prev_input_routing: InputRouting::Artist, @@ -385,32 +385,6 @@ impl Browser { .await; // XXX: Do we want to indicate that song has been added to playlist? } - // Ask the UI for search suggestions for the current query - // XXX: Currently has race conditions - if list is cleared response will arrive - // afterwards. Proposal: When recieving a message from the app validate - // against query string. - fn fetch_search_suggestions(&mut self) { - // No need to fetch search suggestions if contents is empty. - if self.artist_list.search.search_contents.is_empty() { - self.artist_list.search.search_suggestions.clear(); - return; - } - let handler = |this: &mut Self, results| match results { - Ok((suggestions, text)) => { - this.replace_search_suggestions(suggestions, text); - } - Err(e) => { - error!("Error <{e}> recieved getting search suggestions"); - } - }; - if let Err(e) = self.async_tx.add_callback( - GetSearchSuggestions(self.artist_list.search.get_text().to_string()), - handler, - Some(Constraint::new_kill_same_type()), - ) { - error!("Error <{e}> recieved sending message") - }; - } async fn get_songs(&mut self) { let selected = self.artist_list.get_selected_item(); self.change_routing(InputRouting::Song); @@ -484,16 +458,6 @@ impl Browser { // Handled by this function? self.increment_cur_list(0); } - pub fn replace_search_suggestions( - &mut self, - search_suggestions: Vec, - search: String, - ) { - if self.artist_list.search.get_text() == search { - self.artist_list.search.search_suggestions = search_suggestions; - self.artist_list.search.suggestions_cur = None; - } - } pub fn handle_no_songs_found(&mut self) { self.album_songs_list.list.state = ListStatus::Loaded; } diff --git a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs index d679f82..9296258 100644 --- a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs +++ b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs @@ -1,15 +1,19 @@ use std::borrow::Cow; +use async_callback_manager::{AsyncCallbackManager, AsyncCallbackSender, Constraint}; use crossterm::event::KeyCode; use rat_text::text_input::{handle_events, TextInputState}; use ratatui::widgets::ListState; +use tracing::error; use ytmapi_rs::{common::SearchSuggestion, parse::SearchResultArtist}; use crate::app::{ component::actionhandler::{Action, KeyRouter, Suggestable, TextHandler}, keycommand::KeyCommand, + server::{ArcServer, GetSearchSuggestions, TaskMetadata}, ui::browser::BrowserAction, view::{ListView, Loadable, Scrollable, SortableList}, + CALLBACK_CHANNEL_SIZE, }; #[derive(Clone, Debug, Default, PartialEq)] @@ -19,7 +23,6 @@ pub enum ArtistInputRouting { List, } -#[derive(Default, Clone)] pub struct ArtistSearchPanel { pub list: Vec, // Duplicate of search popped? @@ -34,11 +37,11 @@ pub struct ArtistSearchPanel { pub widget_state: ListState, } -#[derive(Default, Clone)] pub struct SearchBlock { pub search_contents: TextInputState, pub search_suggestions: Vec, pub suggestions_cur: Option, + async_tx: AsyncCallbackSender, } #[derive(Clone, Debug, PartialEq)] @@ -56,11 +59,17 @@ pub enum ArtistAction { } impl ArtistSearchPanel { - pub fn new() -> Self { + pub fn new(callback_manager: &mut AsyncCallbackManager) -> Self { Self { keybinds: browser_artist_search_keybinds(), search_keybinds: search_keybinds(), - ..Default::default() + list: Default::default(), + route: Default::default(), + selected: Default::default(), + sort_commands_list: Default::default(), + search_popped: Default::default(), + search: SearchBlock::new(callback_manager), + widget_state: Default::default(), } } pub fn open_search(&mut self) { @@ -109,12 +118,56 @@ impl TextHandler for SearchBlock { rat_text::event::TextOutcome::Continue => false, rat_text::event::TextOutcome::Unchanged => true, rat_text::event::TextOutcome::Changed => true, - rat_text::event::TextOutcome::TextChanged => true, + rat_text::event::TextOutcome::TextChanged => { + self.fetch_search_suggestions(); + true + } } } } impl SearchBlock { + pub fn new(callback_manager: &mut AsyncCallbackManager) -> Self { + Self { + search_contents: Default::default(), + search_suggestions: Default::default(), + suggestions_cur: Default::default(), + async_tx: callback_manager.new_sender(CALLBACK_CHANNEL_SIZE), + } + } + // Ask the UI for search suggestions for the current query + fn fetch_search_suggestions(&mut self) { + // No need to fetch search suggestions if contents is empty. + if self.search_contents.is_empty() { + self.search_suggestions.clear(); + return; + } + let handler = |this: &mut Self, results| match results { + Ok((suggestions, text)) => { + this.replace_search_suggestions(suggestions, text); + } + Err(e) => { + error!("Error <{e}> recieved getting search suggestions"); + } + }; + if let Err(e) = self.async_tx.add_callback( + GetSearchSuggestions(self.get_text().to_string()), + handler, + Some(Constraint::new_kill_same_type()), + ) { + error!("Error <{e}> recieved sending message") + }; + } + fn replace_search_suggestions( + &mut self, + search_suggestions: Vec, + search: String, + ) { + if self.get_text() == search { + self.search_suggestions = search_suggestions; + self.suggestions_cur = None; + } + } pub fn increment_list(&mut self, amount: isize) { if !self.search_suggestions.is_empty() { self.suggestions_cur = Some( @@ -149,7 +202,7 @@ impl TextHandler for ArtistSearchPanel { self.search.clear_text() } fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { - self.search.handle_event_repr(&event) + self.search.handle_event_repr(event) } } diff --git a/ytmapi-rs/Cargo.toml b/ytmapi-rs/Cargo.toml index dcbba86..abb83d2 100644 --- a/ytmapi-rs/Cargo.toml +++ b/ytmapi-rs/Cargo.toml @@ -11,26 +11,26 @@ readme = "README.md" exclude = ["test_json/*"] [dependencies] -tokio = { version = "1.39.3", features = ["full"] } +tokio = { version = "1.41.1", features = ["full"] } # To allow alternative TLS options, we need to opt out of a single reqwest feature. # This isn't possible in Cargo, so we need to opt back into the other default features. # https://github.com/rust-lang/cargo/issues/3126 # As of 26/4/24 the following are reqwest default features: # http2, default-tls, charset -reqwest = { version = "0.12.7", features = [ +reqwest = { version = "0.12.9", features = [ "json", "http2", "charset", ], default-features = false } -serde = { version = "1.0.203", features = ["derive"] } -serde_json = "1.0.127" +serde = { version = "1.0.215", features = ["derive"] } +serde_json = "1.0.133" json-crawler = { version = "0.0.4", path = "../json-crawler" } sha1 = "0.10.6" -const_format = "0.2.32" +const_format = "0.2.33" chrono = "0.4.38" rand = "0.8.5" # Futures `executor` feature is not required. -futures = { version = "0.3.30", features = ["async-await", "std"] } +futures = { version = "0.3.31", features = ["async-await", "std"] } itertools = "0.13.0" [features] @@ -55,7 +55,7 @@ workspace = true # Dev only section [dev-dependencies] -pretty_assertions = "1.4.0" +pretty_assertions = "1.4.1" # Docs.rs-specific configuration required to enable documentation of # code requiring optional features. From 1ae6431ae7048baf93bad231c7e8142c2a81d4a7 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 17:03:59 +0800 Subject: [PATCH 09/13] Fix logging, fix cursor rendering in wall of block, fix no search suggestions --- Cargo.lock | 1 + youtui/Cargo.toml | 1 + youtui/src/app.rs | 3 +++ youtui/src/app/ui/browser.rs | 5 ++++- .../ui/browser/artistalbums/artistsearch.rs | 2 +- youtui/src/app/ui/browser/draw.rs | 21 ++++++++++++------- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4cafdd..c19786f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4696,6 +4696,7 @@ dependencies = [ "futures", "gag", "itertools 0.13.0", + "log", "rat-text", "ratatui", "rodio", diff --git a/youtui/Cargo.toml b/youtui/Cargo.toml index 9704c08..cc691ce 100644 --- a/youtui/Cargo.toml +++ b/youtui/Cargo.toml @@ -39,6 +39,7 @@ itertools = "0.13.0" tokio-stream = "0.1.16" async_cell = "0.2.2" bytes = "1.8.0" +log = "0.4.22" [dependencies.rusty_ytdl] # version = "0.7.4" diff --git a/youtui/src/app.rs b/youtui/src/app.rs index 3d30c36..7066700 100644 --- a/youtui/src/app.rs +++ b/youtui/src/app.rs @@ -7,6 +7,7 @@ use crossterm::{ execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; +use log::LevelFilter; use ratatui::{backend::CrosstermBackend, Terminal}; use server::{Server, TaskMetadata}; use std::borrow::Cow; @@ -210,6 +211,7 @@ fn init_tracing(debug: bool) -> Result<()> { .with(tui_logger_layer.and_then(log_file_layer)) .with(context_layer) .init(); + tui_logger::init_logger(LevelFilter::Debug); info!("Started in debug mode, logging to {:?}.", log_file_name); } else { // TODO: Confirm if this filter is correct. @@ -219,6 +221,7 @@ fn init_tracing(debug: bool) -> Result<()> { .with(tui_logger_layer) .with(context_layer) .init(); + tui_logger::init_logger(LevelFilter::Debug); } Ok(()) } diff --git a/youtui/src/app/ui/browser.rs b/youtui/src/app/ui/browser.rs index 0708f37..a7655d9 100644 --- a/youtui/src/app/ui/browser.rs +++ b/youtui/src/app/ui/browser.rs @@ -267,7 +267,10 @@ impl Browser { } pub async fn async_update(&mut self) -> StateMutationBundle { // TODO: Size - self.async_tx.get_next_mutations(10).await + tokio::select! { + browser = self.async_tx.get_next_mutations(10) => browser, + search = self.artist_list.search.async_tx.get_next_mutations(10) => search.map(|b: &mut Self| &mut b.artist_list.search), + } } fn left(&mut self) { // Doesn't consider previous routing. diff --git a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs index 9296258..36b5f10 100644 --- a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs +++ b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs @@ -41,7 +41,7 @@ pub struct SearchBlock { pub search_contents: TextInputState, pub search_suggestions: Vec, pub suggestions_cur: Option, - async_tx: AsyncCallbackSender, + pub async_tx: AsyncCallbackSender, } #[derive(Clone, Debug, PartialEq)] diff --git a/youtui/src/app/ui/browser/draw.rs b/youtui/src/app/ui/browser/draw.rs index 1dfcdda..8ef3bd0 100644 --- a/youtui/src/app/ui/browser/draw.rs +++ b/youtui/src/app/ui/browser/draw.rs @@ -120,14 +120,21 @@ fn draw_text_box( contents: &mut TextInputState, chunk: Rect, ) { + let block_widget = Block::default() + .borders(Borders::ALL) + .border_style(Style::default().fg(SELECTED_BORDER_COLOUR)) + .title(title.as_ref()); + let text_chunk = block_widget.inner(chunk); + let text_chunk = Rect { + x: text_chunk.x, + y: text_chunk.y, + width: text_chunk.width.saturating_sub(1), + height: text_chunk.height, + }; // TODO: Scrolling, if input larger than box. - let text_widget = TextInput::new().block( - Block::default() - .borders(Borders::ALL) - .border_style(Style::default().fg(SELECTED_BORDER_COLOUR)) - .title(title.as_ref()), - ); - f.render_stateful_widget(text_widget, chunk, contents); + let text_widget = TextInput::new(); + f.render_widget(block_widget, chunk); + f.render_stateful_widget(text_widget, text_chunk, contents); if let Some(cursor_pos) = contents.screen_cursor() { f.set_cursor_position(cursor_pos) }; From 1cf4620786a5e88aa929593c1220566df1e155bb Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 17:20:54 +0800 Subject: [PATCH 10/13] Fix - search suggestions stay after searching, cursor doesnt move to end after selecting --- youtui/src/app/ui/browser.rs | 1 + youtui/src/app/ui/browser/artistalbums/artistsearch.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/youtui/src/app/ui/browser.rs b/youtui/src/app/ui/browser.rs index a7655d9..6b885b2 100644 --- a/youtui/src/app/ui/browser.rs +++ b/youtui/src/app/ui/browser.rs @@ -429,6 +429,7 @@ impl Browser { async fn search(&mut self) { self.artist_list.close_search(); let search_query = self.artist_list.search.get_text().to_string(); + self.artist_list.clear_text(); let handler = |this: &mut Self, results| match results { Ok(artists) => { diff --git a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs index 36b5f10..43ed8b8 100644 --- a/youtui/src/app/ui/browser/artistalbums/artistsearch.rs +++ b/youtui/src/app/ui/browser/artistalbums/artistsearch.rs @@ -109,8 +109,10 @@ impl TextHandler for SearchBlock { } fn replace_text(&mut self, text: impl Into) { self.search_contents.set_text(text); + self.search_contents.move_to_line_end(false); } fn clear_text(&mut self) -> bool { + self.search_suggestions.clear(); self.search_contents.clear() } fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { @@ -180,7 +182,7 @@ impl SearchBlock { ); // Safe - clamped above // Clone is ok here as we want to duplicate the search suggestion. - self.search_contents.set_text( + self.replace_text( self.search_suggestions[self.suggestions_cur.expect("Set to non-None value above")] .get_text(), ); From b5324e568384186b066f7ba34048906fd690b988 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 19:46:44 +0800 Subject: [PATCH 11/13] Fix default loglevel, handle error initialising logging --- youtui/src/app.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/youtui/src/app.rs b/youtui/src/app.rs index 7066700..ad64fdd 100644 --- a/youtui/src/app.rs +++ b/youtui/src/app.rs @@ -211,17 +211,19 @@ fn init_tracing(debug: bool) -> Result<()> { .with(tui_logger_layer.and_then(log_file_layer)) .with(context_layer) .init(); - tui_logger::init_logger(LevelFilter::Debug); + tui_logger::init_logger(LevelFilter::Debug) + .expect("Expected logger to initialise succesfully"); info!("Started in debug mode, logging to {:?}.", log_file_name); } else { // TODO: Confirm if this filter is correct. let context_layer = - tracing_subscriber::filter::Targets::new().with_target("youtui", tracing::Level::TRACE); + tracing_subscriber::filter::Targets::new().with_target("youtui", tracing::Level::INFO); tracing_subscriber::registry() .with(tui_logger_layer) .with(context_layer) .init(); - tui_logger::init_logger(LevelFilter::Debug); + tui_logger::init_logger(LevelFilter::Info) + .expect("Expected logger to initialise succesfully"); } Ok(()) } From 31257a29e8288ed3ee7f4fc8237fc617619b4a56 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 19:47:20 +0800 Subject: [PATCH 12/13] Cargo fix --- youtui/src/app/component/actionhandler.rs | 2 +- youtui/src/app/ui/browser.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/youtui/src/app/component/actionhandler.rs b/youtui/src/app/component/actionhandler.rs index b8f689e..addebd7 100644 --- a/youtui/src/app/component/actionhandler.rs +++ b/youtui/src/app/component/actionhandler.rs @@ -1,5 +1,5 @@ use crate::app::keycommand::{CommandVisibility, DisplayableCommand, KeyCommand, Keymap}; -use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseEvent}; +use crossterm::event::{Event, KeyEvent, MouseEvent}; use std::borrow::Cow; use ytmapi_rs::common::SearchSuggestion; diff --git a/youtui/src/app/ui/browser.rs b/youtui/src/app/ui/browser.rs index 6b885b2..ca892fd 100644 --- a/youtui/src/app/ui/browser.rs +++ b/youtui/src/app/ui/browser.rs @@ -11,7 +11,7 @@ use crate::app::{ Action, ActionHandler, DominantKeyRouter, KeyRouter, Suggestable, TextHandler, }, server::{ - api::GetArtistSongsProgressUpdate, ArcServer, GetArtistSongs, GetSearchSuggestions, + api::GetArtistSongsProgressUpdate, ArcServer, GetArtistSongs, SearchArtists, Server, TaskMetadata, }, structures::{ListStatus, SongListComponent}, From 1020c170ed695f23c62a68b35d595cd1d0cd522f Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 22 Nov 2024 20:05:21 +0800 Subject: [PATCH 13/13] Clippy lints --- youtui/src/app/ui/draw.rs | 2 +- youtui/src/app/ui/footer.rs | 4 ++-- youtui/src/app/ui/logger.rs | 2 +- youtui/src/app/ui/playlist.rs | 2 +- youtui/src/app/view/draw.rs | 7 +++---- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/youtui/src/app/ui/draw.rs b/youtui/src/app/ui/draw.rs index 9aa275d..9fe9760 100644 --- a/youtui/src/app/ui/draw.rs +++ b/youtui/src/app/ui/draw.rs @@ -198,7 +198,7 @@ fn draw_generic_scrollable_table<'a, T: IntoIterator>>( let table_height = chunk.height.saturating_sub(4) as usize; let headings_iter = headings.iter().copied(); let table_widget = Table::new(table_items, layout) - .highlight_style(highlight_style()) + .row_highlight_style(highlight_style()) .header( Row::new(headings_iter).style( Style::default() diff --git a/youtui/src/app/ui/footer.rs b/youtui/src/app/ui/footer.rs index 37aee85..38b2930 100644 --- a/youtui/src/app/ui/footer.rs +++ b/youtui/src/app/ui/footer.rs @@ -9,7 +9,7 @@ use ratatui::{ prelude::Alignment, style::{Modifier, Style}, text::{Line, Span}, - widgets::{block::Title, Block, Borders, Gauge, Paragraph}, + widgets::{Block, Borders, Gauge, Paragraph}, Frame, }; @@ -112,7 +112,7 @@ pub fn draw_footer(f: &mut Frame, w: &super::YoutuiWindow, chunk: Rect) { let footer = Paragraph::new(vec![Line::from(song_title_string), Line::from(album_title)]); let block = Block::default() .title("Status") - .title(Title::from("Youtui").alignment(Alignment::Right)) + .title(Line::from("Youtui").right_aligned()) .borders(Borders::ALL); let block_inner = block.inner(chunk); let song_vol = Layout::default() diff --git a/youtui/src/app/ui/logger.rs b/youtui/src/app/ui/logger.rs index 8b5cda7..035a0b7 100644 --- a/youtui/src/app/ui/logger.rs +++ b/youtui/src/app/ui/logger.rs @@ -87,7 +87,7 @@ impl TextHandler for Logger { fn clear_text(&mut self) -> bool { false } - fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + fn handle_event_repr(&mut self, _event: &crossterm::event::Event) -> bool { false } } diff --git a/youtui/src/app/ui/playlist.rs b/youtui/src/app/ui/playlist.rs index 348beb6..b7fdf3c 100644 --- a/youtui/src/app/ui/playlist.rs +++ b/youtui/src/app/ui/playlist.rs @@ -113,7 +113,7 @@ impl TextHandler for Playlist { fn clear_text(&mut self) -> bool { false } - fn handle_event_repr(&mut self, event: &crossterm::event::Event) -> bool { + fn handle_event_repr(&mut self, _event: &crossterm::event::Event) -> bool { false } } diff --git a/youtui/src/app/view/draw.rs b/youtui/src/app/view/draw.rs index 505a367..156e862 100644 --- a/youtui/src/app/view/draw.rs +++ b/youtui/src/app/view/draw.rs @@ -14,7 +14,6 @@ use ratatui::{ symbols::{block, line}, text::Line, widgets::{ - block::{Position, Title}, Block, Borders, Cell, List, ListItem, ListState, Paragraph, Row, Scrollbar, ScrollbarOrientation, ScrollbarState, Table, TableState, }, @@ -60,7 +59,7 @@ pub fn draw_panel>( if let Some(s) = footer { let block = Block::new() .title(title.as_ref()) - .title(Title::from(s.as_ref()).position(Position::Bottom)) + .title_bottom(s.as_ref()) .borders(Borders::ALL) .border_style(Style::new().fg(border_colour)); let inner_chunk = block.inner(chunk); @@ -129,7 +128,7 @@ where ); // Minus block let heading_names = table.get_headings(); let table_widget = Table::new(table_items, table_widths) - .highlight_style(Style::default().bg(ROW_HIGHLIGHT_COLOUR)) + .row_highlight_style(Style::default().bg(ROW_HIGHLIGHT_COLOUR)) .header( Row::new(heading_names).style( Style::default() @@ -217,7 +216,7 @@ where filter_str }; let table_widget = Table::new(table_items, table_widths) - .highlight_style(Style::default().bg(ROW_HIGHLIGHT_COLOUR)) + .row_highlight_style(Style::default().bg(ROW_HIGHLIGHT_COLOUR)) .header( Row::new(combined_headings).style( Style::default()