Summary
A merchant on Chrome for Windows opens an <s-app-window> from my embedded app and the window’s top bar shows the heading and the close button, but neither of the two buttons slotted into <s-page> (a secondary-actions Cancel and a primary-action Add). The merchant can tick rows in the window but has no way to confirm or cancel except the X.
It is reproducible for the merchant, not random:
- On a page reached by client-side navigation that has unsaved changes (a create form, save bar showing), the window opens without the two buttons every time. A full reload does not change it.
- Once the merchant saves the record (the app client-side navigates to the record’s own page) and opens the same window from there, both buttons are present.
I cannot reproduce either case on Chrome for macOS: both buttons render, and the primary action’s label updates as rows are ticked.
Setup
- Embedded app, App Home,
polaris.jsandapp-bridge.jsfrom cdn.shopify.com - React 19 + React Router 6 SPA. The window’s
srcis a route in the same SPA, loaded in the window’s iframe withapp-bridge.jspresent - Inside the window:
<s-page heading="Add products" inlineSize="large">
<s-button slot="primary-action" variant="primary" disabled={selected.size === 0 || undefined} onClick={add}>
{selected.size > 0 ? `Add ${selected.size} products` : "Add products"}
</s-button>
<s-button slot="secondary-actions" onClick={cancel}>Cancel</s-button>
...table...
</s-page>
- The primary action starts disabled and enables once a row is ticked. In the merchant’s screenshot a row is ticked and the top bar is still empty.
- One detail that may matter: the window route first renders
<s-page heading="Add products">on its own while it fetches settings, then re-renders a few hundred ms later with the two slotted buttons. On macOS the top bar picks up the buttons on that second render. On the merchant’s machine it looks as if only the first render reached the top bar. - The parent opens the window with
element.show()right after a React state update mounts the<s-app-window>, and callsshopify.saveBar.hide()on its own save bar just before.
Steps the merchant takes
- Open the app’s list page from the admin sidebar, click Create (client-side navigation to the create form, save bar appears)
- Click the control that opens the app window
- The window opens with its rows and heading, no Cancel, no Add
- Close with the X, save the form (client-side navigation to the record’s page), open the same window again: both buttons are there
Related threads
- 26381 reports the same symptom: the primary action in an
<s-app-window>sometimes not shown, with the heading falling back to the app name - 26912 and my earlier 37561 are the Chrome click-eventing issue on
<s-page>actions after a client-side navigation. The same merchant hits that one too, on the same machine
Questions
- Is the window’s top bar expected to pick up slotted actions that are added after the initial
<s-page>render, or should they be present on first paint? - If first paint is required, is there a way to force the top bar to re-sync with the page’s slots?