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(dashboard): drag and drop indicator UX #26699

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Jan 19, 2024

SUMMARY

Following up #26313
This commit addresses and resolves the issue of an unclear drop zone indicator that was negatively impacting the user experience in the dashboard editor.

When a component was being dragged towards the edge of the tab container or the row/column containers, multiple drop indicators were often displayed. This created confusion about the exact insertion point of the element. [fig. 1]

fig. 1
drop-indicator-bug

The root of the problem was that these dashboard components were wrapped by both draggable and droppable interfaces, which led to overlapping and conflicting drop zones. This commit modifies this by making the dashboard components draggable only, and builds a distinct, non-conflicting area for the drop zone. Moreover, it also highlights the drop zone during the dragging process to clearly indicate where the element will be placed. [fig. 2]

fig. 2
drop-indicator-after

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--dashboard-indicator.mov

After:

after--dashboard-indicator.mov

TESTING INSTRUCTIONS

Go to dashboard and edit mode
Drag and drag multiple components and then save
Verify the dashboard shown as designed

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

Copy link

codecov bot commented Jan 20, 2024

Codecov Report

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

Comparison is base (daaf657) 67.19% compared to head (e4fdc64) 67.20%.

Files Patch % Lines
...nd/src/dashboard/components/gridComponents/Row.jsx 53.84% 8 Missing and 4 partials ⚠️
...rontend/src/dashboard/components/dnd/handleDrop.js 0.00% 5 Missing ⚠️
...src/dashboard/components/gridComponents/Column.jsx 80.00% 0 Missing and 2 partials ⚠️
...rontend/src/dashboard/components/DashboardGrid.jsx 83.33% 0 Missing and 1 partial ⚠️
...end/src/dashboard/components/dnd/DragDroppable.jsx 66.66% 0 Missing and 1 partial ⚠️
...nd/src/dashboard/components/gridComponents/Tab.jsx 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26699      +/-   ##
==========================================
+ Coverage   67.19%   67.20%   +0.01%     
==========================================
  Files        1899     1899              
  Lines       74369    74398      +29     
  Branches     8274     8287      +13     
==========================================
+ Hits        49971    50000      +29     
- Misses      22343    22349       +6     
+ Partials     2055     2049       -6     
Flag Coverage Δ
javascript 56.94% <67.16%> (+0.03%) ⬆️

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

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

@justinpark
Copy link
Member Author

/testenv up

Copy link
Contributor

@justinpark Ephemeral environment creation is currently limited to committers.

@michael-s-molina
Copy link
Member

/testenv up

Copy link
Contributor

@michael-s-molina Ephemeral environment spinning up at http://18.236.117.76:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@michael-s-molina
Copy link
Member

@sadpandajoe

@yousoph
Copy link
Member

yousoph commented Jan 31, 2024

@justinpark this looks and feels so much better! definitely a much needed improvement :)

A few things I noticed:

  1. When adding tabs to a dashboard, the drop area extends a bit too far, into the right panel
    image
  2. When adding a chart element, the dashboard header row is also highlighted as a possible drop area
  3. I managed to get an error when dragging a chart in between the header and the dashboard area somewhere, but I can't figure out how to repro it :(
image

@kasiazjc
Copy link
Contributor

@justinpark this looks and feels so much better! definitely a much needed improvement :)

A few things I noticed:

  1. When adding tabs to a dashboard, the drop area extends a bit too far, into the right panel
    image
  2. When adding a chart element, the dashboard header row is also highlighted as a possible drop area
  3. I managed to get an error when dragging a chart in between the header and the dashboard area somewhere, but I can't figure out how to repro it :(
image

agree with Sophie on all of the above!

Definitely an improvement to the dnd, thank you @justinpark ☺️

one comment about the header thing Sophie mentioned: when you try to hover over it it shows a red box (error), which gave me an idea. I think maybe it could be used in places where there is not enough space to place the item, for example if the row is full. What do you think?

image

@justinpark
Copy link
Member Author

@yousoph Sorry for the late response. Here are my answers.

  1. When adding tabs to a dashboard, the drop area extends a bit too far, into the right panel

Given that the tab (in the header) will occupy the whole row, including the right panel as shown in the following screenshot, it seems more logical for this highlight area to indicate its transition into a global header layout.

Screenshot_2024-02-07_at_4_05_40 PM

  1. When adding a chart element, the dashboard header row is also highlighted as a possible drop area

As discussed during our plans for further D&D improvements, I've earmarked this particular enhancement for @rtexelm's project. In the interim, this version will highlight in red (instead of the primary color) when you hover over the drop area, as shown in the following screenshot.

chart_disabled_area

  1. I managed to get an error when dragging a chart in between the header and the dashboard area somewhere, but I can't figure out how to repro it :(

I tried to reproduce the same problem but cannot get the issue yet. please let me know if you find the problem again.

@justinpark
Copy link
Member Author

justinpark commented Feb 8, 2024

one comment about the header thing Sophie mentioned: when you try to hover over it it shows a red box (error), which gave me an idea. I think maybe it could be used in places where there is not enough space to place the item, for example if the row is full.

I had a similar thought as well, but there are complexities when it comes to dropping an existing component into a space that's just enough.
Specifically, it's challenging to programmatically differentiate this from the prohibited drop zones.

(For instance, the highlight box should not turn red when item [1] is dropped into a zone without space, as it's possible to reorder among the same row items. However, it should turn red when item [4] is dropped into a zone without space.)

|[ 1 ]|[ 2 ]|[ 3 ][no space drop zone]|
--------
|[ 4 ]|[             ]|

Therefore, I've decided to retain the post notification as it is currently displayed.

@justinpark justinpark force-pushed the fix--dashboard-dnd-indicator-ux branch from 04b1319 to e4fdc64 Compare February 8, 2024 01:04
@justinpark
Copy link
Member Author

@kasiazjc @yousoph, barring any further objections from your end, I intend to proceed to the next step.

@justinpark
Copy link
Member Author

@michael-s-molina could you help this code review?

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

@justinpark justinpark merged commit ac8c283 into apache:master Feb 21, 2024
33 checks passed
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina added v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch and removed v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Feb 22, 2024
michael-s-molina pushed a commit that referenced this pull request Mar 4, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🍒 4.0.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Apr 17, 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 v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 4.0.0 🍒 4.0.1 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants