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

Reflect theme changes without a refresh #575

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

garsonbyte
Copy link
Contributor

@garsonbyte garsonbyte commented Jan 11, 2024

By leveraging IThemeManager.themeChanged, we can listen on theme change signals and rebuild the theme object in response. This allows CSS variable changes to reflect in the MUI theme without having to refresh the page.

(@dlqqq) I've verified that this PR:

Copy link

welcome bot commented Jan 11, 2024

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@JasonWeill
Copy link
Collaborator

@garsonbyte Thank you so much for opening this! It looks like the linting test is failing. Can you try running jlpm run prettier locally, then committing and pushing any changes?

@andrii-i andrii-i added the enhancement New feature or request label Jan 11, 2024
@dlqqq dlqqq mentioned this pull request Jan 11, 2024
@dlqqq dlqqq self-requested a review January 11, 2024 20:07
@dlqqq dlqqq self-assigned this Jan 11, 2024
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

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

@garsonbyte Thank you so much for working on this! This issue had totally escaped my attention. Your PR worked great out-of-the-box. 🎉

There were a few additional changes that I wanted to make to your branch before merging. I've submitted these as a pull request on your fork: garsonbyte#1

If you're OK with these suggestions, then please merge that PR, which will include those commits in this PR. Then I'll approve and merge this PR. 👍

garsonbyte added a commit to garsonbyte/jupyter-ai that referenced this pull request Jan 11, 2024
@garsonbyte garsonbyte requested a review from dlqqq January 11, 2024 23:04
gchow and others added 4 commits January 23, 2024 14:48
By leveraging `IThemeManager.themeChanged`, we can listen on theme change signals
and rebuild the theme object in response. This allows CSS variable changes to reflect
in the MUI theme without having to refresh the page.
@dlqqq
Copy link
Member

dlqqq commented Jan 23, 2024

@garsonbyte Sorry for the delay in merging your PR. I rebased the branch onto the latest version of main, and these changes will be included in the next release. Thank you very much for working on this! 🎉

BTW, you should add your Git email to your GitHub profile so your avatar shows up in the commit history. Right now, only my avatar is showing, even though you authored the first commit. The email you used to sign your commit is garson.chow@factset.com. GitHub won't show your avatar in the commit history until you add that email to your GitHub account. 👋

@dlqqq dlqqq enabled auto-merge (squash) January 23, 2024 23:00
@dlqqq dlqqq disabled auto-merge January 23, 2024 23:19
@dlqqq dlqqq merged commit ca03e2c into jupyterlab:main Jan 23, 2024
8 checks passed
Copy link

welcome bot commented Jan 23, 2024

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@dlqqq
Copy link
Member

dlqqq commented Jan 23, 2024

@meeseeksdev please backport to 1.x

Copy link

lumberbot-app bot commented Jan 23, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 1.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 ca03e2c9a846344c379d50ccbe8323f7e0c7b1ed
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #575: Reflect theme changes without a refresh'
  1. Push to a named branch:
git push YOURFORK 1.x:auto-backport-of-pr-575-on-1.x
  1. Create a PR against branch 1.x, I would have named this PR:

"Backport PR #575 on branch 1.x (Reflect theme changes without a refresh)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

dlqqq pushed a commit to dlqqq/jupyter-ai that referenced this pull request Jan 23, 2024
* Reflect theme changes without a refresh

By leveraging `IThemeManager.themeChanged`, we can listen on theme change signals
and rebuild the theme object in response. This allows CSS variable changes to reflect
in the MUI theme without having to refresh the page.

* update yarn.lock

* pass themeManager as a prop instead of using top-level scope

* remove theme hack added in jupyterlab#192

---------

Co-authored-by: gchow <garson.chow@factset.com>
Co-authored-by: David L. Qiu <david@qiu.dev>
(cherry picked from commit ca03e2c)
dlqqq pushed a commit to dlqqq/jupyter-ai that referenced this pull request Jan 23, 2024
* Reflect theme changes without a refresh

By leveraging `IThemeManager.themeChanged`, we can listen on theme change signals
and rebuild the theme object in response. This allows CSS variable changes to reflect
in the MUI theme without having to refresh the page.

* update yarn.lock

* pass themeManager as a prop instead of using top-level scope

* remove theme hack added in jupyterlab#192

---------

Co-authored-by: gchow <garson.chow@factset.com>
Co-authored-by: David L. Qiu <david@qiu.dev>
(cherry picked from commit ca03e2c)
dlqqq added a commit that referenced this pull request Jan 23, 2024
* Reflect theme changes without a refresh

By leveraging `IThemeManager.themeChanged`, we can listen on theme change signals
and rebuild the theme object in response. This allows CSS variable changes to reflect
in the MUI theme without having to refresh the page.

* update yarn.lock

* pass themeManager as a prop instead of using top-level scope

* remove theme hack added in #192

---------

Co-authored-by: gchow <garson.chow@factset.com>
Co-authored-by: David L. Qiu <david@qiu.dev>
(cherry picked from commit ca03e2c)

Co-authored-by: Garson R Chow <58149459+garsonbyte@users.noreply.github.com>
dbelgrod pushed a commit to dbelgrod/jupyter-ai that referenced this pull request Jun 10, 2024
* Reflect theme changes without a refresh

By leveraging `IThemeManager.themeChanged`, we can listen on theme change signals
and rebuild the theme object in response. This allows CSS variable changes to reflect
in the MUI theme without having to refresh the page.

* update yarn.lock

* pass themeManager as a prop instead of using top-level scope

* remove theme hack added in jupyterlab#192

---------

Co-authored-by: gchow <garson.chow@factset.com>
Co-authored-by: David L. Qiu <david@qiu.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix MUI text theme Chat UI input loses border when theme is switched
4 participants