Do not silently dismiss unapplied document changes when adding module

Part of #9356
When switching classes, warn user about all unapplied document changes

Currently, this is limited to modules.

Part of #9356.