From 17b29e8051e5c017a18dce71a7acca6e3e466187 Mon Sep 17 00:00:00 2001 From: "shilpi.mittal" Date: Thu, 19 Nov 2026 06:09:50 +0530 Subject: [PATCH 1/3] Add category-description attribute for PLP description rendering Bump version to 0.5.1. --- CHANGELOG.md | 4 +++ demo/index.html | 9 +++--- package-lock.json | 4 +-- package.json | 2 +- src/components/QuestionPills.tsx | 54 ++++++++++++++++++-------------- src/custom-element.ts | 3 ++ src/provider/types.ts | 3 ++ src/styles.css | 9 ++++++ 8 files changed, 58 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26d1c4a..035f41a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ The release version comes from `package.json`. Keep the newest dated entry first. +## 0.5.1 — 2026-11-19 + +- Add `category-description` attribute and `categoryDescription` config field for rendering category description text above question pills on PLP pages. + ## 0.5.0 — 2026-11-19 - Add `search-questions` attribute and `srpQuestions` config field for rendering static opener pills on SRP pages, separate from `category-questions` used on PLP. diff --git a/demo/index.html b/demo/index.html index 6e29e24..8de58d6 100644 --- a/demo/index.html +++ b/demo/index.html @@ -68,12 +68,13 @@

inline-agent-widget — inline demo

"persist: no restorable session …" before a fresh handshake. --> inline-agent-widget — inline demo --> diff --git a/package-lock.json b/package-lock.json index 6769f2d..632c616 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "inline-agent-widget", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "inline-agent-widget", - "version": "0.5.0", + "version": "0.5.1", "license": "MIT", "devDependencies": { "@testing-library/jest-dom": "^6.9.1", diff --git a/package.json b/package.json index 0c4bfe7..b779d8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inline-agent-widget", - "version": "0.5.0", + "version": "0.5.1", "description": "A bare-minimum, embeddable inline chat widget for Salesforce Agentforce (SCRT2 Messaging for In-App and Web). Renders agent replies as sanitized markdown inside a Shadow DOM.", "type": "module", "main": "./dist/inline-agent-widget.umd.js", diff --git a/src/components/QuestionPills.tsx b/src/components/QuestionPills.tsx index e2cfdd1..c2f1a91 100644 --- a/src/components/QuestionPills.tsx +++ b/src/components/QuestionPills.tsx @@ -41,29 +41,37 @@ export function QuestionPills() { ); }; + const description = + !hasAsked && config.pageType === "plp" ? config.categoryDescription : undefined; + return ( - +
+ {description && ( +

{description}

+ )} +
    + {pills.map((pill) => { + const isMainAgent = isHybrid && pill.answerable_by === "shopper-agent"; + return ( +
  • + +
  • + ); + })} +
+
); } diff --git a/src/custom-element.ts b/src/custom-element.ts index 66b2a8d..6ea4c80 100644 --- a/src/custom-element.ts +++ b/src/custom-element.ts @@ -22,6 +22,8 @@ const OBSERVED = [ "category-id", "category-name", "category-questions", + "category-description", + "search-questions", "search-query", ] as const; @@ -58,6 +60,7 @@ function readConfig(el: HTMLElement): WidgetConfig { pageType: readPageType(attr("page-type")), categoryId: attr("category-id"), categoryName: attr("category-name"), + categoryDescription: attr("category-description"), categoryQuestions: parsePdpQuestions(attr("category-questions")), searchQuery: attr("search-query"), srpQuestions: parsePdpQuestions(attr("search-questions")), diff --git a/src/provider/types.ts b/src/provider/types.ts index 120ae1c..4df2c28 100644 --- a/src/provider/types.ts +++ b/src/provider/types.ts @@ -45,6 +45,9 @@ export interface WidgetConfig { /** Category display name for PLP pages (e.g. "Men's Jackets"). */ categoryName?: string; + /** Category description for PLP pages, shown above the question pills. */ + categoryDescription?: string; + /** * Pre-generated opener questions for a category page, analogous to * `pdpQuestions` for PDP. Stored on the category object's custom attribute diff --git a/src/styles.css b/src/styles.css index f2e8eb8..5ff71fb 100644 --- a/src/styles.css +++ b/src/styles.css @@ -188,6 +188,15 @@ outline-offset: 2px; } +/* ── Category description ── */ +.category-description { + margin: 0 0 8px; + font-size: 13px; + line-height: 1.4; + color: var(--iaw-fg); + opacity: 0.8; +} + /* ── Opener question pills ── */ .pills { display: flex; From 7eda8296f495bc741119473e7130699b49963698 Mon Sep 17 00:00:00 2001 From: "shilpi.mittal" Date: Thu, 19 Nov 2026 06:13:32 +0530 Subject: [PATCH 2/3] Revert demo/index.html to placeholder values --- demo/index.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/demo/index.html b/demo/index.html index 8de58d6..6e29e24 100644 --- a/demo/index.html +++ b/demo/index.html @@ -68,13 +68,12 @@

inline-agent-widget — inline demo

"persist: no restorable session …" before a fresh handshake. --> inline-agent-widget — inline demo --> From e05c1a60b4083c387e7d79107781ea61c902fda0 Mon Sep 17 00:00:00 2001 From: "shilpi.mittal" Date: Thu, 19 Nov 2026 06:16:50 +0530 Subject: [PATCH 3/3] Use React Fragment instead of div wrapper in QuestionPills --- src/components/QuestionPills.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/QuestionPills.tsx b/src/components/QuestionPills.tsx index c2f1a91..96281e0 100644 --- a/src/components/QuestionPills.tsx +++ b/src/components/QuestionPills.tsx @@ -45,7 +45,7 @@ export function QuestionPills() { !hasAsked && config.pageType === "plp" ? config.categoryDescription : undefined; return ( -
+ <> {description && (

{description}

)} @@ -72,6 +72,6 @@ export function QuestionPills() { ); })} -
+ ); }