Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

A placed table keeps a host header band; a chain re-splits after a handle resize (core v0.71.13) - #10

Merged
drietsch merged 3 commits into
mainfrom
fix/gesture-reflow-header-bands
Oct 17, 2026
Merged

drietsch merged 3 commits into
mainfrom
fix/gesture-reflow-header-bands

Conversation

@drietsch

@drietsch drietsch commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Follows core v0.71.13 (additive on protocol 71, core ADR 159).

A placed table keeps a header band the host added

The in-place refresh of a stale placed table could not keep a header or footer band the host added with insertHeaderRow / insertFooterRow: the engine reported a table's row count but not where its bands sit, so a table whose row count differed from what was placed was replaced and the band lost.

Core v0.71.13 reports tableHeaderRowCount / tableFooterRowCount on a table. Where the engine answers them, refreshBands takes the table's body and columns as the workbook's and the refresh writes them below the header band (offsetTableRows in sheet-host-model moves every row-addressed op of the refresh by the band's size). The band, its text and the table id stay. Where the engine does not answer them, behaviour is unchanged: the table is replaced. A body row the host inserted cannot be located either way, so that table is replaced too.

A paginated range re-splits after a handle resize

The chain subscription already re-paginates on any document.onDidChange event that carries reflow, keyed off the field's presence. Until now only a resizeFrame (mutationApplied) carried one. Core v0.71.13 also reports it on gestureCommitted when a frame is resized by its handles, and plugin-sdk 0.2.58 passes it through. So the fix needs no logic change in this bundle; an older host reports a handle resize without it and the split stays where it was, as before. The docs say so.

Tests

Each new spec fails on the old pins first:

  • session-wave9.spec.ts: a band added in an earlier session survives a reopen; the body shows the new values below it and the table id is unchanged. A band added in this session survives two refreshes. On canvas-wasm 0.71.8 both fail (the table was replaced). Also: an engine without band counts still replaces the table (withoutBandCounts), and an inserted body row replaces it.
  • sheet-host-model/test/table-refresh.spec.ts: offsetTableRows moves every row-addressed op kind and nothing else.
  • chain-gesture-reflow.spec.ts: a 40-row range over two chained frames; the first frame shortened by a resize/south gesture through the host (begin, update, commit). The rows move into the second frame and the same two tables are kept. A move by the gesture kit changes nothing. On the 0.2.45 contract it fails ("the first frame holds fewer rows: expected 34 to be less than 34").

Release

  • @paged-media/sheet 0.1.0-canary.22 → 0.1.0-canary.23 (a merge publishes it).
  • Peers unchanged: @paged-media/plugin-api / @paged-media/plugin-sdk >=0.2.45-canary.0. Detection is by field presence; nothing needs 0.2.58.
  • Real-engine tests: canvas-wasm 0.71.8 → 0.71.13; contract pins (plugin-api, plugin-sdk, devDependencies) 0.2.45-canary.0 → 0.2.58-canary.0.
  • docs/status.md is read from this code at 0.1.0-canary.23.

CI note

The check job (cargo-deny) fails on three RustSec advisories against zip published 2026-10-16/17: RUSTSEC-2026-0367, -0368, -0369. All three concern ZipArchive::extract() / ZipStreamReader::extract(), which this repo does not call. This PR changes no Rust or Cargo file, so main fails the same way. Whether to upgrade zip or record an ignore is a separate decision.

🤖 Generated with Claude Code

drietsch and others added 2 commits October 17, 2026 08:36
The in-place refresh could not keep a header or footer band the host
added with insertHeaderRow / insertFooterRow: the engine reported a
table's row count but not where its bands sit, so a table whose row
count differed from what was placed was replaced, and the band lost.

Core v0.71.13 reports tableHeaderRowCount and tableFooterRowCount on a
table (core ADR 159). Where the engine answers them, refreshBands takes
the table's body (rows outside the bands) and columns as the workbook's,
and the refresh writes them below the header band: every row-addressed
op of the refresh moves down by the band's size (offsetTableRows in
sheet-host-model). The band, its text and the table id stay. Where the
engine does not answer them, the behaviour is today's: a table whose
rows differ from what was placed is replaced. A body row the host
inserted cannot be located either way, so that table is replaced too.

The real-engine tests move to canvas-wasm 0.71.13. New specs: a band
added in an earlier session survives a reopen with the body refreshed
below it and the table id unchanged; a band added in this session
survives two refreshes; an engine without band counts replaces the
table (the old behaviour); an inserted body row replaces it. The chain
subscription's docs name the gesture case, which needs no code change:
it re-splits on any change that carries a reflow.

Release 0.1.0-canary.23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plugin-sdk 0.2.58 passes the reflow core v0.71.13 reports on a
gestureCommitted (a frame resized by its handles) through
document.onDidChange. The chain subscription re-paginates on any change
that carries a reflow, so it needs no code change; this proves it on the
real engine: a 40-row range paginated over two chained frames, the first
shortened by a resize gesture begun, moved and committed through the
host. Its rows move into the second frame, and the same two tables are
refreshed. A move by the gesture kit reports no reflow and changes
nothing. On the 0.2.45 contract the split stayed where it was.

The contract pins move to 0.2.58-canary.0; the peers stay
>=0.2.45-canary.0 (presence of the field is the feature test).
docs/status.md is read from this code at 0.1.0-canary.23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@drietsch
drietsch merged commit 0217708 into main Oct 17, 2026
4 of 5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant