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
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 set_active(
&mut self,
active: Option<ActiveViewMarker>,
feedback: Option<ViewFeedback>,
)
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.
Sourcepub fn active(&self) -> Option<&ActiveViewMarker>
pub fn active(&self) -> Option<&ActiveViewMarker>
The active saved-view marker, when the board is associated with one.
Sourcepub fn view_id(&self) -> Option<&ViewId>
pub fn view_id(&self) -> Option<&ViewId>
The stable id of the active view — the identity, never the name (C-002).
Sourcepub fn applied_plan(&self) -> Option<&ViewPlan>
pub fn applied_plan(&self) -> Option<&ViewPlan>
The normalized plan that was applied when the marker was set.
Sourcepub fn set_feedback(&mut self, feedback: Option<ViewFeedback>)
pub fn set_feedback(&mut self, feedback: Option<ViewFeedback>)
Replace the rendered feedback (T026), which the app recomputes on every live change.
Sourcepub fn feedback(&self) -> Option<&ViewFeedback>
pub fn feedback(&self) -> Option<&ViewFeedback>
The indicator and detail lines currently rendered, when there are any.
Sourcepub fn indicator_line(&self) -> Option<String>
pub fn indicator_line(&self) -> Option<String>
The one-line indicator, when the board is associated with a saved view.
Sourcepub fn header_height(&self) -> u16
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.
Sourcepub fn active_filter(&self) -> &StructuredFilter
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.
pub fn active_filter_mut(&mut self) -> &mut StructuredFilter
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 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.
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 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 + 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