How to replicate s-switch + s-modal behavior in customer-account-ext?

Hi everyone,

I’m building a Customer Account UI ext (Preact + Polaris web components) on the new customer accounts, API version 2026-07.

I’d like to replicate the same behavior that Shopify uses in the native marketing preferences UI:
a switch on the profile page that, when the customer tries to turn it OFF, opens a confirmation modal before the change is applied.

I’m using the Polaris s-switch and s-modal components. According to the docs, s-switch supports command and commandFor, and s-modal is opened via overlay commands (command/commandFor).

However, when I try to point s-switch at a s-modal, I get this warning in the console:

Command "--auto" targets "marketing-modal" but Component does not support overlay commands.

This suggests that s-switch cannot be used as a command source for modals, even though it has command/commandFor.

My questions for the community:

  1. Is it officially unsupported to use s-switch to control s-modal (overlay commands)?
  2. Is there any supported pattern or API to open a s-modal from a switch interaction (e.g. only when toggling from ON → OFF), similar to what Shopify does for its native marketing preferences?

Thanks in advance!