Skip to content

πŸ› fix: update viewport selector for JL 4.4 + ✨ improve zoom controls - #412

Merged
MFA-X-AI merged 54 commits into
XpressAI:canvas-fit-featurefrom
rabea-al:canvas-fit-enhancement
Jun 23, 2025
Merged

MFA-X-AI merged 54 commits into
XpressAI:canvas-fit-featurefrom
rabea-al:canvas-fit-enhancement

Conversation

@rabea-al

Copy link
Copy Markdown
Contributor

Description

This PR addresses two improvements related to the zoom functionality in Xircuits:

πŸ› Fix: JupyterLab 4.4 Compatibility

  • Updated the CSS selector used to measure the viewport (zoomToFit).

  • JupyterLab 4.4 changed the aria-label value from "notebook content" to "main area content".

  • The old selector caused zoomToFit to silently fail; now it works reliably across JupyterLab versions.

✨ Enhancement: Zoom Controls UX

  • Redesigned the Zoom controls UI:

  • Switched to a vertical layout.

  • Replaced icons with simpler + / - / fit icons (no magnifying glass).

  • Added hover effect, light/dark theme adaptation, and box shadow.

  • Auto-hide behavior: buttons fade out after 1.5s of no mouse movement and reappear when hovering over the canvas or buttons.


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. Zoom to Fit Selector Compatibility Test

  • Open any workflow with multiple nodes.

  • Click the "Fit All Nodes" button.

  • Confirm that the canvas zooms and pans correctly to include all nodes.


2. Zoom Controls UI Behavior Test

  • Hover over the canvas β†’ controls appear.

  • Stop mouse movement for 1.5 seconds β†’ controls fade out.

  • Hover over controls β†’ they remain visible.

  • Click + or - β†’ zoom in/out as expected.

  • Click "fit" β†’ fit all nodes.

  • Confirm proper appearance in both light and dark themes.


Tested on? Specify Version.

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

rabea-al and others added 30 commits May 13, 2025 20:29
Sync JupyterLab theme with Xircuits toggle
Replace old Argument test with new one
🐞 Improve node connection test + πŸ§ͺ Add Argument component test
✨ Migrate library checks to get_config & API-based installs + 🐞 Fix launcher section reorder
…d-popup

Show component parse error only on manual reload
…/ui-tests/cross-spawn-7.0.6

Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests
…e-notifications

✨ Notifications: Install, Save, Compile + Unify Install Logic
@github-actions

Copy link
Copy Markdown

Binder πŸ‘ˆ Launch a binder notebook on branch rabea-al/xircuits/canvas-fit-enhancement

@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! Appreciate you polishing the current zoom control feature.
Things seem to be working well, but I'm noting that for the very first instance, the css doesn't seem to apply correctly. After toggling the theme, it seems to properly apply.

theme.mismatch.mp4

It's a pretty minor thing and I think it's good to merge anyways, but if you could take a look at why that would happen, then it would be perfect. Thanks!

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

Ah I think I got it. The icon should follow the xircuits theme, not the jupyterlab theme.

image

@rabea-al

Copy link
Copy Markdown
Contributor Author

Thanks! Just updated the zoom buttons to follow the Xircuits theme instead of the JupyterLab one. Should work fine now.

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

Works perfectly. Great job!

@MFA-X-AI
MFA-X-AI merged commit b4cd448 into XpressAI:canvas-fit-feature Jun 23, 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.

3 participants