Skip to content

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Sep 29, 2025

COMPASS-9742

Screenshot 2025-09-29 at 4 25 09 AM

Old pr #7300
I'll do the e2e tests in a separate pr as they are testing more field interactions than just this.

@Anemy Anemy requested a review from a team as a code owner September 29, 2025 08:25
@Anemy Anemy requested review from nbbeeken and removed request for a team September 29, 2025 08:25
@Anemy Anemy added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Sep 29, 2025
@github-actions github-actions bot added the feat label Sep 29, 2025
Base automatically changed from COMPASS-9742-bump-diagramming-use-add-field to main September 29, 2025 23:44
@Anemy Anemy requested a review from paula-stacho October 1, 2025 00:24
@Copilot Copilot AI review requested due to automatic review settings October 1, 2025 10:34
Copy link
Contributor

@Copilot 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 adds functionality to insert nested fields into object fields within data modeling diagrams, enabling users to add fields directly to object-type fields rather than only at the top level of collections.

  • Extends getNewUnusedFieldName to support nested field paths for generating unique field names within object fields
  • Adds onAddNestedField action to create nested fields at specified parent paths
  • Updates diagram component to handle nested field addition through new callback handlers

Reviewed Changes

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

File Description
packages/compass-data-modeling/src/utils/schema.ts Extended getNewUnusedFieldName to traverse nested field paths
packages/compass-data-modeling/src/utils/nodes-and-edges.ts Added getBaseFieldsFromSchema function and refactored field creation logic
packages/compass-data-modeling/src/store/diagram.ts Added onAddNestedField action to handle nested field creation
packages/compass-data-modeling/src/components/diagram-editor.tsx Connected nested field addition functionality to UI callbacks

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

);

let i = 1;
let fieldName = `field-${i}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

A nothing comment but I feel compelled to suggest, why aren't we using "_" instead of "-" since I feel like snake case is the typical format for document keys. But that's just my onion 🧅 (smelly opinion)

Copy link
Member Author

Choose a reason for hiding this comment

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

No reason. I think we just did it that way, I'm cool with either, if there's a standard for it let's do it that way! I'll include that change in another pr to avoid another ci run here.

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.

2 participants