mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-25 23:46:51 +00:00
fix(gui): refill the folder well when the merge countdown restarts
The merge dwell pins its stillness anchor at first contact with the tile, and a hand decelerating INTO a target routinely covers more than the 7px allowance between that moment and the first tick — so the countdown quietly restarts. The well's fill, tuned to the same 460ms, had already completed by then and just sat there half-open: a drop it seemed to promise a folder for actually reordered. Restart the fill with the countdown, so what the well shows is always the countdown that is actually running.
This commit is contained in:
@@ -1966,6 +1966,16 @@ const TabApps = {
|
||||
if ( moved > DRAG_MERGE_TRAVEL ) {
|
||||
d.mergeAnchorX = d.lastClientX;
|
||||
d.mergeAnchorY = d.lastClientY;
|
||||
// The well's fill IS this countdown to the user (the CSS
|
||||
// transition runs the same DRAG_MERGE_DWELL_MS) — and the
|
||||
// hand that decelerates INTO a tile routinely trips this
|
||||
// restart, because the anchor was pinned back at first
|
||||
// contact. Refill from empty, or the well sits full while
|
||||
// the countdown quietly runs again, promising a folder the
|
||||
// drop wouldn't make.
|
||||
overTile.classList.remove('myapps-tile-merge-pending');
|
||||
void overTile.offsetWidth; // commit the empty state
|
||||
overTile.classList.add('myapps-tile-merge-pending');
|
||||
d.mergeTimer = setTimeout(tick, DRAG_MERGE_DWELL_MS);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user