Skip to content

feat(data-modeling): add side panel COMPASS-9476 #7111

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mabaasit
Copy link
Contributor

Add diagram editor side panel. Currently open when an edge is clicked.

Preview
SidePanel.mov

Description

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)

@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 19:41
@mabaasit mabaasit requested a review from a team as a code owner July 14, 2025 19:41
@github-actions github-actions bot added the feat label Jul 14, 2025
Copy link

@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

Adds a side panel to the diagram editor that opens when an edge is clicked.

  • Introduce Redux state (side-panel.ts) for tracking panel open/closed
  • Wire openSidePanel action into DiagramEditor and display DiagramEditorSidePanel
  • Integrate new component into the main DataModeling view

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-data-modeling/src/store/side-panel.ts New Redux module for side‐panel state, actions, and reducer
packages/compass-data-modeling/src/store/reducer.ts Combined sidePanel slice into root reducer and action types
packages/compass-data-modeling/src/components/diagram-editor.tsx Added onEdgeClick handler dispatching openSidePanel
packages/compass-data-modeling/src/components/diagram-editor-side-panel.tsx New side‐panel component connected to Redux
packages/compass-data-modeling/src/components/data-modeling.tsx Render DiagramEditorSidePanel alongside DiagramEditor
Comments suppressed due to low confidence (2)

packages/compass-data-modeling/src/components/diagram-editor-side-panel.tsx:36

  • Typo in component name: DiagmramEditorSidePanel should be DiagramEditorSidePanel to match the file name and naming conventions.
function DiagmramEditorSidePanel({

packages/compass-data-modeling/src/store/side-panel.ts:27

  • No unit tests were added for sidePanelReducer. Consider adding tests to verify that the open and close actions correctly update isOpen state.
export const sidePanelReducer: Reducer<SidePanelState> = (

return null;
}
return (
<div className={cx(containerStyles, isDarkMode && darkModeContainerStyles)}>
Copy link
Preview

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

Consider adding appropriate ARIA attributes (e.g., role="dialog", aria-label) to the panel container so screen readers can properly announce this element.

Suggested change
<div className={cx(containerStyles, isDarkMode && darkModeContainerStyles)}>
<div
className={cx(containerStyles, isDarkMode && darkModeContainerStyles)}
role="dialog"
aria-label="Diagram Editor Side Panel"
>

Copilot uses AI. Check for mistakes.

@@ -332,6 +335,10 @@ const DiagramEditor: React.FunctionComponent<{
title={diagramLabel}
edges={edges}
nodes={areNodesReady ? nodes : []}
onEdgeClick={() => {
// TODO: we have to open a side panel with edge details
Copy link
Preview

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

[nitpick] The TODO comment is now outdated since onOpenSidePanel is implemented. Please update or remove this comment to keep the code clean.

Suggested change
// TODO: we have to open a side panel with edge details

Copilot uses AI. Check for mistakes.

@mabaasit mabaasit added feature flagged PRs labeled with this label will not be included in the release notes of the next release no release notes Fix or feature not for release notes labels Jul 14, 2025
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 no release notes Fix or feature not for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant