feat(dialog): sort-key-aware table deltas — typed append + whole-cell updates#154
Merged
Conversation
… 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>
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.
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
updateTableCellscould not refresh the ordering truth behind the text.appendTableRowsgains aTableItemoverload emitting a sparseappend_valuescolumn map aligned to the appended rows — the delta-side mirror ofcolumn_values, produced by a sharedencodeTypedRowshelper now backing both typed entry points. The string overload erasesappend_values(same stale-key protection as plainsetTableRows).TableCellUpdatebecomes{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 thecolumn_valuesconvention. Existing{r, c, "text"}brace-init call sites still compile viaTableItem(const char*).TableDeltaViewdecodesappend_values+CellUpdate::valuestrictly (a malformed key or misaligned column rejects the whole delta, preserving the retransmission contract) through a sharednumericFromJsonhelper that now also backstableColumnValues.appendTableRowscall sites explicitized per feat(sdk): typed table sort keys in the dialog protocol (0.18.0) #149's documented overload-ambiguity caveat, which now namesappendTableRowstoo; docs + CHANGELOG updated; last stale0.17.0reference removed (test comment).Versioning
Rides the still-untagged 0.18.0 with #149/#150/#152; the
TableCellUpdatelayout 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