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

feat: Theming Iris Grid #1568

Merged
merged 20 commits into from
Oct 17, 2023
Merged

Conversation

bmingles
Copy link
Contributor

@bmingles bmingles commented Oct 10, 2023

  • Created new base theme for Iris grid and mapped existing styles to it
  • Added color palettes to styleguide
  • IrisGrid now creates and resolves css variables when creating the default theme

Testing

  • Easiest way to see the new color palettes is in the styleguide.
  • Iris Grid should look as it did before except for a few cases where the new color palette doesn't exactly align with the old one. aka. a color may have a subtle change in saturation but there shouldn't be any changes to the visual color.

Current mapping of Bootstrap gray palette to new --dh-color-gray vars based on Don's POC. The Bootstrap variables will get updated in a future PR to pull from the new vars, but this is how things line up right now:
image

BREAKING CHANGE: Enterprise will need ThemeProvider for the css variables to be available

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (cf1b368) 46.45% compared to head (14df256) 46.47%.

❗ Current head 14df256 differs from pull request most recent head 4e2d70e. Consider uploading reports for the commit 4e2d70e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1568      +/-   ##
==========================================
+ Coverage   46.45%   46.47%   +0.01%     
==========================================
  Files         571      572       +1     
  Lines       36030    36060      +30     
  Branches     9020     9026       +6     
==========================================
+ Hits        16738    16759      +21     
- Misses      19240    19249       +9     
  Partials       52       52              
Flag Coverage Δ
unit 46.47% <54.54%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/code-studio/src/styleguide/Colors.tsx 100.00% <ø> (ø)
packages/code-studio/src/styleguide/StyleGuide.tsx 100.00% <ø> (ø)
packages/iris-grid/src/IrisGridTheme.ts 100.00% <100.00%> (ø)
packages/utils/src/ColorUtils.ts 100.00% <100.00%> (ø)
packages/iris-grid/src/IrisGrid.tsx 26.96% <83.33%> (+0.12%) ⬆️
...ackages/code-studio/src/styleguide/ThemeColors.tsx 40.00% <40.00%> (ø)

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmingles bmingles requested review from mofojed and dsmmcken October 11, 2023 22:41
@bmingles bmingles marked this pull request as ready for review October 11, 2023 22:41
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Not sure why some of the grid tests are failing - looks like the colour isn't matching up. Double check that the correct colour is being used, if it is a new colour then update the snapshots (though I'm confused why can open a simple table passes but rollup/goto don't).

@@ -12,92 +12,90 @@ $header-separator-color: $gray-900;
$header-height: 30px;

:export {
grid-bg: $gray-900;
grid-bg: var(--dh-color-grid-bg);
Copy link
Member

Choose a reason for hiding this comment

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

Many of the variables above are no longer used (e.g. $selection-color).
Also the new selection color doesn't match the old color; I think that may be intentional? Confirm with @dsmmcken , but that's one reason the goto row tests are failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted the unused vars. Will check with Don on the selection color diff.
image

Comment on lines 74 to 76
--dh-color-grid-tree-line: var(--dh-color-gray-700);
--dh-color-grid-tree-marker: var(--dh-color-gray-800);
--dh-color-grid-tree-marker-hover: var(--dh-color-gray-900);
Copy link
Member

Choose a reason for hiding this comment

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

These don't match what they were before:

  tree-line-color: $gray-500; 
  tree-marker-color: $gray-300;
  tree-marker-hover-color: $gray-100;

If that's intentional, then need to update snapshots. Seems odd we're going in the reverse on the gray scale though (the scale may not be the same anymore? Dunno).

Copy link
Contributor Author

@bmingles bmingles Oct 12, 2023

Choose a reason for hiding this comment

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

Spectrum numbers ascending 1-100 darkest to lightest. Here's how Don mapped the colors in his POC (left side old, right side new)
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the tree variables to be closer to the original for now. Seems to have fixed these tests

mofojed
mofojed previously approved these changes Oct 17, 2023
@bmingles bmingles requested a review from mofojed October 17, 2023 17:10
@bmingles bmingles merged commit ed8f4b7 into deephaven:main Oct 17, 2023
4 checks passed
@bmingles bmingles deleted the 1541-theming-iris-grid branch October 17, 2023 18:01
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2023
@bmingles bmingles linked an issue Oct 23, 2023 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Theming - IrisGrid
2 participants