Skip to content

Commit 28a849b

Browse files
authored
Merge pull request #90 from lusingander/ratatui
Update ratatui to 0.30.0
2 parents d575fb2 + 4f5c4dc commit 28a849b

16 files changed

Lines changed: 976 additions & 218 deletions

Cargo.lock

Lines changed: 928 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ license = "MIT"
1010
keywords = ["s3", "aws", "cli", "tui", "terminal"]
1111
categories = ["command-line-utilities"]
1212
edition = "2021"
13-
rust-version = "1.88.0"
13+
rust-version = "1.90.0"
1414

1515
exclude = ["/.github", "/img", "/tool", "Makefile", "/docs"]
1616

1717
[dependencies]
18-
ansi-to-tui = "7.0.0"
18+
ansi-to-tui = "8.0.0"
1919
anyhow = "1.0.100"
2020
arboard = { version = "3.6.1", features = ["wayland-data-control"] }
2121
aws-config = "1.8.11"
@@ -25,19 +25,22 @@ chardetng = "0.1.17"
2525
chrono = "0.4.42"
2626
clap = { version = "4.5.53", features = ["derive"] }
2727
console = "0.16.1"
28-
crossterm = { version = "0.28.1", features = ["event-stream"] }
28+
crossterm = { version = "0.29.0", features = ["event-stream"] }
2929
encoding_rs = "0.8.35"
3030
futures = "0.3.31"
3131
humansize = "2.1.3"
3232
image = "0.25.9"
3333
indexmap = { version = "2.12.1", features = ["serde"] }
3434
infer = "0.19.0"
3535
itsuki = "0.2.1"
36-
laurier = "0.2.0"
36+
laurier = "0.3.0"
3737
once_cell = "1.21.3"
3838
open = "5.3.3"
39-
ratatui = "0.29.0"
40-
ratatui-image = "8.0.1"
39+
ratatui = "0.30.0"
40+
ratatui-image = { version = "10.0.2", default-features = false, features = [
41+
"crossterm",
42+
"image-defaults",
43+
] }
4144
serde = { version = "1.0.219", features = ["derive"] }
4245
smart-default = "0.7.1"
4346
syntect = { version = "5.2.0", default-features = false, features = [
@@ -49,7 +52,7 @@ toml = "0.9.8"
4952
tracing = "0.1.41"
5053
tracing-log = "0.2.0"
5154
tracing-subscriber = { version = "0.3.20", features = ["chrono"] }
52-
tui-input = "0.14.0"
55+
tui-input = "0.15.0"
5356
umbra = "0.4.0"
5457

5558
[dev-dependencies]

src/environment.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ fn build_image_picker(image_preview_enabled: bool, fix_dynamic_values: bool) ->
2727
// - font size cannot be obtained with xterm.js
2828
// - want to fix the protocol to iterm2
2929
// so changed the settings if fix_dynamic_values is true
30+
#[allow(deprecated)]
3031
let mut picker = ratatui_image::picker::Picker::from_fontsize((10, 20));
3132
picker.set_protocol_type(ratatui_image::picker::ProtocolType::Iterm2);
3233
return ImagePicker::Ok(picker);

src/pages/bucket_list.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ mod tests {
764764
};
765765

766766
#[tokio::test]
767-
async fn test_render_without_scroll() -> std::io::Result<()> {
767+
async fn test_render_without_scroll() -> Result<(), core::convert::Infallible> {
768768
let ctx = Rc::default();
769769
let tx = sender();
770770
let mut terminal = setup_terminal()?;
@@ -802,7 +802,7 @@ mod tests {
802802
}
803803

804804
#[tokio::test]
805-
async fn test_render_with_scroll() -> std::io::Result<()> {
805+
async fn test_render_with_scroll() -> Result<(), core::convert::Infallible> {
806806
let ctx = Rc::default();
807807
let tx = sender();
808808
let mut terminal = setup_terminal()?;
@@ -840,7 +840,7 @@ mod tests {
840840
}
841841

842842
#[tokio::test]
843-
async fn test_render_filter_items() -> std::io::Result<()> {
843+
async fn test_render_filter_items() -> Result<(), core::convert::Infallible> {
844844
let ctx = Rc::default();
845845
let tx = sender();
846846
let mut terminal = setup_terminal()?;
@@ -923,7 +923,7 @@ mod tests {
923923
}
924924

925925
#[tokio::test]
926-
async fn test_render_sort_items() -> std::io::Result<()> {
926+
async fn test_render_sort_items() -> Result<(), core::convert::Infallible> {
927927
let ctx = Rc::default();
928928
let tx = sender();
929929
let mut terminal = setup_terminal()?;
@@ -1146,7 +1146,7 @@ mod tests {
11461146
assert_eq!(page.view_indices, vec![0, 4]);
11471147
}
11481148

1149-
fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
1149+
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
11501150
let backend = TestBackend::new(30, 10);
11511151
let mut terminal = Terminal::new(backend)?;
11521152
terminal.clear()?;

src/pages/help.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ mod tests {
186186
use ratatui::{backend::TestBackend, buffer::Buffer, text::Span, Terminal};
187187

188188
#[tokio::test]
189-
async fn test_render() -> std::io::Result<()> {
189+
async fn test_render() -> Result<(), core::convert::Infallible> {
190190
let ctx = Rc::default();
191191
let tx = sender();
192192
let mut terminal = setup_terminal()?;
@@ -241,7 +241,7 @@ mod tests {
241241
Ok(())
242242
}
243243

244-
fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
244+
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
245245
let backend = TestBackend::new(70, 20);
246246
let mut terminal = Terminal::new(backend)?;
247247
terminal.clear()?;

src/pages/initializing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mod tests {
4646
use ratatui::{backend::TestBackend, buffer::Buffer, Terminal};
4747

4848
#[tokio::test]
49-
async fn test_render() -> std::io::Result<()> {
49+
async fn test_render() -> Result<(), core::convert::Infallible> {
5050
let ctx = Rc::default();
5151
let tx = sender();
5252
let mut terminal = setup_terminal()?;
@@ -76,7 +76,7 @@ mod tests {
7676
Ok(())
7777
}
7878

79-
fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
79+
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
8080
let backend = TestBackend::new(30, 10);
8181
let mut terminal = Terminal::new(backend)?;
8282
terminal.clear()?;

src/pages/object_detail.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ mod tests {
829829
use ratatui::{backend::TestBackend, buffer::Buffer, crossterm::event::KeyCode, Terminal};
830830

831831
#[tokio::test]
832-
async fn test_render_detail_tab() -> std::io::Result<()> {
832+
async fn test_render_detail_tab() -> Result<(), core::convert::Infallible> {
833833
let ctx = Rc::default();
834834
let tx = sender();
835835
let mut terminal = setup_terminal()?;
@@ -895,7 +895,7 @@ mod tests {
895895
}
896896

897897
#[tokio::test]
898-
async fn test_render_detail_tab_with_config() -> std::io::Result<()> {
898+
async fn test_render_detail_tab_with_config() -> Result<(), core::convert::Infallible> {
899899
let tx = sender();
900900
let mut terminal = setup_terminal()?;
901901

@@ -962,7 +962,7 @@ mod tests {
962962
}
963963

964964
#[tokio::test]
965-
async fn test_render_version_tab() -> std::io::Result<()> {
965+
async fn test_render_version_tab() -> Result<(), core::convert::Infallible> {
966966
let ctx = Rc::default();
967967
let tx = sender();
968968
let mut terminal = setup_terminal()?;
@@ -1030,7 +1030,7 @@ mod tests {
10301030
}
10311031

10321032
#[tokio::test]
1033-
async fn test_render_version_tab_with_config() -> std::io::Result<()> {
1033+
async fn test_render_version_tab_with_config() -> Result<(), core::convert::Infallible> {
10341034
let tx = sender();
10351035
let mut terminal = setup_terminal()?;
10361036

@@ -1099,7 +1099,7 @@ mod tests {
10991099
}
11001100

11011101
#[tokio::test]
1102-
async fn test_render_save_dialog_detail_tab() -> std::io::Result<()> {
1102+
async fn test_render_save_dialog_detail_tab() -> Result<(), core::convert::Infallible> {
11031103
let ctx = Rc::default();
11041104
let tx = sender();
11051105
let mut terminal = setup_terminal()?;
@@ -1164,7 +1164,7 @@ mod tests {
11641164
}
11651165

11661166
#[tokio::test]
1167-
async fn test_render_copy_detail_dialog_detail_tab() -> std::io::Result<()> {
1167+
async fn test_render_copy_detail_dialog_detail_tab() -> Result<(), core::convert::Infallible> {
11681168
let ctx = Rc::default();
11691169
let tx = sender();
11701170
let mut terminal = setup_terminal()?;
@@ -1235,7 +1235,7 @@ mod tests {
12351235
}
12361236

12371237
#[tokio::test]
1238-
async fn test_render_copy_detail_dialog_version_tab() -> std::io::Result<()> {
1238+
async fn test_render_copy_detail_dialog_version_tab() -> Result<(), core::convert::Infallible> {
12391239
let ctx = Rc::default();
12401240
let tx = sender();
12411241
let mut terminal = setup_terminal()?;
@@ -1319,7 +1319,7 @@ mod tests {
13191319
Ok(())
13201320
}
13211321

1322-
fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
1322+
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
13231323
let backend = TestBackend::new(60, 20);
13241324
let mut terminal = Terminal::new(backend)?;
13251325
terminal.clear()?;

src/pages/object_list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ mod tests {
961961
};
962962

963963
#[tokio::test]
964-
async fn test_render_without_scroll() -> std::io::Result<()> {
964+
async fn test_render_without_scroll() -> Result<(), core::convert::Infallible> {
965965
let ctx = Rc::default();
966966
let tx = sender();
967967
let mut terminal = setup_terminal()?;
@@ -1008,7 +1008,7 @@ mod tests {
10081008
}
10091009

10101010
#[tokio::test]
1011-
async fn test_render_with_scroll() -> std::io::Result<()> {
1011+
async fn test_render_with_scroll() -> Result<(), core::convert::Infallible> {
10121012
let ctx = Rc::default();
10131013
let tx = sender();
10141014
let mut terminal = setup_terminal()?;
@@ -1050,7 +1050,7 @@ mod tests {
10501050
}
10511051

10521052
#[tokio::test]
1053-
async fn test_render_with_config() -> std::io::Result<()> {
1053+
async fn test_render_with_config() -> Result<(), core::convert::Infallible> {
10541054
let tx = sender();
10551055
let mut terminal = setup_terminal()?;
10561056

@@ -1167,7 +1167,7 @@ mod tests {
11671167
assert_eq!(page.view_indices, vec![3, 1, 4, 0, 2]);
11681168
}
11691169

1170-
fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
1170+
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
11711171
let backend = TestBackend::new(60, 10);
11721172
let mut terminal = Terminal::new(backend)?;
11731173
terminal.clear()?;

src/pages/object_preview.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ mod tests {
435435
}
436436

437437
#[tokio::test]
438-
async fn test_render_without_scroll() -> std::io::Result<()> {
438+
async fn test_render_without_scroll() -> Result<(), core::convert::Infallible> {
439439
let ctx = Rc::default();
440440
let tx = sender();
441441
let mut terminal = setup_terminal()?;
@@ -477,7 +477,7 @@ mod tests {
477477
}
478478

479479
#[tokio::test]
480-
async fn test_render_with_scroll() -> std::io::Result<()> {
480+
async fn test_render_with_scroll() -> Result<(), core::convert::Infallible> {
481481
let ctx = Rc::default();
482482
let tx = sender();
483483
let mut terminal = setup_terminal()?;
@@ -514,7 +514,7 @@ mod tests {
514514
}
515515

516516
#[tokio::test]
517-
async fn test_render_save_dialog_without_scroll() -> std::io::Result<()> {
517+
async fn test_render_save_dialog_without_scroll() -> Result<(), core::convert::Infallible> {
518518
let ctx = Rc::default();
519519
let tx = sender();
520520
let mut terminal = setup_terminal()?;
@@ -563,7 +563,7 @@ mod tests {
563563
.unwrap()
564564
}
565565

566-
fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
566+
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
567567
let backend = TestBackend::new(30, 10);
568568
let mut terminal = Terminal::new(backend)?;
569569
terminal.clear()?;

src/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
pages::page::Page,
99
};
1010

11-
pub async fn run<B: Backend>(
11+
pub async fn run<B: Backend<Error = std::io::Error>>(
1212
app: &mut App,
1313
terminal: &mut Terminal<B>,
1414
mut rx: Receiver,

0 commit comments

Comments
 (0)