Skip to content

feat(panel): dnd improvements for the app list#1343

Open
edfloreshz wants to merge 3 commits intopop-os:masterfrom
edfloreshz:fix/duplicate-icon-dnd
Open

feat(panel): dnd improvements for the app list#1343
edfloreshz wants to merge 3 commits intopop-os:masterfrom
edfloreshz:fix/duplicate-icon-dnd

Conversation

@edfloreshz
Copy link
Contributor

@edfloreshz edfloreshz commented Mar 8, 2026

This PR improves the app list drag and drop experience:

  • Dragged icon no longer appears three times while dragging
  • Icons can now be dragged all the way to the right
  • Icon preview is now aligned precisely to the position of the icon in the dock, the cursor's position is used to calculate the exact pickup offset when the drag starts
  • Fixed a bug that caused multiple insertions if an icon entered the dock multiple times.

Currently blocked by: pop-os/libcosmic#1161

Current behavior:

2026-03-08.15-13-44.mp4

New behavior:

2026-03-08.15-12-45.mp4
  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@edfloreshz edfloreshz force-pushed the fix/duplicate-icon-dnd branch 2 times, most recently from 71cc9a1 to 98fcf7f Compare March 9, 2026 16:36
@mmstick mmstick requested review from a team March 9, 2026 16:38
@edfloreshz
Copy link
Contributor Author

I've noticed some inconsistencies, please hold on merging this until I fix them.

@jacobgkau jacobgkau marked this pull request as draft March 10, 2026 01:16
@jacobgkau
Copy link
Member

I've noticed some inconsistencies, please hold on merging this until I fix them.

I've marked as a draft for you. Just let us know when it's ready to look at.

- hide the original icon and replace its position with an empty container while dragging
- reorder items only when the drag position crosses a defined threshold: center of the target +- 4px
- the cursor's position is used to calculate the exact pickup offset
- reduce the drag threshold to 0 to ensure no drag events are skipped
- track the dragged item so that if it is removed during a drag and was previously active, it is automatically added to the active list
@edfloreshz edfloreshz force-pushed the fix/duplicate-icon-dnd branch from 98fcf7f to e2937f3 Compare March 10, 2026 08:15
@edfloreshz edfloreshz marked this pull request as ready for review March 10, 2026 08:31
@edfloreshz
Copy link
Contributor Author

Reworked a few things to address some inconsistencies, also fixed a bug that caused multiple insertions if DndEnter fired repeatedly.

Would appreciate a second pair of eyes before we merge, happy to discuss any of the changes.

Copy link
Contributor

@wash2 wash2 left a comment

Choose a reason for hiding this comment

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

I'd like to revisit this after the rebase updates are merged, and fix the libcosmic issue before merging the changes.

@edfloreshz
Copy link
Contributor Author

@wash2 Yesterday I bumped the applet to the latest libcosmic rev and I noticed some issues with how the app list was rendered, if you'd like I could push a branch for you to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants