Skip to content

Conversation

rabea-al
Copy link
Contributor

Description

This PR enhances the search functionality in Xircuits by including literal values stored in port labels, in addition to node names.
This makes it easier for users to quickly locate nodes by their literal string contents, not just by node names.

Key Changes

  • Added collectLiteralValues helper to gather port.label values.
  • Updated searchModel to match against:
    • Node names (options.name)
    • Literal values (port.label)

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. Created workflow containing multiple Literal String and Literal Boolean nodes.
  2. Searched for keywords present in node names (e.g., Print, BranchComponent) → nodes correctly matched.
  3. Searched for literal values inside nodes (e.g., True, Xircuits, Hello) → literal nodes correctly matched.
  4. Verified that non-literal port labels (e.g., from BranchComponent) were not included in search results.

Tested on? Specify Version.

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

Copy link

Binder 👈 Launch a binder notebook on branch rabea-al/xircuits/feat/search-literal

@rabea-al rabea-al marked this pull request as ready for review October 2, 2025 07:16
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 does seem to work. I've added one quick thing I'd like you to fix, but more importantly I'd like you to consider if say said Literal is an attached literal node. Currently it highlights the empty space where the node was before being attached.
The solution should be to simply highlight the port where it is attached.
To see if a node is attached, you can refer to their
extras.attached bool status.

image

@rabea-al
Copy link
Contributor Author

rabea-al commented Oct 6, 2025

Done — I’ve updated the logic to use "Literal " (with a space) exactly as you suggested, so we reliably detect only actual literal nodes.

Additionally, I modified the search behavior so that when a Literal node is attached, the search now highlights the target port it’s connected to instead of the empty space where the node used to be.

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