Skip to content

A cell is edited in place - #13

Merged
anderix merged 1 commit into
an-edit-changes-one-subtreefrom
a-cell-is-edited-in-place
Sep 21, 2026
Merged

anderix merged 1 commit into
an-edit-changes-one-subtreefrom
a-cell-is-edited-in-place

Conversation

@anderix

@anderix anderix commented Sep 21, 2026

Copy link
Copy Markdown
Member

The third slice of 0.4.0, on top of #12, and the first editing a person can do. In xods, typing on the picked cell replaces it, Enter or F2 opens it with what it holds, Enter commits and moves down, Tab commits and moves right, Escape puts it back, and Delete clears it. The text box sits in the cell in the cell's own font, with the caret at the end. A spreadsheet edits without the mode, by convention.

What is typed goes through Value::from_input and set_cell with the tree recorded first, so Ctrl+Z takes it back. Leaving a cell as it was is not an edit. A formula cell or a covered cell is not opened and the cell bar says why; once anything has changed, every formula's cached result is drawn faint until a spreadsheet application recalculates. The shell keeps its shortcuts to itself while a text field has the focus and tells the view when the unsaved-changes question is up.

Checked: clippy with -D warnings, fmt, the catalogue check, the full test suite, and the window on X11: 12 typed over as 99 in B2 with the formula cells fainting and the title marked, Ctrl+S clearing the mark and content.xml carrying office:value="99" in the document's own calcext: spelling, Ctrl+W after a second edit raising Save / Discard / Cancel, Escape cancelling it, and Ctrl+Z putting 300 back and unmarking the title.

🤖 Generated with Claude Code

The first editing a person can do. In xods, typing on the picked cell
replaces it, Enter or F2 opens it with what it holds, Enter commits and
moves down, Tab commits and moves right, Escape puts it back, and
Delete clears it. The text box sits in the cell, in the cell's own font
on the page's paper, with the caret at the end. A spreadsheet edits
without the mode, by every spreadsheet's convention.

What is typed goes through `Value::from_input` and `set_cell`, with the
tree recorded first so that Ctrl+Z takes it back. Leaving a cell as it
was is not an edit, so stepping through a currency does not retype it
as a number: the editor opens on the value's input form and compares
against it. A cell that holds a formula, or one under a neighbour's
span, is not opened, and the cell bar says why until the pick moves;
`SheetDocument::can_edit` is that question, asked by the window before
it opens an editor and by `set_cell` before it writes.

Once anything in the document has changed, every formula's cached
result is drawn faint, because which of them went stale cannot be told
without evaluating them, and a spreadsheet application recalculates on
opening the file.

The shell keeps its keys to itself while a text field has the focus,
so Ctrl+Z inside a cell undoes the typing and not the document, and
tells the view when a question is up over the window, so the Enter
that answers it does not open a cell.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@anderix anderix mentioned this pull request Sep 21, 2026
@anderix
anderix merged commit 157fcfe into an-edit-changes-one-subtree Sep 21, 2026
@anderix
anderix deleted the a-cell-is-edited-in-place branch September 21, 2026 22:21
@anderix anderix mentioned this pull request Sep 21, 2026
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