fix(records): include _Measure as visible column in records mode (improvise-rbv)

The records mode column filter excluded all categories starting with '_',
which hid _Measure. Changed to explicitly exclude only _Index and _Dim,
making _Measure visible as a data column. Updated the blank-model editing
test to reflect the new column order (_Measure first, Value last).

Made-with: Cursor
This commit is contained in:
Edward Langley
2026-04-15 03:56:18 -07:00
parent ee5fc89e43
commit 38f83b2417
2 changed files with 48 additions and 3 deletions

View File

@ -744,7 +744,8 @@ mod tests {
/// Regression: editing the first row in a blank model's records view
/// should persist the typed value even though plain records mode does not
/// use drill state.
/// use drill state. With _Measure as the first column, `o` lands on it;
/// type a measure name, Tab to Value, type the number, Enter to commit.
#[test]
fn edit_record_row_in_blank_model_persists_value() {
use crate::model::cell::CellKey;
@ -753,15 +754,30 @@ mod tests {
app.handle_key(KeyEvent::new(KeyCode::Char('R'), KeyModifiers::NONE))
.unwrap();
// `o` adds a record row and enters edit at (0, 0) = _Measure column
app.handle_key(KeyEvent::new(KeyCode::Char('o'), KeyModifiers::NONE))
.unwrap();
// Type a measure name
app.handle_key(KeyEvent::new(KeyCode::Char('R'), KeyModifiers::NONE))
.unwrap();
app.handle_key(KeyEvent::new(KeyCode::Char('e'), KeyModifiers::NONE))
.unwrap();
app.handle_key(KeyEvent::new(KeyCode::Char('v'), KeyModifiers::NONE))
.unwrap();
// Tab to commit _Measure and move to Value column
app.handle_key(KeyEvent::new(KeyCode::Tab, KeyModifiers::NONE))
.unwrap();
// Type the value
app.handle_key(KeyEvent::new(KeyCode::Char('5'), KeyModifiers::NONE))
.unwrap();
// Enter to commit
app.handle_key(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE))
.unwrap();
assert_eq!(
app.model.get_cell(&CellKey::new(vec![])),
app.model.get_cell(&CellKey::new(vec![
("_Measure".to_string(), "Rev".to_string()),
])),
Some(&crate::model::cell::CellValue::Number(5.0)),
"editing a synthetic row in plain records mode should write the value"
);