feat: Simple / Aggregation / Shell query modes#3
Merged
Merged
Conversation
Add a three-way mode picker in place of the old redundant db.coll
header so each tab can be driven by one of:
- Simple — existing filter/sort/projection/limit/export
- Aggregation — single editor for an EJSON pipeline array, dispatched
through a new query.aggregate IPC channel + QueryService method
- Shell — mongosh-flavoured one-liner like
db.coll.find({…}, {…}).sort({…}).skip(n).limit(n) or
db.coll.aggregate([…]); parsed in the renderer (new shellParser
with 12 tests) and dispatched to the existing find / aggregate APIs
The mode picker uses an underline-indicator style flush against the
toolbar body, with Run / Limit / Export on the right of the same bar.
Active collection tab in the TabBar above gets a 2px primary top-border,
font-medium, and a tinted db. prefix so it's clearly distinguishable.
Other UX fixes bundled in:
- Run morphs into a destructive Cancel (X) while a query is in flight;
click soft-cancels via queryClient.cancelQueries.
- Sort and Projection editors share their height — whichever's content
is taller pushes the other to match (QueryEditor reports its natural
content height; SimpleBody feeds max() back as both editors' minHeight).
- Switching tabs no longer re-runs the query: refetchOnMount: false +
staleTime: Infinity on the active query. Initial open still fetches
(no cache for that key).
- Run is always clickable when not loading; bumping a per-tab runEpoch
on every Run guarantees a fresh fetch even when none of the
mode-specific params changed.
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.
Add a three-way mode picker in place of the old redundant db.coll
header so each tab can be driven by one of:
through a new query.aggregate IPC channel + QueryService method
db.coll.find({…}, {…}).sort({…}).skip(n).limit(n) or
db.coll.aggregate([…]); parsed in the renderer (new shellParser
with 12 tests) and dispatched to the existing find / aggregate APIs
The mode picker uses an underline-indicator style flush against the
toolbar body, with Run / Limit / Export on the right of the same bar.
Active collection tab in the TabBar above gets a 2px primary top-border,
font-medium, and a tinted db. prefix so it's clearly distinguishable.
Other UX fixes bundled in:
click soft-cancels via queryClient.cancelQueries.
is taller pushes the other to match (QueryEditor reports its natural
content height; SimpleBody feeds max() back as both editors' minHeight).
staleTime: Infinity on the active query. Initial open still fetches
(no cache for that key).
on every Run guarantees a fresh fetch even when none of the
mode-specific params changed.