Skip to content

Delete with del key - #848

Merged
haraldsteinlechner merged 3 commits into
developfrom
features/delete_with_del_key
Oct 20, 2026
Merged

haraldsteinlechner merged 3 commits into
developfrom
features/delete_with_del_key

Conversation

@sophie-sudoku

Copy link
Copy Markdown
Collaborator

No description provided.

…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
@haraldsteinlechner

Copy link
Copy Markdown
Collaborator

@sophie-sudoku I pushed two commits on top of yours (no rebase, no force-push — your commit and #849 are untouched):

844ba24 — merge of develop. Brings in #850/#853: Ctrl+Z/Y/S are now handled on every page body (each dock panel is its own iframe document), not only by the focused render control. Merged cleanly.

08c52bc — Delete folded into that mechanism, plus review fixes.

  • Where Delete works. Previously only with the 3D view focused (getDrawingActionForKey). Now it goes through the page-body handler like Ctrl+Z, but only on the pages about annotations: the 3D view, Annotations, Properties. Other panels don't take it — in Surfaces, Delete would be expected to mean the selected surface. Text fields keep Delete for their text. Removed from getDrawingActionForKey, since the render control's keydown bubbles to its page body and would otherwise run twice.
    • pro3dDeleteKey(event) in resources/utilities.js, Events.onCtrlShortcutOrDelete in Utilities.fs, Gui.annotationShortcut in ViewerGUI.fs.
  • One tree walk per deletion. HashSet.fold … removeLeafById walked and rebuilt the tree once per id; with box selection (Features/mouse selection #849) that is thousands of walks. Now GroupsApp.removeLeavesById ids before (already on develop, same semantics incl. clearing singleSelectLeaf/selectedLeaves).
  • Section19 tests: List.head / List.take 3 replaced by pattern matches (CLAUDE.md: total functions only). Logic unchanged.
  • Docs: AnnotationDeletion.md (where the key works, implementation table), KeyboardShortcuts.md (own Delete section; on Mac keyboards Delete is fn+delete).
  • Tests: Section18 +2 (only annotation pages take Delete; Delete → DeleteSelectedAnnotations). Playwright tests-ui/tests/keyboard-undo.spec.ts: Delete in Surfaces deletes nothing, in Properties and in the focused 3D view deletes the selected line, Ctrl+Z restores it.

Results: Section 18 14/14, Section 19 28/28, Playwright keyboard-undo passes (1.9 min, Dimorphos).

Review notes, not changed (pre-existing, but Delete makes them one key away): a selected but hidden annotation is deleted too; undo is a whole-GroupsModel snapshot, so colour/text edits made after a Delete revert with its Ctrl+Z (same as Clear/union/cut); deleting a supporting-profile parent leaves its children's profileOf.parent dangling (same as the tree's remove button).

#849: a trial merge onto this shows three small conflicts — Viewer.fs (releaseModifiersOnBlur next to BoxSelectEvents: keep both) and src/Tests/Program.fs / Tests.fsproj (both add a Section22_*; develop already has Section22_SupportingProfiles, so yours would become Section23).

@haraldsteinlechner
haraldsteinlechner merged commit 692086b into develop Oct 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants