Skip to content

✨ Replace ReactTooltip with Notification.error + add Center action button - #424

Merged
MFA-X-AI merged 3 commits into
XpressAI:masterfrom
rabea-al:use-notification-instead-of-tooltip
Jul 15, 2025
Merged

MFA-X-AI merged 3 commits into
XpressAI:masterfrom
rabea-al:use-notification-instead-of-tooltip

Conversation

@rabea-al

Copy link
Copy Markdown
Contributor

Description

  1. This PR replaces all instances of error tooltip bubbles (ReactTooltip) with standardized Notification.error calls:

    • Removed all tooltip-based error messages (mainly using extras["tip"]).
    • Replaced them with Notification.error displaying the same message.
    • Preserved visual highlighting via borderColor = "red" and node.setSelected(true) where applicable.
    • Removed one redundant Notification.error call for [★]COMPULSORY InPorts check to avoid duplicate error messages when running workflows.
  2. Standardized error notifications with action buttons for better UX:

    • Introduced a new showNodeCenteringNotification() helper function.
    • This function displays an error message using Notification.error(...), and includes a "Center" button.
    • Clicking the "Center" button auto-scrolls and centers the related node in the canvas for easier visibility and debugging.
    • The toast remains visible for the duration of autoClose (e.g. 3 seconds), even after clicking the action button.

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. In-to-In Port Connection Check

  • Attempted to connect two InPorts together.
  • Notification: "Link cannot be created between inPorts."

2. Triangle Port Link Check

  • Tried connecting non-triangle port to triangle port.
  • Notification: "Flow ports (▶) can only connect to other flow ports (▶)."

3. Invalid Link Direction

  • Connected ports from left-to-right instead of right-to-left.
  • Notification: "Link should be created from an outPort to an inPort."

4. Data Type Mismatch

  • Linked ports with incompatible data types.
  • Notification includes expected vs. provided types.

5. InPort Already Connected

  • Tried connecting a second link to an InPort.
  • Notification: "You can only create one link for this inPort..."

6. Last Node is Not “Finish”

  • Workflow ends with wrong node.
  • Notification: "Please make sure this \"<name>\" node ends with a \"Finish\" node."

7. Unconnected ★ InPort

  • Tried compiling/running with missing [★] compulsory connections.
  • Notification: "Please make sure the [★]COMPULSORY InPorts are connected."

8. Component Path Error

  • Dropped a missing/invalid component.
  • Notification: "Component could not be loaded from path..."

General Behavior on Toast Notifications

  • On click button: the canvas auto-scrolls to center the corresponding node for easier visibility and debugging.

These interactions can be tested with any of the above notifications.

Tested on? Specify Version.

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

@github-actions

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch rabea-al/xircuits/use-notification-instead-of-tooltip

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! Things seem to be working well, just that there's a small git conflict that I'd like you to resolve due to a bug fix PR.
I'd also like you to rename the button from Center Node to Show Node. Thanks!

@MFA-X-AI
MFA-X-AI merged commit 85e0ca6 into XpressAI:master Jul 15, 2025
@MFA-X-AI MFA-X-AI changed the title Replace ReactTooltip with Notification.error + add Center action button ✨ Replace ReactTooltip with Notification.error + add Center action button Jul 24, 2025
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