From c9cb2b5efb54befcb9e6efd1a054c06067fb2693 Mon Sep 17 00:00:00 2001 From: jelveh Date: Sat, 8 Aug 2026 00:06:20 -0700 Subject: [PATCH] fix(gui): make Escape cancel a folder rename instead of saving it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Escape pressed mid-edit fell through to the folder's close handler, and closing commits whatever the name box holds — so the one key every inline rename uses for "never mind" stored the abandoned half-typed name. Escape in the box now puts the stored name back and steps out to the folder's tiles, exactly the cancel Finder/Explorer taught; with nothing left to cancel (name untouched) it falls through and closes the folder as before, so a second press still exits. --- src/gui/src/UI/Dashboard/TabApps.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/gui/src/UI/Dashboard/TabApps.js b/src/gui/src/UI/Dashboard/TabApps.js index 41d8ab746..b0d5fcfb2 100644 --- a/src/gui/src/UI/Dashboard/TabApps.js +++ b/src/gui/src/UI/Dashboard/TabApps.js @@ -1394,6 +1394,24 @@ const TabApps = { if ( first ) first.focus({ preventScroll: true }); else this.blur(); } + if ( e.key === 'Escape' ) { + const group = findGroupById(self._groups, self._openGroupId); + const stored = group ? groupLabel(group) : ''; + // An edit in progress: Escape means "never mind THIS EDIT" + // (the convention of every inline rename), not "close the + // folder" — left to propagate, the document handler would + // close it and _closeGroup's commit-on-close would store the + // very half-typed name being abandoned. Put the stored name + // back and step out of the box; the next Escape, with no + // edit left to cancel, closes the folder as usual. + if ( this.value === stored ) return; + e.preventDefault(); + e.stopPropagation(); + this.value = stored; + const first = $overlay.find('.myapps-group-panel-grid .myapps-tile')[0]; + if ( first ) first.focus({ preventScroll: true }); + else this.blur(); + } }); $name.on('change blur', function () { self._renameGroup($el_window, self._openGroupId, this.value);