Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,097 changes: 928 additions & 169 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ license = "MIT"
keywords = ["s3", "aws", "cli", "tui", "terminal"]
categories = ["command-line-utilities"]
edition = "2021"
rust-version = "1.88.0"
rust-version = "1.90.0"

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

[dependencies]
ansi-to-tui = "7.0.0"
ansi-to-tui = "8.0.0"
anyhow = "1.0.100"
arboard = { version = "3.6.1", features = ["wayland-data-control"] }
aws-config = "1.8.11"
Expand All @@ -25,19 +25,22 @@ chardetng = "0.1.17"
chrono = "0.4.42"
clap = { version = "4.5.53", features = ["derive"] }
console = "0.16.1"
crossterm = { version = "0.28.1", features = ["event-stream"] }
crossterm = { version = "0.29.0", features = ["event-stream"] }
encoding_rs = "0.8.35"
futures = "0.3.31"
humansize = "2.1.3"
image = "0.25.9"
indexmap = { version = "2.12.1", features = ["serde"] }
infer = "0.19.0"
itsuki = "0.2.1"
laurier = "0.2.0"
laurier = "0.3.0"
once_cell = "1.21.3"
open = "5.3.3"
ratatui = "0.29.0"
ratatui-image = "8.0.1"
ratatui = "0.30.0"
ratatui-image = { version = "10.0.2", default-features = false, features = [
"crossterm",
"image-defaults",
] }
serde = { version = "1.0.219", features = ["derive"] }
smart-default = "0.7.1"
syntect = { version = "5.2.0", default-features = false, features = [
Expand All @@ -49,7 +52,7 @@ toml = "0.9.8"
tracing = "0.1.41"
tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.20", features = ["chrono"] }
tui-input = "0.14.0"
tui-input = "0.15.0"
umbra = "0.4.0"

[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fn build_image_picker(image_preview_enabled: bool, fix_dynamic_values: bool) ->
// - font size cannot be obtained with xterm.js
// - want to fix the protocol to iterm2
// so changed the settings if fix_dynamic_values is true
#[allow(deprecated)]
let mut picker = ratatui_image::picker::Picker::from_fontsize((10, 20));
picker.set_protocol_type(ratatui_image::picker::ProtocolType::Iterm2);
return ImagePicker::Ok(picker);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/bucket_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ mod tests {
};

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

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

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

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

fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
let backend = TestBackend::new(30, 10);
let mut terminal = Terminal::new(backend)?;
terminal.clear()?;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod tests {
use ratatui::{backend::TestBackend, buffer::Buffer, text::Span, Terminal};

#[tokio::test]
async fn test_render() -> std::io::Result<()> {
async fn test_render() -> Result<(), core::convert::Infallible> {
let ctx = Rc::default();
let tx = sender();
let mut terminal = setup_terminal()?;
Expand Down Expand Up @@ -241,7 +241,7 @@ mod tests {
Ok(())
}

fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
let backend = TestBackend::new(70, 20);
let mut terminal = Terminal::new(backend)?;
terminal.clear()?;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/initializing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod tests {
use ratatui::{backend::TestBackend, buffer::Buffer, Terminal};

#[tokio::test]
async fn test_render() -> std::io::Result<()> {
async fn test_render() -> Result<(), core::convert::Infallible> {
let ctx = Rc::default();
let tx = sender();
let mut terminal = setup_terminal()?;
Expand Down Expand Up @@ -76,7 +76,7 @@ mod tests {
Ok(())
}

fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
let backend = TestBackend::new(30, 10);
let mut terminal = Terminal::new(backend)?;
terminal.clear()?;
Expand Down
16 changes: 8 additions & 8 deletions src/pages/object_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ mod tests {
use ratatui::{backend::TestBackend, buffer::Buffer, crossterm::event::KeyCode, Terminal};

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

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

Expand Down Expand Up @@ -962,7 +962,7 @@ mod tests {
}

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

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

Expand Down Expand Up @@ -1099,7 +1099,7 @@ mod tests {
}

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

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

#[tokio::test]
async fn test_render_copy_detail_dialog_version_tab() -> std::io::Result<()> {
async fn test_render_copy_detail_dialog_version_tab() -> Result<(), core::convert::Infallible> {
let ctx = Rc::default();
let tx = sender();
let mut terminal = setup_terminal()?;
Expand Down Expand Up @@ -1319,7 +1319,7 @@ mod tests {
Ok(())
}

fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
let backend = TestBackend::new(60, 20);
let mut terminal = Terminal::new(backend)?;
terminal.clear()?;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/object_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ mod tests {
};

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

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

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

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

fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
let backend = TestBackend::new(60, 10);
let mut terminal = Terminal::new(backend)?;
terminal.clear()?;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/object_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ mod tests {
}

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

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

#[tokio::test]
async fn test_render_save_dialog_without_scroll() -> std::io::Result<()> {
async fn test_render_save_dialog_without_scroll() -> Result<(), core::convert::Infallible> {
let ctx = Rc::default();
let tx = sender();
let mut terminal = setup_terminal()?;
Expand Down Expand Up @@ -563,7 +563,7 @@ mod tests {
.unwrap()
}

fn setup_terminal() -> std::io::Result<Terminal<TestBackend>> {
fn setup_terminal() -> Result<Terminal<TestBackend>, core::convert::Infallible> {
let backend = TestBackend::new(30, 10);
let mut terminal = Terminal::new(backend)?;
terminal.clear()?;
Expand Down
2 changes: 1 addition & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
pages::page::Page,
};

pub async fn run<B: Backend>(
pub async fn run<B: Backend<Error = std::io::Error>>(
app: &mut App,
terminal: &mut Terminal<B>,
mut rx: Receiver,
Expand Down
5 changes: 2 additions & 3 deletions src/widget/confirm_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ratatui::{
layout::{Margin, Rect},
style::{Color, Stylize},
text::Line,
widgets::{block::Title, Block, BorderType, Padding, Paragraph, StatefulWidget, Widget},
widgets::{Block, BorderType, Padding, Paragraph, StatefulWidget, Widget},
};

use crate::{
Expand Down Expand Up @@ -94,11 +94,10 @@ impl StatefulWidget for ConfirmDialog<'_> {
lines.extend(divider_lines);
lines.extend(select_lines);

let title = Title::from("Confirm");
let content = Paragraph::new(lines).centered().block(
Block::bordered()
.border_type(BorderType::Rounded)
.title(title)
.title("Confirm")
.padding(Padding::horizontal(1))
.bg(self.color.bg)
.fg(self.color.block),
Expand Down
5 changes: 2 additions & 3 deletions src/widget/copy_detail_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ratatui::{
layout::{Margin, Rect},
style::{Color, Modifier, Stylize},
text::Line,
widgets::{block::Title, Block, BorderType, List, ListItem, Padding, StatefulWidget, Widget},
widgets::{Block, BorderType, List, ListItem, Padding, StatefulWidget, Widget},
};

use crate::{
Expand Down Expand Up @@ -319,11 +319,10 @@ impl StatefulWidget for CopyDetailDialog {
let dialog_height = state.item_type_len() * 2 + 2 /* border */;
let area = calc_centered_area(area, dialog_width, dialog_height as u16);

let title = Title::from("Copy");
let list = List::new(list_items).block(
Block::bordered()
.border_type(BorderType::Rounded)
.title(title)
.title("Copy")
.bg(self.color.bg)
.fg(self.color.block)
.padding(Padding::horizontal(1)),
Expand Down
5 changes: 2 additions & 3 deletions src/widget/input_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ratatui::{
crossterm::event::KeyEvent,
layout::{Margin, Rect},
style::{Color, Stylize},
widgets::{block::Title, Block, BorderType, Padding, Paragraph, StatefulWidget, Widget},
widgets::{Block, BorderType, Padding, Paragraph, StatefulWidget, Widget},
};
use tui_input::{backend::crossterm::EventHandler, Input};

Expand Down Expand Up @@ -108,11 +108,10 @@ impl StatefulWidget for InputDialog {
let input_start_index = state.input.visual_cursor().saturating_sub(input_max_width);
let input_view: &str = &state.input.value()[input_start_index..];

let title = Title::from(self.title);
let dialog_content = Paragraph::new(input_view.fg(self.color.text)).block(
Block::bordered()
.border_type(BorderType::Rounded)
.title(title)
.title(self.title)
.bg(self.color.bg)
.fg(self.color.block)
.padding(Padding::horizontal(1)),
Expand Down
2 changes: 1 addition & 1 deletion src/widget/scroll_lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ratatui::{
layout::{Constraint, Layout, Rect},
style::{Color, Style, Stylize},
text::Line,
widgets::{block::BlockExt, Block, Borders, Padding, Paragraph, StatefulWidget, Widget, Wrap},
widgets::{Block, BlockExt, Borders, Padding, Paragraph, StatefulWidget, Widget, Wrap},
};

use crate::{color::ColorTheme, util::digits};
Expand Down
5 changes: 2 additions & 3 deletions src/widget/sort_list_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ratatui::{
layout::{Margin, Rect},
style::{Color, Stylize},
text::Line,
widgets::{block::Title, Block, BorderType, List, ListItem, Padding, Widget},
widgets::{Block, BorderType, List, ListItem, Padding, Widget},
};

use crate::{color::ColorTheme, config, widget::Dialog};
Expand Down Expand Up @@ -257,11 +257,10 @@ impl Widget for ListSortDialog {
let dialog_height = self.labels.len() as u16 + 2 /* border */;
let area = calc_centered_area(area, dialog_width, dialog_height);

let title = Title::from("Sort");
let list = List::new(list_items).block(
Block::bordered()
.border_type(BorderType::Rounded)
.title(title)
.title("Sort")
.padding(Padding::horizontal(1))
.bg(self.color.bg)
.fg(self.color.block),
Expand Down
Loading