Skip to content

feat(point-of-sale): add resolution target types for cart and payment validations - #4641

Merged
vctrchu merged 18 commits into
2026-10-rcfrom
vc/pos-resolution-target-types
Aug 21, 2026
Merged

feat(point-of-sale): add resolution target types for cart and payment validations#4641
vctrchu merged 18 commits into
2026-10-rcfrom
vc/pos-resolution-target-types

Conversation

@vctrchu

@vctrchu vctrchu commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Resolves https://github.com/shop/issues-retail/issues/33801

Background

POS intercept extensions (shopify.intercept('cartvalidations' | 'paymentvalidations', ...)) block a workflow by returning an ERROR-level validationAdd. When that happens, POS opens an app-owned remediation UI inside its resolution flow. Each interceptable event gets its own dedicated resolution render target so the public types can express per-event API availability.

This adds the TypeScript contracts for those targets. Everything lands @private, matching the rest of the intercept type family, until early access.

Solution

Two new render targets in RenderExtensionTargets:

  • pos.cart.validations.resolution.render — Standard APIs + Scanner + mutating Cart + ResolutionApi<CartValidationsEvent>
  • pos.payment.validations.resolution.render — Standard APIs + Scanner + read-only Cart + ResolutionApi<PaymentValidationsEvent>

The cart is frozen during payment, so the payment target reuses ReadonlyCartApi; the cart target mutates via the existing CartApi. Neither target exposes the Action API (resolution is host-invoked, not merchant-invoked) or domain-scoped APIs.

New supporting types:

  • ResolutionApi<TEventData> — target-scoped shopify.resolution.event signal carrying the intercepted event's data (CartValidationsEventData, PaymentValidationsEventData — the same fields the interceptor sees, without the DOM Event base), typed per event rather than as one broad union.
  • ResolutionComponents — all standard components except Page, POSBlock/PosBlock, and Tile, since resolution UI renders inside a POS-owned flow step.

The tester's PosMockFactory map is exhaustively keyed over all POS targets, so mock factories for both new targets are included, with tests covering the mutating/read-only cart split and the resolution event shape.

🎩

image image
  • yarn build, yarn test (64 tests incl. 6 new in pos-resolution-targets.test.ts), eslint + prettier on touched files — all green

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

… validations

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
@vctrchu vctrchu self-assigned this Aug 20, 2026
@vctrchu
vctrchu requested review from a team, aaronschubert0 and henryStelle August 20, 2026 18:08
Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
@vctrchu

vctrchu commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/snapit

@shopify-github-actions-access

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @vctrchu! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/ui-extensions": "0.0.0-snapshot-20260820182142",
"@shopify/ui-extensions-tester": "0.0.0-snapshot-20260820182142"

Comment thread packages/ui-extensions/src/surfaces/point-of-sale/extension-targets.ts Outdated
…gets

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
…rget convention

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
…xpress

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
…s too

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
…on targets

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
…a DOM Event

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
@vctrchu

vctrchu commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/snapit

@shopify-github-actions-access

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @vctrchu! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/ui-extensions": "0.0.0-snapshot-20260820185458",
"@shopify/ui-extensions-tester": "0.0.0-snapshot-20260820185458"

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
@vctrchu

vctrchu commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/snapit

@shopify-github-actions-access

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @vctrchu! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/ui-extensions": "0.0.0-snapshot-20260820191219",
"@shopify/ui-extensions-tester": "0.0.0-snapshot-20260820191219"

… framing

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
…dation obligations

Assisted-By: devx/c380b28c-ab53-4c64-a5d7-b1e4b72559e9
@vctrchu
vctrchu merged commit 7ef321c into 2026-10-rc Aug 21, 2026
6 checks passed
@vctrchu vctrchu added the #gsd:51812 POS Intercept Extensions — https://vault.shopify.io/gsd/projects/51812 label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:51812 POS Intercept Extensions — https://vault.shopify.io/gsd/projects/51812

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants