pub struct SessionWidget<'a> { /* private fields */ }Expand description
Root compositor widget that orchestrates rendering of the entire session UI
This widget follows the compositional pattern recommended by Ratatui where a single root widget manages the layout and delegates rendering to child widgets.
It handles:
- Responsive layout based on terminal size (Compact/Standard/Wide)
- Layout calculation (header, main, footer regions)
- Coordinating child widget rendering
- Modal and palette overlay management
- Sidebar rendering in wide mode
§Layout Modes
- Compact (< 80 cols): Minimal chrome, no borders, no sidebar
- Standard (80-119 cols): Borders, titles, optional logs panel
- Wide (>= 120 cols): Full layout with sidebar for queue/context
§Example
ⓘ
SessionWidget::new(session)
.header_lines(lines)
.header_area(header_area)
.transcript_area(transcript_area)
.render(area, buf);Implementations§
Source§impl<'a> SessionWidget<'a>
impl<'a> SessionWidget<'a>
Sourcepub fn new(session: &'a mut Session) -> Self
pub fn new(session: &'a mut Session) -> Self
Create a new SessionWidget with required parameters
Sourcepub fn header_lines(self, lines: Vec<Line<'static>>) -> Self
pub fn header_lines(self, lines: Vec<Line<'static>>) -> Self
Set the header lines to render
Sourcepub fn header_area(self, area: Rect) -> Self
pub fn header_area(self, area: Rect) -> Self
Set the header area
Sourcepub fn transcript_area(self, area: Rect) -> Self
pub fn transcript_area(self, area: Rect) -> Self
Set the transcript area
Set the navigation area
Sourcepub fn layout_mode(self, mode: LayoutMode) -> Self
pub fn layout_mode(self, mode: LayoutMode) -> Self
Override the layout mode (auto-detected by default)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SessionWidget<'a>
impl<'a> RefUnwindSafe for SessionWidget<'a>
impl<'a> Send for SessionWidget<'a>
impl<'a> Sync for SessionWidget<'a>
impl<'a> Unpin for SessionWidget<'a>
impl<'a> UnsafeUnpin for SessionWidget<'a>
impl<'a> !UnwindSafe for SessionWidget<'a>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more