Skip to content

Drawings: the Delete key doesn't delete a selected view or dimension #19015

Closed

Description

@CamWight

Requested by Cam

In the Drawing workspace, pressing Delete does nothing on the sheet. A selected view or dimension stays. When a view goes, the views projected or cut from it (a section view, for example) go too, but the confirm doesn't say which ones.

What happens

  1. Open a drawing with a base view, a projected view and a section view cut from the base view, and a dimension.
  2. Click the dimension and press Delete. Nothing happens.
  3. Click the base view and press Delete. Nothing happens.
  4. The view's card has a Delete button. Its confirm says "Delete this view and its dependent views and annotations?", but it doesn't list the views that will go with it.

Screenshots of the sheet, before and after, come with the PR.

Expected

  • Delete (and Backspace) on a selected dimension deletes it, in one undo step.
  • Delete on a selected view with no views that depend on it deletes it and its dimensions at once, with the Undo toast the card's Delete already shows.
  • Delete on a view that other views depend on opens an "Are you sure?" window that lists those views by name. Confirm deletes them all in one undo step, and Cancel deletes nothing.
  • The card's Delete button uses the same rule and the same window.

Cause

  • In Drawing, the key handler blocks every Design shortcut (toolbar.rs, the gate that Drawing workspace: Ctrl+Z and Ctrl+Y undo and redo the open drawing (#18938) #18939 opens for Ctrl+Z and Ctrl+Y only). So the Key::Delete | Key::Backspace arm (toolbar.rs line 2800), which deletes the model selection, is never reached. The sheet page has no Delete key of its own.
  • The sheet page selects only views (drawing_sheet_page/view_tools.rs, state.selected). A dimension can't be selected.
  • selection.delete already deletes drawing objects ({type: drawing, drawing, object}). With dry_run it reports what would go, and without contents: delete it refuses a view with dependants and names them (crates/engine/src/cmd/delete.rs line 28). The confirm (view_tools.rs, confirm_delete) doesn't use the dry run, so it can't list them.

Proposed fix

With a drawing open, Delete and Backspace delete the sheet page's selection through selection.delete. A dry run first finds the dependants. If there are any, the kit Confirm lists them, and the card's Delete button uses the same path. A click selects a dimension as it selects a view. Nothing changes in the engine or crates/geom.

Part of #4894.

Activity

  1. added
    area:sketch
    needs-triage
    in progress
    on Nov 18, 2026
  2. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    Claimed by @CamWight through #19016. The claim lapses after 14 days without pushes.

  3. CamWight commented on Nov 20, 2026

    @CamWight
    ContributorAuthor

    Done on main. The details and thanks are on #19016.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:sketchin progressneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions