Repository navigation
fix(sheets): undo, view duplicates, draft uploads and the multiline editor - #65
Conversation
…ne at a time - The cell undo and redo steps waited for nothing (`() => void commit(...)`), so a step the server refused still left the history, and Mod+Z after it did nothing. They now wait for the commit and throw when any row was not saved; the history keeps the step for another try. - Steps run one at a time: a held Mod+Z against a slow server no longer sends the undos of one cell in parallel, where they could land out of order.
…e page A name of 76 to 80 characters made every "<name> copy N" too long, so the search for a free name never ended. The copy now shortens the name to fit.
A new row that still lacked required values said "The row was created, but its key could not be read" and told the host a row was created. It now says which fields to fill, and the row stays a draft.
… when the grid scrolls
|
Review complete. 🟠 1 high · 🟡 1 medium 💬 Inline comments (2)
🧹 Nitpicks (1) — 🟢 1 low
The change serializes undo/redo through a promise chain so held Mod+Z against a slow server runs writes in order, and keeps refused steps on the undo stack for retry while surfacing an
Reviewed commit: 8cab575 |
There was a problem hiding this comment.
This PR hardens Sheets undo/redo, inline editor anchoring, saved-view naming, and draft submission failure paths.
Key findings
- 🟠 Refused in-flight undo resurrects entry after
recordfork — use-undo-redo.ts:77 - 🟡 Queued undo/redo pops a stack mutated mid-flight — use-undo-redo.ts:70
…ry right - A refused step goes back to its place, under any edit recorded while it waited, so the next undo is that edit and not a replay of old values over it. - A refused step whose stack was cleared, or whose redo stack an edit forked, is dropped: Undo no longer turns back on after a clear. - An edit or a clear cancels the undo and redo steps asked for before it that have not started, so a held Mod+Z never undoes the newer edit.
|
Tenki nitpick (unthrottled scroll |
Fixes the Sheets problems a review of constructive-io/dashboard#324 found in the grid it copies from here. Each fix has a test that fails without it.
() => void commit(...), so the history never saw a refusal and a refused undo was lost. They now wait for the commit and throw when any row was not saved (CommitCellsResult.unsaved), so the step stays for another try. The writes are values, so a retry also suits the rows that saved.useUndoRedoruns each step after the one before it ends. A held Mod+Z against a slow server no longer sends undos of one cell in parallel, where they could land out of order.copyViewName(grid/views/view-names.ts) shortens the name so the copy fits.Before and after
The multiline cell editor after the grid scrolls by one row (Storybook, Stress/10k Rows):
🤖 Generated with Claude Code
https://claude.ai/code/session_017WbsG7HDw7AL26N4UZGgrM