Skip to content

feat(dialog): sort-key-aware table deltas — typed append + whole-cell updates#154

Merged
facontidavide merged 1 commit into
mainfrom
feat/typed-table-deltas
Jul 18, 2026
Merged

feat(dialog): sort-key-aware table deltas — typed append + whole-cell updates#154
facontidavide merged 1 commit into
mainfrom
feat/typed-table-deltas

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Summary

Immediate follow-up to #149 (it merged while this was being written against its branch — same content, rebased onto main). Without this, #149's typed sort keys and #152's batch deltas undermined each other: a typed table that streams via deltas silently degraded — appended rows could carry no keys (dropping those cells to the text rank inside a numeric column) and updateTableCells could not refresh the ordering truth behind the text.

  • appendTableRows gains a TableItem overload emitting a sparse append_values column map aligned to the appended rows — the delta-side mirror of column_values, produced by a shared encodeTypedRows helper now backing both typed entry points. The string overload erases append_values (same stale-key protection as plain setTableRows).
  • TableCellUpdate becomes {row, col, TableItem} — an update replaces the whole cell, display text and optional key together, so they cannot desync; a keyless item clears the key. Wire: [row, col, text] or [row, col, text, value]; a null key means keyless (NaN/Inf serialize as null), matching the column_values convention. Existing {r, c, "text"} brace-init call sites still compile via TableItem(const char*).
  • TableDeltaView decodes append_values + CellUpdate::value strictly (a malformed key or misaligned column rejects the whole delta, preserving the retransmission contract) through a shared numericFromJson helper that now also backs tableColumnValues.
  • Braced-literal appendTableRows call sites explicitized per feat(sdk): typed table sort keys in the dialog protocol (0.18.0) #149's documented overload-ambiguity caveat, which now names appendTableRows too; docs + CHANGELOG updated; last stale 0.17.0 reference removed (test comment).

Versioning

Rides the still-untagged 0.18.0 with #149/#150/#152; the TableCellUpdate layout change is legal pre-release (no tag has shipped the 3-member form). Header-only, no C ABI change.

Review trail

Codex review of the extension: no behavioral findings across brace-init compat, seq-sharing, null-key handling, and the append/append_values alignment check; one low doc gap (CHANGELOG key enumeration) fixed. TDD throughout (typed round-trips, misaligned/malformed rejections, null-keyless — each watched fail first). Full SDK suite 49/49; pre-commit clean.

Host-side application of the keys (stamping Qt sort roles from append_values/value) belongs to the PlotJuggler sort-keys binding when it lands; today's hosts ignore the new fields harmlessly.

🤖 Generated with Claude Code

… updates

Without this, the sort-keys feature and the batch deltas undermined each
other: a typed table that streams via deltas silently degraded, because
appended rows could carry no keys (text rank in a numeric column) and cell
updates could not refresh the ordering truth behind the text.

- appendTableRows gains a TableItem overload emitting a sparse append_values
  column map aligned to the appended rows (the delta-side mirror of
  column_values, via a shared encodeTypedRows helper); the string overload
  erases append_values for the same stale-key protection as setTableRows.
- TableCellUpdate becomes {row, col, TableItem}: an update replaces the WHOLE
  cell — display text and optional key together, so they cannot desync; a
  keyless item clears the key. Wire: [row, col, text] or [row, col, text,
  value]; a null key means keyless (NaN/Inf serialize as null), matching the
  column_values convention.
- TableDeltaView decodes both strictly (malformed key or misaligned
  append_values column rejects the whole delta) through a shared
  numericFromJson helper, now also backing tableColumnValues.
- Existing braced-literal appendTableRows call sites explicitized per the
  documented overload-ambiguity caveat, which now names appendTableRows too.
- Removed the last stale 0.17.0 reference (test comment).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@facontidavide
facontidavide merged commit 9def534 into main Jul 18, 2026
4 checks passed
@facontidavide
facontidavide deleted the feat/typed-table-deltas branch July 18, 2026 14:13
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