Skip to main content

App

Struct App 

Source
pub struct App {
Show 24 fields pub diff_data: DiffData, pub ui_state: UiState, pub highlight_cache: HighlightCache, pub should_quit: bool, pub event_tx: Option<Sender<Message>>, pub debounce_handle: Option<JoinHandle<()>>, pub input_mode: InputMode, pub search_query: String, pub active_filter: Option<String>, pub semantic_groups: Option<Vec<SemanticGroup>>, pub grouping_status: GroupingStatus, pub grouping_handle: Option<JoinHandle<()>>, pub llm_backend: Option<LlmBackend>, pub llm_model: String, pub focused_panel: FocusedPanel, pub tree_state: RefCell<TreeState<TreeNodeId>>, pub tree_filter: Option<HunkFilter>, pub theme: Theme, pub previous_head: Option<String>, pub previous_file_hashes: HashMap<String, u64>, pub git_diff_args: Vec<String>, pub preview_mode: bool, pub image_support: ImageSupport, pub mermaid_cache: Option<MermaidCache>,
}
Expand description

The main application state (TEA Model).

Fields§

§diff_data: DiffData§ui_state: UiState§highlight_cache: HighlightCache§should_quit: bool§event_tx: Option<Sender<Message>>

Channel sender for spawning debounce timers that send DebouncedRefresh.

§debounce_handle: Option<JoinHandle<()>>

Handle to the current debounce timer task, if any.

§input_mode: InputMode

Current input mode (Normal or Search).

§search_query: String

Current search query being typed.

§active_filter: Option<String>

The confirmed filter pattern (set on Enter in search mode).

§semantic_groups: Option<Vec<SemanticGroup>>

Semantic groups from LLM, if available. None = ungrouped.

§grouping_status: GroupingStatus

Lifecycle state of the current grouping request.

§grouping_handle: Option<JoinHandle<()>>

Handle to the in-flight grouping task, for cancellation (ROB-05).

§llm_backend: Option<LlmBackend>

Which LLM backend is available (Claude preferred, Copilot fallback), if any.

§llm_model: String

Model string resolved for the active backend.

§focused_panel: FocusedPanel

Which panel currently has keyboard focus.

§tree_state: RefCell<TreeState<TreeNodeId>>

Persistent tree state for tui-tree-widget (RefCell for interior mutability in render).

§tree_filter: Option<HunkFilter>

When a group is selected in the sidebar, filter the diff view to those (file, hunk) pairs. Key = file path (stripped), Value = set of hunk indices (empty = all hunks).

§theme: Theme

Active theme (colors + syntect theme name), derived from config at startup.

§previous_head: Option<String>

HEAD commit hash when current groups were computed. Used for incremental grouping.

§previous_file_hashes: HashMap<String, u64>

Per-file content hashes from the last grouping. Used to detect what changed.

§git_diff_args: Vec<String>

Git diff arguments from the CLI, used for refreshes.

§preview_mode: bool

Whether markdown preview mode is active (toggled with “p”).

§image_support: ImageSupport

Whether the terminal supports inline image rendering.

§mermaid_cache: Option<MermaidCache>

Mermaid diagram cache (only used when image_support == Supported).

Implementations§

Source§

impl App

Source

pub fn new( diff_data: DiffData, config: &Config, git_diff_args: Vec<String>, ) -> Self

Create a new App with parsed diff data, user config, and git diff arguments.

Source

pub fn update(&mut self, msg: Message) -> Option<Command>

TEA update: dispatch message to handler, return optional command.

Source

pub fn item_visual_rows(&self, item: &VisibleItem, width: u16) -> usize

Calculate the visual row count for an item given the available width.

Source

pub fn visible_items(&self) -> Vec<VisibleItem>

Compute the list of visible items respecting collapsed state, active filter, and hunk-level tree filter.

Source

pub fn view(&self, frame: &mut Frame<'_>) -> Vec<PendingImage>

TEA view: delegate rendering to the UI module. Returns pending images that must be flushed after terminal.draw().

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more