Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Desktop: Ctrl + numpad +/-/0 do not zoom (Electron zoomIn/zoomOut/resetZoom role accelerators match main keyboard only)

Aperta Adatta ai principianti
#10,503 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
electron, javascript
Ambito
desktop

Direzione di ricerca

Inizia in runtime/src/js/pgadmin.js, in launchPgAdminWindow, e confronta la gestione degli input con i ruoli dello zoom assemblati in runtime/src/js/menu.js. Esegui la build desktop di Electron e verifica che Ctrl più +, - e 0 del tastierino numerico funzionino insieme alle scorciatoie esistenti della tastiera principale; il report è stato testato solo su Linux Wayland.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug

i build pgadmin4 locally on linux, as Electron desktop, from source; it builds/installs ok

Version 9.18
Application Mode Desktop
Commit ecb6446c313b69ec1310b5816178e79040f98a92 (2026-10-02 17:41 +0100)
Python Version 3.14.7
Electron Version 44.4.5
Browser Chrome 152.0.7977.130
Operating System Fedora Linux 44 (Forty Four), Linux-7.2.8-200.fc44.x86_64-x86_64-with-glibc2.43

rpm -qa pgadmin4-electron
  pgadmin4-electron-git_master-0.20261004_135416.gitecb6446.fc44.x86_64

on exec of the Desktop runtime,

-- Ctrl + main-keyboard + (=), - and 0 zoom in, zoom out and reset as expected
-- UI View > Zoom In / Zoom Out / Actual Size work from the menu

BUT,

-- Ctrl + numpad +, Ctrl + numpad - and Ctrl + numpad 0 do nothing

checking src,

runtime/src/js/menu.js:169-171

    { role: 'resetZoom' },
    { role: 'zoomIn' },
    { role: 'zoomOut' },

builds the View menu zoom items from Electron menu roles.

electron v44.4.5 hardcodes those roles' accelerators in lib/browser/api/menu-item-roles.ts

resetzoom: accelerator: 'CommandOrControl+0'     (line 169)
zoomin:    accelerator: 'CommandOrControl+Plus'  (line 238)
zoomout:   accelerator: 'CommandOrControl+-'     (line 246)

electron v44.4.5's accelerator parser, shell/common/keyboard_util.cc, maps those only to main-keyboard keys.
numpad keys are SEPARATE key codes, reachable only through separate tokens; e.g.:

"plus"   -> ui::VKEY_OEM_PLUS   (line 97, main keyboard)
"numadd" -> ui::VKEY_ADD        (line 88)
"numsub" -> ui::VKEY_SUBTRACT   (line 93)
"num0"   -> ui::VKEY_NUMPAD0    (line 78)

since menu items hold only ONE accelerator, role items can't be edited to ALSO match a numpad key.

a workaround/fix is to handle numpad keys directly in the main window with a before-input-event handler, matched on input.code.

e.g., this works

diff --git a/runtime/src/js/pgadmin.js b/runtime/src/js/pgadmin.js
--- a/runtime/src/js/pgadmin.js
+++ b/runtime/src/js/pgadmin.js
@@ -381,6 +381,23 @@ function launchPgAdminWindow() {
   splashWindow.close();
   pgAdminMainScreen.webContents.session.clearCache();

+  // Electron's zoomIn/zoomOut/resetZoom menu roles match only the
+  // main-keyboard keys; handle the numpad keys at window level.
+  pgAdminMainScreen.webContents.on('before-input-event', (event, input) => {
+    if (input.type !== 'keyDown' || !(input.control || input.meta)) return;
+    const wc = pgAdminMainScreen.webContents;
+    if (input.code === 'NumpadAdd') {
+      wc.setZoomLevel(wc.getZoomLevel() + 0.5);
+    } else if (input.code === 'NumpadSubtract') {
+      wc.setZoomLevel(wc.getZoomLevel() - 0.5);
+    } else if (input.code === 'Numpad0') {
+      wc.setZoomLevel(0);
+    } else {
+      return;
+    }
+    event.preventDefault();
+  });
+
   setupMenu(pgAdminMainScreen, configStore, menuCallbacks);

   setupDownloader();

with that patch/build, Ctrl- +/-/0 work BOTH on main keyboard AND numpad.

i've only tested this on Linux/KDE Plasma/Wayland
NOT tested on X11, Windows or macOS.

but iiuc the role accelerators are the same on all platforms, so i'd expect the same behavior on those.

Lingua principale
Python
Stelle
3.9k
Fork
904
Merge medio
1g 3h
PR unite (30g)
30

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pgadmin-org/pgadmin4

Tutte le issue di pgadmin-org/pgadmin4

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.