From ac227aa670935e80b994570d3de929d9c2b4cc4d Mon Sep 17 00:00:00 2001 From: Laura Sach <5183697+lawsie@users.noreply.github.com> Date: Tue, 7 Jul 2026 13:04:29 +0100 Subject: [PATCH 1/2] Fix --- accessibility/keyboardui.js | 8 ++++++++ ui/addmenu.js | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/accessibility/keyboardui.js b/accessibility/keyboardui.js index 1b4eea6f..4aad81ca 100644 --- a/accessibility/keyboardui.js +++ b/accessibility/keyboardui.js @@ -210,6 +210,9 @@ const AreaManager = { /* Overlay for gizmo buttons */ const GizmoMenuManager = { overlay: null, + // Other menus (e.g. the add-shape dropdown) that should close themselves + // when the gizmo overlay opens, so they don't sit on top of the gizmos. + _closeHooks: [], buttons: [ { id: 'showShapesButton', label: '1' }, { id: 'colorPickerButton', label: '2' }, @@ -241,9 +244,14 @@ const GizmoMenuManager = { return !this.overlay.classList.contains('hidden'); }, + registerCloseHook(fn) { + this._closeHooks.push(fn); + }, + toggle(show) { if (!this.overlay) return; if (show) { + this._closeHooks.forEach((fn) => fn()); this.renderBadges(); if (this._watchFocus) { diff --git a/ui/addmenu.js b/ui/addmenu.js index 86ad3126..ff0ad3d9 100644 --- a/ui/addmenu.js +++ b/ui/addmenu.js @@ -925,6 +925,16 @@ function cancelPlacement() { cleanupPlacementMode(); } +// Close the add-shape dropdown when the gizmo overlay opens (e.g. Ctrl+G), +// so it doesn't sit on top of the gizmo buttons it's meant to reveal. +GizmoMenuManager.registerCloseHook(() => { + const dropdown = document.getElementById("shapes-dropdown"); + if (!dropdown || dropdown.style.display === "none") return; + dropdown.style.display = "none"; + removeKeyboardNavigation(); + cancelPlacement(); +}); + // --- Keyboard Navigation --- let currentFocusedElement = null; From e850c707919df76c0fc09df292f77d1ad7975736 Mon Sep 17 00:00:00 2001 From: Laura Sach <5183697+lawsie@users.noreply.github.com> Date: Tue, 7 Jul 2026 13:17:14 +0100 Subject: [PATCH 2/2] Rabbit complaint --- accessibility/keyboardui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/accessibility/keyboardui.js b/accessibility/keyboardui.js index 4aad81ca..5a3f3ba1 100644 --- a/accessibility/keyboardui.js +++ b/accessibility/keyboardui.js @@ -251,7 +251,13 @@ const GizmoMenuManager = { toggle(show) { if (!this.overlay) return; if (show) { - this._closeHooks.forEach((fn) => fn()); + this._closeHooks.forEach((fn) => { + try { + fn(); + } catch (e) { + console.error('GizmoMenuManager close hook failed:', e); + } + }); this.renderBadges(); if (this._watchFocus) {