From f6728619a77d53edc6f090df4313b78d0ffe9779 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Fri, 7 Aug 2026 21:22:17 -0700 Subject: [PATCH] fix(gui): stop renaming a folder from swallowing the click that commits it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The folder's name box commits on blur, and blur fires on the PRESS — before the click that press belongs to. Committing re-rendered, and the re-render replaced every tile in the open folder, so by the time the click was dispatched the tile under the pointer was detached and the delegated handler never saw it. Typing a name and then tapping an app in the folder — the path a brand-new folder puts the user on — renamed the folder and did nothing else; the app only opened on a second click. Rebuild the folder's contents only when they actually differ from what is on screen. A rename doesn't change them, so nothing is detached, and a background refresh no longer throws away hover/focus either. Tiles that survive get their drag resting-rects cleared, since the card can have moved under them since the rects were taken. --- src/gui/src/UI/Dashboard/TabApps.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gui/src/UI/Dashboard/TabApps.js b/src/gui/src/UI/Dashboard/TabApps.js index c50584693..d3420d932 100644 --- a/src/gui/src/UI/Dashboard/TabApps.js +++ b/src/gui/src/UI/Dashboard/TabApps.js @@ -1421,8 +1421,23 @@ const TabApps = { '--myapps-group-cols', String(Math.max(1, Math.min(apps.length, Number.isFinite(maxCols) ? maxCols : 4))), ); - $grid.html(apps.map(app => buildTileHtml(app)).join('')); - $overlay.find('.myapps-tile').attr('tabindex', '0'); + const html = apps.map(app => buildTileHtml(app)).join(''); + // A rebuild replaces every tile node, and a node detached mid-gesture + // takes the rest of that gesture with it: the name box commits on + // BLUR, which fires on the press — before the click it belongs to — + // so renaming a folder and then clicking an app in it renamed the + // folder and did nothing else (the click found no tile to bubble + // from). Nothing here changes on a rename, so nothing is rebuilt. + if ( $grid[0].__myappsPanelHtml !== html ) { + $grid[0].__myappsPanelHtml = html; + $grid.html(html); + $overlay.find('.myapps-tile').attr('tabindex', '0'); + } else { + // Tiles that survive keep the resting rects an earlier drag left + // on them, and the card may have moved since (a resize re-centres + // it) — stale rects are what the next drag would hit-test against. + for ( const el of $grid[0].children ) el.__myappsRestRect = null; + } this.updateRunningDots($el_window); },