pub struct BulkTagEditorState {
pub rows: Vec<BulkTagRow>,
pub aliases: Vec<String>,
pub skipped_included: Vec<String>,
pub new_tag_input: Option<String>,
pub new_tag_cursor: usize,
pub initial_actions: Vec<BulkTagAction>,
}Expand description
Snapshot state for the bulk tag editor overlay.
Fields§
§rows: Vec<BulkTagRow>§aliases: Vec<String>Aliases being edited, snapshot at open time so selection changes during the flow do not affect the in-progress edit.
skipped_included: Vec<String>Aliases that live in an Include file and cannot be edited in place. Surfaced in the header so the user sees the blast radius.
new_tag_input: Option<String>Draft name for a brand-new tag being typed by the user. None when
the input bar is inactive. Newly entered tags are appended to rows
with action = AddToAll.
new_tag_cursor: usize§initial_actions: Vec<BulkTagAction>Snapshot of rows[i].action at editor open time. Used by is_dirty
to detect pending changes on Esc and prompt the user before
discarding. Captured by the opener (e.g. App::open_bulk_tag_editor)
after rows is populated.
Length-mismatch semantics: any extra row beyond the baseline length
(i.e. a newly added tag via +) counts as dirty if its action is
non-Leave. This matches the user’s intuition that “I typed a new tag,
closing now should warn me”.
Implementations§
Source§impl BulkTagEditorState
impl BulkTagEditorState
Sourcepub fn is_dirty(&self) -> bool
pub fn is_dirty(&self) -> bool
Returns true if any row’s action differs from the open-time baseline, or if rows have been added since open.
Single source of truth for the dirty check. The handler consults this on Esc to decide between immediate exit and discard confirmation. Every editable surface gets a dirty-check so Esc never drops unsaved work.
Invariant: rows is append-only after open_bulk_tag_editor
captures the baseline. The + new tag flow only appends to rows;
no code path removes rows during the editor session. If a future
change introduces row removal, the length-mismatch branch below will
silently treat the missing baseline rows as clean (because zip
stops at the shorter slice). At that point this method needs an
explicit shrink branch; the assertion below guards the assumption.
Trait Implementations§
Source§impl Debug for BulkTagEditorState
impl Debug for BulkTagEditorState
Source§impl Default for BulkTagEditorState
impl Default for BulkTagEditorState
Source§fn default() -> BulkTagEditorState
fn default() -> BulkTagEditorState
Auto Trait Implementations§
impl Freeze for BulkTagEditorState
impl RefUnwindSafe for BulkTagEditorState
impl Send for BulkTagEditorState
impl Sync for BulkTagEditorState
impl Unpin for BulkTagEditorState
impl UnsafeUnpin for BulkTagEditorState
impl UnwindSafe for BulkTagEditorState
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