final refactors

This commit is contained in:
2026-06-11 22:17:46 -05:00
parent f249e109ed
commit 7f41f704ef
4 changed files with 26 additions and 23 deletions
+7 -2
View File
@@ -13,7 +13,6 @@ use ratatui::widgets::{Block, Paragraph, StatefulWidget, Widget, Wrap};
use crate::utils::rgba8_to_color;
/// View state for the log panel.
#[derive(Default)]
pub struct LogState {
/// Whether the log panel is currently open.
pub open: bool,
@@ -23,10 +22,16 @@ pub struct LogState {
pub scroll: u16,
}
impl Default for LogState {
fn default() -> Self {
Self { open: false, height: 10, scroll: 0 }
}
}
impl LogState {
/// Creates a `LogState` with sensible defaults (closed, 10 rows tall).
pub fn new() -> Self {
Self { open: false, height: 10, scroll: 0 }
Self::default()
}
/// Toggles the panel open or closed, resetting scroll to the top on open.