chore(deps): bump ratatui to 0.29.0 (#2474)

This commit is contained in:
Pavel Ivanov
2024-12-27 23:15:19 +01:00
committed by GitHub
parent fd9ef9b8c1
commit dda66753d2
7 changed files with 62 additions and 65 deletions

70
Cargo.lock generated
View File

@ -847,13 +847,14 @@ dependencies = [
[[package]] [[package]]
name = "compact_str" name = "compact_str"
version = "0.7.1" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644"
dependencies = [ dependencies = [
"castaway", "castaway",
"cfg-if", "cfg-if",
"itoa", "itoa",
"rustversion",
"ryu", "ryu",
"static_assertions", "static_assertions",
] ]
@ -1015,16 +1016,16 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]] [[package]]
name = "crossterm" name = "crossterm"
version = "0.27.0" version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"crossterm_winapi", "crossterm_winapi",
"filedescriptor", "filedescriptor",
"libc", "mio",
"mio 0.8.11",
"parking_lot", "parking_lot",
"rustix",
"serde", "serde",
"signal-hook", "signal-hook",
"signal-hook-mio", "signal-hook-mio",
@ -2208,6 +2209,12 @@ dependencies = [
"web-time", "web-time",
] ]
[[package]]
name = "indoc"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]] [[package]]
name = "inout" name = "inout"
version = "0.1.3" version = "0.1.3"
@ -2217,6 +2224,20 @@ dependencies = [
"generic-array", "generic-array",
] ]
[[package]]
name = "instability"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "898e106451f7335950c9cc64f8ec67b5f65698679ac67ed00619aeef14e1cf75"
dependencies = [
"darling",
"indoc",
"pretty_assertions",
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "interim" name = "interim"
version = "0.1.2" version = "0.1.2"
@ -2558,18 +2579,6 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eea6e49e831ee0ee624f0435c357e452f6a68e194335f457a4d1551c09c9a300" checksum = "eea6e49e831ee0ee624f0435c357e452f6a68e194335f457a4d1551c09c9a300"
[[package]]
name = "mio"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
dependencies = [
"libc",
"log",
"wasi",
"windows-sys 0.48.0",
]
[[package]] [[package]]
name = "mio" name = "mio"
version = "1.0.3" version = "1.0.3"
@ -2577,6 +2586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
dependencies = [ dependencies = [
"libc", "libc",
"log",
"wasi", "wasi",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
@ -3376,23 +3386,23 @@ dependencies = [
[[package]] [[package]]
name = "ratatui" name = "ratatui"
version = "0.27.0" version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"cassowary", "cassowary",
"compact_str", "compact_str",
"crossterm", "crossterm",
"indoc",
"instability",
"itertools", "itertools",
"lru", "lru",
"paste", "paste",
"stability",
"strum", "strum",
"strum_macros",
"unicode-segmentation", "unicode-segmentation",
"unicode-truncate", "unicode-truncate",
"unicode-width 0.1.14", "unicode-width 0.2.0",
] ]
[[package]] [[package]]
@ -4061,7 +4071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
dependencies = [ dependencies = [
"libc", "libc",
"mio 0.8.11", "mio",
"signal-hook", "signal-hook",
] ]
@ -4375,16 +4385,6 @@ dependencies = [
"uuid", "uuid",
] ]
[[package]]
name = "stability"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac"
dependencies = [
"quote",
"syn",
]
[[package]] [[package]]
name = "stable_deref_trait" name = "stable_deref_trait"
version = "1.2.0" version = "1.2.0"
@ -4694,7 +4694,7 @@ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
"libc", "libc",
"mio 1.0.3", "mio",
"parking_lot", "parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry", "signal-hook-registry",

View File

@ -57,10 +57,7 @@ serde_with = "3.8.1"
# encryption # encryption
rusty_paseto = { version = "0.7.0", default-features = false } rusty_paseto = { version = "0.7.0", default-features = false }
rusty_paserk = { version = "0.4.0", default-features = false, features = [ rusty_paserk = { version = "0.4.0", default-features = false, features = ["v4", "serde"] }
"v4",
"serde",
] }
# sync # sync
urlencoding = { version = "2.1.0", optional = true } urlencoding = { version = "2.1.0", optional = true }
@ -71,7 +68,7 @@ indicatif = "0.17.7"
tiny-bip39 = "=1.0.0" tiny-bip39 = "=1.0.0"
# theme # theme
crossterm = { version = "0.27.0", features = ["serde"] } crossterm = { version = "0.28.1", features = ["serde"] }
palette = { version = "0.7.5", features = ["serializing"] } palette = { version = "0.7.5", features = ["serializing"] }
lazy_static = "1.4.0" lazy_static = "1.4.0"
strum_macros = "0.26.3" strum_macros = "0.26.3"

View File

@ -24,7 +24,7 @@ directories = { workspace = true }
indicatif = "0.17.5" indicatif = "0.17.5"
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
crossterm = { version = "0.27", features = ["use-dev-tty"] } crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
unicode-width = "0.1" unicode-width = "0.1"
itertools = { workspace = true } itertools = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }

View File

@ -58,7 +58,7 @@ directories = { workspace = true }
indicatif = "0.17.5" indicatif = "0.17.5"
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
crossterm = { version = "0.27", features = ["use-dev-tty"] } crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
unicode-width = "0.1" unicode-width = "0.1"
itertools = { workspace = true } itertools = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
@ -78,7 +78,7 @@ tiny-bip39 = "1"
futures-util = "0.3" futures-util = "0.3"
fuzzy-matcher = "0.3.7" fuzzy-matcher = "0.3.7"
colored = "2.0.4" colored = "2.0.4"
ratatui = "0.27" ratatui = "0.29.0"
tracing = "0.1" tracing = "0.1"
tracing-subscriber = { workspace = true } tracing-subscriber = { workspace = true }
uuid = { workspace = true } uuid = { workspace = true }

View File

@ -7,6 +7,7 @@ use atuin_client::{
use atuin_common::utils::Escapable as _; use atuin_common::utils::Escapable as _;
use ratatui::{ use ratatui::{
buffer::Buffer, buffer::Buffer,
crossterm::style,
layout::Rect, layout::Rect,
style::{Modifier, Style}, style::{Modifier, Style},
widgets::{Block, StatefulWidget, Widget}, widgets::{Block, StatefulWidget, Widget},
@ -206,7 +207,7 @@ impl DrawState<'_> {
{ {
// if not applying alternative highlighting to the whole row, color the command // if not applying alternative highlighting to the whole row, color the command
style = self.theme.as_style(Meaning::AlertError); style = self.theme.as_style(Meaning::AlertError);
style.attributes.set(crossterm::style::Attribute::Bold); style.attributes.set(style::Attribute::Bold);
} }
for section in h.command.escape_control().split_ascii_whitespace() { for section in h.command.escape_control().split_ascii_whitespace() {

View File

@ -5,8 +5,8 @@ use atuin_client::{
history::{History, HistoryStats}, history::{History, HistoryStats},
settings::Settings, settings::Settings,
}; };
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use ratatui::{ use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::Rect, layout::Rect,
prelude::{Constraint, Direction, Layout}, prelude::{Constraint, Direction, Layout},
style::Style, style::Style,

View File

@ -4,15 +4,6 @@ use std::{
}; };
use atuin_common::utils::{self, Escapable as _}; use atuin_common::utils::{self, Escapable as _};
use crossterm::{
cursor::SetCursorStyle,
event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers,
KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags,
PushKeyboardEnhancementFlags,
},
execute, terminal,
};
use eyre::Result; use eyre::Result;
use futures_util::FutureExt; use futures_util::FutureExt;
use semver::Version; use semver::Version;
@ -38,6 +29,15 @@ use crate::{command::client::search::engines, VERSION};
use ratatui::{ use ratatui::{
backend::CrosstermBackend, backend::CrosstermBackend,
crossterm::{
cursor::SetCursorStyle,
event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers,
KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags,
PushKeyboardEnhancementFlags,
},
execute, terminal,
},
layout::{Alignment, Constraint, Direction, Layout}, layout::{Alignment, Constraint, Direction, Layout},
prelude::*, prelude::*,
style::{Modifier, Style}, style::{Modifier, Style},
@ -588,13 +588,13 @@ impl State {
theme: &Theme, theme: &Theme,
) { ) {
let compact = match settings.style { let compact = match settings.style {
atuin_client::settings::Style::Auto => f.size().height < 14, atuin_client::settings::Style::Auto => f.area().height < 14,
atuin_client::settings::Style::Compact => true, atuin_client::settings::Style::Compact => true,
atuin_client::settings::Style::Full => false, atuin_client::settings::Style::Full => false,
}; };
let invert = settings.invert; let invert = settings.invert;
let border_size = if compact { 0 } else { 1 }; let border_size = if compact { 0 } else { 1 };
let preview_width = f.size().width - 2; let preview_width = f.area().width - 2;
let preview_height = Self::calc_preview_height( let preview_height = Self::calc_preview_height(
settings, settings,
results, results,
@ -604,12 +604,12 @@ impl State {
border_size, border_size,
preview_width, preview_width,
); );
let show_help = settings.show_help && (!compact || f.size().height > 1); let show_help = settings.show_help && (!compact || f.area().height > 1);
// This is an OR, as it seems more likely for someone to wish to override // This is an OR, as it seems more likely for someone to wish to override
// tabs unexpectedly being missed, than unexpectedly present. // tabs unexpectedly being missed, than unexpectedly present.
let hide_extra = settings.auto_hide_height != 0 let hide_extra = settings.auto_hide_height != 0
&& compact && compact
&& f.size().height <= settings.auto_hide_height; && f.area().height <= settings.auto_hide_height;
let show_tabs = settings.show_tabs && !hide_extra; let show_tabs = settings.show_tabs && !hide_extra;
let chunks = Layout::default() let chunks = Layout::default()
.direction(Direction::Vertical) .direction(Direction::Vertical)
@ -643,7 +643,7 @@ impl State {
} }
.as_ref(), .as_ref(),
) )
.split(f.size()); .split(f.area());
let input_chunk = if invert { chunks[0] } else { chunks[3] }; let input_chunk = if invert { chunks[0] } else { chunks[3] };
let results_list_chunk = if invert { chunks[1] } else { chunks[2] }; let results_list_chunk = if invert { chunks[1] } else { chunks[2] };
@ -722,9 +722,8 @@ impl State {
let message = Paragraph::new("Nothing to inspect") let message = Paragraph::new("Nothing to inspect")
.block( .block(
Block::new() Block::new()
.title( .title(Title::from(" Info ".to_string()))
Title::from(" Info ".to_string()).alignment(Alignment::Center), .title_alignment(Alignment::Center)
)
.borders(Borders::ALL) .borders(Borders::ALL)
.padding(Padding::vertical(2)), .padding(Padding::vertical(2)),
) )
@ -774,11 +773,11 @@ impl State {
let extra_width = UnicodeWidthStr::width(self.search.input.substring()); let extra_width = UnicodeWidthStr::width(self.search.input.substring());
let cursor_offset = if compact { 0 } else { 1 }; let cursor_offset = if compact { 0 } else { 1 };
f.set_cursor( f.set_cursor_position((
// Put cursor past the end of the input text // Put cursor past the end of the input text
input_chunk.x + extra_width as u16 + PREFIX_LENGTH + 1 + cursor_offset, input_chunk.x + extra_width as u16 + PREFIX_LENGTH + 1 + cursor_offset,
input_chunk.y + cursor_offset, input_chunk.y + cursor_offset,
); ));
} }
} }