The diff rendering logic tests whether the DetailedDiff is nil to determine whether to use it for rendering or defer to older older supported approaches to computing diffs.
The new logic added in https://github.com/pulumi/pulumi/pull/7226 could lead to replacing a nil DetailedDiff with an empty DetailedDiff, whcih would make the rendering logic believe that a DetailedDiff was present but empty, instead of missing entirely.
This change ensures that we maintain nil-ness of the DetailedDiff when we transform it for handling of replaceOnChanges.
Also adds tests for this and other cases on applyReplaceOnChanges.
Fixes#7486.