-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat: TableReport dark theme #1201
Conversation
Hi @rouk1 ! thanks so much for doing this 🚀 the TableReport looks really nice in the proposed dark mod🤩 I noticed that some aspects that are not related to colors are affected by the PR as well; here are a first few comments
In the summary statistics there used to be a thick gray line separating the first column when it overlaps the rest, I think it helps realize that this column is sticky and some content is hidden behind it due to horizontal scrolling, that has been removed in the toggle tip shown below, there used to be a transition delay so that if we hover the ( i ) button and then move the mouse to hover over the text it doesn't disappear; now as soon as the mouse leaves the button the text disappears. also there used to be a ring around it when we click it not sure if it is intentional but the background color of the header in the associations panel is gone, I don't have a strong opinion as to whether it is better or worse most of these changes don't seem to be related to dark mode but it is true we had discussed that this is an opportunity to refactor the css a bit. so I'm not sure which of these are intentional or not, maybe it would help to have another quick call also with @glemaitre to discuss this? it might be easier interactively while looking at an open report. now regarding the colors and the dark mode itself, here are a couple of comments:
thanks again for all this work and LMK if you would like to schedule a call or I can also come to montparnasse sometime! |
Thanks for the review @jeromedockes, I'll try to work on your feedbacks on friday. |
cool, thanks!! |
…appear when hovering it - tip button outline is now blue
…high contrast and is not related to plot colors
Hello @jeromedockes ! I think I've addressed your feedbacks. Please let me know if you want something else or if I miss something. tackled feedbacks
Not sure on how I may address this. UI previewsk-tr-dm-pr.mp4 |
Made a few changes... |
Thanks @rouk1 that's very cool... I was thinking we could look at the color of the parent element and try to guess from it what theme we should adopt but that's probably too brittle, I like your approach better. BTW sorry for the delay we haven't forgotten about this PR but I took a long end-of-year vacation and recently we've been dealing with urgent stuff like the fact the service hosting the example datasets was down and a workshop that will take place this week -- from Thursday things should get back to normal |
@@ -1,4 +1,5 @@ | |||
if (customElements.get('skrub-table-report') === undefined) { | |||
console.log("coucou"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoooooups
No worries we also add issues with that provider : ) |
2eb49a7
to
32b619f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @rouk1 !
I pushed a few small changes, mainly
- to set the matplotlib config before plotting so that all the lines, ticks etc. have the same color as the text
- to revert 1 or 2 details not related to the color theme eg the size of some buttons in pixels instead of relative to font size could cause them to be too big or small in some cases (image below)
- to also set the color of the full page when we generate a standalone report using the same media query.
I think the PR is ready to merge now. Let me know if you want to make some more changes otherwise I'll merge it (and we can always do further tweaks in other prs).
} | ||
|
||
.table-with-selectable-cells .table-cell { | ||
transition: background-color var(--animation-duration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit on the fence about this animation -- I have the impression it makes the interaction feel a little bit more sluggish; also we see some of the cells' color fading in when we load the page (or insert the report). could you say a bit more about the motivation?
I know on the main branch it is not perfect either because the focus ring disappears when we press the mouse button down on a new cell but the colors only update when we release the button so there is a delay between the 2 : was adding the animation meant to make that less noticeable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I always add animation when changing color on hover, it's more of an habit than motivated by objective arguments. To me having a few animations here and there make the widget more pleasing to the eye, but that is a matter of taste. Not that as it uses css transition user who do not like animations can disable it browser wide.
Feel free to remove if it doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for explaining :) let's keep it then and we'll see if we get any feedback
adjustAllSvgViewBoxes(report); | ||
} | ||
|
||
detectTheme() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as this does not use the skrubTableReport object and could potentially be useful to other components if we ever add any, I wonder if it would make sense for detectTheme
to be a top-level function, outside of this class? there are a few at the bottom of this module. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not but for now you have only one : )
@@ -386,7 +409,7 @@ if (customElements.get('skrub-table-report') === undefined) { | |||
while (!stop(i, j)) { | |||
const cell = this.elem.querySelector(`[data-spans__${i}__${j}]`); | |||
if (cell !== null && cell.id !== startCellId && !cell.hasAttribute( | |||
"data-excluded-by-column-filter") && cell.dataset.role !== | |||
"data-excluded-by-column-filter") && cell.dataset.role !== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we discussed briefly at some point it could be nice to configure some automatic formatting for the js and css files so that we don't get spurious diff lines (but that is for another pr)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a prettier pre commit hook could be a quick win.
LGTM then and feel free to ping me for future enhancements :) |
cool, will do! and thanks so much for the tablereport dark theme 🤩 |
This PR introduces a dark mode for the TableReport.
I tried to use as much as possible css variables all centralized in a
_variables.css
file.UI preview
darkmode.mp4