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

chore: Remove logo forced width #19049

Merged
merged 14 commits into from
Mar 21, 2022
Merged

chore: Remove logo forced width #19049

merged 14 commits into from
Mar 21, 2022

Conversation

geido
Copy link
Member

@geido geido commented Mar 7, 2022

SUMMARY

This PR removes the necessity of adding a forced width to the APP_ICON image.

Fixes #19105

AFTER

Screen Shot 2022-03-08 at 15 28 53

Screen Shot 2022-03-08 at 15 28 23

Screen Shot 2022-03-08 at 15 27 57

TESTING INSTRUCTIONS

  1. Open Superset
  2. Verify that the logo in the navbar is fitting properly

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #19049 (8c926f4) into master (88029e2) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #19049      +/-   ##
==========================================
- Coverage   66.57%   66.57%   -0.01%     
==========================================
  Files        1667     1666       -1     
  Lines       64421    64328      -93     
  Branches     6503     6492      -11     
==========================================
- Hits        42886    42824      -62     
+ Misses      19850    19822      -28     
+ Partials     1685     1682       -3     
Flag Coverage Δ
hive 52.70% <ø> (-0.01%) ⬇️
mysql 81.56% <ø> (-0.01%) ⬇️
postgres 81.61% <ø> (-0.01%) ⬇️
presto 52.54% <ø> (-0.01%) ⬇️
python 82.03% <ø> (-0.01%) ⬇️
sqlite 81.37% <ø> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/config.py 91.71% <ø> (-0.03%) ⬇️
superset/views/base.py 75.49% <ø> (ø)
superset-frontend/src/views/components/Menu.tsx 60.00% <100.00%> (+1.02%) ⬆️
...et-frontend/src/dashboard/actions/dashboardInfo.ts 52.17% <0.00%> (-9.37%) ⬇️
...perset-frontend/src/dashboard/containers/Chart.jsx 72.72% <0.00%> (-2.28%) ⬇️
...-frontend/src/dashboard/reducers/dashboardState.js 73.33% <0.00%> (-0.58%) ⬇️
...t-frontend/src/dashboard/actions/dashboardState.js 36.06% <0.00%> (-0.35%) ⬇️
...frontend/src/dashboard/components/Header/index.jsx 61.11% <0.00%> (-0.27%) ⬇️
...-frontend/src/dashboard/actions/dashboardLayout.js 96.05% <0.00%> (-0.06%) ⬇️
superset-frontend/src/dashboard/actions/hydrate.js 2.08% <0.00%> (-0.05%) ⬇️
... and 43 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 88029e2...8c926f4. Read the comment docs.

@@ -236,7 +236,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:

# Specify the App icon
APP_ICON = "/static/assets/images/superset-logo-horiz.png"
APP_ICON_WIDTH = 126
Copy link
Member

Choose a reason for hiding this comment

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

Should we add something to UPDATING.MD stating that this configuration was removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right! Added to the breaking changes. Thanks @michael-s-molina

@rusackas let me know your thoughts about communicating this breaking change to the wider community before merging.

Copy link
Member

Choose a reason for hiding this comment

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

If we do this, I think we should tag the PR with the 2.0 label and the risk:breaking-change label, add it to the 2.0 project board, and update UPDATING.MD as you've done here.

Or, as noted elsewhere, we COULD use that value in the CSS, to make it a little more configurable. If we want to keep that complexity and avoid the breaking change, that is.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rusackas I think the configurability brings a bit of complexity to it. If there is a strong signal from the community that they need the APP_ICON_WIDTH, we should probably add another config flag, such as USE_APP_ICON_FORCED_WIDTH = Boolean, and then behave consistently with that when True. When False just fallback to the implementation of this PR.

@michael-s-molina
Copy link
Member

@rusackas and I were playing with the padding property for different icon shapes and we tweak a couple of CSS props:

.navbar-brand {
   ...
   padding: 4px 8px 4px 16px; // replace with grid-unit
   max-width: 148px;

Before the changes:

Screen.Recording.2022-03-08.at.4.12.13.PM.mov

After the changes:

Screen.Recording.2022-03-08.at.4.21.01.PM.mov

What do you think?

@rusackas I know that you mentioned calculating the left and right paddings from the icon's width but do you think is necessary or this is enough? Maybe it is worth a shot.

@rusackas
Copy link
Member

rusackas commented Mar 9, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2022

@rusackas Ephemeral environment spinning up at http://34.220.105.158:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

UPDATING.md Outdated Show resolved Hide resolved
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

Approving, as this seems like a sensible change. The width removal is super nitpicky thing to be considered a breaking change, but it's POSSIBLE someone is using the app config to do something specific and this will change their layout by a pixel here or a pixel there.

This was not voted in as part of the 2.0 SIP, but I think it's minor enough that we might consider it a late addition, and just label the PR appropriately with 2.0 and risk:breaking0change. Curious the thoughts of @john-bodley and @etr2460 or any other folks from the community on the relative risk or addition of a change while we're in the 2.0 build window.

`${theme.gridUnit}px ${theme.gridUnit * 2}px ${theme.gridUnit}px ${
theme.gridUnit * 4
}px`};
max-width: ${({ theme }) => `${theme.gridUnit * 37}px`};
Copy link
Member

Choose a reason for hiding this comment

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

I'm on the fence about this... 37 seems like a pretty arbitrary number. We could use the APP_ICON_WIDTH here, I suppose, as much as I'd like to remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem with using the APP_ICON_WIDTH here is that it would not behave the same as it used to. I think best is not to use it or change it with APP_ICON_MAX_WIDTH for clarity, if that can be of any benefit to the users

@@ -97,6 +96,17 @@ const StyledHeader = styled.header`
display: flex;
flex-direction: column;
justify-content: center;
min-height: ${({ theme }) => `${theme.gridUnit * 12.5}px`};
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just 12? Or lucky 13? Trying to avoid fractional gridUnits wherever possible, as usual.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. It needs to be exactly 50 or it will break the antdesign nav bar

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we just forgo the gridUnit here and give it a pixel measurement (and maybe a comment for the rationale). Then it won't be fragile if someone changes the gridUnit from 4px to 5px in their theme.

@@ -236,7 +236,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:

# Specify the App icon
APP_ICON = "/static/assets/images/superset-logo-horiz.png"
APP_ICON_WIDTH = 126
Copy link
Member

Choose a reason for hiding this comment

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

If we do this, I think we should tag the PR with the 2.0 label and the risk:breaking-change label, add it to the 2.0 project board, and update UPDATING.MD as you've done here.

Or, as noted elsewhere, we COULD use that value in the CSS, to make it a little more configurable. If we want to keep that complexity and avoid the breaking change, that is.

@etr2460
Copy link
Member

etr2460 commented Mar 10, 2022

I agree that removing a config option should be a breaking change, and thus this should be added in UPDATING.md and tagged for superset 2.0

@rusackas rusackas added v2.0 risk:breaking-change Issues or PRs that will introduce breaking changes labels Mar 10, 2022
@rusackas
Copy link
Member

Fixes #19105

@michael-s-molina
Copy link
Member

michael-s-molina commented Mar 11, 2022

Fixes #19105

@rusackas The keyword fixes won't automatically close the issue when used in comments. You need to add it to the PR's description to make it work. I updated the PR description 😉

Copy link
Member

@rusackas rusackas 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 the updates

@rusackas
Copy link
Member

@geido this just needs a rebase to pass CI, I believe.

Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

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

another approval 😁

@rusackas
Copy link
Member

I keep trying to merge this thing, but UPDATING.md keeps causing conflicts. The most frustrating kind of progress :) Here we go again... go, CI, go!!

@rusackas
Copy link
Member

Updating became a merge conflict AGAIN. Go, CI, go!

@geido geido merged commit 9ae51f7 into apache:master Mar 21, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

michael-hoffman-26 pushed a commit to nielsen-oss/superset that referenced this pull request Mar 23, 2022
* Remove logo forced width

* improve styling

* improve paddings

* Update UPDATING.md

* Fixes a typo

* Add fixed height

Co-authored-by: Michael S. Molina <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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 risk:breaking-change Issues or PRs that will introduce breaking changes size/S 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove APP_ICON_WIDTH config and adjust logo CSS layout to maintain support for varying aspect ratios
6 participants