Commit af96bfbb41

af96bfbb41a8d165776f7e463c8fdc9d3804d4fc

parent: 5f927ce9c3

Unregistered key

Ulyssa <git@ulyssa.dev> · 2025-05-17 01:02 UTC
committer: <noreply@github.com>

Update to latest `modalkit`, `modalkit-ratatui` and `ratatui-image` (#422)

Layout: unified · split

Cargo.lock +80 −32
@@ -564,6 +564,12 @@ dependencies = [
564564 "rustc-demangle",
565565]
566566
567[[package]]
568name = "base64"
569version = "0.21.7"
570source = "registry+https://github.com/rust-lang/crates.io-index"
571checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
572
567573[[package]]
568574name = "base64"
569575version = "0.22.1"
@@ -1452,12 +1458,6 @@ version = "1.2.1"
14521458source = "registry+https://github.com/rust-lang/crates.io-index"
14531459checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
14541460
1455[[package]]
1456name = "dyn-clone"
1457version = "1.0.17"
1458source = "registry+https://github.com/rust-lang/crates.io-index"
1459checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
1460
14611461[[package]]
14621462name = "ed25519"
14631463version = "2.2.3"
@@ -2505,9 +2505,9 @@ dependencies = [
25052505
25062506[[package]]
25072507name = "image"
2508version = "0.25.2"
2508version = "0.25.6"
25092509source = "registry+https://github.com/rust-lang/crates.io-index"
2510checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10"
2510checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a"
25112511dependencies = [
25122512 "bytemuck",
25132513 "byteorder-lite",
@@ -2528,9 +2528,9 @@ dependencies = [
25282528
25292529[[package]]
25302530name = "image-webp"
2531version = "0.1.3"
2531version = "0.2.1"
25322532source = "registry+https://github.com/rust-lang/crates.io-index"
2533checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904"
2533checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f"
25342534dependencies = [
25352535 "byteorder-lite",
25362536 "quick-error",
@@ -2785,7 +2785,8 @@ dependencies = [
27852785[[package]]
27862786name = "keybindings"
27872787version = "0.0.1"
2788source = "git+https://github.com/ulyssa/modalkit?rev=45855daeeb7081eec626a8f9cf657f0fc2ff0a7a#45855daeeb7081eec626a8f9cf657f0fc2ff0a7a"
2788source = "registry+https://github.com/rust-lang/crates.io-index"
2789checksum = "680e4699c91c0622dd70da32c274881aadb1ac86252d738c3641266e90e4ca15"
27892790dependencies = [
27902791 "textwrap",
27912792 "unicode-segmentation",
@@ -3227,7 +3228,7 @@ checksum = "da30f51dbfcd03297a04f49f92c365a41cb2b012ad3338c0fc5d4efafcbff88b"
32273228dependencies = [
32283229 "anyhow",
32293230 "async-trait",
3230 "base64",
3231 "base64 0.22.1",
32313232 "getrandom 0.2.15",
32323233 "gloo-utils",
32333234 "hkdf",
@@ -3277,7 +3278,7 @@ version = "0.10.0"
32773278source = "registry+https://github.com/rust-lang/crates.io-index"
32783279checksum = "dcc8b6650757f953664e5f906988690cef05c09d83081946adce446c45810a2d"
32793280dependencies = [
3280 "base64",
3281 "base64 0.22.1",
32813282 "blake3",
32823283 "chacha20poly1305",
32833284 "hmac",
@@ -3298,6 +3299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32983299checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519"
32993300dependencies = [
33003301 "cfg-if",
3302 "rayon",
33013303]
33023304
33033305[[package]]
@@ -3394,8 +3396,9 @@ dependencies = [
33943396
33953397[[package]]
33963398name = "modalkit"
3397version = "0.0.20"
3398source = "git+https://github.com/ulyssa/modalkit?rev=45855daeeb7081eec626a8f9cf657f0fc2ff0a7a#45855daeeb7081eec626a8f9cf657f0fc2ff0a7a"
3399version = "0.0.21"
3400source = "registry+https://github.com/rust-lang/crates.io-index"
3401checksum = "dc7599fc1bcd2f0a0b4598f23433b45613345a46419ab27d3a9adecb57acd648"
33993402dependencies = [
34003403 "anymap2",
34013404 "arboard",
@@ -3415,8 +3418,9 @@ dependencies = [
34153418
34163419[[package]]
34173420name = "modalkit-ratatui"
3418version = "0.0.20"
3419source = "git+https://github.com/ulyssa/modalkit?rev=45855daeeb7081eec626a8f9cf657f0fc2ff0a7a#45855daeeb7081eec626a8f9cf657f0fc2ff0a7a"
3421version = "0.0.21"
3422source = "registry+https://github.com/rust-lang/crates.io-index"
3423checksum = "dd3d88c86435d4b1fb22c7c0f978b09cb888338cafc10336715aa5070e92b6f6"
34203424dependencies = [
34213425 "crossterm",
34223426 "intervaltree",
@@ -4367,39 +4371,40 @@ dependencies = [
43674371
43684372[[package]]
43694373name = "ratatui"
4370version = "0.28.1"
4374version = "0.29.0"
43714375source = "registry+https://github.com/rust-lang/crates.io-index"
4372checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d"
4376checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
43734377dependencies = [
43744378 "bitflags 2.8.0",
43754379 "cassowary",
43764380 "compact_str",
43774381 "crossterm",
4382 "indoc",
43784383 "instability",
43794384 "itertools 0.13.0",
43804385 "lru",
43814386 "paste",
43824387 "strum",
4383 "strum_macros",
43844388 "unicode-segmentation",
43854389 "unicode-truncate",
4386 "unicode-width 0.1.13",
4390 "unicode-width 0.2.0",
43874391]
43884392
43894393[[package]]
43904394name = "ratatui-image"
4391version = "1.0.5"
4395version = "6.0.0"
43924396source = "registry+https://github.com/rust-lang/crates.io-index"
4393checksum = "de94276254cb20fb7431726875bd2ac6391a6ffc26f4b8e3d23f79d1286b491e"
4397checksum = "d6f868820aabfce698e69639620ab9100f2ca29319ba960b9ba218482065489d"
43944398dependencies = [
4395 "base64",
4396 "dyn-clone",
4399 "base64 0.21.7",
43974400 "icy_sixel",
43984401 "image",
43994402 "rand 0.8.5",
44004403 "ratatui",
44014404 "rustix 0.38.44",
44024405 "serde",
4406 "thiserror 1.0.63",
4407 "windows 0.58.0",
44034408]
44044409
44054410[[package]]
@@ -4448,6 +4453,7 @@ dependencies = [
44484453 "loop9",
44494454 "quick-error",
44504455 "rav1e",
4456 "rayon",
44514457 "rgb",
44524458]
44534459
@@ -4551,7 +4557,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
45514557checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da"
45524558dependencies = [
45534559 "async-compression",
4554 "base64",
4560 "base64 0.22.1",
45554561 "bytes",
45564562 "futures-core",
45574563 "futures-util",
@@ -4599,9 +4605,6 @@ name = "rgb"
45994605version = "0.8.50"
46004606source = "registry+https://github.com/rust-lang/crates.io-index"
46014607checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a"
4602dependencies = [
4603 "bytemuck",
4604]
46054608
46064609[[package]]
46074610name = "ring"
@@ -4718,7 +4721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
47184721checksum = "1058c04b8dd62f4fba71c9f65112fb79bc332438d11aefe1e8edf67b7fb58a98"
47194722dependencies = [
47204723 "as_variant",
4721 "base64",
4724 "base64 0.22.1",
47224725 "bytes",
47234726 "form_urlencoded",
47244727 "getrandom 0.2.15",
@@ -5418,7 +5421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
54185421checksum = "006851c9ccefa3c38a7646b8cec804bb429def3da10497bfa977179869c3e8e2"
54195422dependencies = [
54205423 "quick-xml 0.30.0",
5421 "windows",
5424 "windows 0.51.1",
54225425]
54235426
54245427[[package]]
@@ -6053,7 +6056,7 @@ checksum = "c022a277687e4e8685d72b95a7ca3ccfec907daa946678e715f8badaa650883d"
60536056dependencies = [
60546057 "aes",
60556058 "arrayvec",
6056 "base64",
6059 "base64 0.22.1",
60576060 "base64ct",
60586061 "cbc",
60596062 "chacha20poly1305",
@@ -6343,6 +6346,16 @@ dependencies = [
63436346 "windows-targets 0.48.5",
63446347]
63456348
6349[[package]]
6350name = "windows"
6351version = "0.58.0"
6352source = "registry+https://github.com/rust-lang/crates.io-index"
6353checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
6354dependencies = [
6355 "windows-core 0.58.0",
6356 "windows-targets 0.52.6",
6357]
6358
63466359[[package]]
63476360name = "windows-core"
63486361version = "0.51.1"
@@ -6361,6 +6374,41 @@ dependencies = [
63616374 "windows-targets 0.52.6",
63626375]
63636376
6377[[package]]
6378name = "windows-core"
6379version = "0.58.0"
6380source = "registry+https://github.com/rust-lang/crates.io-index"
6381checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
6382dependencies = [
6383 "windows-implement",
6384 "windows-interface",
6385 "windows-result",
6386 "windows-strings",
6387 "windows-targets 0.52.6",
6388]
6389
6390[[package]]
6391name = "windows-implement"
6392version = "0.58.0"
6393source = "registry+https://github.com/rust-lang/crates.io-index"
6394checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
6395dependencies = [
6396 "proc-macro2",
6397 "quote",
6398 "syn 2.0.90",
6399]
6400
6401[[package]]
6402name = "windows-interface"
6403version = "0.58.0"
6404source = "registry+https://github.com/rust-lang/crates.io-index"
6405checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
6406dependencies = [
6407 "proc-macro2",
6408 "quote",
6409 "syn 2.0.90",
6410]
6411
63646412[[package]]
63656413name = "windows-registry"
63666414version = "0.2.0"
Cargo.toml +9 −7
@@ -37,7 +37,7 @@ emojis = "0.5"
3737futures = "0.3"
3838gethostname = "0.4.1"
3939html5ever = "0.26.0"
40image = "0.25.2"
40image = "^0.25.6"
4141libc = "0.2"
4242markup5ever_rcdom = "0.2.0"
4343mime = "^0.3.16"
@@ -45,8 +45,8 @@ mime_guess = "^2.0.4"
4545nom = "7.0.0"
4646open = "3.2.0"
4747rand = "0.8.5"
48ratatui = "0.28.1"
49ratatui-image = { version = "=1.0.5", features = ["serde"] }
48ratatui = "0.29.0"
49ratatui-image = { version = "~6.0.0", features = ["serde"] }
5050regex = "^1.5"
5151rpassword = "^7.2"
5252serde = "^1.0"
@@ -76,13 +76,15 @@ features = ["zbus", "serde"]
7676optional = true
7777
7878[dependencies.modalkit]
79version = "0.0.21"
7980default-features = false
80git = "https://github.com/ulyssa/modalkit"
81rev = "45855daeeb7081eec626a8f9cf657f0fc2ff0a7a"
81#git = "https://github.com/ulyssa/modalkit"
82#rev = "e40dbb0bfeabe4cfd08facd2acb446080a330d75"
8283
8384[dependencies.modalkit-ratatui]
84git = "https://github.com/ulyssa/modalkit"
85rev = "45855daeeb7081eec626a8f9cf657f0fc2ff0a7a"
85version = "0.0.21"
86#git = "https://github.com/ulyssa/modalkit"
87#rev = "e40dbb0bfeabe4cfd08facd2acb446080a330d75"
8688
8789[dependencies.matrix-sdk]
8890version = "0.10.0"
src/base.rs +4 −8
@@ -1319,7 +1319,7 @@ fn emoji_map() -> CompletionMap<String, &'static Emoji> {
13191319
13201320#[cfg(unix)]
13211321fn picker_from_termios(protocol_type: Option<ProtocolType>) -> Option<Picker> {
1322 let mut picker = match Picker::from_termios() {
1322 let mut picker = match Picker::from_query_stdio() {
13231323 Ok(picker) => picker,
13241324 Err(e) => {
13251325 tracing::error!("Failed to setup image previews: {e}");
@@ -1327,12 +1327,8 @@ fn picker_from_termios(protocol_type: Option<ProtocolType>) -> Option<Picker> {
13271327 },
13281328 };
13291329
1330 // `guess_protocol` also does tmux detection,
1331 // run it always then overwrite the guessed protocol if needed
1332 picker.guess_protocol();
1333
13341330 if let Some(protocol_type) = protocol_type {
1335 picker.protocol_type = protocol_type;
1331 picker.set_protocol_type(protocol_type);
13361332 }
13371333
13381334 Some(picker)
@@ -1355,8 +1351,8 @@ fn picker_from_settings(settings: &ApplicationSettings) -> Option<Picker> {
13551351 }) = image_preview_protocol
13561352 {
13571353 // User forced type and font_size: use that.
1358 let mut picker = Picker::new(font_size);
1359 picker.protocol_type = protocol_type;
1354 let mut picker = Picker::from_fontsize(font_size);
1355 picker.set_protocol_type(protocol_type);
13601356 Some(picker)
13611357 } else {
13621358 // Guess, but use type if forced.
src/message/mod.rs +5 −5
@@ -70,7 +70,7 @@ mod printer;
7070
7171pub use self::compose::text_to_message;
7272
73type ProtocolPreview<'a> = (&'a dyn Protocol, u16, u16);
73type ProtocolPreview<'a> = (&'a Protocol, u16, u16);
7474
7575pub type MessageKey = (MessageTimeStamp, OwnedEventId);
7676
@@ -826,7 +826,7 @@ impl<'a> MessageFormatter<'a> {
826826pub enum ImageStatus {
827827 None,
828828 Downloading(ImagePreviewSize),
829 Loaded(Box<dyn Protocol>),
829 Loaded(Protocol),
830830 Error(String),
831831}
832832
@@ -1046,7 +1046,7 @@ impl Message {
10461046 style: Style,
10471047 hide_reply: bool,
10481048 emoji_shortcodes: bool,
1049 ) -> (Text, Option<&dyn Protocol>) {
1049 ) -> (Text, Option<&Protocol>) {
10501050 if let Some(html) = &self.html {
10511051 (html.to_text(width, style, hide_reply, emoji_shortcodes), None)
10521052 } else {
@@ -1066,8 +1066,8 @@ impl Message {
10661066 placeholder_frame(Some("Downloading..."), width, image_preview_size)
10671067 },
10681068 ImageStatus::Loaded(backend) => {
1069 proto = Some(backend.as_ref());
1070 placeholder_frame(Some("Loading..."), width, &backend.rect().into())
1069 proto = Some(backend);
1070 placeholder_frame(Some("Loading..."), width, &backend.area().into())
10711071 },
10721072 ImageStatus::Error(err) => Some(format!("[Image error: {err}]\n")),
10731073 };
src/windows/room/scrollback.rs +1 −1
@@ -1402,7 +1402,7 @@ impl<'a> StatefulWidget for Scrollback<'a> {
14021402 // line.
14031403 for (x, y, backend) in image_previews {
14041404 let image_widget = Image::new(backend);
1405 let mut rect = backend.rect();
1405 let mut rect = backend.area();
14061406 rect.x = x;
14071407 rect.y = y;
14081408 // Don't render outside of scrollback area