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

Inherit terminal theme from lab theme #5964

Merged
merged 8 commits into from
Apr 5, 2019

Conversation

gnestor
Copy link
Contributor

@gnestor gnestor commented Feb 8, 2019

This provides the terminal with a theme based on the current lab theme's CSS variables and removes the setting, command, and menu item for toggling the terminal theme light/dark. This simplifies things for the user and has the added benefit of the terminal theme playing nice with themes other than the official light/dark.

Another option: We can provide a new CSS variable or set of variables for the terminal theme. This would allow themes to have a little more control over the terminal theme (vs. defaulting to general variables like --jp-layout-color0 and --jp-font-color0). I'm starting work on refactoring the CSS theme variables (#5549) and this may be a good place to refactor.

@jasongrout
Copy link
Contributor

Cool, thanks for working on this!

Copy link
Member

@ian-r-rose ian-r-rose left a comment

Choose a reason for hiding this comment

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

This is cool @gnestor. At some point somebody suggested (I forget who) that we provide three options for the terminal: light, dark, or "inherit from JupyterLab theme". Do you think that would be appropriate here?

I know that I kind of like to have a dark terminal theme, even if I am using the light JupyterLab theme.

packages/terminal-extension/src/index.ts Outdated Show resolved Hide resolved
@gnestor gnestor changed the title Inherit terminal theme from lab theme [WIP] Inherit terminal theme from lab theme Feb 13, 2019
@gnestor gnestor requested a review from ian-r-rose February 28, 2019 22:49
@gnestor gnestor changed the title [WIP] Inherit terminal theme from lab theme Inherit terminal theme from lab theme Feb 28, 2019
@gnestor
Copy link
Contributor Author

gnestor commented Feb 28, 2019

Per @ian-r-rose's suggestion, I added a command that allows users to select light, dark, or inherit terminal theme. It's available from the "Settings" menu and the command palette.

@ellisonbg
Copy link
Contributor

Love this!

Copy link
Member

@ian-r-rose ian-r-rose left a comment

Choose a reason for hiding this comment

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

This looks great!

packages/terminal/src/widget.ts Outdated Show resolved Hide resolved
packages/terminal-extension/src/index.ts Show resolved Hide resolved
@@ -46,7 +46,7 @@
"title": "Theme",
"description": "The theme for the terminal.",
"$ref": "#/definitions/theme",
"default": "dark"
"default": "inherit"
Copy link
Member

Choose a reason for hiding this comment

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

I guess I'm just naturally a bit conservative about defaults: any reason to change this from "dark"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ellisonbg What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. What about having another setting of "opposite" (dark terminal on the light theme) and having that as the default? The reason we have had a dark terminal on a light theme previously is to help users understand that it is different from other UIs that look similar (like a test editor).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I'm not a fan on light terminal on dark theme. Give it a try. I'm ok either way 👌

@jasongrout
Copy link
Contributor

What's the current status of this PR? Is there still work that you are planning on doing, or has everything been addressed?

@jasongrout jasongrout modified the milestones: 1.0, 1.1 Mar 19, 2019
@gnestor
Copy link
Contributor Author

gnestor commented Mar 19, 2019

The only thing to resolve is whether or not the "inherit" (inherit the lab theme's color for the terminal theme) should be the default or whether we should leave "dark" as the default.

@jasongrout
Copy link
Contributor

+1 to inherit by default, but having the option to be dark/light explicitly.

@gnestor
Copy link
Contributor Author

gnestor commented Mar 20, 2019

I agree. Feel free to merge and we can always change the default if need be 👍

Copy link
Member

@ian-r-rose ian-r-rose left a comment

Choose a reason for hiding this comment

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

Okay, we can move forwards with this and change the default back to "dark" if people complain.

@gnestor
Copy link
Contributor Author

gnestor commented Apr 1, 2019

Ok 👌

I rebased from master once more so let's see if we can't get these checks to fully pass...

@ian-r-rose
Copy link
Member

Looks like legitimate test failures.

@gnestor
Copy link
Contributor Author

gnestor commented Apr 3, 2019

@ian-r-rose We're in the JupyterLab meeting and it sounds like this @jupyterlab/apputils ClientSession #restartKernel() should restart if the user accepts the dialog failure (https://github.com/jupyterlab/jupyterlab/blob/master/tests/test-apputils/src/clientsession.spec.ts#L375-L395) is unrelated to any changes in this PR. Do you concur? If so, then @jasongrout says it's ok to merge.

@ian-r-rose
Copy link
Member

I thought I saw terminal failures here.

@gnestor
Copy link
Contributor Author

gnestor commented Apr 3, 2019

🤔

@ian-r-rose
Copy link
Member

Yep, just checked, there are legitimate terminal failures.

@gnestor
Copy link
Contributor Author

gnestor commented Apr 3, 2019

I'm not seeing it, can you share a link?

@ian-r-rose
Copy link
Member

ian-r-rose commented Apr 3, 2019 via email

@ian-r-rose ian-r-rose modified the milestones: 1.1, 1.0 Apr 5, 2019
@ian-r-rose ian-r-rose merged commit c31b311 into jupyterlab:master Apr 5, 2019
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg:terminal pkg:themes status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Design and UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants