ElyTable: header clicks and row or column sizes work right after a cell click (T-07)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 18:20:28 -04:00
1 parent 7a12a28b67
commit 798e00571a
4 files changed
+24 -3

No files matched your search

@@ -256,3 +256,21 @@ fn commands_from_one_read_run_together_and_hovering_changes_nothing() {
assert!(crate::is_stale(&stale), "{stale}");
assert_eq!(only(&mut worker), ["One", "Two", "U"], "nothing else was renamed");
}
#[test]
fn a_header_act_after_a_click_is_not_stale() {
if install().is_none() {
eprintln!("SKIP: no pinned LOK build");
return;
}
let (_dir, mut worker, doc) = open_book(SHEETS);
let read = worker.now(&doc).expect("the state");
// A click moves the revision; rows and columns stay.
for kind in [0, 1] {
let click = crate::Mouse { kind, x: 500, y: 500, count: 1, buttons: 1, modifiers: 0 };
worker.post_mouse(&read, click).expect("clicks");
}
assert_ne!(worker.now(&doc).expect("the state"), read, "the click counts as a change");
worker.run(&read, "select.column", &["2", "0"]).expect("the column header still selects");
worker.run(&read, "columns.width", &["800", "3"]).expect("the column's width still sets");
}
+4 -2
View File
@@ -61,7 +61,7 @@ pub struct Command {
/// Arguments that count things as a read saw them.
const NUMBERED: &[&str] = &[
"Index", "nTabNumber", "TabNo", "Part", "Row", "Col", "Column", "StartColumn", "StartRow", "EndColumn", "EndRow",
"Index", "nTabNumber", "TabNo", "Part", "StartColumn", "StartRow", "EndColumn", "EndRow",
];
impl Command {
@@ -306,7 +306,9 @@ mod tests {
assert!(find("sheet.delete").expect("the row").addressed(&["1"]));
assert!(!find("cell.enter").expect("the row").addressed(&["1"]));
assert!(find("notes.set").expect("the row").addressed(&["text", "1"]), "a slide by number");
assert!(find("select.row").expect("the row").addressed(&["3", "0"]), "a row by number");
// Clicks renumber no row or column: never stale.
assert!(!find("select.row").expect("the row").addressed(&["3", "0"]), "a header row");
assert!(!find("columns.width").expect("the row").addressed(&["500", "2"]), "a column's width");
assert!(!find("rows.height_selected").expect("the row").addressed(&["500"]), "a size names nothing");
}