From 73eaccc2ad40f6633e8b57458cc55c4e721a894e Mon Sep 17 00:00:00 2001 From: marcelofukumoto Date: Fri, 6 Nov 2026 08:58:41 +0000 Subject: [PATCH] fix: show VNC console dialogs in full screen and restore deleting custom shortcut keys (#1222) * fix: show the VNC console's dialogs in full screen Only the console went full screen and dialogs render outside of it, so the Ctrl+Alt+Del and Soft Reboot confirmations, among others, stayed hidden behind it until full screen was left. Put the whole page in full screen instead. Signed-off-by: Marcelo Fukumoto * fix: bring back deleting saved VNC console shortcut keys The Vue 3 migration dropped the close button from the list of saved shortcuts, which left no way to delete one. Restore it, and remove by position in the list: the old code parsed the displayed HTML to find the shortcut, which cannot match one with the Space key in it, such as Ctrl+Space. Signed-off-by: Marcelo Fukumoto * fix: tidy the VNC console's custom shortcut keys Give the saved shortcuts in the menu the same space as the separator above them, and name the dialog's buttons Cancel and Save, which say what they do. Signed-off-by: Marcelo Fukumoto --------- Signed-off-by: Marcelo Fukumoto --- .../novnc/NovncConsoleCustomKeys.vue | 27 +++--- .../components/novnc/NovncConsoleWrapper.vue | 14 ++- .../__tests__/NovncConsoleCustomKeys.test.js | 92 +++++++++++++++++++ .../__tests__/NovncConsoleWrapper.test.js | 13 +++ 4 files changed, 126 insertions(+), 20 deletions(-) create mode 100644 pkg/harvester/components/novnc/__tests__/NovncConsoleCustomKeys.test.js diff --git a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue index 25a84c84..426ba896 100644 --- a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue +++ b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue @@ -136,20 +136,15 @@ export default { this.addedShortcutKeys.push([].concat(this.keysRecord)); }, - removeKey(keys) { - const key = keys.replace(/(\s*)|<\/code>/g, '').replace(/\s*,\s*/g, ','); + // The index is the one in displayedKeys, which lists the added shortcuts first. + removeKey(index) { + const added = this.addedShortcutKeys.length; - this.addedShortcutKeys = this.addedShortcutKeys.filter((item) => { - const formatkey = item.map((K) => K.key.charAt(0).toUpperCase() + K.key.slice(1)).join(','); - - return formatkey !== key; - }); - - this.preferredShortcutKeys = this.preferredShortcutKeys.filter((item) => { - const formatkey = item.map((K) => K.key.charAt(0).toUpperCase() + K.key.slice(1)).join(','); - - return formatkey !== key; - }); + if (index < added) { + this.addedShortcutKeys.splice(index, 1); + } else { + this.preferredShortcutKeys.splice(index - added, 1); + } }, async saveKeys(buttonCb) { @@ -220,6 +215,8 @@ export default { @@ -233,10 +230,10 @@ export default { class="btn role-secondary mr-20" @click.prevent="closeRecordingModal" > - + diff --git a/pkg/harvester/components/novnc/NovncConsoleWrapper.vue b/pkg/harvester/components/novnc/NovncConsoleWrapper.vue index 8dcf9e74..43155a17 100644 --- a/pkg/harvester/components/novnc/NovncConsoleWrapper.vue +++ b/pkg/harvester/components/novnc/NovncConsoleWrapper.vue @@ -428,7 +428,8 @@ export default { if (document.fullscreenElement) { await document.exitFullscreen(); } else { - await this.$refs.consoleContainer.requestFullscreen(); + // The whole page and not only the console, because dialogs render outside of it. + await document.documentElement.requestFullscreen(); // Keyboard lock lets shortcuts such as Ctrl+W and F11 reach the guest. await navigator.keyboard?.lock?.(['KeyW', 'F11']); } @@ -454,10 +455,7 @@ export default {