Skip to content

0.4.0: slices two to six - #18

Merged
anderix merged 7 commits into
mainfrom
editing-slices-two-to-six
Sep 21, 2026
Merged

anderix merged 7 commits into
mainfrom
editing-slices-two-to-six

Conversation

@anderix

@anderix anderix commented Sep 21, 2026

Copy link
Copy Markdown
Member

Slices 2 to 6 of 0.4.0 as one tree: the commits of #12, #13, #14, #15 and #16, plus the removal of drag and drop. Opened because merging the stacked chain in a loop went wrong: #13 and #15 merged into the branch below them rather than into main, and #12, #14 and #16 were closed when their base branches were deleted. This is the same commit (f917072) that #17 ran every workflow on, green on every lane, and it descends from #11's commit, so it merges cleanly.

Each slice's own description is on its PR: #12 (the core mutation), #13 (cell entry), #14 (shape geometry), #15 (paragraph and label editing), #16 (the words).

🤖 Generated with Claude Code

anderix and others added 7 commits September 21, 2026 14:37
The core can now change a document, in the three ways the views will
ask for, and no view asks yet. Each write is tested by mutating a
corpus document and comparing everything else.

`Element` gains a path of child indices to reach a node again without
holding a reference into the tree, mutable access by that path, and
attribute writes; `Document::name` spells a new name in the prefix the
document declares for its namespace, so a document that writes `t:`
for the text namespace is written its own way.

`SheetDocument::set_cell` puts a value in a cell by sheet, row and
column. A row or cell the document wrote once with a repeat count is
split into the run before, the one, and the run after, with the counts
fixed, so the one changes and its neighbours in the run keep what they
had; a row or cell past what the document wrote is created, with one
repeated empty run filling the gap. A cell under a neighbour's span or
holding a formula is refused, and nothing moves. `Value::from_input`
reads what a person typed the way a spreadsheet does, and the cached
text is the value's shortest spelling, which a spreadsheet application
reformats from the value when it next opens the file.

`Presentation::set_geometry` writes a shape's four `svg:` attributes,
each in the unit it was read in. A shape placed by `draw:transform` is
refused rather than answered wrongly.

`odox_core::edit` edits a paragraph through its flat text, built from
the tree and not from the renderer's layout. Characters are deleted
from the nodes that hold them, new text goes into the text node at the
start of the range, every element that contributes no characters — a
bookmark, a frame, a field, a note — stays where it was, and
whitespace is then written the way ODF requires. Adjacent text nodes
are joined, because the parser keeps an entity reference as a node of
its own and two left side by side would not read back as themselves. A
split carries a zero-length element at the split point to the first
half. The test replaces six kinds of text across a grid of ranges in
every paragraph of every corpus document and checks the result against
string arithmetic, the marker count, and a re-parse.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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]>
In xodp, in edit mode, a click picks one of the slide's own shapes, a
drag moves it, and a drag on a corner handle moves that corner with the
opposite one fixed. Each frame of the drag writes the four `svg:`
attributes through `set_geometry`, so the shape is drawn where it is
rather than previewed, and the tree is recorded once when the drag
begins, so a drag is one undo step. Escape and a click on the empty
page put the pick down; changing slide does too.

The hit is tested where the button went down. egui reports a drag only
once the pointer has travelled past its threshold and gives the
pointer's position then, ten points from an eight-point handle, which
is how the first attempt at a resize deselected the shape instead.

What is not picked: a shape placed by `draw:transform`, which states no
corner; a line, placed by its ends; a connector; a group; and
everything the master page contributes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
In edit mode a click on a paragraph opens it as a text box in place, at
the paragraph's own font, size, colour, indent and width, on the page's
paper: in xodt for the flow, and in xodp for a shape's label, which is
the same paragraph through the same box. Escape puts the paragraph
back, Ctrl+Enter or a click elsewhere keeps what was typed, Enter is a
new paragraph once it is kept, and Backspace with the caret at the very
start joins the paragraph onto the one before it and reopens the box
there with the caret at the join.

What is written is the difference between what the box was given and
what it hands back. `odox_core::edit::rewrite` compares the two from
both ends and replaces only the middle, putting the new text into the
node that held the old before the old comes out, so a span or a marker
outside the change is untouched and what replaces a bold word is bold;
a newline inside the change splits the paragraph, each half with the
original's style. `apply` and `join_with_previous` do that by a path
under a root, which is how both views reach a paragraph again.

The renderer keeps a path of child indices as it walks, reports the
paragraph a click landed on, and draws the box in place of the
paragraph the path names. A slide's label is drawn from the shape and
edited from the page, so the canvas tells the flow where its root sits
and hands the box's state through. A frame anchored inside a paragraph
is reached by a clone, so nothing in it is edited in place. On a slide
in edit mode a drag moves the shape and does not select its text.

Two things found on the way. A measuring pass is an invisible ui, and
an invisible ui is disabled: a text box added in one surrendered the
focus the real one had just taken, so the box closed itself on the
next frame; a sizing pass now takes the box's height and no box. And a
proportional line height was resolved against the paragraph's size and
applied to every run, so a title whose size lives on its span sat in a
line thirteen points tall and its click target with it; each run now
takes its own.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Every surface that said viewer, reader, or "reads and does not write"
now says what 0.4.0 is: a lightweight editor that changes what is there
and saves the document back as it was opened. The README, both store
listings and their App Review notes, the privacy statement, the desktop
entries, the Debian descriptions, the man pages, the crate descriptions,
the launcher's help and the repository guide.

The promise changes from nothing written to nothing written until Save,
and then only the file that was opened or the one named; no temporary
file left beside it, no backup, no cache, and one preference in a
settings file written only when it is changed. The store subtitles
become "Edit OpenDocument text", "Edit OpenDocument sheets" and "Edit
OpenDocument slides", in German "Textdokumente bearbeiten" and its
siblings, and every field is counted against its limit in both
languages. The App Review notes say `CFBundleTypeRole` Editor and the
read-write entitlement, which the Mac session changes in the bundle.

The desktop entries move from Office;Viewer to WordProcessor,
Spreadsheet and Presentation. The version is 0.4.0 and the changelog
says what it carries. The privacy entry is canonical here and is copied
to excelano.com/legal, which is a change in that repository.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A Wayland session delivers no file drop to a winit window, so the
sentence names the platforms where one does.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A Wayland session delivers no file drop to a winit window, so the drop
path is taken out of the shell rather than left working on some
desktops and not others, and no document mentions one. A document is
opened from the command line, from Ctrl+O, or from the desktop.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@anderix
anderix merged commit 56b0911 into main Sep 21, 2026
11 checks passed
@anderix
anderix deleted the editing-slices-two-to-six branch September 21, 2026 22:22
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