Skip to content

Conversation

paula-stacho
Copy link
Collaborator

@paula-stacho paula-stacho commented Oct 14, 2025

Description

Adding inline edit for fields.
https://github.com/user-attachments/assets/f9f12d7d-28be-402d-849c-257b6fe210b7

Also adding e2e for selecting, adding and editing field.

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)

@github-actions github-actions bot added the feat label Oct 14, 2025
@paula-stacho paula-stacho added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Oct 14, 2025
@paula-stacho paula-stacho marked this pull request as ready for review October 16, 2025 15:57
@paula-stacho paula-stacho requested a review from a team as a code owner October 16, 2025 15:57
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

Implements inline field name editing in the data modeling diagram along with supporting selectors, store wiring, and tests.

  • Adds editable flag to schema-derived fields and prevents _id from being renamed
  • Wires renameField action through diagram editor components
  • Adds new e2e test and selectors for selecting, adding, and renaming fields

Reviewed Changes

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

Show a summary per file
File Description
packages/compass-e2e-tests/tests/data-modeling-tab.test.ts Adds e2e test for field selection, addition, and inline rename; refactors drawer close logic.
packages/compass-e2e-tests/helpers/selectors.ts Introduces new selectors for field name input, add field button, field node, and inline edit input.
packages/compass-data-modeling/src/utils/nodes-and-edges.ts Adds editable property to field objects based on isIdField logic.
packages/compass-data-modeling/src/utils/nodes-and-edges.spec.ts Updates unit tests to assert editable flag, including non-editable _id.
packages/compass-data-modeling/src/components/diagram-editor.tsx Wires renameField handler into diagram content and passes it to node creation logic.

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

Comment on lines 368 to 373
onPaneClick,
onEdgeClick,
onFieldClick,
onRenameField,
onNodeDragStop,
onConnect,
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

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

onRenameField is included in this dependency array but (based on the diff) does not appear to be referenced inside the corresponding memoized callback. Remove it if unused to avoid unnecessary recalculations.

Copilot uses AI. Check for mistakes.

Copy link

Assigned kmruiz for team compass-developers because gribnoysup is out of office.

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.

1 participant