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

fix(listview): add nowrap to view mode container #18246

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

villebro
Copy link
Member

@villebro villebro commented Feb 1, 2022

SUMMARY

Add white-space: nowrap; to the listview view mode container to prevent the buttons from line wrapping.

AFTER

image

BEFORE

image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue: closes cosmetic: prevent line-breaks on table/card icons #18239
  • 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

@kasiazjc
Copy link
Contributor

kasiazjc commented Feb 1, 2022

@villebro In this case I am not sure if we should do a no-wrap. Those view buttons side by side take up a lot of space and it's even more obvious when you have a few rows of filters. We could actually keep this logic that if there is more than one row the icons are stacked on the top of each other or improve the margins/spacings of the whole component + icons. Wdyt?

The view icon could also be a drop down radio button to save the space.

@villebro
Copy link
Member Author

villebro commented Feb 1, 2022

@villebro In this case I am not sure if we should do a no-wrap. Those view buttons side by side take up a lot of space and it's even more obvious when you have a few rows of filters. We could actually keep this logic that if there is more than one row the icons are stacked on the top of each other or improve the margins/spacings of the whole component + icons. Wdyt?

The view icon could also be a drop down radio button to save the space.

Thanks @kasiazjc for the review! In the current design, keeping the no-wrap kinda feels ok as the dropdowns usually aren't able to gobble up the whole available space on the right (=the no-wrapped buttons don't eat up valuable horizontal space). However, having said that, I think an alternative layout in the whole component that adjusts to different sizes better would probably be optimal. Did you have a particular layout in mind?

@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Merging #18246 (8c541e8) into master (c40b337) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #18246   +/-   ##
=======================================
  Coverage   66.30%   66.30%           
=======================================
  Files        1592     1592           
  Lines       62437    62439    +2     
  Branches     6292     6295    +3     
=======================================
+ Hits        41401    41403    +2     
  Misses      19383    19383           
  Partials     1653     1653           
Flag Coverage Δ
javascript 51.37% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...rset-frontend/src/components/ListView/ListView.tsx 96.25% <ø> (ø)
...-frontend/src/explore/components/ControlHeader.jsx
...-frontend/src/explore/components/ControlHeader.tsx 82.60% <0.00%> (ø)

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 c40b337...8c541e8. Read the comment docs.

@kasiazjc
Copy link
Contributor

kasiazjc commented Feb 1, 2022

@villebro Makes sense! So I thought about something like this.

ezgif-5-e06c96c81b

The popover logic is something that we are implementing now for time columns in explore with @kgabryje. This way we would be able to save a little bit of precious space, let me know what you think (and do not mind the mocks, i found random ones in figma).

@villebro
Copy link
Member Author

villebro commented Feb 1, 2022

I like this @kasiazjc 👍 @rusackas @mistercrunch thoughts on rolling out this new design here?

@rusackas
Copy link
Member

rusackas commented Feb 2, 2022

@villebro / @kasiazjc I'm OK with it... I can't say it's love though. I appreciate the saved real estate, but it doesn't seem like the biggest real estate hog in its vicinity. As far as the interaction itself, If the menu/dropdown opens on hover, it's not so bad. But otherwise, we're asking for two clicks for a toggle, which seems cumbersome.

We could make the toggler smaller, and even use some AntD components, similar to this

I think this PR solves the acute issue, so I'm approving... we can certainly continue to optimize if we feel like it, in this PR or another.

@villebro
Copy link
Member Author

villebro commented Feb 4, 2022

Merging this for now, going to follow up later when we've had more time to iterate on the designs

@villebro villebro merged commit 8b0634c into apache:master Feb 4, 2022
shcoderAlex pushed a commit to casual-precision/superset that referenced this pull request Feb 7, 2022
ofekisr pushed a commit to nielsen-oss/superset that referenced this pull request Feb 8, 2022
bwang221 pushed a commit to casual-precision/superset that referenced this pull request Feb 10, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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 preset-io size/XS 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cosmetic: prevent line-breaks on table/card icons
4 participants