feat(wasm): edit and save a sheet from the example - #866
Conversation
427dc31 to
782dd82
Compare
2167f4c to
bee64f2
Compare
782dd82 to
2df7282
Compare
bee64f2 to
359462c
Compare
2df7282 to
e370f6e
Compare
359462c to
0f430c2
Compare
0f430c2 to
c209153
Compare
|
Reviewed and force-pushed. A refused op was swallowed, and the file downloaded anyway. The page has no lock for a position the engine cannot write yet — an Conciseness:
|
The example turns `odr.editing` on, lights its save button off `onEditChange` and says a refusal in the status line - the three callbacks a host assigns, here on the frame's `contentWindow` once it has loaded, where droid and ios go in through `evaluateJavascript`. A view holds its own log, so the log is written into the document when the view goes away as well as before a save, which a cell op being idempotent makes safe. `edit.test.mjs` writes a cell by position through the bindings and reopens what was saved, on an `.ods` built in memory beside the `.odt`. Step 1.5 of `docs/design/spreadsheet-editing.md`, which closes step 1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012eNBvra2NSxLjUvVKzuXSY
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012eNBvra2NSxLjUvVKzuXSY
c209153 to
eb8fa4d
Compare
🤖 Generated with Claude Code
Step 1.5 of
docs/design/spreadsheet-editing.md, which closes step 1. Stacked on #865.The example gains an
editand asavebutton. It assigns the three callbacks on the frame'scontentWindowonce it has loaded — the same moment droid and ios go in throughevaluateJavascript— lights the save button offonEditChange(with the op count on it), and puts a refusal in the status line, which is where an app would raise a snackbar in its own string catalogue.A view holds its own log (decision 6), so the example writes the log into the document when the view goes away as well as before a save; a cell op is idempotent, so doing both is safe, and re-rendering the view shows what was written.
edit.test.mjswrites a cell by position through the bindings and reopens what was saved, on an.odsbuilt in memory beside the.odt— the binding-level pin forsetCell.Verified by hand: drop
ods/file_example_ODS_10.odsinto the example, type777into B2, save, drop the saved bytes back in — the reopened sheet shows777, and the save button falls back tosave…whencommitted()runs.ctest --test-dir build-wasm/wasmis green (43 tests).