feat(tui): ratatui skeleton with layout
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
26
crates/tui/src/ui.rs
Normal file
26
crates/tui/src/ui.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use crate::app::App;
|
||||
|
||||
pub fn render(frame: &mut ratatui::Frame, _app: &App) {
|
||||
use ratatui::layout::{Constraint, Layout};
|
||||
use ratatui::widgets::{Block, Borders, Paragraph};
|
||||
|
||||
let chunks = Layout::vertical([
|
||||
Constraint::Length(1),
|
||||
Constraint::Min(1),
|
||||
Constraint::Length(1),
|
||||
])
|
||||
.split(frame.area());
|
||||
|
||||
frame.render_widget(
|
||||
Paragraph::new(" Log Viewer").style(ratatui::style::Style::default().bold()),
|
||||
chunks[0],
|
||||
);
|
||||
|
||||
// Main area — 使用 Block::new()(ratatui 0.30 推荐风格)
|
||||
frame.render_widget(
|
||||
Block::new().borders(Borders::ALL).title("No file loaded"),
|
||||
chunks[1],
|
||||
);
|
||||
|
||||
frame.render_widget(Paragraph::new(" Press '?' for help | q to quit"), chunks[2]);
|
||||
}
|
||||
Reference in New Issue
Block a user