pub struct AppLayout {
pub header: Rect,
pub chat: Rect,
pub side_panel: Rect,
pub skills: Rect,
pub memory: Rect,
pub resources: Rect,
pub subagents: Rect,
pub activity: Rect,
pub input: Rect,
pub status: Rect,
}Expand description
Pre-computed layout rectangles for all regions of the TUI dashboard.
Call compute once per render frame; pass the result to
individual widget renderers so each widget knows its exact screen region
without re-running the layout algorithm.
When the terminal is narrower than 80 columns or show_side_panels is
false, all side-panel fields are set to Rect::default() (zero-sized)
and the chat area expands to fill the full width.
§Examples
use ratatui::layout::Rect;
use zeph_tui::layout::AppLayout;
let area = Rect::new(0, 0, 120, 40);
let layout = AppLayout::compute(area, true, 3);
assert_eq!(layout.header.height, 1);
assert_eq!(layout.status.height, 1);
assert!(layout.chat.width > layout.side_panel.width);Fields§
§header: RectSingle-row header bar (model name, session info).
chat: RectMain chat / transcript area.
side_panel: RectCombined side-panel column (zero when hidden).
skills: RectSkills mini-panel within the side column.
memory: RectMemory mini-panel within the side column.
resources: RectMCP resources mini-panel within the side column.
subagents: RectSub-agents mini-panel within the side column.
activity: RectSingle-row activity / status-spinner bar.
input: RectMulti-row text input box.
status: RectSingle-row bottom status bar (metrics, keybinding hints).
Implementations§
Source§impl AppLayout
impl AppLayout
Sourcepub fn compute(area: Rect, show_side_panels: bool, input_height: u16) -> Self
pub fn compute(area: Rect, show_side_panels: bool, input_height: u16) -> Self
Compute the layout for the given terminal area.
§Arguments
area— the full terminal rect (fromFrame::area()).show_side_panels—falsehides the side panels regardless of width.input_height— requested composer height including borders.
§Examples
use ratatui::layout::Rect;
use zeph_tui::layout::AppLayout;
// Wide terminal: side panels visible.
let layout = AppLayout::compute(Rect::new(0, 0, 120, 40), true, 3);
assert!(layout.side_panel.width > 0);
// Narrow terminal: side panels hidden.
let layout = AppLayout::compute(Rect::new(0, 0, 60, 24), true, 3);
assert_eq!(layout.side_panel.width, 0);Auto Trait Implementations§
impl Freeze for AppLayout
impl RefUnwindSafe for AppLayout
impl Send for AppLayout
impl Sync for AppLayout
impl Unpin for AppLayout
impl UnsafeUnpin for AppLayout
impl UnwindSafe for AppLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request