pub struct LogPane { /* private fields */ }Expand description
The component itself. Owns the tab state + ring buffers; reads the bee::http capture from a borrowed handle, same as the legacy CommandLog did.
Implementations§
Source§impl LogPane
impl LogPane
pub fn new( capture: Option<LogCapture>, initial_tab: LogTab, initial_height: u16, ) -> Self
Sourcepub fn set_cockpit_capture(&mut self, cap: CockpitCapture)
pub fn set_cockpit_capture(&mut self, cap: CockpitCapture)
Attach the cockpit-capture ring buffer so the Cockpit tab can
render events bee-tui itself emitted (everything that isn’t
bee::http). Wired by [App::new] after
crate::logging::init has installed the capture.
pub fn active_tab(&self) -> LogTab
pub fn height(&self) -> u16
Sourcepub fn set_spawn_active(&mut self, active: bool)
pub fn set_spawn_active(&mut self, active: bool)
Tell the pane bee-tui is acting as the supervisor (so the placeholder changes from “configure bee” to “(awaiting first log line)”). Called once at startup; cheap to call repeatedly.
Sourcepub fn next_tab(&mut self) -> LogTab
pub fn next_tab(&mut self) -> LogTab
Cycle to the next tab (left → right, wrapping). Returns the new active tab so callers can persist state without re-reading. Resets the scroll offset — the new tab’s content has nothing to do with where we were on the old one.
Sourcepub fn scroll_up(&mut self, lines: usize)
pub fn scroll_up(&mut self, lines: usize)
Scroll the active tab up by lines (toward older entries).
Clamped at draw-time to the buffer length so the user can’t
scroll past the top. lines = 1 is the per-keystroke step;
callers can pass a larger value for page-scrolling.
Sourcepub fn scroll_down(&mut self, lines: usize)
pub fn scroll_down(&mut self, lines: usize)
Scroll the active tab down by lines (toward newer entries /
the tail). Saturates at 0, which is the auto-tail state.
Sourcepub fn resume_tail(&mut self)
pub fn resume_tail(&mut self)
Snap back to auto-tail mode (scroll_offset = 0). The pane resumes following new entries as they arrive. Also resets horizontal pan because operators usually want both axes reset together when “going back to live.”
Sourcepub fn scroll_right(&mut self, cols: u16)
pub fn scroll_right(&mut self, cols: u16)
Pan the active tab right by cols characters. Bee log lines
often run past the pane width; ratatui truncates them at the
right edge by default so we add a horizontal scroll to let
operators read the tail.
Sourcepub fn scroll_left(&mut self, cols: u16)
pub fn scroll_left(&mut self, cols: u16)
Pan the active tab left by cols characters. Saturates at 0
(the natural left edge).
Sourcepub fn reset_h_scroll(&mut self)
pub fn reset_h_scroll(&mut self)
Reset horizontal pan to the left edge without touching the vertical scroll. Used when operators want the line start back without leaving the historical window.
Sourcepub fn h_scroll_offset(&self) -> u16
pub fn h_scroll_offset(&self) -> u16
Current horizontal scroll offset. Exposed for tests + the title-strip indicator.
Sourcepub fn is_tailing(&self) -> bool
pub fn is_tailing(&self) -> bool
true when the pane is auto-tailing (the default state).
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Lines the pane is currently scrolled back from the tail. Useful for rendering “[paused N]” indicators in the title.
Sourcepub fn grow(&mut self) -> u16
pub fn grow(&mut self) -> u16
Grow the pane by one line. Returns the new height. No-op once the cap is hit.
Sourcepub fn shrink(&mut self) -> u16
pub fn shrink(&mut self) -> u16
Shrink the pane by one line. Returns the new height. No-op once the floor is hit.
Sourcepub fn push_bee(&mut self, tab: LogTab, line: BeeLogLine)
pub fn push_bee(&mut self, tab: LogTab, line: BeeLogLine)
Push a Bee log line to the appropriate tab. The supervisor’s log tailer calls this for each parsed line. Bounded — when the ring is full the oldest entry is evicted.
Scroll-stability: if this push lands on the active tab
AND we’re currently scrolled back (not auto-tailing), bump
scroll_offset so the visible window stays anchored on the
same content rather than drifting upward as new lines push
the old ones up.
Trait Implementations§
Source§impl Component for LogPane
impl Component for LogPane
Source§fn update(&mut self, action: Action) -> Result<Option<Action>>
fn update(&mut self, action: Action) -> Result<Option<Action>>
Source§fn draw(&mut self, frame: &mut Frame<'_>, area: Rect) -> Result<()>
fn draw(&mut self, frame: &mut Frame<'_>, area: Rect) -> Result<()>
Source§fn register_action_handler(&mut self, tx: UnboundedSender<Action>) -> Result<()>
fn register_action_handler(&mut self, tx: UnboundedSender<Action>) -> Result<()>
Source§fn register_config_handler(&mut self, config: Config) -> Result<()>
fn register_config_handler(&mut self, config: Config) -> Result<()>
Source§fn init(&mut self, area: Size) -> Result<()>
fn init(&mut self, area: Size) -> Result<()>
Source§fn handle_events(&mut self, event: Option<Event>) -> Result<Option<Action>>
fn handle_events(&mut self, event: Option<Event>) -> Result<Option<Action>>
Source§fn handle_key_event(&mut self, key: KeyEvent) -> Result<Option<Action>>
fn handle_key_event(&mut self, key: KeyEvent) -> Result<Option<Action>>
Source§fn handle_mouse_event(&mut self, mouse: MouseEvent) -> Result<Option<Action>>
fn handle_mouse_event(&mut self, mouse: MouseEvent) -> Result<Option<Action>>
Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
Manifest::load(reference) from the command bar).
Default returns None so screens that don’t need it can ignore
this method.Auto Trait Implementations§
impl Freeze for LogPane
impl RefUnwindSafe for LogPane
impl Send for LogPane
impl Sync for LogPane
impl Unpin for LogPane
impl UnsafeUnpin for LogPane
impl UnwindSafe for LogPane
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<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more