Skip to content

feat(crud): show object elements in document view COMPASS-6707#8167

Open
mabaasit wants to merge 9 commits into
mainfrom
COMPASS-6707-show-object-element-count
Open

feat(crud): show object elements in document view COMPASS-6707#8167
mabaasit wants to merge 9 commits into
mainfrom
COMPASS-6707-show-object-element-count

Conversation

@mabaasit

Copy link
Copy Markdown
Collaborator

Description

Draft because waiting for design feedback.

Preview

image

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

Copilot AI review requested due to automatic review settings June 23, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds first-pass UI support for displaying embedded object values in the document view by providing an Object-specific renderer and wiring document-list elements to supply a renderable “original value” for object fields.

Changes:

  • Extend document-list element model to derive an originalValue for Object types (in addition to arrays/primitives).
  • Add an ObjectValue renderer to BSONValue and route type: 'Object' through it.

Reviewed changes

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

File Description
packages/compass-components/src/components/document-list/element.tsx Derives/passes an originalValue suitable for rendering object elements in the document list.
packages/compass-components/src/components/bson-value.tsx Introduces an ObjectValue renderer and uses it for BSON Object types.

Comment thread packages/compass-components/src/components/document-list/element.tsx Outdated
Comment thread packages/compass-components/src/components/bson-value.tsx
@Anemy Anemy changed the title COMPASS-6707: show object elements in document view feat(crud): show object elements in document view COMPASS-6707 Jun 23, 2026
@github-actions github-actions Bot added the feat label Jun 23, 2026
@mabaasit mabaasit marked this pull request as ready for review June 26, 2026 10:51
@mabaasit mabaasit requested a review from a team as a code owner June 26, 2026 10:51
@mabaasit mabaasit requested a review from alenakhineika June 26, 2026 10:51
// Otherwise use default sort method based on the value type
if (typeof a[name] === 'string') {
return sortString(a[name] as string, b[name] as string, order);
return sortString(a[name], b[name] as string, order);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why the first argument cast was removed but the second was kept?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants