-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
feat(dashboard): update tab drag and drop reordering with positional placement and indicators for UI #29395
feat(dashboard): update tab drag and drop reordering with positional placement and indicators for UI #29395
Conversation
Still need to add/edit the tests and refine some things but this is the general idea. |
Let's include a video of before and after, please. Thank you |
/testenv up |
/testenv up |
a3dd2bc
to
6601b1c
Compare
/testenv up |
@yousoph Ephemeral environment spinning up at http://35.87.176.169:8080. Credentials are |
A couple of visual feedback:
I know some of these things were harder to implement but I feel these are still quite relevant. Wdyt @yousoph? |
Also, not sure if this worked like that before, but when you try to drag a selected tab, it will auto-select the next available tab on the right. Another issue is that as you drag and target a new tab, it will make the target tab selected. These create a lot of unnecessary movement of the tabs and the content which can be resource-intensive when you have a bunch of charts on top of being undesirable in terms of UX. |
@geido @yousoph Removing the tab respective X (delete) icon from the from the tabs bar while dragging posed a disproportionately complex problem due to the antd structure of the The necessity to hover over the tab title is another result of only wrapping that component in the DragDroppable. Tab title highlighting during drag over can be changed, it was just the default behavior. All of the tab activation behavior, i.e. the active tab changes to that which is hovered over, is the unchanged previous behavior. Wasn't sure if it was in scope to alter that as it is also the behavior of dragging charts into tabs. |
I think it would be good to remove the title highlighting if possible! The active tab behavior looked ok to me - I think it's fine to keep it as it was. |
I still think that the "x" staying at the original place is weird and should probably not happen. |
@geido @yousoph I tried a different approach here that I was reluctant to in past efforts. I had assumed the dnd configs would break for other dashboard elements if I changed them overtly but the changes here have been pretty innocuous. Now tabs should vanish during drag and the title drop indicator should render only if the dragObject is not a |
superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
Outdated
Show resolved
Hide resolved
8dfc058
to
edce75f
Compare
/testenv up |
@geido Ephemeral environment spinning up at http://54.70.182.123:8080. Credentials are |
edce75f
to
9f45843
Compare
/testenv up |
@geido Ephemeral environment spinning up at http://34.221.129.187:8080. Credentials are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be some clean up possible for the way state is handled, but I think this looks good. Looking to get some feedback from @kgabryje too
It look kinda weird to me that the dragged tab disappears and other tabs become active when I drag over them. Also it's working kinda slowly - it's not smooth at all on my m2pro mac, so it would be really bad on older computers. CC @yousoph Screen.Recording.2024-09-19.at.14.15.50.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to @kgabryje's comment. I still continue to suspect that state management might be the issue here.
re: the active tab changing, I think that is already happening on the current version of tab dragging (before this PR) |
Oh you're right! I haven't noticed that before. Still though, I like that this PR adds the indicators of where the dragged tab is going to land, but I'm not sure about the dragged tab disappearing from its original spot. Now when we drag a tab, there's a "ghost" (low opacity) left. But it's not a blocker if you think it looks better now |
@yousoph could not repro the slowness and so could not QA, so I guess we are good. Merging this now and keeping an eye just in case someone should report a similar problem as @kgabryje did. In that case, we should look at how to improve state management to avoid excessive re-rendering during drag and drop. |
Ephemeral environment shutdown and build artifacts deleted. |
Just wanted to drop a thanks for moving this forward while I've been away on hiatus. Let me know if there's any complications I can help with itf |
SUMMARY
Change reordering and UI specifically for
Tab
components withinTabs
parent components across the codebase.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
B:
tabs-reorder-old.mov
A:
tabs-reoder-new.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION