pub struct FilterModal { /* private fields */ }Expand description
The Tab-navigated structured-filter editor (T012).
Implementations§
Source§impl FilterModal
impl FilterModal
pub fn new() -> Self
Sourcepub fn with_filter(filter: StructuredFilter) -> Self
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).
Sourcepub fn active_filter(&self) -> &StructuredFilter
pub fn active_filter(&self) -> &StructuredFilter
In-progress filter (public API for WP03 to read/commit).
pub fn active_filter_mut(&mut self) -> &mut StructuredFilter
Sourcepub fn apply(&mut self)
pub fn apply(&mut self)
Commit in-progress criteria into the active filter (WP03 calls this on Enter). Pure model transition — no key reading here.
Sourcepub fn clear(&mut self)
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 WP03’s
apply_filter for the query layer).
Sourcepub fn focus_next(&mut self)
pub fn focus_next(&mut self)
Move focus to the next criterion row (Tab).
Sourcepub fn focus_prev(&mut self)
pub fn focus_prev(&mut self)
Move focus to the previous criterion row (Shift+Tab).
Sourcepub fn focus_field(&mut self, field: FilterField)
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.
Sourcepub fn focus(&self) -> FilterField
pub fn focus(&self) -> FilterField
The currently-focused criterion row.
Sourcepub fn is_date_focus(&self) -> bool
pub fn is_date_focus(&self) -> bool
Whether the focused criterion is a picker-only date field.
Sourcepub fn focused_value(&self) -> String
pub fn focused_value(&self) -> String
The focused criterion’s value, or "" when unset.
Sourcepub fn set_focused_date(&mut self, value: &str)
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.
Sourcepub fn focused_date_is_complete(&self) -> bool
pub fn focused_date_is_complete(&self) -> bool
Whether the focused date criterion already holds a complete valid date.
Sourcepub fn type_char(&mut self, c: char)
pub fn type_char(&mut self, c: char)
Type one character into the focused criterion. Date criteria apply the
masked YYYY-MM-DD edit; others append directly.
Sourcepub fn backspace(&mut self)
pub fn backspace(&mut self)
Delete the last character of the focused criterion (masked for dates).
Sourcepub fn render(&self, f: &mut Frame<'_>, area: Rect)
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 + editable value)
with the focused row highlighted; unset criteria show a placeholder.
pub fn render_with_bindings( &self, f: &mut Frame<'_>, area: Rect, bindings: &EffectiveBindings, context: InputContext, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FilterModal
impl RefUnwindSafe for FilterModal
impl Send for FilterModal
impl Sync for FilterModal
impl Unpin for FilterModal
impl UnsafeUnpin for FilterModal
impl UnwindSafe for FilterModal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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