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 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/neet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ categories = ["command-line-utilities", "filesystem"]

[dependencies]
neet-core = { path = "../neet-core", version = "0.1.0" }
ratatui.workspace = true
ratatui = { workspace = true, features = ["unstable-rendered-line-info"] }
unicode-segmentation = "1"

[lints]
workspace = true
Expand Down
15 changes: 9 additions & 6 deletions crates/neet/src/ui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use neet_core::disk::{self, DiskSpace};
use ratatui::Frame;
use ratatui::crossterm::event::{KeyCode, KeyEvent};
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::Style;
use ratatui::text::Line;

use super::clean::Estimate;
use super::help::Help;
Expand Down Expand Up @@ -198,8 +196,12 @@ impl App {
}

pub fn draw(&mut self, frame: &mut Frame) {
let hints = super::visual::hints(self.top().hints());
let footer_height =
super::visual::wrapped_rows(std::slice::from_ref(&hints), frame.area().width);
let [body, footer] =
Layout::vertical([Constraint::Fill(1), Constraint::Length(1)]).areas(frame.area());
Layout::vertical([Constraint::Fill(1), Constraint::Length(footer_height)])
.areas(frame.area());
// Draw from the topmost full screen up, so overlays sit on what is below them.
let base = self
.stack
Expand All @@ -215,9 +217,10 @@ impl App {
for screen in &mut self.stack[base..] {
screen.draw(frame, body, &context);
}
let screen = self.top();
let hints = Line::from(format!(" {}", screen.hints())).style(Style::new());
frame.render_widget(hints, footer);
frame.render_widget(
ratatui::widgets::Paragraph::new(hints).wrap(ratatui::widgets::Wrap { trim: false }),
footer,
);
}

pub fn handle_key(&mut self, key: KeyEvent) {
Expand Down
Loading
Loading