2023 R2: Workaround for the ShowContent() symbols not disappearing on context change anymore

Hi all,

We're currently testing the new System Platform 2023 R2, and found out symbols that have been displayed with a ShowContent() do not disappear anymore when the context changes. Support confirmed to us that this is on purpose and not a bug, even if I'm struggling to understand the point...

The way we've designed our layout, symbols like motor controls are displayed on operator actions with a ShowContent and it doesnt make sense to keep them open when the context changes.
Our idea for a workaround was to have a layout script executed on every context change, that basically goes that way for every pane we want to clear:

dim contentInfo as aaContent.ContentInfo;
contentInfo.PaneName = "NameOfThePane";
contentInfo.ContentType = "App_Device_Faceplate";
HideContent(contentInfo);

The contentType is used to avoid wiping the auto-fill content when the script runs after the autofill has already happened, as only the ShowContent() symboles are using the App_Device_Faceplate content type.

The current issue with this basic script is that it runs without checking if there is matching content in the pane, generating logs when there isnt.

Would anyone have ideas on how to improve that script, or a whole different solution we didnt think of ?
I doubt we'll be the only ones struggling with that new feature, as we've seen others use the same mechanism.

Thanks