tui: move view mode state
This commit is contained in:
+1
-30
@@ -31,36 +31,7 @@ use crate::app::{ActionbarNoticeLevel, App, CompletionState, alert_source_label,
|
||||
use crate::block::{Block, CompactEvent, ThinkingBlock, ThinkingState};
|
||||
use crate::command::CommandCandidate;
|
||||
use crate::task::{TaskCounts, TaskEntry, TaskStatus, TaskStore};
|
||||
|
||||
/// Display density for the history view.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Mode {
|
||||
/// Every block fully expanded.
|
||||
Detail,
|
||||
/// Completed blocks compressed to roughly 5–6 lines; in-progress
|
||||
/// tool blocks stay in detail.
|
||||
Normal,
|
||||
/// Each block rendered as a single line.
|
||||
Overview,
|
||||
}
|
||||
|
||||
impl Mode {
|
||||
pub fn cycle(self) -> Self {
|
||||
match self {
|
||||
Mode::Detail => Mode::Normal,
|
||||
Mode::Normal => Mode::Overview,
|
||||
Mode::Overview => Mode::Detail,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn label(self) -> &'static str {
|
||||
match self {
|
||||
Mode::Detail => "detail",
|
||||
Mode::Normal => "normal",
|
||||
Mode::Overview => "overview",
|
||||
}
|
||||
}
|
||||
}
|
||||
use crate::view_mode::Mode;
|
||||
|
||||
pub fn draw(frame: &mut Frame, app: &mut App) {
|
||||
let area = frame.area();
|
||||
|
||||
Reference in New Issue
Block a user