pub struct SidebarWidget<'a> { /* private fields */ }Expand description
Widget for rendering the sidebar in wide mode
The sidebar provides quick access to:
- Queued inputs/tasks
- Context information
- Recent tool calls
- Session info
§Example
ⓘ
SidebarWidget::new(&styles)
.queue_items(&queue)
.context_info("12K tokens | 45% context")
.active_section(SidebarSection::Queue)
.render(sidebar_area, buf);Implementations§
Source§impl<'a> SidebarWidget<'a>
impl<'a> SidebarWidget<'a>
Sourcepub fn new(styles: &'a SessionStyles) -> Self
pub fn new(styles: &'a SessionStyles) -> Self
Create a new sidebar widget
Sourcepub fn queue_items(self, items: Vec<String>) -> Self
pub fn queue_items(self, items: Vec<String>) -> Self
Set queued items to display
Sourcepub fn context_info(self, info: &'a str) -> Self
pub fn context_info(self, info: &'a str) -> Self
Set context info text
Sourcepub fn recent_tools(self, tools: Vec<String>) -> Self
pub fn recent_tools(self, tools: Vec<String>) -> Self
Set recent tool calls
Sourcepub fn active_section(self, section: SidebarSection) -> Self
pub fn active_section(self, section: SidebarSection) -> Self
Set the active/focused section
Sourcepub fn mode(self, mode: LayoutMode) -> Self
pub fn mode(self, mode: LayoutMode) -> Self
Set the layout mode
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SidebarWidget<'a>
impl<'a> RefUnwindSafe for SidebarWidget<'a>
impl<'a> Send for SidebarWidget<'a>
impl<'a> Sync for SidebarWidget<'a>
impl<'a> Unpin for SidebarWidget<'a>
impl<'a> UnsafeUnpin for SidebarWidget<'a>
impl<'a> UnwindSafe for SidebarWidget<'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