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

Graphs are not themeable #141

Open
daniel-beck opened this issue Aug 8, 2020 · 6 comments
Open

Graphs are not themeable #141

daniel-beck opened this issue Aug 8, 2020 · 6 comments
Labels
core-compatibility Dark Theme compatibility issues in the Jenkins core help wanted Extra attention is needed

Comments

@daniel-beck
Copy link
Member

hudson.util.Graph is used around Jenkins and not (really) themeable. While it can consume some limited query parameters for background color, they're neither set nor work in a way that suits the existing CSS variable approach AFAICT.

On the plus side, if the color definitions are never set we can probably get away with adding an extension point to override them.

Examples

Screenshot Screenshot
@daniel-beck daniel-beck added the core-compatibility Dark Theme compatibility issues in the Jenkins core label Aug 8, 2020
@timja
Copy link
Member

timja commented Aug 8, 2020

The issue with these graphs are that they are rendered server side.

Any idea how we would handle 'System' theme preference with an extension point?

I migrated the junit plugin to use echarts (https://github.com/jenkinsci/echarts-api-plugin) instead of trying to fight with this as it's rendered client side and can lookup CSS variables.

#127 is a similar issue, although slightly easier as we can probably bundle a custom theme which has the extra CCS required for 'system' preference.

@daniel-beck
Copy link
Member Author

Any idea how we would handle 'System' theme preference with an extension point?

Would try to wrap the graphs in a client side wrapper that passes the appropriate colors as query parameters, not unlike the JS that handles dynamic graph width today (but less amateurish). Probably won't handle color scheme changes while the page is being viewed unless we're spending real time on this, but probably good enough?

@daniel-beck
Copy link
Member Author

daniel-beck commented Aug 11, 2020

To clarify, I currently have no specific plans to implement this myself. I think I'm out of my depth here with the CSS/JS required to make this work properly.

@timja timja added the help wanted Extra attention is needed label Aug 11, 2020
@timja
Copy link
Member

timja commented Aug 11, 2020

There's at least two approaches I think,

  1. Extension point in core where you can override the colour's in Java code or pass them as query parameters
  2. Rewrite them using echarts, probably detaching them from core, and then it's a lot easier

I have no intention in the short term of working on it, possibly later on though

@daniel-beck
Copy link
Member Author

Extension point in core where you can override the colour's in Java code or pass them as query parameters

Limited query parameter support exists.

I think this can potentially be done more simply, as described in #141 (comment), which wouldn't require a new extension point. It is based on the assumption that CSS variable values can be accessed by JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-compatibility Dark Theme compatibility issues in the Jenkins core help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants