Repository navigation
feat(results): [WIP] Documents view for document databases - #1766
Draft
vinimcorrea wants to merge 6 commits into
Draft
vinimcorrea wants to merge 6 commits into
vinimcorrea wants to merge 6 commits into
Conversation
Add a read-only Documents view to the result panel of drivers whose primary paradigm is document: one card per document, one field per line, objects and arrays folded until opened, values coloured by type. It is the default view for those drivers; Grid stays one click away. Chart is unchanged and still limited to query tabs.
… layout
The plugin now sends ObjectId, dates, UUIDs, binary and decimals as
Extended JSON wrappers. The Documents view shows them in shell notation
(UUID('...'), ObjectId('...'), ISO dates); the data grid receives them
flattened to plain text, so it keeps displaying and editing text.
Cards use the elevated surface with a thin border, nested fields get a
guide line, rows highlight on hover.
The app disables text selection globally; opt the document list back in and keep the fold toggles out of a selection.
For drivers whose primary paradigm is document, the table toolbar shows
FILTER { field: 'value' } and SORT { field: -1 } instead of WHERE and
ORDER BY. The text is sent as written, the SQL filter builder and column
autocomplete are not offered.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This branch has not been deployed
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
Refs #1531 (not closing it: the follow-up on missing fields vs. stored nulls stays open there).
Plugin side: TabularisDB/tabularis-mongodb-plugin#15
Draft / WIP, opened as agreed in #1531.
A driver whose primary paradigm is
documentnow gets a Documents view next to the grid and the chart, and its toolbar takes Filter and Sort as query documents instead of SQL.(Mock data.)
What changed
DocumentView.tsx: one card per row, one field per line. Objects and arrays are summarised and open one level at a time; long strings are cut with the full text in the tooltip; text can be selected and copied; documents render in bounded batches with "load more".utils/extendedJson.ts: decodes MongoDB Extended JSON values ($oid,$date,$numberLong, ...) and shows them the way a Mongo shell writes them, also inside nested objects and arrays.utils/documentView.ts:isDocumentParadigm()and value classification. Only drivers withdocumentas the primary paradigm get the view; SQL drivers are unchanged.ResultViewToggle,useResultChartState,Editor: the toggle offers only the views it is given; the stored default view is respected.TableToolbar:queryStyle="document"relabels the fields Filter and Sort, with query documents as placeholders, sends them exactly as typed, and hides the SQL filter builder and column autocomplete. The default stays SQL.Known limit
A field a document lacks is shown as
null, the same as a stored null. Per #1531 this is left for a follow-up.Validation
tsc --noEmitpasses; the new and touched tests pass.pluginGuestStyles, which needs the builthost.css.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.