# Browser behaviour checklist

Status: **local Chromium baseline + Shopify Admin smoke run; navigation timing
and the Polaris version matrix pending.** The contract suite uses a DOM stub and
cannot verify Lit rendering or real custom-element internals, so the local
harness loads real `polaris-1.js` or `polaris-2.0-rc.js` with no Shopify session.

Recorded local run (2026-11-29):

- Polaris 1: `https://cdn.shopify.com/shopifycloud/polaris-1.js` (SHA-256 `912455…818fe`)
- Polaris 2.0-rc: `https://cdn.shopify.com/shopifycloud/polaris-2.0-rc.js` (SHA-256 `89dd20…0c7b`)
  SHA-256 `912455ad068713e7595f5a506fb7433a078554c327cf0fd30ce86ccb214818fe`
  (739,944 bytes).
- Browser: Chromium 159.0.8154.6 via Playwright 1.65.1.
- Tests: `npx playwright test` -> 21 passed, 0 failed.
- Missing browser libraries on the development machine are worked around with
  `LD_LIBRARY_PATH=/tmp/polaris-libs/usr/lib`; CI should use
  `npx playwright install --with-deps chromium` instead.
- Harness instructions and scope: [`e2e/README.md`](../e2e/README.md).

Recorded Shopify Admin run (2026-11-29):

- Embedded app served by `shopify-smoke/` through a Shopify CLI tunnel
  (`cloudflared 2026.10.3`, HTTP/2) in an Admin iframe.
- `local contract checks`: 5/5 PASS — text field, select, checkbox,
  `read_form`, native submit, DOM click.
- `App Bridge checks`: 4/4 PASS — `Bridge::detect`, `id_token`, authenticated
  `Bridge::fetch("/api/smoke")` (server verified JWT), and locale.
- `resourcePicker`: one product selected successfully.
- `toast`: displayed successfully.
- This verifies the real Admin path for form values, submit, ID tokens, and
  authenticated fetch. It does not cover client-side navigation timing, the
  `2.0-rc` build, or Firefox/WebKit.

| # | Question | How to verify | Result |
| --- | --- | --- | --- |
| 1 | Does `s-text-field.value` set as an attribute get picked up by Lit? | Set attr, read `el.value` | ✅ local: attribute is read; property is not reflected back to the attribute |
| 2 | Does `s-select` report the value on `target.value` or `detail`? | Change selection, log event | ✅ local: `target.value`; `detail` is undefined |
| 3 | Does `s-checkbox.checked` reflect, and what is the `change` payload? | Toggle, log event | ✅ local: `target.checked`; `detail` is undefined |
| 4 | Does `s-button` inside a form submit the form? | Click, observe request | ✅ local only with `type="submit"`; default `type="button"` does not submit. `components.button(submit=true)` now writes it |
| 5 | What hierarchy does `s-table` require? | Minimal table render | ⚠️ local: rows render under `s-table-body`; a row placed directly under `s-table` is not rendered as a body row |
| 6 | Does `s-app-nav` highlight the current page automatically? | Navigate between two pages | ☐ blocked: the pinned `polaris-1.js` does not define `s-app-nav` |
| 7 | Is full-page SSR navigation visibly flickering? | Record/screenshot | ✅ local: 900 ms delayed Polaris upgrade keeps text/select/checkbox values. Admin `/ssr` step `a`: `server@example.com` / `ca` / checked all survived at 1,740 ms MoonBit entry, `window.shopify` present, readyState `interactive`. Step `b` full-document repeat: same values at 2,069 ms entry. Visual flicker not instrumented |
| 8 | When is `window.shopify` available after navigation? | Inject polling timer | ✅ Admin: `window.shopify` already present when MoonBit entry runs. Plain navigation: 2 ms click→document, 1.36 s document→entry. `Bridge::navigate` after fix: 3 ms click→document, 1.47 s document→entry. Old `shopify.navigate`: ~7.96 s click→document |
| 9 | What differs between `polaris-1.js` and `2.0-rc`? | Same page, both builds | ✅ both builds pass the same 21-test suite; no covered API differences. Both still lack `s-app-nav`, `s-pagination`, and `s-tabs`/`s-tab` |

Third-batch smoke coverage (same baseline):

- `s-modal`: `showOverlay()` opens the internal dialog; the built-in close button closes it.
- `s-spinner`, `s-thumbnail`, `s-empty-state`: shadow content and accessibility labels render.
- `s-date-field`, `s-money-field`: initial property values survive upgrade and update on input.
- `s-grid`: tracks/alignment apply; `s-grid-item` placement accepted `"span N"` but ignored numeric line syntax such as `"1"` (resolved to `auto`).
- Additional primitives: avatar initials/alt, progress `aria-valuenow`, divider strong colour, and button-group children/gap render in the real bundle.
- Specialized fields: `s-email-field` and `s-text-area` expose live `value`; `s-switch` exposes live `checked` and emits our change payload.
- Content primitives: `s-image` renders its shadow `img`; `s-chip` colour classes apply; `s-clickable-chip` renders an anchor; hovering an `s-icon` whose `interestfor` points at an `s-tooltip` opens the tooltip popover.
- Remaining components: `s-color-field` and `s-color-picker` expose live `value` properties; `s-select` renders grouped `s-option-group`/`optgroup` children and honours the initial selected value; `s-ordered-list` renders `ol li`; `s-scroll-box` applies `overflow="auto hidden"` as `overflow-x:auto`/`overflow-y:hidden`, `snaptype="mandatory"` as `scroll-snap-type:inline mandatory`, and `accessibilityrole="region"` + label as `tabindex="0"`/`aria-label`; `s-query-container` applies `containerName` as the CSS container name.

The expected contracts are encoded in [dom.md](dom.md), [events.md](events.md),
[form.md](form.md), and the component pages under [components/](components/).
