Skip to content

feat(html): take a sheet edit back, and tell the host what the log holds - #865

Merged
andiwand merged 1 commit into
mainfrom
feat/sheet-edit-log
Sep 8, 2026
Merged

feat(html): take a sheet edit back, and tell the host what the log holds#865
andiwand merged 1 commit into
mainfrom
feat/sheet-edit-log

Conversation

@andiwand

@andiwand andiwand commented Sep 8, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Step 1.4 of docs/design/spreadsheet-editing.md. Stacked on #863.

odr.editing.undo() and redo() walk the commits the page made, and ctrl/cmd+Z and ctrl/cmd+shift+Z (or ctrl+Y) reach them from the keyboard while the mode is on. An undo shows the value the op replaced and drops the op, so what the log hands out and what the page shows stay the same thing — undoing the only write into a cell leaves that position out of the envelope entirely, and undoing the second write into one leaves the first.

odr.onEditChange carries {dirty, operations, canUndo, canRedo} on every commit, undo, redo and committed(): the save button a host lights, the back-press warning it raises while the page holds unsaved edits, and the toolbar it greys. committed() is what a host calls once the file it saved matches the page again, and undo starts over from there.

test/browser/sheet/editing.html grows the log cases — 48 checks, green in Chrome.

@andiwand
andiwand force-pushed the feat/sheet-overlay-editor branch from 8b2dfb8 to 4603784 Compare September 8, 2026 20:14
@andiwand
andiwand force-pushed the feat/sheet-edit-log branch from 427dc31 to 782dd82 Compare September 8, 2026 20:15
@andiwand
andiwand force-pushed the feat/sheet-overlay-editor branch from 4603784 to b6e6328 Compare September 8, 2026 20:20
Base automatically changed from feat/sheet-overlay-editor to main September 8, 2026 20:21
@andiwand
andiwand force-pushed the feat/sheet-edit-log branch from 782dd82 to 2df7282 Compare September 8, 2026 20:24
@andiwand

andiwand commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

Reviewed and force-pushed, rebased on the reviewed #863. editing.html is 51 checks, the new one verified against a negative control.

A chord in another input was taken as the sheet's. pinnedKey tested the modifiers before it tested the event target, so ctrl/cmd+Z typed into the search box search_js puts on the same page undid a cell edit instead of the text just typed. The target guard sits first now, and the modifier branch reads as one thing: ctrl/cmd is the undo chord here and nothing else.

Comments cut to a line each, and the changelog entry to what a host acts on — onEditChange reports the state of the log, with the payload left to the design doc.

`odr.editing.undo()` and `redo()` walk the commits the page made, and ctrl/cmd+Z
and ctrl/cmd+shift+Z reach them from the keyboard. An undo shows the value the
op replaced and drops the op, so what the log hands out and what the page shows
stay the same thing: undoing the only write into a cell leaves that position out
of the envelope entirely.

`odr.onEditChange` carries `{dirty, operations, canUndo, canRedo}` on every
commit, undo, redo and `committed()` - the save button a host lights, the
back-press warning it raises, and the toolbar it greys. `committed()` is what a
host calls once the file it saved matches the page, and undo starts over there.

Step 1.4 of `docs/design/spreadsheet-editing.md`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eNBvra2NSxLjUvVKzuXSY
@andiwand
andiwand force-pushed the feat/sheet-edit-log branch from 2df7282 to e370f6e Compare September 8, 2026 20:28
@andiwand
andiwand merged commit b928cc0 into main Sep 8, 2026
25 checks passed
@andiwand
andiwand deleted the feat/sheet-edit-log branch September 8, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant