Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to jupyter-ui-toolkit for Switch component #127

Merged

Conversation

mahendrapaipuri
Copy link
Member

Fixes #124

@jtpio I had some time to look at it. Let me know your thoughts!

* Blueprintjs that is used until now is overriding the default body font of lab. This commit fixes it by replace Switch component from blueprintjs to jupyter-ui-toolkit

Signed-off-by: Mahendra Paipuri <[email protected]>
* To ensure dependencies are satisfied with JupyterLab

Signed-off-by: Mahendra Paipuri <[email protected]>
* setup-python action does not support Python < 3.11 for MacOS runners based on Arm

Signed-off-by: Mahendra Paipuri <[email protected]>
* Use venv for all steps in packaging workflow

Signed-off-by: Mahendra Paipuri <[email protected]>
@mahendrapaipuri mahendrapaipuri force-pushed the use_jupyter_ui_components branch from 31dedc6 to 02d3b12 Compare July 16, 2024 06:43
@mahendrapaipuri
Copy link
Member Author

Here is the binder link to test the PR -> https://mybinder.org/v2/gh/mahendrapaipuri/jupyterlab-topbar/use_jupyter_ui_components

Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks @mahendrapaipuri for looking into this!

The new switch looks good. Maybe we should tweak the logic to take into account the current theme on page load?

@@ -85,6 +85,11 @@ jobs:
py_cmd: python3
- os: ubuntu
py_cmd: python
# actions/setup-python do not support MacOS runners based on ARM for Python < 3.11
# https://github.com/actions/setup-python/issues/906
exclude:
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we should remove the line architecture: 'x64' below in the actions/setup-python, and bump to actions/setup-python@v5?

Maybe we could then remove the extra source ./venv/bin/activate?

Copy link
Member Author

Choose a reason for hiding this comment

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

Bumped actions/setup-python to v5. The virtual env stuff is due to MacOS ARM runners that need packages to be installed in virtual envs. To avoid conditional logic, I just made it default for all OS types.

innerLabel="light"
innerLabelChecked="dark"
/>
<Switch onChange={onChange} checked={true}>
Copy link
Member

Choose a reason for hiding this comment

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

Should checked always be true?

Testing on Binder, the theme seems to be changed after a page refresh:

theme-toggler.webm

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you are correct. I over simplified the logic. Now I added the logic back to keep the state of the switch based on current theme.

@jtpio
Copy link
Member

jtpio commented Jul 16, 2024

Also the theme name used to be "inside" the switch component:

image

Not sure there is a way to do this with the component from jupyter-ui-toolkit? And maybe we should remove the "Theme" label so it takes less space?

image

@mahendrapaipuri
Copy link
Member Author

Also the theme name used to be "inside" the switch component:

image

Not sure there is a way to do this with the component from jupyter-ui-toolkit? And maybe we should remove the "Theme" label so it takes less space?

image

Yeah, there is no native way to embed labels inside the Switch component. Not sure if it is worth customizing the component. Maybe it makes more sense to address this issue in jupyter-ui-toolkit?

@mahendrapaipuri
Copy link
Member Author

@jtpio Could you please take a look at it when you got some time? Cheers!

@jtpio jtpio self-requested a review December 4, 2024 13:01
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

@jtpio jtpio merged commit 323e38b into jupyterlab-contrib:main Dec 30, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Theme toggler extension overriding body font
2 participants