Skip to main content

App

Struct App 

Source
pub struct App {
Show 19 fields pub mode: Mode, pub board: BoardState, pub detail: Option<DetailState>, pub form: Option<FormState>, pub confirm_delete_target: Option<String>, pub store: Store, pub status_msg: Option<String>, pub quit: bool, pub bindings: EffectiveBindings, pub active_config: usize, pub tabs: BoardTabs, pub show_archived: bool, pub filter_modal: Option<FilterModal>, pub settings: Option<SettingsModal>, pub planning: Option<PlanningModal>, pub planning_form: Option<PlanningForm>, pub date_picker: Option<DatePicker>, pub bulk: Option<BulkModal>, pub triage: Option<TriageState>, /* private fields */
}
Expand description

Independent toggles are what a TUI session’s state is — the mode lives in Mode, and the flags beside it (archived shown, help line open, one-shot exit) are not states a machine would model, they are switches the user throws. Four is not a design smell here; a struct with a mode enum and a handful of toggles is the shape.

Fields§

§mode: Mode§board: BoardState§detail: Option<DetailState>§form: Option<FormState>§confirm_delete_target: Option<String>§store: Store§status_msg: Option<String>§quit: bool§bindings: EffectiveBindings§active_config: usize

The active named board configuration index into Config::configs() (session state only — never persisted). rebuild_board/apply_filter must not reset it.

§tabs: BoardTabs

Persistent tabs bar of all named boards (DM-01M2MH8J01DZHV3JMT76XX38KX).

§show_archived: bool

Whether the board is showing archived issues too (tix #1492).

Off by default, and that default is the point: the board and the corpus are built from crate::storage::Store::list, which drops a dot-prefixed file from the directory entry without opening it, so a repository with thousands of archived issues costs nothing to open. Toggling this on is the “reload them on demand” half — refresh_corpus re-reads the issue set with the archived files included and rebuilds the board around it.

§filter_modal: Option<FilterModal>§settings: Option<SettingsModal>

Settings modal (board/column configuration via s).

§planning: Option<PlanningModal>

Planning modal (cycle/milestone management via m).

§planning_form: Option<PlanningForm>

Create/edit form for a planning item.

§date_picker: Option<DatePicker>

Open calendar date picker (overlaid on the form that opened it).

§bulk: Option<BulkModal>

The batch modal (WP07), Some exactly while mode is Mode::BulkModal.

§triage: Option<TriageState>

The triage inbox (WP06), Some exactly while mode is Mode::TriageInbox. Its cursor and selection are its own — see the note on that mode.

Implementations§

Source§

impl App

Source

pub fn note_disclosure(&mut self, disclosure: String)

Record a disclosure raised by a write, alongside whatever confirmation the action already produced.

Cycle-4 F4. The event loop drains at the top of the loop body, so a disclosure raised by handle_key at the bottom would overwrite that action’s confirmation message before any frame ever drew it — the user moved an issue and never saw “Moved #1 to in progress”. Composing is the fix: both facts are true, and both are worth showing.

The disclosure is appended rather than prepended so the confirmation reads first, which is the order the user caused them in. The existing message is left untouched, so this cannot swallow anything either.

Source

pub fn new(config: &Config) -> Result<Self>

Source

pub fn handle_key(&mut self, key: KeyEvent) -> Result<Action>

Source

pub fn handle_mouse(&mut self, mouse: MouseEvent) -> Result<Action>

Route a MouseEvent into the active mode’s pointer handler (D2), mirroring App::handle_key: one dispatch trunk per mode, so mouse and keyboard share the same single-mode mental model. Modes that declare no mouse behavior fall through to a no-op. Per-mode handlers land with the click/hover/dialog tasks.

Source

pub fn record_region(&self, rect: Rect, action: Action)

Record a click target bounding rect for the current draw (D3). Widgets call this while rendering; handle_mouse resolves the region under a pointer via App::resolve_region. Regions are cleared at the start of every frame, so stale targets from previous frames never fire.

Source

pub fn open_new_issue_form(&mut self)

Open the create-issue form — n on the board, and where tix new starts the session (#1398).

Seeds the first configured column and the git identity (FR-028, best effort: empty when git is absent, never an error). One method rather than two copies, because the key and the command must produce the same form — two entry points into one dialog that default differently is how a bug is born.

Source

pub fn refresh_from_disk(&mut self) -> Result<()>

Re-read issues from disk and rebuild the board, so edits made outside tix appear without a manual keypress (issue #10, driven by crate::watcher::FsWatcher). A read error (e.g. a partially written file) leaves the current board in place.

Source

pub fn after_editor(&mut self, filename: &str)

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Sync for App

§

impl Send 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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.