| 1 | # Files on the page |
| 2 | |
| 3 | `native/files.one` is OneNote 2010's own section, made in a lab clone on |
| 4 | 2026-09-29. Its second page holds two copies of `float.txt` (38 bytes) outside |
| 5 | any outline: one inserted through COM `UpdatePageContent` as a page-level |
| 6 | `InsertedFile` at (216, 180) and then dragged to (288, 140.4), the other |
| 7 | attached with Insert > Attach File after a click on blank page, at (342, 284.4). |
| 8 | |
| 9 | `candidate/` is `crates/canvas/tests/attachment_insert.rs`'s second section: |
| 10 | the editor places the caret on blank page at (342, 284.4) and attaches |
| 11 | `float 🦀.txt` (37 bytes, with the icon OneNote stored for a text file), then |
| 12 | at (126, 410.4) attaches `large.bin` (2 MiB of noise, with the canvas's |
| 13 | blank-page icon) and drags it to (288, 140.4). Each step is its own edit of the |
| 14 | ops the editor recorded, sealed into one appended revision. `cold/` is a fresh |
| 15 | OneNote 2010 read: both files are page-level `InsertedFile`s at those |
| 16 | positions, and the bytes OneNote materializes to open them |
| 17 | (`read/*.attachment`) hash as written. `tools/test_attachment_floating.py` |
| 18 | checks the capture without a VM. Regenerate with `CANVAS_FLOATING_EXPORT` set to |
| 19 | a directory while running the test, then `tools/native_runner.py DIR COLD |
| 20 | --expected-pages 1 --collect-notebook --screenshots`. |
| 21 | |
| 22 | ## What OneNote 2010 does |
| 23 | |
| 24 | - **Placement.** Attached or dropped on blank page, the file becomes a child of |
| 25 | the page at the point a click there puts the caret: on the 18 pt grid from |
| 26 | the margin origin, 7 px above the pointer. It draws as a file in an outline |
| 27 | does, its 32-pixel icon at 24 points centred in a 54-point column over its |
| 28 | name without the extension, and selects as a shaded column framed in dashes, |
| 29 | without handles. |
| 30 | - **Storage.** The attachment object (jcid 0x60035) carries what a paragraph's |
| 31 | file does, except LayoutAlignmentInParent; its position (0x14001c14/15), |
| 32 | LayoutAlignmentSelf 9, and the column's LayoutMaxWidth/Height (54 by about 63 |
| 33 | points) with the size not set by the user. A file inserted through COM has |
| 34 | neither alignment nor size. |
| 35 | - **Moves.** Dragging rewrites the position alone, on the grid; the |
| 36 | modification time stays. |
| 37 | - **Payloads.** Both copies' embedded-file objects, and both icons, name one |
| 38 | payload in the file data store. |