This is WIP for #7803
I'm not finished yet, but decided to upload this as a draft PR. I'd like to get your feedback on the general direction of this solution and if it fits.
Thank you!