-
Notifications
You must be signed in to change notification settings - Fork 59
Fix listener overlap and component menu button click issue in Architecture Diagram #989
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
…d listeners, ensuring proper positioning of unconnected listeners below other nodes.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 fixes two distinct bugs in the Architecture Diagram component: overlapping listener nodes and incorrect menu button click behavior. The first fix addresses a layout issue where listeners without attached services would overlap with other diagram elements, making the diagram difficult to read. The second fix prevents menu button clicks from inadvertently triggering component navigation, ensuring the menu action is executed instead.
Key Changes
- Modified the auto-distribution algorithm to position unconnected listeners below all other nodes with appropriate spacing
- Added
onMouseDownandonMouseUpevent handlers to all menu buttons to stop event propagation and prevent navigation
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| workspaces/common-libs/ui-toolkit/src/components/Button/Button.tsx | Added onMouseDown and onMouseUp props to ButtonProps interface to support event handling customization |
| workspaces/ballerina/component-diagram/src/utils/diagram.ts | Enhanced autoDistribute function to separate connected and unconnected listeners, positioning unconnected ones below all nodes to prevent overlap |
| workspaces/ballerina/component-diagram/src/components/nodes/ListenerNode/ListenerNodeWidget.tsx | Added mouse event handlers to menu button that stop propagation to prevent unwanted navigation |
| workspaces/ballerina/component-diagram/src/components/nodes/EntryNode/components/GraphQLServiceWidget.tsx | Added mouse event handlers to menu button that stop propagation to prevent unwanted navigation |
| workspaces/ballerina/component-diagram/src/components/nodes/EntryNode/components/GeneralWidget.tsx | Added mouse event handlers to menu button that stop propagation to prevent unwanted navigation |
| workspaces/ballerina/component-diagram/src/components/nodes/EntryNode/components/AIServiceWidget.tsx | Added mouse event handlers to menu button that stop propagation to prevent unwanted navigation |
| workspaces/ballerina/component-diagram/src/components/nodes/ConnectionNode/ConnectionNodeWidget.tsx | Added mouse event handlers to menu button that stop propagation to prevent unwanted navigation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Purpose
This PR Fixes two bugs in the Architecture Diagram view:
Fixes