Repository navigation
feat: render result cells by Studio's value rules - #104
Merged
Merged
Conversation
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.
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.
Ports Studio's cell classification and renderers (libredb-studio c9989a6b5) to
lib/shared/utils/cell_values.dart, withCompactCellandDetailCellinlib/shared/widgets/cells/.Tests port Studio's renderer, vector renderer and row detail copy cases, and read
query_types_postgres.jsonand the new MongoDB answer.Closes #93