use std::path::PathBuf;
use crate::diff::text::{RangeMatch, RenderOptions};
use crate::review::ReviewTarget;
use crate::tui::theme::OverlayTheme;
#[derive(Debug, Clone, PartialEq)]
pub struct DirEntryInfo {
pub name: String,
pub path: PathBuf,
pub is_dir: bool,
}
#[derive(Debug, Clone, PartialEq)]
pub struct DiffSessionData {
pub before_path: PathBuf,
pub after_path: PathBuf,
pub before_contents: String,
pub after_contents: String,
pub before_ranges: Vec<RangeMatch>,
pub after_ranges: Vec<RangeMatch>,
pub comment_only: bool,
pub plain_text_fallback: bool,
}
#[derive(Debug, Clone, PartialEq)]
pub enum DiffOutcome {
Ready(DiffSessionData),
Failed(String),
}
#[derive(Debug, Clone, PartialEq)]
pub enum Action {
Tick,
Render,
Resize(u16, u16),
Quit,
Suspend,
Error(String),
DirectoryListed(PathBuf, Vec<DirEntryInfo>),
FileSelected(PathBuf),
DialogCancelled,
ReviewFileSelected {
target: ReviewTarget,
index: usize,
},
StartDiff(PathBuf, PathBuf),
DiffComputed {
generation: u64,
outcome: DiffOutcome,
},
DiffReady(DiffSessionData),
DiffFailed(String),
ThemeSelected(OverlayTheme),
ThemePreviewed(OverlayTheme),
SyntaxThemePreviewed(String),
SearchSubmitted(String),
SearchQueryChanged(String),
JumpToLineSubmitted(usize),
RenderOptionsChanged(RenderOptions),
RenderOptionsAccepted,
}