Skip to content

Commit de29258

Browse files
committed
Update ratatui to 0.30.0, and relevant dependencies.
1 parent 07913ad commit de29258

8 files changed

Lines changed: 617 additions & 197 deletions

File tree

Cargo.lock

Lines changed: 568 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: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ yap-full = ["yap-lite", "espflash", "defmt-watch"]
3434
yap-lite = ["logging", "macros"]
3535

3636
[dependencies]
37-
ansi-to-tui = { git = "https://github.com/nullstalgia/ansi-to-tui", branch = "lossy_and_line_endings" }
38-
# ansi-to-tui = { path = "../ansi-to-tui" }
37+
# ansi-to-tui = { git = "https://github.com/nullstalgia/ansi-to-tui", branch = "lossy_and_line_endings" }
38+
ansi-to-tui = { path = "../ansi-to-tui" }
3939
# ansi-to-tui = "7.0.0"
4040
arboard = { version = "3.6.0", features = ["wayland-data-control"] }
4141
arc-swap = "1.7.1"
@@ -48,9 +48,9 @@ color-eyre = "0.6.3"
4848
# color-eyre = { path = "/home/tony/git/eyre/color-eyre/" }
4949
compact_str = { version = "0.9.0", features = ["serde"] }
5050
# crokey = { path = "../crokey", features = ["serde"] }
51-
crokey = { version = "=1.1.2", features = ["serde"] }
51+
crokey = { version = "=1.4.0", features = ["serde"] }
5252
crossbeam = "0.8.4"
53-
crossterm = "=0.28.1"
53+
crossterm = "0.29"
5454
# defmt-decoder = { version = "1.0.0", optional = true }
5555
# these are slightly more updated than the versions on crates.io
5656
defmt-decoder = { git = "https://github.com/knurling-rs/defmt", package = "defmt-decoder", optional = true, rev = "d52b9908c175497d46fc527f4f8dfd6278744f09" }
@@ -65,7 +65,7 @@ espflash = { version = "=4.3.0", optional = true, default-features = false, feat
6565
# espflash = { path = "../espflash/espflash", optional = true, features = ["serialport"], default-features = false }
6666
fs-err = "3.1.0"
6767
hex = "0.4.3"
68-
http = "1.3.1"
68+
http = "1.3.1" # TODO make optional
6969
human-panic = "2.0.2"
7070
indexmap = { version = "2.9.0", features = ["serde"] }
7171
# int-enum = { git = "https://github.com/nullstalgia/int-enum-rs", branch = "feat/colors-and-discriminators" }
@@ -84,11 +84,12 @@ num-integer = "0.1.46"
8484
opener = "0.8.2"
8585
# log = "0.4.25"
8686
# num_enum = "0.7.3"
87-
ratatui = { version = "0.29.0", features = ["unstable-rendered-line-info"] }
88-
ratatui-explorer = { version = "0.2.1", optional = true }
89-
ratatui-macros = "0.6.0"
87+
ratatui = { version = "0.30.0", features = ["unstable-rendered-line-info"] }
88+
ratatui-explorer = { version = "0.3.0", optional = true }
89+
ratatui-macros = "0.7.0"
90+
ratatui-widgets = "0.3.0"
9091
regex = "1.11.1"
91-
reqwest = "0.12.22"
92+
reqwest = "0.12.22" # TODO make optional
9293
# regex-lite = "0.1.6"
9394
rolling-file = "0.2.0"
9495
self-replace = { version = "1.5.0", optional = true }
@@ -104,17 +105,18 @@ strum = { version = "0.27", features = ["derive"] }
104105
takeable = "0.2.2"
105106
# TODO update once ratatui's exposed crossterm updates
106107
# but these work for now.
107-
terminput = "0.4.2"
108-
terminput-crossterm = "0.1.2"
108+
terminput = "0.5"
109+
terminput-crossterm = "0.4"
109110
textwrap = "0.16.2"
110111
thiserror = "2.0.12"
111112
tinyvec = { version = "1.9.0", features = ["std"] }
112113
toml = "0.8.21"
113114
tracing = { version = "0.1.41", features = ["log"] }
114115
tracing-appender = "0.2.3"
115116
tracing-subscriber = { version = "0.3.19", features = ["chrono", "env-filter"] }
116-
tui-big-text = "0.7.1"
117-
tui-input = "0.14"
117+
tui-big-text = "0.8"
118+
# tui-input = "0.15"
119+
tui-input = { path = "../tui-input" }
118120
# unescaper = "0.1.5"
119121
unicode-width = "0.2.0"
120122
virtual-serialport = "0.1.3"

src/app.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,12 @@ impl App {
585585
self.state == RunningState::Running
586586
}
587587
// All prep has been complete, begin main loop.
588-
pub fn run(&mut self, mut terminal: Terminal<impl Backend>) -> Result<()> {
588+
pub fn run<B>(&mut self, mut terminal: Terminal<B>) -> Result<()>
589+
where
590+
B: Backend,
591+
<B as ratatui::backend::Backend>::Error: Sync + Send + 'static,
592+
std::io::Error: From<<B as ratatui::backend::Backend>::Error>,
593+
{
589594
if self.allow_first_time_setup {
590595
self.first_time_setup();
591596
}
@@ -695,7 +700,12 @@ impl App {
695700
}
696701
final_app_result
697702
}
698-
fn handle_event(&mut self, event: Event, terminal: &mut Terminal<impl Backend>) -> Result<()> {
703+
fn handle_event<B>(&mut self, event: Event, terminal: &mut Terminal<B>) -> Result<()>
704+
where
705+
B: Backend,
706+
<B as ratatui::backend::Backend>::Error: Sync + Send + 'static,
707+
std::io::Error: From<<B as ratatui::backend::Backend>::Error>,
708+
{
699709
match event {
700710
Event::Quit => self.shutdown(),
701711

@@ -3158,7 +3168,11 @@ impl App {
31583168

31593169
self.popup_menu_scroll = self.current_popup_selectable_item_count().saturating_sub(1);
31603170
}
3161-
pub fn draw(&mut self, terminal: &mut Terminal<impl Backend>) -> Result<()> {
3171+
pub fn draw<B>(&mut self, terminal: &mut Terminal<B>) -> Result<()>
3172+
where
3173+
B: Backend,
3174+
<B as ratatui::backend::Backend>::Error: Sync + Send + 'static,
3175+
{
31623176
// let start = Instant::now();
31633177
terminal.draw(|frame| self.render_app(frame))?;
31643178
// debug!("A4: {:?}", start.elapsed());
@@ -3325,7 +3339,7 @@ impl App {
33253339
}
33263340
Popup::SerialConnectionFailed(error) => {
33273341
let title = "Error connecting to port!";
3328-
let title_line = Line::styled(title, Style::new().reset());
3342+
let title_line = Line::styled(title, Style::reset());
33293343
let block = Block::bordered()
33303344
.border_style(Style::new().red())
33313345
.title_top(title_line)
@@ -3592,7 +3606,7 @@ impl App {
35923606
bottom_sep_line_area,
35933607
);
35943608

3595-
let scrollbar_style = Style::new().reset();
3609+
let scrollbar_style = Style::reset();
35963610

35973611
let scrollbar = Scrollbar::new(ScrollbarOrientation::VerticalRight)
35983612
.style(scrollbar_style)
@@ -4916,7 +4930,7 @@ impl App {
49164930
frame.render_widget(Line::from(more_options_button).centered(), more_options);
49174931
}
49184932

4919-
let scrollbar_style = Style::new().reset();
4933+
let scrollbar_style = Style::reset();
49204934

49214935
let scrollbar = Scrollbar::new(ScrollbarOrientation::VerticalRight)
49224936
.style(scrollbar_style)

src/buffer/buf_line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{borrow::Cow, ops::Range};
33
use chrono::{DateTime, Local};
44
use compact_str::{CompactString, format_compact};
55
use ratatui::{
6-
style::{Style, Stylize},
6+
style::Style,
77
text::{Line, Span},
88
widgets::{Paragraph, Wrap},
99
};

src/buffer/tui.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,15 @@ impl Buffer {
334334
self.styled_lines.rx.len()
335335
}
336336

337-
pub fn update_terminal_size(
337+
pub fn update_terminal_size<B>(
338338
&mut self,
339-
terminal: &mut ratatui::Terminal<impl ratatui::prelude::Backend>,
340-
) -> std::io::Result<()> {
339+
terminal: &mut ratatui::Terminal<B>,
340+
) -> std::io::Result<()>
341+
where
342+
B: Backend,
343+
<B as ratatui::backend::Backend>::Error: Sync + Send + 'static,
344+
std::io::Error: From<<B as ratatui::backend::Backend>::Error>,
345+
{
341346
self.last_terminal_size = {
342347
let mut terminal_size = terminal.size()?;
343348
// `2` is the lines from the repeating_pattern_widget and the input buffer.
@@ -561,7 +566,7 @@ impl Buffer {
561566
if self.combined_height() > hex_area.height as usize {
562567
let vert_block = Block::new()
563568
.borders(Borders::LEFT)
564-
.border_style(Style::new().reset());
569+
.border_style(Style::reset());
565570

566571
vert_block.render(
567572
Rect {

src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{borrow::Cow, collections::BTreeMap, ops::Range};
55
use crate::buffer::{HEX_UPPER, LineEnding};
66
use itertools::Itertools;
77
use ratatui::{
8-
style::{Style, Stylize},
8+
style::Style,
99
text::{Line, Span},
1010
};
1111

src/tui/prompts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crokey::crossterm::event::KeyCode;
44
use ratatui::{
55
Frame,
66
layout::{Alignment, Constraint, Rect},
7-
style::{Color, Style, Stylize},
7+
style::{Color, Style},
88
widgets::{Block, Borders, Clear, Row, Table, TableState},
99
};
1010
use ratatui_macros::{row, span};
@@ -204,7 +204,7 @@ pub trait PromptTable: VariantNames + VariantArray + EnumProperty + Into<u8> + T
204204
.borders(Borders::ALL)
205205
.title_alignment(Alignment::Center)
206206
.border_style(border_style)
207-
.title_style(Style::new().reset());
207+
.title_style(Style::reset());
208208
let block = if let Some(text) = top {
209209
block.title_top(text)
210210
} else {

struct-table/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
ratatui = "0.29.0"
7+
ratatui = "0.30.0"
88
strum = "0.27.1"
99
struct-table-derive = { path = "struct-table-derive" }
1010

0 commit comments

Comments
 (0)