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

LESS is more #9023

Merged
merged 9 commits into from Jan 31, 2020
Merged

LESS is more #9023

merged 9 commits into from Jan 31, 2020

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Jan 25, 2020

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

This shouldn't change anything in the processed CSS.

Now that we have LESS everywhere, this PR just goes through and takes advantage of it, tidying up various things readability/grouping

I went through and did an npm run build on the master branch and this feature branch. I compared all resulting CSS files, and screenshots of the (innocuous as far as I can see) diffs are below - it looks like things were just re-ordered a bit:

image

image
(this yields the same CSS attributes without repeating the properties)

image

image

image

image

image

@codecov-io
Copy link

codecov-io commented Jan 25, 2020

Codecov Report

Merging #9023 into master will increase coverage by 0.29%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9023      +/-   ##
==========================================
+ Coverage   59.15%   59.45%   +0.29%     
==========================================
  Files         367      369       +2     
  Lines       11686    11747      +61     
  Branches     2866     2888      +22     
==========================================
+ Hits         6913     6984      +71     
+ Misses       4594     4584      -10     
  Partials      179      179
Impacted Files Coverage Δ
...assets/src/components/ListView/TableCollection.tsx 92.59% <ø> (ø) ⬆️
...rset/assets/src/components/ConfirmStatusChange.tsx 100% <100%> (ø)
...perset/assets/src/components/ListView/ListView.tsx 92.2% <100%> (+1.03%) ⬆️
superset/assets/src/SqlLab/constants.js 100% <100%> (ø) ⬆️
...et/assets/src/components/IndeterminateCheckbox.jsx 100% <100%> (ø)
superset/assets/src/components/ListView/utils.ts 98.46% <100%> (+0.31%) ⬆️
...uperset/assets/src/SqlLab/components/SqlEditor.jsx 51.94% <100%> (ø) ⬆️
.../assets/src/SqlLab/components/AceEditorWrapper.jsx 54.21% <33.33%> (ø) ⬆️
...t/assets/src/views/dashboardList/DashboardList.tsx 73.39% <61.29%> (+14.44%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 440665c...94cdc14. Read the comment docs.

@craig-rueda
Copy link
Member

LGTM, but prob needs to be tested. This definitely makes things easier to read...

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

A few comments, but otherwise seems legit. could you add a bunch of before and after screenshots to your test plan to confirm that this works. alternatively, you could attach a diff on the processed CSS to confirm it's all correct


div.tablePopover:hover {
opacity: 1 !important;
&:hover {
Copy link
Member

Choose a reason for hiding this comment

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

this is a styling thing, but personally i prefer a new line between normal styles and the &:foo { line. I think there's a way to lint for that, if so maybe you could add that rule in another PR. if not, maybe we could start standardizing that here if you agree?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer that too, but glad you caught ones I missed. I'll look for a linting rule.

@@ -28,7 +28,6 @@

.dashboard--editing {
.grid-column:after {
border: 1px solid transparent;
Copy link
Member

Choose a reason for hiding this comment

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

lol, what was this?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are a bunch of fairly convoluted styles around the dashed borders in the dashboard editor, which seem like they could use a simplification effort (a future PR, probably). I'll double check that this one wasn't providing some useful 1px offset.

@rusackas
Copy link
Member Author

You could attach a diff on the processed CSS to confirm it's all correct.

I like this idea... will do later today.

@rusackas
Copy link
Member Author

@etr2460 I pasted a bunch of diff screenshots above. To get these, I ran the build on master, and on this branch. I then took all the resulting CSS files from each build, removed the annoying hashes from the filenames, ran prettier on them so I could get a reasonable DIFF, and then got the DIFF via github. Hopefully I didn't screw anything up in that process, but I'm feeling pretty good about it overall :D

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

Thanks for all the diligence in testing and ensuring the outputted CSS is correct. And double thanks for adding the lint rule!

@craig-rueda craig-rueda merged commit bbe4337 into apache:master Jan 31, 2020
@craig-rueda craig-rueda deleted the LESS-is-more branch January 31, 2020 17:38
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants