mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 23:36:20 +00:00
fix(ffi): keep merged children in place and rename PageView to PageData
Merging a first child into its parent now gives its children the merged block's slot instead of appending them after the parent's other children. PageView clashed with Flutter's PageView widget in Dart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
305428eaea
commit
8c11d049fb
5 files changed
+104
-85
No files matched your search
@@ -66,6 +66,19 @@ fn merge_appends_text_and_adopts_children() {
|
||||
assert_eq!(g.outline(page).unwrap().len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn merging_a_first_child_into_its_parent_keeps_grandchildren_in_place() {
|
||||
let (_d, g) = open();
|
||||
let (_, ids) = page_with(&g, "P", &["p", "c", "gc", "s"]);
|
||||
g.indent_block(ids[1].clone()).unwrap();
|
||||
g.indent_block(ids[2].clone()).unwrap();
|
||||
g.indent_block(ids[2].clone()).unwrap();
|
||||
g.indent_block(ids[3].clone()).unwrap();
|
||||
// p > c > gc, p > s
|
||||
let rows = g.merge_block(ids[1].clone(), ids[0].clone()).unwrap();
|
||||
assert_eq!(shape(&rows), vec![(0, "pc"), (1, "gc"), (1, "s")]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insert_first_child_and_move() {
|
||||
let (_d, g) = open();
|
||||
|
||||
Reference in new issue
Block a user