Repository navigation
Ctrl+Z/Y/S work from every dock panel, not only the focused 3D view - #850
Merged
Merged
Conversation
…sed 3D view Each page body now carries a client-filtered onkeydown (Ctrl/Cmd, no Alt, not repeated, not in an editable field) that sends CtrlShortcut; modifiers come from the event instead of the tracked ctrlFlag. The render controls clear ctrlFlag/shiftFlag on blur so a modifier released elsewhere cannot stay stuck.
- Ctrl+S in a text field: preventDefault (no browser 'save page'), still no scene save - Ctrl+S no longer clears ctrlFlag; Ctrl may still be held, blur releases it otherwise - key code decoded with Int32.TryParse (total) - docs: Alt+Z no longer undoes - tests: Ctrl+S keeps Ctrl armed, KeyUp clears both flags, client filter and key decoding
…itelist; UI spec - pro3dCtrlShortcut(event) in resources/utilities.js decides what is sent; the F# attribute only asks it. Text entry is a whitelist (contenteditable, textarea, text-like input types) instead of a blacklist of non-text inputs; a focused <select> no longer blocks the shortcut. - tests-ui keyboard-undo spec: Ctrl+Z/Y over the properties panel undo/redo, Ctrl+Z in a number field undoes nothing, Ctrl+Z over the 3D view undoes exactly once.
…top-level page - step 4 blurs the render control and re-enters it, so the no-double-undo check runs with onmouseenter focus, asserted, instead of focus left over from a pick - Ctrl+Z/Y on the top-level page outside the number field - field focus by DOM instead of locator click (ai/TESTING.md) - docs: keys go to the focused panel, not where the cursor is; Shift is not looked at - pro3dIsTextEntry: prefixed global
haraldsteinlechner
added a commit
that referenced
this pull request
Oct 20, 2026
haraldsteinlechner
added a commit
that referenced
this pull request
Oct 20, 2026
…dy shortcut handler - Delete goes through the page-body onkeydown like Ctrl+Z (#850): pro3dDeleteKey in utilities.js, Events.onCtrlShortcutOrDelete, Gui.annotationShortcut. Only the 3D view, Annotations and Properties take it; Surfaces and the other panels do not, and text fields keep it. Removed from getDrawingActionForKey (would run twice through bubbling). - DeleteSelectedAnnotations removes the batch in one tree walk (GroupsApp.removeLeavesById) - tests: Section18 Delete wiring; Section19 List.head/List.take replaced by matches; keyboard-undo spec: Delete in Surfaces (none), Properties and the focused 3D view - docs: AnnotationDeletion.md, KeyboardShortcuts.md
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ctrl+Z / Ctrl+Y / Ctrl+S were only handled by the main render control's
onkeydown. Every dock panel (annotation properties, annotation tree, surfaces, config, …) is its own page (?page=…) with no key listener, so the shortcuts did nothing while the cursor was over a panel.The shortcut also checked the model's
ctrlFlag, which only key events reaching the render control maintain:ctrlFlagstuck; the next plain Z/S acted as Ctrl+Z/S and picking stayed armed.Change
pro3dCtrlShortcut(event)(resources/utilities.js) decides client-side: Ctrl/Cmd, no Alt, not repeated, key Z/Y/S, target not a text-entry field (whitelist: contenteditable, textarea, text-like input types),preventDefault. Modifiers come from the event, notctrlFlag.Events.onCtrlShortcut(Utilities.fs): the page-bodyonkeydownthat asks it and sends the key code. Bubbling delivers the key to the body; the target check is needed because a text field's own undo is the browser's default action, not a listener that could stop the event.Gui.Pages.pageRouting(dock panels, render, instrument, map projection, image inspector, top-level page).ViewerAction.CtrlShortcuthandles undo / redo / save. Z/Y/S removed from theKeyDowncase — the render control's keydown bubbles to its page body, so keeping both would undo twice.ctrlFlag/shiftFlagon blur. Ctrl+S no longer resetsctrlFlag(Ctrl may still be held).docs/KeyboardShortcuts.md.Behaviour notes
Keyboard.Modifiercounted LeftAlt as Ctrl).Testing
Section 18 — Keyboard Shortcuts: 11/11 pass, five new:CtrlShortcutZ/Y undo/redo withctrlFlagunset;KeyDownLeftCtrl+Z no longer touches the undo stack; Ctrl+S keeps a held Ctrl armed; KeyUp clears Ctrl+Shift;onCtrlShortcutcallspro3dCtrlShortcut(event)and decodes the key code (totally).stopPropagation(e.g. a Semantic dropdown) swallows the shortcut; macOS Electron Edit-menu accelerators not checked.tests-ui/tests/keyboard-undo.spec.ts(passes, ~1.2 min, Dimorphos), focus asserted before every press: two Sky lines; Ctrl+Z / Ctrl+Y in the properties panel undo and redo one; Ctrl+Z in the toolbar's number field undoes nothing, outside it on the top-level page Ctrl+Z / Ctrl+Y undo and redo; with the render control focused by hovering, Ctrl+Z undoes exactly one (no double undo through bubbling).🤖 Generated with Claude Code