Skip to content

Sync JupyterLab theme with Xircuits toggle - #400

Merged
MFA-X-AI merged 2 commits into
XpressAI:masterfrom
rabea-al:feature/theme-sync
May 15, 2025
Merged

MFA-X-AI merged 2 commits into
XpressAI:masterfrom
rabea-al:feature/theme-sync

Conversation

@rabea-al

Copy link
Copy Markdown
Contributor

Description

This PR implements one-way theme synchronization between Xircuits and JupyterLab:

  • When the user toggles the theme from the Xircuits toolbar, JupyterLab's theme is updated accordingly (Light or Dark).
  • Added a slight delay before updating Xircuits theme to prevent visual mismatch during JupyterLab’s theme transition.

Note: Changes in JupyterLab’s theme settings will not affect Xircuits — sync is one-way only (Xircuits → JupyterLab).

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)

Type of Change

  • New feature (non-breaking change which adds functionality)

Tested on? Specify Version.

  • Fedora

@github-actions

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch rabea-al/xircuits/feature/theme-sync

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

image
I'm seeing that the toggle theme icon looks like this.
Tested it out in the binder build and wheel build on chrome.

@MFA-X-AI

MFA-X-AI commented May 14, 2025 •

Copy link
Copy Markdown
Member

I'm seeing that the toggle theme icon looks like this. Tested it out in the binder build and wheel build on chrome.

Actually upon further investigation, it might not be due to this PR, but rather the migration to jupyterlab 4.4.
Here's the light mode implementation.
#373
Would be great if you can investigate which parts needs to be updated. Likely a css that needs to be updated.

@rabea-al

Copy link
Copy Markdown
Contributor Author

@MFA-X-AI Thanks for the observation.
the issue from outdated CSS targeting .dark-mode-switch, which no longer exists in JupyterLab 4.4.
I resolved it by:

  • Replacing those selectors with jp-button[title="Toggle Light/Dark Mode"].
  • Restoring sun/moon toggle logic based on the existing body.light-mode and body.dark-mode classes.
  • Cleaning up unused rules to prevent icon overlap.

@MFA-X-AI
MFA-X-AI merged commit ed2bcf5 into XpressAI:master May 15, 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