feat: Add support for tabular/csv data input.
This commit is contained in:
@@ -81,12 +81,24 @@ pub struct ViewState {
|
||||
pub mode: Mode,
|
||||
pub selection_count: usize,
|
||||
pub multi_enabled: bool,
|
||||
/// Column headers for table mode. None when not in
|
||||
/// table mode.
|
||||
pub columns: Option<Vec<ColumnHeader>>,
|
||||
/// Monotonically increasing counter. Each call to
|
||||
/// `build_view_state()` bumps this, so frontends can
|
||||
/// detect duplicate broadcasts and skip redundant redraws.
|
||||
pub generation: u64,
|
||||
}
|
||||
|
||||
/// Column header with display name and computed width for
|
||||
/// table mode rendering.
|
||||
#[must_use]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ColumnHeader {
|
||||
pub display_name: String,
|
||||
pub width: u16,
|
||||
}
|
||||
|
||||
/// A single item in the current viewport window. Has the
|
||||
/// display label pre-resolved and the position in the
|
||||
/// filtered list.
|
||||
@@ -97,6 +109,9 @@ pub struct VisibleItem {
|
||||
pub formatted_text: Option<String>,
|
||||
pub index: usize,
|
||||
pub selected: bool,
|
||||
/// Column cell values for table mode. None when not in
|
||||
/// table mode.
|
||||
pub column_values: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
/// Final outcome of [`crate::menu::MenuRunner::run`]. The
|
||||
|
||||
Reference in New Issue
Block a user