Skip to content
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

✨ Add Attach - Detach Options to Canvas Context Menu #342

Merged
merged 5 commits into from
Jul 16, 2024
Merged

Conversation

MFA-X-AI
Copy link
Member

Description

This PR introduces 3 new context menu options, with the following spawn logic:

  • Attach - will spawn if one or more Literals are selected.
  • Attach Literals - will spawn if one or more non-parameter components are selected that has at least one detached Literal connected.
  • Detach Literals - will spawn if one or more non-parameter components are selected that has at least one attached Literal connected.

attach detach context options

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Xircuits Project Template
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Tests

  1. Verify that you can Attach a Literal node by right clicking a Literal Node. Verify you can also do this by selecting multiple Literals.
  2. Verify that you can attach Literals connected but detached from a component node. Verify that you can also do this by selecting multiple component nodes.
  3. Verify that you can detach Literals from a component node. Verify that you can also do this by selecting multiple component nodes.

Tested on?

  • Windows
  • Linux Ubuntu
  • Centos
  • Mac
  • Others (State here -> xxx )

Copy link

Binder 👈 Launch a binder notebook on branch XpressAI/xircuits/fahreza/port-ctx

src/commands/NodeActionCommands.tsx Show resolved Hide resolved
src/commands/NodeActionCommands.tsx Outdated Show resolved Hide resolved
@@ -365,6 +366,26 @@ export class CustomPortModel extends DefaultPortModel {

}

getTargetPorts = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat, these functions could cut down on some of the repetition I've got in the addHover and removeHover functions, as well as the ones in the copy & paste support.

Copy link
Member Author

Choose a reason for hiding this comment

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

For this one, I've noticed that the selectAllRelevantNodes also highlights the links, and the addHover - removeHover accesses the properties through their names.

src/context-menu/CanvasContextMenu.tsx Outdated Show resolved Hide resolved
src/context-menu/CanvasContextMenu.tsx Outdated Show resolved Hide resolved
@treo treo merged commit a63375a into master Jul 16, 2024
8 checks passed
@MFA-X-AI MFA-X-AI deleted the fahreza/port-ctx branch July 22, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants