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

Allow attaching Literals to their target nodes #340

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

treo
Copy link
Contributor

@treo treo commented Jul 11, 2024

Description

Pictures say more than 1000 words :)

image
turns to
image

If a literal is attached to multiple ports, then highlighting that port will also highlight all the other places where it is attached.
image

To modify an attached literal, double click on the port.

An attached port has the same color as the literal that is attached to it.
image

As you can see the literal value is easily visible on the node, but if it gets too long, it is truncated.

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

Tested on?

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

Copy link

Binder 👈 Launch a binder notebook on branch XpressAI/xircuits/paul/attached-literals

Copy link
Member

@MFA-X-AI MFA-X-AI left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This would be super helpful in reducing the clutter for very large workflows. I've noticed the following things:
Bugs:

  • pulling a literal from a Literal Any port would return TypeError: Cannot read properties of undefined (reading 'charAt'). The Literal Any port takes the first character to determine its type.
  • Selecting attach node while not connected to a port would send it to the shadow realm. The component still exists in the canvas code though.

Not bugs but observation:

  • since the self connect is now disallowed from the code itself, we can remove the tooltip error.
  • copying a component node that has a literal node to attached to it will only copy the component code.

@MFA-X-AI MFA-X-AI merged commit a464313 into master Jul 15, 2024
8 checks passed
@MFA-X-AI MFA-X-AI deleted the paul/attached-literals 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.

2 participants