R3.3: the LOK view's pointer follows the kernel; an arrow over cells

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

[skip ci]
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-12 23:31:28 -04:00
1 parent ee1b8ad375
commit 26c0a64665
11 files changed
+72 -6

No files matched your search

+2
View File
@@ -14,6 +14,7 @@ fn unpack_pushed(body: &[u8]) -> io::Result<(u64, Events)> {
let rects = rects_of(&mut unpack)?;
let cursor = rects_of(&mut unpack)?.first().copied();
let cursor_visible = unpack.u64()? != 0;
let pointer = unpack.str()?;
let selection = rects_of(&mut unpack)?;
let graphic = rects_of(&mut unpack)?.first().copied();
let cropping = unpack.u64()? != 0;
@@ -55,6 +56,7 @@ fn unpack_pushed(body: &[u8]) -> io::Result<(u64, Events)> {
rects,
cursor,
cursor_visible,
pointer,
selection,
graphic,
cropping,
+24
View File
@@ -195,3 +195,27 @@ fn a_theme_switch_is_no_edit() {
assert_eq!(undo["actions"], "", "{scheme} left undo steps");
}
}
#[test]
fn the_pointer_is_text_only_while_a_cell_edits() {
if install().is_none() {
eprintln!("SKIP: no pinned LOK build");
return;
}
let (_dir, mut worker, doc) = open_book(FODS);
let hover = |worker: &mut Worker, x| {
let at = Mouse { kind: 2, x, y: 120, count: 1, buttons: 0, modifiers: 0 };
worker.post_mouse(&doc, at).expect("hovers");
};
hover(&mut worker, 400);
let reading = poll_until(&mut worker, &doc, &Events::default(), SETTLE, |seen| {
!seen.pointer.is_empty()
});
assert_eq!(reading.pointer, "default", "a cell shows the arrow");
worker.post_key(&doc, 0, 769).expect("F2 edits A1");
hover(&mut worker, 500);
let editing = poll_until(&mut worker, &doc, &reading, SETTLE, |seen| {
seen.pointer == "text"
});
assert_eq!(editing.pointer, "text", "the edited cell shows the text pointer");
}