Skip to content

feat: render result cells by Studio's value rules - #104

Merged
cevheri merged 2 commits into
mainfrom
feat/93-cell-values
Oct 23, 2026
Merged

cevheri merged 2 commits into
mainfrom
feat/93-cell-values

Conversation

@cevheri

@cevheri cevheri commented Oct 23, 2026

Copy link
Copy Markdown
Member

Ports Studio's cell classification and renderers (libredb-studio c9989a6b5) to lib/shared/utils/cell_values.dart, with CompactCell and DetailCell in lib/shared/widgets/cells/.

  • NULL, scalar, JSON, binary and vector cells in Studio's order, each with compact, detail and copy text by the row detail sheet's rule.
  • Digits are never lost: strings stay strings, numbers print as JavaScript prints them, and a JSON string keeps its stored text unless the round trip is lossless. An integer past 2^53 counts as lossy, as it does in Studio.
  • Vector cells for dense, multi and both sparse encodings; a cell never builds a large vector's whole text.
  • A NULL marker that screen readers read as a null value (English and Turkish).
  • A hand-written MongoDB find answer with its README row.

Tests port Studio's renderer, vector renderer and row detail copy cases, and read query_types_postgres.json and the new MongoDB answer.

Closes #93

Add classifyCell in lib/shared/utils/cell_values.dart, a port of Studio's classifyValue and renderers: a sealed CellValue of NullCell, ScalarCell, JsonCell, BinaryCell and VectorCell, each with its compact, detail and copy text.
Strings are never turned into numbers, numbers print as JavaScript prints them without rounding, a JSON string keeps its stored text unless the round trip is lossless, binary previews 32 bytes and its size, and vector cells cover dense, multi and both sparse encodings, building the whole text only on demand.
Add CompactCell and DetailCell in lib/shared/widgets/cells/, with a NULL marker that screen readers read as a null value in English and Turkish.
Add a hand-written MongoDB find answer with a nested document, an array, an ObjectId and a document with a type field.
…as NULL

A JSON string holding a number past the double range read as an infinity, and jsonEncode threw on it in the detail and the copy; it now counts as lossy and keeps its stored text, as in Studio, and an infinity inside an object is written as null, as JSON.stringify writes it.
classifyCell takes isAbsent for a field the row lacks, which shows NULL in the detail and the copy while a JSON null shows null, as Studio splits null from undefined.
The JsonCell comment now says where Dart's round trip differs from JavaScript's in both directions.
@cevheri
cevheri merged commit 45e1113 into main Oct 23, 2026
6 checks passed
@cevheri
cevheri deleted the feat/93-cell-values branch October 23, 2026 07:08
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.

Cell value rendering rules: NULL, JSON documents, binary and big numbers

1 participant