Skip to content

Show component parse error only on manual reload - #404

Merged
MFA-X-AI merged 2 commits into
XpressAI:masterfrom
rabea-al:improve-component-reload-popup
Jun 2, 2025
Merged

MFA-X-AI merged 2 commits into
XpressAI:masterfrom
rabea-al:improve-component-reload-popup

Conversation

@rabea-al

@rabea-al rabea-al commented May 21, 2025 •

Copy link
Copy Markdown
Contributor

Description

When editing a component Python file, users often encounter a syntax error popup triggered by auto-save, even for minor temporary edits. This creates a disruptive user experience. This PR improves that behavior by ensuring the error popup appears only during manual reloads, allowing silent background reloads without unnecessary interruptions.

  • Added a manual reload flag to control popup visibility.
  • Error popup now appears only when reload is triggered manually.
  • Silent reloads (e.g. auto-save) will no longer show parse errors to the user.

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. Test A – Silent Reload (Auto-save):

  1. Open a component Python file (e.g. utils.py).
  2. Introduce a syntax error (e.g. missing parenthesis).
  3. Wait for auto-save to trigger.
  4. ✅ Confirm that no popup appears.

2. Test B – Manual Reload :

  1. Click reload.
  2. ✅ Confirm that the popup appears showing the syntax error from the file.

3. Test C – Fix the Syntax Error:

  1. Fix the invalid syntax.
  2. Reload.
  3. ✅ Confirm that the popup does not appear anymore.

Tested on? Specify Version.

  • Linux (Fedora)

@github-actions

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch rabea-al/xircuits/improve-component-reload-popup

@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.

  1. Test B – Manual Reload :
    Click reload.
    ✅ Confirm that the popup appears showing the syntax error from the file.

I'm not sure what you mean by reload here, but when I introduce a syntax error and press save, it doesn't show the warning. Is this intentional?

@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.

As commented above

@rabea-al

rabea-al commented Jun 1, 2025

Copy link
Copy Markdown
Contributor Author

Yes, it's intentional.
The popup is now shown only when the reload is triggered manually via the "Reload" button — based on Paul's feedback.
Auto-save or background reloads will not show the syntax error popup anymore.

@MFA-X-AI

MFA-X-AI commented Jun 2, 2025

Copy link
Copy Markdown
Member

That part was understood, the one that I've mentioned was a side effect of when pressing save manually. I kinda liked that it would warn users, but after further thought, we wouldn't want to introduce annoyances outside of what's necessary.
A suggestion from Paul was to hook it up to the notification system, but we can leave it to the other PR. This one is good to go then, good job.

@MFA-X-AI
MFA-X-AI merged commit 2743053 into XpressAI:master Jun 2, 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