Skip to content

Commit 4e31ea5

Browse files
[POS UI extensions version 2025-10]: Refine example descriptions, limitations, and links (#3605)
* Refine example descriptions * Refine limitations * Add cross-reference to other component docs Fix version Fix type error Move subSection to original position * Add missing example descriptions Fixes * Further refinements Wording * Integrate feedback from Tim * POS UI extensions components reference docs updates (#3607) * Update Components section to remove inappropriate content from limitations sections and add to description * Linting * Formatting, typos, and other minor revisions --------- Co-authored-by: Michelle Vinci <[email protected]> * POS UI extensions components reference docs updates (#3607) * Update Components section to remove inappropriate content from limitations sections and add to description * Linting * Formatting, typos, and other minor revisions --------- Co-authored-by: Michelle Vinci <[email protected]> * code styling --------- Co-authored-by: Tim Trevor <[email protected]>
1 parent aaedbba commit 4e31ea5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+694
-806
lines changed

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/action-api.doc.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ const data: ReferenceEntityTemplateSchema = {
3636
type: 'Generic',
3737
anchorLink: 'limitations',
3838
title: 'Limitations',
39-
sectionContent:
40-
'Each extension can only present one modal at a time. Subsequent calls to `presentModal()` while a modal is already open may be ignored or replace the current modal.',
39+
sectionContent: `
40+
The \`presentModal()\` method must be called from a user interaction (such as a button click or tile tap) and can't be invoked programmatically during extension initialization or from background operations.
41+
`,
4142
},
4243
],
4344
examples: {
@@ -50,15 +51,15 @@ const data: ReferenceEntityTemplateSchema = {
5051
'present-modal',
5152
),
5253
description:
53-
"Create an action menu item that appears after a purchase is completed. When pressed, it launches a full-screen modal view using the Action API's `presentModal()` method, allowing you to display custom workflows or additional functionality in the post-purchase flow.",
54+
'Present a full-screen modal from menu item actions in detail screens. This example shows how to use `shopify.action.presentModal()` to launch a modal workflow from post-purchase, order details, or other action menu item contexts. With this pattern, you can implement complex, multi-step operations.',
5455
},
5556
{
5657
codeblock: generateJsxCodeBlockForActionApi(
5758
'Open a modal from a smart grid tile',
5859
'present-modal-tile',
5960
),
6061
description:
61-
"Create a smart grid tile on the POS home screen that launches a full-screen modal when tapped. This example shows how to use the Action API to present detailed views or workflows from your app's home tile, providing quick access to extended functionality.",
62+
'Present a full-screen modal from smart grid tiles on the POS home screen. This example demonstrates using `shopify.action.presentModal()` to launch modal workflows from tile interactions. This pattern is well-suited for high-frequency tasks that require additional UI beyond the tile itself.',
6263
},
6364
],
6465
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/cart-api.doc.ts

Lines changed: 54 additions & 47 deletions
Large diffs are not rendered by default.

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/cart-line-item-api.doc.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const data: ReferenceEntityTemplateSchema = {
2727
examples: [
2828
{
2929
codeblock: generateJsxCodeBlockForCartLineItemApi(
30-
'Display the line item ID',
30+
'Retrieve the line item ID',
3131
'id',
3232
),
3333
description:
34-
'Access the unique identifier of the current line item in a cart line item action context. This example shows how to use `shopify.cartLineItem.id` to retrieve the line item ID, which can be used for tracking, analytics, or performing operations on the specific item.',
34+
'Access the unique identifier of the current cart line item in line item detail contexts. This example shows how to use `shopify.cartLineItem.id` to retrieve the line item ID. This can be used for modifying the item, applying discounts, or implementing item-specific functionality.',
3535
},
3636
],
3737
},
@@ -43,21 +43,22 @@ const data: ReferenceEntityTemplateSchema = {
4343
type: 'Generic',
4444
anchorLink: 'best-practices',
4545
title: 'Best practices',
46-
sectionContent:
47-
'- **Handle optional properties gracefully:** Check for `undefined` values in optional properties like `price`, `productId`, `title`, `sku`, `vendor`, and selling plan-related fields before using them in your extension logic.\n' +
48-
'- **Use line item context effectively:** Use the line item data to create contextual experiences—for example, showing different interfaces for gift cards versus regular products, subscription items versus one-time purchases, or displaying vendor-specific information.\n' +
49-
'- **Implement item-specific validation:** Use line item properties like `taxable`, `isGiftCard`, `requiresSellingPlan`, and `hasSellingPlanGroups` to implement appropriate validation and business logic for different item types.\n' +
50-
'- **Handle selling plans appropriately:** When working with subscription products, check `requiresSellingPlan` and `sellingPlan` properties.\n' +
51-
'- **Access related data efficiently:** Use `productId` and `variantId` to fetch additional product information when needed, but avoid unnecessary API calls by using the data already available in the line item.',
46+
sectionContent: `
47+
- **Handle optional properties:** Check for \`undefined\` in optional properties like \`price\`, \`productId\`, \`title\`, \`sku\`, and vendor before use.
48+
- **Create contextual experiences:** Use line item data to show different interfaces for gift cards, subscriptions, or vendor-specific information.
49+
- **Implement item-specific validation:** Use properties like \`taxable\`, \`isGiftCard\`, and \`requiresSellingPlan\` for appropriate business logic.
50+
- **Handle selling plans:** When working with subscriptions, check \`requiresSellingPlan\` and \`sellingPlan\` to provide appropriate subscription management.
51+
- **Access related data efficiently:** Use \`productId\` and \`variantId\` to fetch additional info when needed, but avoid unnecessary API calls.
52+
`,
5253
},
5354
{
5455
type: 'Generic',
5556
anchorLink: 'limitations',
5657
title: 'Limitations',
57-
sectionContent:
58-
'- The API provides read-only access to line item data—use the Cart API for modifying line item properties, discounts, selling plans, or other attributes.\n' +
59-
'- Line item data reflects the current state and may not include real-time inventory, pricing, or selling plan updates until the cart is refreshed.\n' +
60-
"- Selling plan information may be limited during refund or exchange operations where digest values aren't available.",
58+
sectionContent: `
59+
- Line item data reflects the current state and may not include real-time inventory, pricing, or selling plan updates until the cart is refreshed.
60+
- Selling plan information may be limited during refund or exchange operations where digest values aren't available.
61+
`,
6162
},
6263
],
6364
};

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/connectivity-api.doc.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ const data: ReferenceEntityTemplateSchema = {
3838
type: 'Generic',
3939
anchorLink: 'limitations',
4040
title: 'Limitations',
41-
sectionContent:
42-
"- The Connectivity API provides read-only access to connectivity information and can't be used to control or modify network settings on the device.\n" +
43-
'- Connectivity status reflects Internet connectivity only and may not indicate the quality or speed of the connection, which could affect API performance.\n' +
44-
"- The API monitors general Internet connectivity but doesn't provide specific information about Shopify service availability or API endpoint availability.",
41+
sectionContent: `
42+
Connectivity status reflects Internet connectivity only and may not indicate the quality or speed of the connection, which could affect API performance.
43+
`,
4544
},
4645
],
4746
examples: {
@@ -54,7 +53,7 @@ const data: ReferenceEntityTemplateSchema = {
5453
'subscribe',
5554
),
5655
description:
57-
'Subscribe to connectivity state changes to build network-aware extensions that respond to connectivity changes. This example shows how to use `shopify.connectivity.subscribe()` to receive real-time notifications when the device goes online or offline, allowing you to adapt your UI or disable features when Internet access is unavailable.',
56+
'Subscribe to connectivity changes to monitor network status in real time. This example demonstrates using `shopify.connectivity.subscribe()` and `shopify.connectivity.connected` to detect when the device goes online or offline. This enables adaptive behavior for offline-capable features or network-dependent operations.',
5857
},
5958
],
6059
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/customer-api.doc.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const data: ReferenceEntityTemplateSchema = {
2525
examples: [
2626
{
2727
codeblock: generateJsxCodeBlockForCustomerApi(
28-
'Display the customer ID',
28+
'Retrieve the customer ID',
2929
'id',
3030
),
3131
description:
32-
'Access the unique identifier of the current customer in a customer detail action context. This example shows how to use `shopify.customer.id` to retrieve the customer ID, which can be used for personalization, fetching additional customer data, or building customer-specific features.',
32+
'Access the unique identifier of the current customer in a customer detail context. This example shows how to use `shopify.customer.id` to retrieve the customer ID. This can be used for fetching additional customer data, implementing loyalty features, or building personalized customer experiences.',
3333
},
3434
],
3535
},
@@ -41,18 +41,19 @@ const data: ReferenceEntityTemplateSchema = {
4141
type: 'Generic',
4242
anchorLink: 'best-practices',
4343
title: 'Best practices',
44-
sectionContent:
45-
'- **Use customer ID for data lookups:** Use the customer ID to fetch additional customer information from external systems, CRM platforms, or Shopify APIs when building comprehensive customer experiences.\n' +
46-
'- **Implement customer-specific features:** Use the customer context to enable personalized functionality like customer-specific pricing, loyalty program integration, or customized product recommendations.\n' +
47-
'- **Validate customer access:** Verify that the customer ID is valid before performing customer-specific operations or external API calls.',
44+
sectionContent: `
45+
- **Use customer ID for lookups:** Fetch additional customer information from external systems or Shopify APIs using the customer ID.
46+
- **Enable personalized features:** Use customer context for customer-specific pricing, loyalty programs, or product recommendations.
47+
- **Validate customer access:** Verify the customer ID is valid before performing operations or API calls.
48+
`,
4849
},
4950
{
5051
type: 'Generic',
5152
anchorLink: 'limitations',
5253
title: 'Limitations',
53-
sectionContent:
54-
'- The API provides only the customer identifier—use Shopify APIs or external systems to fetch additional customer details like name, email, or purchase history.\n' +
55-
'- Customer data reflects the current POS session and may not include real-time updates from other channels until the session is refreshed.',
54+
sectionContent: `
55+
Customer data reflects the current POS session and may not include real-time updates from other channels until the session is refreshed.
56+
`,
5657
},
5758
],
5859
};

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/device-api.doc.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ const data: ReferenceEntityTemplateSchema = {
3232
'- **Cache device information appropriately:** Consider caching device information after the initial query to avoid repeated async calls, but ensure you handle cases where device characteristics might change during the session.\n' +
3333
'- **Provide device-appropriate experiences:** Design different user experiences for tablets versus other devices, taking advantage of larger screens while ensuring functionality works across all supported device types.',
3434
},
35-
{
36-
type: 'Generic',
37-
anchorLink: 'limitations',
38-
title: 'Limitations',
39-
sectionContent:
40-
'- Device information queries are asynchronous and may take time to resolve, so always handle the Promise-based responses appropriately in your extension logic.\n' +
41-
"- The Device API provides read-only access to device information and can't be used to modify device settings or capabilities.\n" +
42-
"- Device type detection is limited to basic form factor identification (tablet vs. non-tablet) and doesn't provide detailed hardware specifications or capabilities.",
43-
},
4435
],
4536
examples: {
4637
description:
@@ -52,23 +43,23 @@ const data: ReferenceEntityTemplateSchema = {
5243
'tablet',
5344
),
5445
description:
55-
'Determine whether the extension is running on a tablet form factor. This example shows how to use `shopify.device.isTablet()` to check the device type, allowing you to adapt your UI layout, component sizes, or features based on whether the device is a tablet or other form factor.',
46+
'Check if the POS device is running on tablet hardware to adapt your UI accordingly. This example shows how to use `shopify.device.isTablet()` to determine the device form factor. This enables responsive layouts and touch-optimized interfaces for tablet devices versus traditional POS terminals.',
5647
},
5748
{
5849
codeblock: generateJsxCodeBlockForDeviceApi(
59-
'Display the device ID',
50+
'Retrieve the device ID',
6051
'device-id',
6152
),
6253
description:
63-
'Access the unique identifier of the POS device. This example demonstrates using `shopify.device.id` to retrieve the device ID, which can be used for device-specific configurations, tracking, or associating data with particular devices.',
54+
'Access the unique identifier of the current POS device. This example demonstrates using `shopify.device.id` to retrieve the device ID. This enables device-specific configurations, analytics tracking, or multi-device coordination features.',
6455
},
6556
{
6657
codeblock: generateJsxCodeBlockForDeviceApi(
67-
'Display the device name',
58+
'Retrieve the device name',
6859
'name',
6960
),
7061
description:
71-
'Access the name of the POS device running your extension. This example shows how to use `shopify.device.name` to retrieve the device name, which can be useful for debugging, analytics, or displaying device-specific information to users.',
62+
'Retrieve the name of the current POS device. This example shows how to use `shopify.device.name` to get the device name configured in POS settings. This is useful for device identification, multi-device workflows, or displaying location-specific information.',
7263
},
7364
],
7465
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/draft-order-api.doc.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ const data: ReferenceEntityTemplateSchema = {
2727
examples: [
2828
{
2929
codeblock: generateJsxCodeBlockForDraftOrderApi(
30-
'Display the draft order ID',
30+
'Retrieve a draft order ID',
3131
'id',
3232
),
3333
description:
34-
'Access the unique identifier of the current draft order in a draft order detail action context. This example shows how to use `shopify.draftOrder.id` to retrieve the draft order ID, which can be used for tracking, fetching additional order data, or implementing draft order-specific workflows.',
34+
'Access the unique identifier of the current draft order in a draft order detail context. This example shows how to use `shopify.draftOrder.id` to retrieve the draft order ID. This can be used for fetching additional order data, implementing custom workflows, or building draft order-specific features.',
3535
},
3636
{
3737
codeblock: generateJsxCodeBlockForDraftOrderApi(
3838
"Retrieve a draft order's name, ID, and associated customer ID",
3939
'draft-order-details',
4040
),
41+
description:
42+
'Access multiple properties from the draft order object including name, ID, and customer information. This example demonstrates using `shopify.draftOrder` to retrieve comprehensive draft order details. This enables building contextual interfaces and implementing order-specific workflows.',
4143
},
4244
],
4345
},
@@ -58,9 +60,9 @@ const data: ReferenceEntityTemplateSchema = {
5860
type: 'Generic',
5961
anchorLink: 'limitations',
6062
title: 'Limitations',
61-
sectionContent:
62-
'- The API provides only basic draft order information—use Shopify APIs or external systems to fetch additional draft order details like line items, totals, or timestamps.\n' +
63-
'- Draft order data reflects the current POS session and may not include real-time updates from other channels until the session is refreshed.',
63+
sectionContent: `
64+
Draft order data reflects the current POS session and may not include real-time updates from other channels until the session is refreshed.
65+
`,
6466
},
6567
],
6668
};

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/locale-api.doc.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ const data: ReferenceEntityTemplateSchema = {
3232
'- **Cache localized content:** Consider caching translated content and locale-specific formatting to improve performance, but ensure you invalidate caches when locale changes occur through subscription updates.\n' +
3333
'- **Provide fallback locale handling:** Implement fallback behavior for unsupported locales or when localization resources are unavailable, defaulting to a supported language like English.',
3434
},
35-
{
36-
type: 'Generic',
37-
anchorLink: 'limitations',
38-
title: 'Limitations',
39-
sectionContent:
40-
"- The Locale API provides read-only access to locale information and can't be used to change the merchant's locale settings, which must be configured through POS system settings.\n" +
41-
"- Locale changes are detected through the subscription mechanism, but the API doesn't provide historical locale information or change timestamps.\n" +
42-
'- The locale format follows IETF standards, but the specific locales available depend on POS system configuration and may vary between different Shopify POS installations.',
43-
},
4435
],
4536
examples: {
4637
description:
@@ -52,7 +43,7 @@ const data: ReferenceEntityTemplateSchema = {
5243
'subscribe',
5344
),
5445
description:
55-
"Subscribe to locale changes to build internationalized extensions that automatically adapt to the merchant's language settings. This example shows how to use `shopify.locale.subscribe()` to receive real-time notifications when the merchant changes their language, allowing you to update your UI text, date formats, and number formats accordingly.",
46+
"Subscribe to locale changes to monitor the merchant's language settings in real time. This example shows how to use `shopify.locale.subscribe()` and `shopify.locale.ianaCode` to detect when the merchant changes their language preference. This enables dynamic content localization and internationalized user experiences.",
5647
},
5748
],
5849
},

0 commit comments

Comments
 (0)