Editing Subgraphs

There seems to be 3 modes for editing Subgraphs.

  1. Normal, outside shape selected, allowing connecting to internal magnets.
  2. Subgraph as active shape.
  3. Subgraph double clicked, so that everything else is greyed out.

If I edit a subgraph adding a connection between two internal shapes, when collapsing the shape this new internal connection becomes an external connection.

How should I be editing a subgraph so that it can be collapsed nicely?