Skip to main content

FilterModal

Struct FilterModal 

Source
pub struct FilterModal { /* private fields */ }
Expand description

The Tab-navigated structured-filter editor (T012).

WP05 adds one thing to it: the active saved view (T024). The modal holds the marker — the stable id and the normalized plan that was applied — plus the already-rendered indicator/feedback the app derived (T026). It is deliberately not live filter state: clear() empties the criteria and leaves the marker alone, because “the view the board is associated with” and “the criteria in force” are two different facts (C-006), and only the second is editable here.

Implementations§

Source§

impl FilterModal

Source

pub fn new() -> Self

Source

pub fn with_filter(filter: StructuredFilter) -> Self

Seed the modal with an existing filter (used when re-opening the modal for an already-applied filter).

Source

pub fn set_active( &mut self, active: Option<ActiveViewMarker>, feedback: Option<ViewFeedback>, )

Install the active saved-view marker and its rendered feedback (T024).

Informational: this changes what the modal shows, never the criteria it edits. The app calls it when the modal opens and after every live change while it is open, so the indicator cannot describe a state the board is no longer in.

Source

pub fn active(&self) -> Option<&ActiveViewMarker>

The active saved-view marker, when the board is associated with one.

Source

pub fn view_id(&self) -> Option<&ViewId>

The stable id of the active view — the identity, never the name (C-002).

Source

pub fn applied_plan(&self) -> Option<&ViewPlan>

The normalized plan that was applied when the marker was set.

Source

pub fn set_feedback(&mut self, feedback: Option<ViewFeedback>)

Replace the rendered feedback (T026), which the app recomputes on every live change.

Source

pub fn feedback(&self) -> Option<&ViewFeedback>

The indicator and detail lines currently rendered, when there are any.

Source

pub fn indicator_line(&self) -> Option<String>

The one-line indicator, when the board is associated with a saved view.

Source

pub fn header_height(&self) -> u16

The rows the active-view feedback occupies above the criteria — one for the indicator, one blank, one per detail line (0 without a view).

Public because the app places the criterion rows’ click targets from the same arithmetic the widget draws with (D6): a hit region that ignored the feedback block would jump focus to the wrong criterion.

Source

pub fn active_filter(&self) -> &StructuredFilter

Read the in-progress criteria for editing (App writes a picker’s choice into it) and for the commit that closes the modal.

Source

pub fn active_filter_mut(&mut self) -> &mut StructuredFilter

Source

pub fn clear(&mut self)

Clear/reset all criteria (FR-014). Never touches the / text filter layer (reset is a pure structured-filter op, mirrored by the query layer’s own reset).

The active-view marker is untouched: emptying the criteria is a live change, and a live change is exactly what the marker’s divergence report exists to name (C-006). Clearing the marker here would hide the divergence the user just created.

Source

pub fn focus_next(&mut self)

Move focus to the next criterion row (Tab).

Source

pub fn focus_prev(&mut self)

Move focus to the previous criterion row (Shift+Tab).

Source

pub fn focus_field(&mut self, field: FilterField)

Jump focus directly to a specific criterion row (a row click, D6) — the same focus state the Tab/arrow cycling produces, chosen directly.

Source

pub fn focus(&self) -> FilterField

The currently-focused criterion row.

Source

pub fn is_date_focus(&self) -> bool

Whether the focused criterion is a picker-only date field.

Source

pub fn focused_value(&self) -> String

The focused criterion’s value, or "" when unset.

Source

pub fn set_focused_date(&mut self, value: &str)

Overwrite the focused date criterion (no-op when it isn’t a date field). An empty value clears the criterion.

Source

pub fn render(&self, f: &mut Frame<'_>, area: Rect)

Render the filter modal: a bordered, centered box (via modal_rect) listing each criterion row (label + value) with the focused row highlighted; unset criteria show a placeholder.

Source

pub fn render_with_bindings( &self, f: &mut Frame<'_>, area: Rect, bindings: &EffectiveBindings, context: InputContext, )

Trait Implementations§

Source§

impl Default for FilterModal

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.