Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
54 changes: 31 additions & 23 deletions src/components/QuestionPills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,37 @@ export function QuestionPills() {
);
};

const description =
!hasAsked && config.pageType === "plp" ? config.categoryDescription : undefined;

return (
<ul className="pills" aria-label="Suggested questions">
{pills.map((pill) => {
const isMainAgent = isHybrid && pill.answerable_by === "shopper-agent";
return (
<li key={pill.text} className="pills-item">
<button
className={`pill${isMainAgent ? " pill--main-agent" : ""}`}
type="button"
disabled={disabled}
onClick={() => {
if (isMainAgent) {
dispatchHandoff(pill.text);
} else {
void sendMessage(pill.text);
}
}}
>
{pill.text}
</button>
</li>
);
})}
</ul>
<>
{description && (
<p className="category-description">{description}</p>
)}
<ul className="pills" aria-label="Suggested questions">
{pills.map((pill) => {
const isMainAgent = isHybrid && pill.answerable_by === "shopper-agent";
return (
<li key={pill.text} className="pills-item">
<button
className={`pill${isMainAgent ? " pill--main-agent" : ""}`}
type="button"
disabled={disabled}
onClick={() => {
if (isMainAgent) {
dispatchHandoff(pill.text);
} else {
void sendMessage(pill.text);
}
}}
>
{pill.text}
</button>
</li>
);
})}
</ul>
</>
);
}
3 changes: 3 additions & 0 deletions src/custom-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const OBSERVED = [
"category-id",
"category-name",
"category-questions",
"category-description",
"search-questions",
"search-query",
] as const;

Expand Down Expand Up @@ -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")),
Expand Down
3 changes: 3 additions & 0 deletions src/provider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading