cherry-pick SWC-248 for release branch

SWC-248: Generate appropriate previews for all leaf entities