feat(html): mark the formula cells an edit left out of date - #887
Merged
Conversation
andiwand
force-pushed
the
feat/sheet-dependencies
branch
from
September 11, 2026 22:15
de13e68 to
8f6aaa9
Compare
andiwand
force-pushed
the
feat/stale-formulas
branch
2 times, most recently
from
September 12, 2026 06:50
0eeb6b3 to
f8b6951
Compare
andiwand
force-pushed
the
feat/sheet-dependencies
branch
2 times, most recently
from
September 12, 2026 07:27
08dc7d0 to
d9144fd
Compare
andiwand
force-pushed
the
feat/stale-formulas
branch
2 times, most recently
from
September 12, 2026 07:31
4d42c3b to
eadb004
Compare
andiwand
force-pushed
the
feat/sheet-dependencies
branch
from
September 12, 2026 07:31
d9144fd to
84a500e
Compare
andiwand
force-pushed
the
feat/stale-formulas
branch
from
September 12, 2026 07:39
eadb004 to
ea2abd7
Compare
andiwand
force-pushed
the
feat/sheet-dependencies
branch
2 times, most recently
from
September 12, 2026 07:51
bb51ea6 to
79cedf7
Compare
andiwand
force-pushed
the
feat/stale-formulas
branch
from
September 12, 2026 07:51
ea2abd7 to
5c4d809
Compare
andiwand
force-pushed
the
feat/sheet-dependencies
branch
from
September 12, 2026 08:41
79cedf7 to
be80cc7
Compare
andiwand
force-pushed
the
feat/stale-formulas
branch
from
September 12, 2026 15:25
5c4d809 to
388788b
Compare
A sheet view states, per formula cell, the expression it computes (`data-odr-formula`) and the rectangles it reads (`data-odr-reads`: sheet, columns, rows, with `*` for an axis a reference leaves open). Both are editing scaffolding, so a read-only render carries neither. A commit marks the cells reading what it wrote, and the cells reading those, with `odr-sheet-stale`, and raises `odr.onCellsStale`. The marks follow the log, not the last write: `repaintStale` recomputes them after every commit, undo and redo, and the host hears only when the set moves. Nothing here recomputes a value; that is step 4. The page carries the graph rather than asking the host for it, because a mark has to keep up with typing. `odr.sheet.formulaAt` hands a formula bar the expression, and `formula::syntax_of` is now the one mapping from a file type to a formula syntax. Step 3.3 of `docs/design/spreadsheet-editing.md`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VVmjmddv2Ui17Nptc1ggue
andiwand
force-pushed
the
feat/stale-formulas
branch
from
September 12, 2026 15:36
388788b to
34064b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
Rebased on
main, now that #884, #885 and #886 have landed. One commit.Step 3.3 of
docs/design/spreadsheet-editing.md.What the markup gains
Per formula cell, in an editable render only:
data-odr-readsissheet,first column,last column,first row,last rowperrectangle, space separated, with
*for an axis a reference leaves open(
A:A). The renderer parses the cell's formula and resolves each sheet name tothe ordinal an op names it by.
What the page does with it
A commit marks the cells reading what it wrote — and the cells reading those —
with
odr-sheet-stale, and raises the newodr.onCellsStalecallback(
{sheet, cells}). The cell still shows the result its producer cached;nothing here recomputes one, that is step 4.
The marks follow the log, not the last write.
repaintStalerecomputesthem off the coalesced log after every commit, undo and redo, so an undo takes
back what it made stale and a save clears them with the log. The host hears
only when the set actually moves.
The style is a wavy underline in
--odr-sheet-stale, which layers over the pinand hover wash instead of fighting them and moves no geometry.
Why the page carries the graph
A mark has to keep up with typing, so a host round trip is the wrong shape
here. The engine's own graph (#886) is what the file side will use in step 3.4.
odr.sheet.formulaAt(column, row)hands a formula bar the expression.formula::syntax_of(FileType)is now the one mapping from a file type to aformula syntax; the renderer and
SheetDependenciesboth read it.Test
test/src/html_test.cpp: six cases — the expression, the rectangles, areference into another sheet resolving to its ordinal, the attribute
escaping, a read-only render carrying neither, and a formula reading nothing
stating no rectangle.
test/browser/sheet/editing.html: 61 checks now (was 51), headless-greentogether with the other four sheet pages. The fixture gained a second formula
cell reading the first, so the chain is checked.
onCellsStale, as the host-wiring reference.Reference output: this changes the emitted html for every sheet holding a
formula, so
compare-htmlstays red until the output repos get their commitand the pins advance.
https://claude.ai/code/session_01VVmjmddv2Ui17Nptc1ggue