Skip to content

Conversation

@paula-stacho
Copy link
Collaborator

Description

Bringing back #7455, but on default everything is expanded, and the functionality is behind a new feature flag.

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
  • 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)

@paula-stacho paula-stacho requested a review from a team as a code owner November 5, 2025 13:49
@github-actions github-actions bot added the feat label Nov 5, 2025
@paula-stacho paula-stacho added feature flagged PRs labeled with this label will not be included in the release notes of the next release and removed feat labels Nov 5, 2025
@github-actions github-actions bot added the feat label Nov 5, 2025
Copy link
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

This PR reintroduces collapse/expand functionality for collections in the data modeling diagram view, controlled by a new feature flag enableDataModelingCollapse. By default, all collections are expanded, and the collapse functionality is only available when the feature flag is enabled.

  • Adds a new isExpanded boolean property to collection data models with a default value of true
  • Introduces a feature flag enableDataModelingCollapse to control the visibility of collapse/expand functionality
  • Implements a ToggleExpandCollection edit action to handle expand/collapse state changes

Reviewed Changes

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

Show a summary per file
File Description
packages/compass-web/sandbox/index.tsx Enables the data modeling collapse feature flag in the sandbox environment
packages/compass-preferences-model/src/feature-flags.ts Defines the new enableDataModelingCollapse feature flag
packages/compass-data-modeling/test/fixtures/data-model-with-relationships.json Adds isExpanded: false to fixture collections for testing collapsed state
packages/compass-data-modeling/src/utils/nodes-and-edges.ts Updates field extraction logic to respect isExpanded state and filters nested fields when collapsed
packages/compass-data-modeling/src/utils/nodes-and-edges.spec.ts Updates tests to include the new path property in field objects
packages/compass-data-modeling/src/store/diagram.ts Adds toggleCollectionExpanded action and handles isExpanded in collection state
packages/compass-data-modeling/src/store/diagram.spec.ts Updates test fixtures to include isExpanded: true
packages/compass-data-modeling/src/store/apply-edit.ts Implements the ToggleExpandCollection edit handler
packages/compass-data-modeling/src/store/analysis-process.ts Ensures new collections created from analysis have default isExpanded state
packages/compass-data-modeling/src/services/data-model-storage.ts Adds isExpanded to collection schema and defines ToggleExpandCollection edit type
packages/compass-data-modeling/src/components/saved-diagrams-list.spec.tsx Updates test fixtures with isExpanded property
packages/compass-data-modeling/src/components/diagram-editor.tsx Connects expand/toggle handler and conditionally enables it based on feature flag
packages/compass-data-modeling/src/components/diagram-editor.spec.tsx Updates test fixtures with isExpanded property
packages/compass-data-modeling/src/components/diagram-card.spec.tsx Updates test fixture with isExpanded property
packages/compass-components/src/index.ts Exports the FieldId type for use in diagram components

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

@addaleax addaleax changed the title feat: bring back collapse all under a flag COMPASS-9504 feat(data-modeling): bring back collapse all under a flag COMPASS-9504 Nov 5, 2025
Comment on lines 148 to 149
atlasCloudFeatureFlagName:
'DATA_EXPLORER_COMPASS_WEB_ENABLE_DATA_MODELING_COLLAPSE',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if it needs a separate controlled rollout flag in atlas, but if you feel like setting one up it doesn't hurt 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I'm also not sure. Actually, let's remove it, we can add if needed, but otherwise it'd just complicate the release

@paula-stacho paula-stacho merged commit d9d4546 into main Nov 7, 2025
61 checks passed
@paula-stacho paula-stacho deleted the COMPASS-9504-revival branch November 7, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants