Merge branch 'main' into worktree-improvise-ewi-formula-crate

# Conflicts:
#	src/model/types.rs
#	src/view/layout.rs
This commit is contained in:
Edward Langley
2026-04-15 21:11:55 -07:00
16 changed files with 1170 additions and 497 deletions

View File

@ -43,6 +43,8 @@ pub struct CmdContext<'a> {
/// View navigation stacks (for drill back/forward)
pub view_back_stack: &'a [String],
pub view_forward_stack: &'a [String],
/// Whether the app currently has an active drill snapshot.
pub has_drill_state: bool,
/// Display value at the cursor — works uniformly for pivot and records mode.
pub display_value: String,
/// How many data rows/cols fit on screen (for viewport scrolling).
@ -55,9 +57,22 @@ pub struct CmdContext<'a> {
}
impl<'a> CmdContext<'a> {
/// Return true when the current layout is a records-mode layout.
pub fn is_records_mode(&self) -> bool {
self.layout.is_records_mode()
}
pub fn cell_key(&self) -> Option<CellKey> {
self.layout.cell_key(self.selected.0, self.selected.1)
}
/// Return synthetic record coordinates for the current cursor, if any.
pub fn synthetic_record_at_cursor(&self) -> Option<(usize, String)> {
self.cell_key()
.as_ref()
.and_then(crate::view::synthetic_record_info)
}
pub fn row_count(&self) -> usize {
self.layout.row_count()
}