1# Rust table authoring
2
3`created/candidate` is the page writer's output for
4`a_new_table_is_created_on_a_fresh_page` in
5`crates/onestore/tests/page_tables.rs`: on a section created in Rust, a
6paragraph between two text paragraphs becomes a two-by-two table with locked
7144 pt and 216 pt columns, visible borders and a text paragraph in every
8cell. `created/cold` is a fresh OneNote 2010 read showing both columns with
9their widths and locks, both rows and every cell text.
10
11`edited/candidate` is the writer's output for
12`a_row_and_a_column_are_added_to_a_native_table_and_removed_again` on
13`corpus/outline-edit/tree/before`: the one-row, two-column native table on
14"Delete cell subtree" gains an unlocked 120 pt third column and a second row
15of three cells. `edited/cold` is its cold read: the native columns keep their
16widths and locks, OneNote sizes the unlocked column to its content, and the
17new row and cells read back with their text.
18
19`nested/candidate` is the writer's output for
20`a_table_nests_inside_a_cell_and_is_removed_again` on the same tree fixture:
21the second cell of the native table gains a paragraph holding a one-column,
22two-row table with locked 72 pt column and visible borders. `nested/cold` is
23its cold read with both tables.
24
25Native rows and cells are plain containers; the writer creates them with the
26modification time, the indent array copied from a sibling cell (OneNote's
27default without one), and the flags every native cell carries, rebuilds each table's row and cell order to the
28model's, and writes the column count, widths, locks and border flag. New
29tables start as an empty paragraph whose content the structure pass replaces.
30An edit that ends with an empty cell is refused; its ops refill the cell themselves.
31`tools/test_table_edit.py` checks all three captures without a VM. Regenerate
32with `ONESTORE_TABLE_EXPORT`, `ONESTORE_TABLE_EDIT_EXPORT` and
33`ONESTORE_NESTED_TABLE_EXPORT` set to new absolute directories while running
34the tests, then cold-open them with `tools/native_runner.py OUTPUT COLD
35--expected-pages 1|12 --collect-notebook`.