jdaviz
jdaviz copied to clipboard
feat: use drag and drop to change layer order
Description
This pull request adds support for changing layer order with drag and drop.
Change log entry
- [ ] Is a change log needed? If yes, is it added to
CHANGES.rst? If you want to avoid merge conflicts, list the proposed change log here for review and add toCHANGES.rstbefore merge. If no, maintainer should add ano-changelog-entry-neededlabel.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
- [ ] Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the
triviallabel. - [ ] Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
- [ ] Do the proposed changes follow the STScI Style Guides?
- [ ] Are tests added/updated as required? If so, do they follow the STScI Style Guides?
- [ ] Are docs added/updated as required? If so, do they follow the STScI Style Guides?
- [ ] Did the CI pass? If not, are the failures related?
- [ ] Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone. Bugfix milestone also needs an accompanying backport label.
- [ ] After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?
https://github.com/user-attachments/assets/7e5bf1f0-151e-4808-823e-54aa875af02f
I just found out drag and drop doesn't work in the popout. I'm working on this. [fixed]
I merged main into this to get it up-to-date but am still having some issues where I don't see the actual viewer update. We'll also need to update the logic in get_active_image_layer so both the mouseover coordinates and https://github.com/spacetelescope/jdaviz/pull/3514 can handle layer ordering by z-order rather than the order in the list (or alternatively, could/should this just update the layers list order directly?).
this now seems to be working for me after another rebase 🎉 . We'll need to update the mouseover logic yet before merge, but can handle that on our end
Codecov Report
:x: Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 87.52%. Comparing base (53c48a0) to head (3661266).
:warning: Report is 3 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...viz/configs/default/plugins/data_menu/data_menu.py | 90.47% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3532 +/- ##
==========================================
+ Coverage 87.51% 87.52% +0.01%
==========================================
Files 191 191
Lines 26120 26146 +26
==========================================
+ Hits 22858 22884 +26
Misses 3262 3262
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
I pushed a couple commits here today to get subset deletion working (the layer was not properly disappearing from the data menu after the subset was deleted) and to get the mouseover coordinates to correctly pick up the top layer after drag and drop changes. There is one outstanding bug where occasionally the viewer will update but the layer dragged to the top will end up second from top in the data menu. Dragging it again puts it at the top of the data menu as intended:
https://github.com/user-attachments/assets/1289c1de-bc5a-4c3b-b67a-2409b9ddb983
Both of the CI failures will be fixed once glue-jupyter releases with this PR https://github.com/glue-viz/glue-jupyter/pull/493
@MatthewPortman All good points and great things to address in a UX improvement follow-up. A ticket has been created to track that effort.