-
Notifications
You must be signed in to change notification settings - Fork 244
feat(data-modeling): bring back collapse all under a flag COMPASS-9504 #7537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
isExpandedboolean property to collection data models with a default value oftrue - Introduces a feature flag
enableDataModelingCollapseto control the visibility of collapse/expand functionality - Implements a
ToggleExpandCollectionedit 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.
packages/compass-data-modeling/src/components/diagram-editor.tsx
Outdated
Show resolved
Hide resolved
packages/compass-data-modeling/src/components/diagram-editor.tsx
Outdated
Show resolved
Hide resolved
| atlasCloudFeatureFlagName: | ||
| 'DATA_EXPLORER_COMPASS_WEB_ENABLE_DATA_MODELING_COLLAPSE', |
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
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
Description
Bringing back #7455, but on default everything is expanded, and the functionality is behind a new feature flag.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes