Skip to content

Improve trash-hover chunk shrink behavior and drag/drop stability#5788

Open
Siddharth-732 wants to merge 3 commits intosugarlabs:masterfrom
Siddharth-732:ui
Open

Improve trash-hover chunk shrink behavior and drag/drop stability#5788
Siddharth-732 wants to merge 3 commits intosugarlabs:masterfrom
Siddharth-732:ui

Conversation

@Siddharth-732
Copy link
Contributor

Fixes #5787

Summary

This PR improves the trash-delete drag UX for block stacks by making delete interactions clearer, safer, and more stable during drag operations.


What’s Changed

  • Added trash-hover visual feedback that smoothly shrinks the actively dragged stack.
  • Applied the hover transform only to the currently dragged group so unrelated blocks remain unaffected.
  • Made hover enter/exit behavior stable and fully reversible to prevent scale or position drift.

File Changed

  • block.js

How the Issue Was Solved

  • Implemented _setDragGroupTrashHoverScale(...) to manage a reversible hover-shrink state for the active drag group.
  • Captured the baseline position and scale once per trash-hover session and reused it to prevent cumulative transform errors.
  • Updated the drag-move flow to apply the hover transform after block/group movement in the same frame, avoiding visual misalignment.
  • Restricted hover scaling strictly to blocks.dragGroup (the currently dragged stack), ensuring unrelated blocks are unaffected.
  • Added drag-state guarding (_dragPointerDown) so transient mouseout events during drag do not trigger drop or delete logic.
  • Gated trash deletion logic to occur only on release (pressup) while over the trash area.
  • Cleared long-press timeouts during guarded mouseout paths to prevent unintended pie menu activation.

Video

Music.Blocks.and.4.more.pages.-.Personal.-.Microsoft_.Edge.2026-02-18.19-14-17.mp4

Result

  • Improved precision and confidence when deleting large stacks.
  • No accidental deletion while still holding drag.
  • No stack fragmentation or persistent shrink after rapid in/out trash hover.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@vanshika2720
Copy link
Contributor

@Siddharth-732 CI check is failing.

@Siddharth-732
Copy link
Contributor Author

I'll fix it shortly.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@Siddharth-732
Copy link
Contributor Author

@vanshika2720 Hi, could you please help me with the CI failure?

I haven’t made any dependency-related changes in this PR (only changes in block.js).
To debug the failure, I tried the following:

Verified the PR is opened from my ui branch into sugarlabs:master.

Synced my branch with the latest upstream/master (it was already up to date).

Confirmed that package.json was not modified by my changes.

Tried reinstalling dependencies locally using npm install.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@subhraneel2005
Copy link
Contributor

subhraneel2005 commented Feb 18, 2026

@Siddharth-732 try changeing "electron-builder" version to "26.7.0" both in package.json and package-lock.json

@vanshika2720
Copy link
Contributor

vanshika2720 commented Feb 18, 2026

@Siddharth-732 I think you got your answer...and if you have any other confusion/or need help please let me know.

@subhraneel2005
Copy link
Contributor

@Siddharth-732 bro take pull from latest commit and re run ci, it should work now :)

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@Siddharth-732
Copy link
Contributor Author

Finally !
@vanshika2720 @subhraneel2005 thanks a lot guys.

@Siddharth-732
Copy link
Contributor Author

@walterbender @omsuneri please review this, let me know if any changes are required.

@Ashutoshx7
Copy link
Contributor

@Siddharth-732 hy siddhart this can be good addition
but still if possible join sugarlabs meeting 5:30 pm sunday
mentors opinion is necessary as they can instruct you better on this

@Siddharth-732
Copy link
Contributor Author

Meet will be on next Sunday right ?

@Ashutoshx7
Copy link
Contributor

Meet will be on next Sunday right ?

yes

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.

[UI/UX] Trash UX Improvement for Large Block Stacks

4 participants