Ctrl+A does also select invisible nodes

If some nodes are visible=false and the user presses Ctrl+A, the nodes are being selected. If the user then presses Delete, all nodes, including the invisible ones, are deleted.

I believe this is not what is usually desired. For example, if the user uses the DraggingTool from the top left to the bottom right, the invisible nodes are not included. This makes more sense.

Maybe there could be an optional property includeInvisible for selectAll() which defaults to false, especially if it is invoked by the Ctrl+A shortcut.

If you decide not to change this behaviour, could you extend the documentation for visible?: This object is selected by selectAll/Ctrl+A events even if it is not visible.

There are a bunch of other plausible considerations when deciding what to include in a CommandHandler.selectAll command implementation. For example, if you are not going to include Parts that are not visible, should you not include member Parts of a collapsed Group? Or Nodes and Links that are in the subtree of a collapsed tree Node? Or label Nodes on a Link that is not visible because they are in a collapsed subtree that is contained by a collapsed Group? Or if your app supports virtualization, do you really want to select all Parts, even if they don’t exist in the Diagram?

You might want to decide for your own application what CommandHandler.selectAll does. It’s easy enough to override that method to do what you want. For example, maybe you want something like:

  new go.Diagram("myDiagramDiv", {
      "commandHandler.selectAll": function() {
        const a = [];
        this.diagram.parts.each(p => { if (p.isVisible()) a.push(p); });
        this.diagram.nodes.each(p => { if (p.isVisible()) a.push(p); });
        this.diagram.links.each(p => { if (p.isVisible()) a.push(p); });
        this.diagram.selectCollection(a);
      },
      . . .

Because this could be very application-specific, and because it’s easy to override, I don’t think we should make any API changes.