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

refactor(explore): Enhance Dataset and Control panel Collapse components #12218

Merged
merged 17 commits into from
Jan 25, 2021
Merged

refactor(explore): Enhance Dataset and Control panel Collapse components #12218

merged 17 commits into from
Jan 25, 2021

Conversation

geido
Copy link
Member

@geido geido commented Dec 28, 2020

SUMMARY

Removes react-bootstrap Collapse with Antdesign enhanced Collapse.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Collapse_BBEFORE.mp4

After:

Collapse_AFTER.mp4

TEST PLAN

  1. Open the explorer
  2. Make sure the control panel has all the collapsible expanded
  3. Close a collapsible panel, the content should be hidden
  4. Re-open the closed collapsible panel, the content should appear

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@geido
Copy link
Member Author

geido commented Dec 28, 2020

@rusackas @junlincc

@junlincc
Copy link
Member

junlincc commented Jan 1, 2021

thanks @geido for the PR. if the caret was the only thing that changed, it LGTM. but im not sure why the tabs in the control panel got messed up a bit...
Screen Shot 2021-01-01 at 2 10 13 PM
this is what im seeing and how it supposed to look in another open PR

Screen Shot 2021-01-01 at 2 11 47 PM

@geido
Copy link
Member Author

geido commented Jan 1, 2021

Thanks @junlincc. Let me check what might have caused that.

@mistercrunch mistercrunch reopened this Jan 4, 2021
@geido
Copy link
Member Author

geido commented Jan 4, 2021

@junlincc Please check now. The issue should be resolved.

@junlincc junlincc self-requested a review January 5, 2021 01:21
Copy link
Member

@junlincc junlincc left a comment

Choose a reason for hiding this comment

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

manually tested, LGTM!

If it's easy, please remove 'Dataset' from the Dataset & Chart Type Section in this PR as well.
Screen Shot 2021-01-04 at 9 07 55 PM

and get the tests passed.

@ktmud
Copy link
Member

ktmud commented Jan 5, 2021

The caret directions are inconsistent with the datasource panel.

Folded:
image

Expanded:

image

I think the directions used by the datasource pane makes more sense.

@ktmud
Copy link
Member

ktmud commented Jan 5, 2021

Also, can we fix the font-size inconsistency in these panes as well (shouldn't they use the same styled component)?

@ktmud
Copy link
Member

ktmud commented Jan 5, 2021

May I also suggest tune the font size/spacing of the columns/metrics as well?

Before:

After:

(a rough adjustment, could be better)

@ktmud
Copy link
Member

ktmud commented Jan 5, 2021

The title border spacing is also inconsistent.

@geido
Copy link
Member Author

geido commented Jan 5, 2021

Hello @ktmud. Thanks for your feedback. We are working on moving the Collapse components to Antd in small steps. This is the reason why you see inconsistencies between the two. We should use Antdesign as a reference though.

Concerning the fonts, react-bootstrap was having a 16px overriding the default 14px. This should be an improvement. Unless you think keeping the 16px imposed by react-bootstrap was intentional.

As for the direction of the arrows, those are by default in Antd. While I agree with you that the directions used by the previous Collapse are more intuitive, this is a change that will have an impact on all the Collapse components already moved to Antd. I would keep it as an item for later.

@codecov-io
Copy link

codecov-io commented Jan 5, 2021

Codecov Report

Merging #12218 (88413e2) into master (878f123) will decrease coverage by 3.44%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12218      +/-   ##
==========================================
- Coverage   66.83%   63.39%   -3.45%     
==========================================
  Files        1022      488     -534     
  Lines       49992    30102   -19890     
  Branches     4892        0    -4892     
==========================================
- Hits        33411    19082   -14329     
+ Misses      16456    11020    -5436     
+ Partials      125        0     -125     
Flag Coverage Δ
cypress ?
javascript ?
python 63.39% <ø> (-0.61%) ⬇️

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

Impacted Files Coverage Δ
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/db_engine_specs/hive.py 73.84% <0.00%> (-10.00%) ⬇️
superset/databases/commands/create.py 83.67% <0.00%> (-8.17%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/connectors/sqla/models.py 84.31% <0.00%> (-6.28%) ⬇️
superset/db_engine_specs/sqlite.py 90.62% <0.00%> (-6.25%) ⬇️
superset/databases/commands/test_connection.py 84.78% <0.00%> (-4.35%) ⬇️
superset/utils/celery.py 96.42% <0.00%> (-3.58%) ⬇️
superset/models/core.py 85.59% <0.00%> (-3.27%) ⬇️
... and 541 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 878f123...88413e2. Read the comment docs.

@ktmud
Copy link
Member

ktmud commented Jan 5, 2021

Cool. Glad to hear this is an ongoing migration. Just documenting what I found here in case they slip through.

@rusackas rusackas added the hold! On hold label Jan 6, 2021
@geido
Copy link
Member Author

geido commented Jan 6, 2021

After another look, I have noticed that the DatasourcePanel is using the Antd Collapse already, just not the enhanced one that we have introduced in the common components, but another flavor of it. This will need to be consolidated. Most probably all the existing instances of the Antd Collapse that aren't using the enhanced one will need to be moved to the enhanced. Thoughts @rusackas?

@junlincc junlincc added need:design-review Requires input/approval from a Designer and removed hold! On hold labels Jan 22, 2021
@rusackas
Copy link
Member

After much discussion with the Preset design team (other voices can pitch in here!) we think we'd like to keep the current arrow directions.

As far as arrow direction goes, the design proposal is this: If the collapse arrow is on the right side of the content area (like controls), it will point up when open or down when closed.. If it's on the left side of a header (like the Data pane) it will point right when closed, and down when open.

The above is more or less in accordance with the Apple guidelines.

We should utilize a prop in the Collapse component to pick which version we're using... it appears the expandIconPosition could trigger conditional styling.

There's also a discrepancy in animation - we agreed that they should all be animated (and quickly!) with clockwise rotation when opening, and counterclockwise when closing.

And in coming to all these conclusions, we came up with a whole system of floating design proposals as Github Issues, then moving them to the Github wiki when consensus is reached. We'll be sending a proposal around this to the dev@ list soon!

@ktmud
Copy link
Member

ktmud commented Jan 22, 2021

While we are here, can we also fix the click area?

Currently the Dateset panel accordions can click to fold/expand on the whole header section, but the Controls panel accordions only have the text and the caret clickable.

@ktmud
Copy link
Member

ktmud commented Jan 22, 2021

Personally I'm also not a fan of caret animation (and even the slide up/slide down animation maybe we can also get rid of).

Airbnb design guidelines for internal tools is avoid animations. We don't even have animation for modals and popovers.

For tools people will use everyday, (the presumed) efficiency and speed are probably more important than the "pleasant surprises" animations are normally designed to inspire.

@geido geido changed the title refactor: Enhance control panel Collapse refactor(explore): Enhance Dataset and Control panel Collapse components Jan 22, 2021
@geido
Copy link
Member Author

geido commented Jan 22, 2021

While we are here, can we also fix the click area?

@ktmud this PR will bring that for free as the Antdesign Collapse has the full header area clickable

@geido
Copy link
Member Author

geido commented Jan 22, 2021

@rusackas @ktmud I have made some adjustments so that the Dataset panel and Control panels use the same styling. As for the open points, concerning animation and direction of the arrows, let's come to a consensus so that I can close this up.

I tend to agree to avoid animations. As for the direction of the arrows, I am fine with what Evan has proposed.

@junlincc junlincc added the explore:refactor Related to refactoring Explore label Jan 23, 2021
@geido
Copy link
Member Author

geido commented Jan 25, 2021

I have made more changes as follows:

  • Added an animateArrows prop so that those animations can be optional
  • Implemented the arrow open/close position based on whether the expandIconPosition is right or left
  • Added a storybook entry to show the arrows when the animation is ON
  • I have enhanced also the DataSource panel, so it looks the same as the Control panel
  • I have also updated the description with the updated videos showing the functionality

This is quite a big change. I will appreciate support with testing eventual edge cases.

Thank you!

@junlincc @rusackas @ktmud

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

LGTM. Hope we can have a Collapse.test.tsx file but that's a low priority.

@adam-stasiak
Copy link
Contributor

I see that when I click on second collapse then field with search metrics and columns jumps a little bit.
Are we able to fix this?

Nagranie.z.ekranu.2021-01-25.o.20.03.12.mov

@geido
Copy link
Member Author

geido commented Jan 25, 2021

Hello @adam-stasiak I am seeing the same problem on master. Would you like to create a separate issue for that?

https://www.awesomescreenshot.com/video/2508610?key=292778fadfc41d2f0f20f3099117aea6

Thanks

@adam-stasiak
Copy link
Contributor

ah ok! I will create! sorry for inconvenience.

@adam-stasiak
Copy link
Contributor

after manual testing looks fine to me 🟢

@ktmud ktmud merged commit 1b2611c into apache:master Jan 25, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Jan 26, 2021
* master: (52 commits)
  docs: Updates to Superset Site for 1.0 (apache#12626)
  test(native-filters): scoping tree in native filters modal (apache#12655)
  Fix tests errors and warnings - iteration 3 (apache#12212) (apache#12219)
  Fix tests errors and warnings - iteration 5 (apache#12212) (apache#12224)
  Fix tests errors and warnings - iteration 6 (apache#12212) (apache#12227)
  feat(native-filters): apply scoping of native filters to dashboard (apache#12716)
  Fix tests errors and warnings - iteration 4 (apache#12212) (apache#12223)
  Fix tests errors and warnings - iteration 7 (apache#12212) (apache#12245)
  fix: missing select menu background (apache#12759)
  fix(explore): incorrect missing datasource condition (apache#12758)
  feat: default timepicker to last week when dataset is changed (apache#12609)
  feat(explore): allow opening charts with missing dataset (apache#12705)
  chore: upgrade Cypress to 6.2.1 (apache#12605)
  refactor(explore): Enhance Dataset and Control panel Collapse components (apache#12218)
  feat: Adding option to set_database_uri CLI command (apache#12740)
  docs: Fixed typo on line 348 (apache#12739)
  Fix tests errors and warnings - iteration 2 (apache#12212) (apache#12214)
  docs: Remove gatsby-plugin-offline (apache#12693)
  test: oracle engine spec (apache#12615)
  test: hive db engine spec (apache#12520)
  ...
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 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 explore:refactor Related to refactoring Explore need:design-review Requires input/approval from a Designer size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants