From 778a6961cc1cca9d6649d3ff38206f6f5e9e929a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 14 May 2024 17:42:59 -0300 Subject: prepare to view selected items page after starting selection This was the intended behavior from the start! We just forgot to code this part, oops. --- ui.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui.js b/ui.js index 3d66ce8..b784688 100644 --- a/ui.js +++ b/ui.js @@ -971,6 +971,13 @@ export default class AppElement extends FocusElement { return } + // If this is the first addition (starting from empty), switch the + // remembered context menu page so that the next context menu will show + // the marked items automatically. + if (!mark.length) { + this.itemMenuPage = 'mark' + } + for (const track of add) { mark.push(track) } @@ -998,6 +1005,15 @@ export default class AppElement extends FocusElement { mark.splice(mark.indexOf(track), 1) } + // If this is the last removal (going to empty), switch the remembered + // context menu page so that the next context menu will show the usual + // controls for the item under the cursor. This isn't exactly necessary + // since various fallbacks will handle this value pointing to a page that + // doesn't exist anymore, but it's nice for consistency. + if (!mark.length) { + this.itemMenuPage = 'cursor' + } + this.emitMarkChanged() } -- cgit 1.3.0-6-gf8a5