jdaviz icon indicating copy to clipboard operation
jdaviz copied to clipboard

feat: use drag and drop to change layer order

Open mariobuikhuizen opened this issue 8 months ago • 6 comments

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 to CHANGES.rst before merge. If no, maintainer should add a no-changelog-entry-needed label.

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 trivial label.
  • [ ] 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

mariobuikhuizen avatar Apr 08 '25 13:04 mariobuikhuizen

I just found out drag and drop doesn't work in the popout. I'm working on this. [fixed]

mariobuikhuizen avatar Apr 08 '25 13:04 mariobuikhuizen

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?).

kecnry avatar May 08 '25 15:05 kecnry

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

kecnry avatar Sep 16 '25 17:09 kecnry

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.

codecov[bot] avatar Sep 16 '25 18:09 codecov[bot]

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

rosteen avatar Oct 07 '25 20:10 rosteen

Both of the CI failures will be fixed once glue-jupyter releases with this PR https://github.com/glue-viz/glue-jupyter/pull/493

javerbukh avatar Oct 21 '25 14:10 javerbukh

@MatthewPortman All good points and great things to address in a UX improvement follow-up. A ticket has been created to track that effort.

javerbukh avatar Nov 07 '25 18:11 javerbukh