Skip to content

aggregation builder v1#230

Open
IslandRhythms wants to merge 5 commits into
mainfrom
IslandRhythms/aggregation-builder
Open

aggregation builder v1#230
IslandRhythms wants to merge 5 commits into
mainfrom
IslandRhythms/aggregation-builder

Conversation

@IslandRhythms
Copy link
Copy Markdown
Contributor

closes #189

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio Ready Ready Preview, Comment May 19, 2026 9:10pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial “Aggregation” UI and supporting API endpoint so users can build MongoDB aggregation pipelines in the Studio UI and preview outputs at each stage (Compass-inspired), addressing the core of issue #189.

Changes:

  • Adds a new aggregationBuilder route and navbar entries for a new Aggregation tab.
  • Introduces a new frontend aggregation-builder component with stage editing, per-stage output previews, and auto-run results.
  • Adds a backend Model.aggregate action and frontend API bindings to execute aggregation pipelines with a server-enforced result limit.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/src/routes.js Adds aggregationBuilder route and updates role/route allowlists.
frontend/src/navbar/navbar.js Adds route-name detection for the Aggregation tab active state.
frontend/src/navbar/navbar.html Adds Aggregation tab links (desktop + mobile) gated by hasAccess().
frontend/src/api.js Adds api.Model.aggregate() for both lambda and non-lambda modes.
frontend/src/aggregation-builder/aggregation-builder.js New aggregation builder component logic (stages, auto-run, per-stage preview queries).
frontend/src/aggregation-builder/aggregation-builder.html New UI layout for stage editor, pipeline JSON preview, and results list.
frontend/src/aggregation-builder/aggregation-builder.css New styles for code/result panels and preview cards.
backend/authorize.js Allows readonly (and other roles) to call Model.aggregate.
backend/actions/Model/index.js Exports the new aggregate action.
backend/actions/Model/aggregate.js Implements server-side aggregation execution with pipeline validation and limit clamping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/routes.js
name: 'aggregationBuilder',
component: 'aggregation-builder',
meta: {
authorized: true
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta.authorized is set to true for the new aggregationBuilder route, but the global navigation guard in frontend/src/index.js only enforces hasAccess() when to.meta.authorized is falsy. As-is, users can deep-link to #/aggregation-builder even when hasAccess(roles, 'aggregationBuilder') is false (navbar hides it, but the route guard won't redirect). Set meta.authorized: false for this route (or adjust the guard logic) so RBAC is enforced consistently.

Suggested change
authorized: true
authorized: false

Copilot uses AI. Check for mistakes.
Comment thread frontend/src/aggregation-builder/aggregation-builder.js Outdated
Comment thread frontend/src/aggregation-builder/aggregation-builder.html Outdated
Comment thread backend/actions/Model/aggregate.js
Comment thread backend/actions/Model/aggregate.js
Comment thread frontend/src/aggregation-builder/aggregation-builder.js
Comment thread frontend/src/aggregation-builder/aggregation-builder.css Outdated
Comment thread frontend/src/aggregation-builder/aggregation-builder.html Outdated
Comment thread frontend/src/aggregation-builder/aggregation-builder.html Outdated
Comment thread frontend/src/aggregation-builder/aggregation-builder.js Outdated
Comment thread frontend/src/aggregation-builder/aggregation-builder.js Outdated
Comment thread frontend/src/aggregation-builder/aggregation-builder.html Outdated
Copy link
Copy Markdown
Member

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Evaluating for syntax errors on every keystroke is a little aggressive, better to wait until blur or clicking "preview" or "run" to show syntax errors. So you don't get blaring errors when you're typing.
Image
  1. Pipeline errors hides very valuable screen real estate
Image
  1. In general, the "Pipeline Stages" panel is too small and difficult to work with. Instead of having a fixed height "Pipeline Stages" panel with "Stage 1" , "Stage 2" etc. subpanels, let's have "Stage 1", "Stage 2", etc. be separate top level panels and then have the result panel always at the bottom. That makes it easier to scroll through.

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.

Aggregation pipeline builder

3 participants