Skip to main content

render

Function render 

Source
pub fn render<B: Backend>(
    terminal: &mut Terminal<B>,
    state: &mut AppState,
) -> Result<()>
Expand description

Draws all three panels into the terminal frame.

The layout splits the screen into a top region (nav + preview side by side) and a bottom status bar. The top region is split 40/60 between the navigation panel and the preview panel. An open terminal panel takes the bottom [terminal] height percent of the top region, or all of it when maximized — in which case the file list and preview are not drawn.

This function does not clear state.dirty; the caller (main.rs) is responsible for setting it to false after a successful render so that the invariant is visible at the event-loop level.

Generic over B: Backend so that integration tests can use ratatui::backend::TestBackend without a real terminal.

Takes state mutably because an image preview owns encoder state that ratatui-image re-encodes whenever the preview pane changes size.