Skip to content

feat(conversational-ai): deliver complete 2nd-gen conversational AI pattern with accessibility, docs, and test coverage#6170

Merged
TarunAdobe merged 73 commits into
mainfrom
ttomar/conversation-ai
Apr 29, 2026
Merged

feat(conversational-ai): deliver complete 2nd-gen conversational AI pattern with accessibility, docs, and test coverage#6170
TarunAdobe merged 73 commits into
mainfrom
ttomar/conversation-ai

Conversation

@TarunAdobe
Copy link
Copy Markdown
Contributor

@TarunAdobe TarunAdobe commented Apr 13, 2026

Description

This PR introduces and iterates on the entire Conversational AI pattern in 2nd-gen/packages/swc/patterns/conversational-ai, including component primitives, pattern wrappers, docs, tests, and accessibility support.

Motivation and context

Conversational AI experiences are emerging across Adobe products. These experiences share a common set of UI patterns (chat interfaces, message threads, composer inputs, agent status indicators, streaming text, and more) that don't yet exist in the Spectrum component library.

This work covers the definition and delivery of those UI patterns for Spectrum Web Components. The goal is to ship a set of well-specified, production-ready components that any Adobe product team building conversational AI features can use—solving the problem once in Spectrum rather than having every team invent their own solutions independently.

Related issue(s)

  • fixes SWC-1933

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

[ ] Conversational AI end-to-end component validation

  • Go here and open the main full-pattern demo canvas.
  • Validate all major components in one flow:
    • swc-conversation-thread / swc-conversation-turn: Tab into thread, use ArrowUp/ArrowDown/Home/End, confirm roving focus and logical order.
    • swc-system-message: verify status/prose/feedback/sources/suggestions slots render in expected layout.
    • swc-response-status: confirm loading state announces status; in complete state, chevron only appears when reasoning slot has content; toggle updates expanded/collapsed state.
    • swc-message-feedback: Arrow keys move focus only; Enter/Space (or click) triggers selection behavior.
    • swc-message-sources: collapsed list is hidden; expand/collapse works; custom label (if present) updates visible text and ARIA labeling.
    • swc-suggestion / swc-suggestion-item: title is visible; each item is keyboard-focusable and activatable with correct accessible name.
    • swc-user-message: verify copy/card/media variants match expected styling/layout.
    • swc-upload-artifact: verify card/media rendering, thumbnail visibility, dismiss affordance behavior.
    • swc-prompt-field: verify keyboard focus ring, upload/send/stop controls, artifact region behavior, and tab order from thread to composer.
  • Expect the full experience to be visually correct, keyboard-accessible, and semantically consistent across all components, with no broken focus flow or contradictory behavior versus docs.

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Go here, open the main demo canvas, and test with keyboard first: use Tab/Shift+Tab through thread, system message actions, feedback, sources, suggestions, and prompt field; use ArrowUp/ArrowDown/Home/End in conversation thread; use arrows in feedback (focus move only) and Enter/Space to activate controls (feedback, sources toggle, suggestion items, send/stop/upload).
  • Repeat key interactions with a screen reader enabled (VoiceOver/NVDA): verify announcements for turn grouping labels, response status state, sources expanded/collapsed state, suggestion item names, feedback radiogroup/radio states, and prompt controls; confirm no duplicate/decorative icon noise and that focus order remains logical without traps.
  • Expect fully operable keyboard flow, visible focus indicators, correct ARIA role/name/state announcements, accurate state-change announcements (expanded/checked/status), and no regressions in accessibility semantics across all conversational AI components.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 13, 2026

🦋 Changeset detected

Latest commit: d4405a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 84 packages
Name Type
@spectrum-web-components/action-button Minor
@spectrum-web-components/styles Minor
@adobe/spectrum-wc Minor
@spectrum-web-components/action-group Minor
@spectrum-web-components/action-menu Minor
@spectrum-web-components/combobox Minor
@spectrum-web-components/contextual-help Minor
@spectrum-web-components/menu Minor
@spectrum-web-components/overlay Minor
@spectrum-web-components/tabs Minor
@spectrum-web-components/vrt-compare Minor
@spectrum-web-components/bundle Minor
@spectrum-web-components/card Minor
@spectrum-web-components/illustrated-message Minor
@spectrum-web-components/custom-vars-viewer Minor
@spectrum-web-components/theme Minor
@spectrum-web-components/truncated Minor
@spectrum-web-components/action-bar Minor
@spectrum-web-components/breadcrumbs Minor
@spectrum-web-components/picker Minor
@spectrum-web-components/story-decorator Minor
@spectrum-web-components/popover Minor
@spectrum-web-components/textfield Minor
@spectrum-web-components/tooltip Minor
@spectrum-web-components/top-nav Minor
documentation Patch
@spectrum-web-components/slider Minor
@spectrum-web-components/coachmark Minor
@spectrum-web-components/color-field Minor
@spectrum-web-components/number-field Minor
@spectrum-web-components/search Minor
@spectrum-web-components/accordion Minor
@spectrum-web-components/alert-banner Minor
@spectrum-web-components/alert-dialog Minor
@spectrum-web-components/asset Minor
@spectrum-web-components/avatar Minor
@spectrum-web-components/badge Minor
@spectrum-web-components/button-group Minor
@spectrum-web-components/button Minor
@spectrum-web-components/checkbox Minor
@spectrum-web-components/clear-button Minor
@spectrum-web-components/close-button Minor
@spectrum-web-components/color-area Minor
@spectrum-web-components/color-handle Minor
@spectrum-web-components/color-loupe Minor
@spectrum-web-components/color-slider Minor
@spectrum-web-components/color-wheel Minor
@spectrum-web-components/dialog Minor
@spectrum-web-components/divider Minor
@spectrum-web-components/dropzone Minor
@spectrum-web-components/field-group Minor
@spectrum-web-components/field-label Minor
@spectrum-web-components/help-text Minor
@spectrum-web-components/icon Minor
@spectrum-web-components/icons-ui Minor
@spectrum-web-components/icons-workflow Minor
@spectrum-web-components/icons Minor
@spectrum-web-components/iconset Minor
@spectrum-web-components/infield-button Minor
@spectrum-web-components/link Minor
@spectrum-web-components/meter Minor
@spectrum-web-components/modal Minor
@spectrum-web-components/picker-button Minor
@spectrum-web-components/progress-bar Minor
@spectrum-web-components/progress-circle Minor
@spectrum-web-components/radio Minor
@spectrum-web-components/sidenav Minor
@spectrum-web-components/split-view Minor
@spectrum-web-components/status-light Minor
@spectrum-web-components/swatch Minor
@spectrum-web-components/switch Minor
@spectrum-web-components/table Minor
@spectrum-web-components/tags Minor
@spectrum-web-components/thumbnail Minor
@spectrum-web-components/toast Minor
@spectrum-web-components/tray Minor
@spectrum-web-components/underlay Minor
@spectrum-web-components/base Minor
@spectrum-web-components/grid Minor
@spectrum-web-components/opacity-checkerboard Minor
@spectrum-web-components/reactive-controllers Minor
@spectrum-web-components/shared Minor
@spectrum-web-components/eslint-plugin Minor
@spectrum-web-components/stylelint-header-plugin Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@TarunAdobe TarunAdobe marked this pull request as ready for review April 13, 2026 11:28
@TarunAdobe TarunAdobe requested a review from a team as a code owner April 13, 2026 11:28
@TarunAdobe TarunAdobe added the Status:WIP PR is a work in progress or draft label Apr 13, 2026
@aramos-adobe aramos-adobe self-assigned this Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6170

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@TarunAdobe TarunAdobe force-pushed the ttomar/conversation-ai branch from efa98e1 to 38ba0ce Compare April 14, 2026 11:11
Copy link
Copy Markdown
Contributor

@nikkimk nikkimk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's chat about status and conversation turn accessibility.

Comment thread 2nd-gen/packages/swc/patterns/conversational-ai/response-status/ResponseStatus.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need minrows/maxrows???

…of github.com:adobe/spectrum-web-components into ttomar/conversation-ai
Copy link
Copy Markdown
Contributor

@nikkimk nikkimk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting better and better. I found a few more a11y issues to resolve, and I have a question out to the a11y team about the conversation thread rti. I'll update you when I hear back.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it might be better if we do not use an RTI in the conversation because the sections themselves have interactive components.

The reasoning is similar to the accordion recommendations here: https://adobedesign.slack.com/archives/CB2S6SRK4/p1776959570558769?thread_ts=1776954369.555639&cid=CB2S6SRK4

I'll check with the accessibility team to confirm whether my instincts are correct here and let you know when I hear back.

@@ -0,0 +1,242 @@
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have an story in the behaviors section where selecting positive/negative feedback changes the feedback? It would be good to show our consumers how to do this and also good for manual screenreader testing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -0,0 +1,258 @@
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have an story in the behaviors section where the status changes programmatically? It would be good to show our consumers how to do this and also good for manual screenreader testing.

<div class="swc-SuggestionGroup">
${hasHeading
? html`
<h3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be any heading level from h2 to h6, depending on the page hierarchy it is used on. I recommend using a heading-level attribute and rendering the heading based on that attribute.

See the following for more information:

Comment thread 2nd-gen/packages/swc/patterns/conversational-ai/upload-artifact/UploadArtifact.ts Outdated
private focusgroupNavigationController = new FocusgroupNavigationController(
this,
{
direction: 'horizontal',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably allow both directions here. See https://www.w3.org/WAI/ARIA/apg/patterns/radio/examples/radio-rating/

Comment on lines +33 to +40
h2,
h3,
h4,
h5,
h6,
p {
margin: 0;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These selectors are globally scoped and would apply to any h2, h3, p etc. where we use this stylesheet (ie anywhere in Storybook) if there's not a more specific style to override it (usually there is).

I don't think there's any example of an .swc-conversationalAi-systemProse h1 in this repo either, that's not a big deal, but just noting we never see that selector in action in Storybook.


.swc-conversationalAi-systemProse ul,
.swc-conversationalAi-systemProse ol {
padding-inline-start: 20px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a token that would work here?

.swc-ConversationThread {
display: flex;
flex-direction: column;
gap: var(--swc-conversation-thread-gap, 16px);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a token? For instance

Suggested change
gap: var(--swc-conversation-thread-gap, 16px);
gap: var(--swc-conversation-thread-gap, token("spacing-300"));

Comment on lines +28 to +30
h3 {
font-size: token("font-size-300");
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason the font-size needs to be under this selector and not .swc-SuggestionGroup-title?

I'm not all that familiar with the markup, but from what I see in Storybook, the h3 child of .swc-SuggestionGroup is .swc-SuggestionGroup-title.

It looks like .swc-SuggestionGroup-title can have different levels other than h3 though. In those other heading levels, would we not want to set the font-size? (For instance if you set it to h4 or lower it gets quite a bit smaller.)

Comment on lines +33 to +34
inline-size: var(--swc-message-feedback-button-inline-size, 32px);
block-size: var(--swc-message-feedback-button-block-size, 32px);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want tokens for these? spacing-500?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component will need some forced-colors adjustments so users can tell if an option is selected, right now the Status story looks like this in WHCM:

Image

Vs. in regular dark mode:

Image

padding: 0;
color: token("gray-800");
background: token("gray-200");
border: none;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs a transparent border for WHCM 🙂

gap: token("spacing-300");
align-items: center;
min-block-size: var(--swc-upload-artifact-card-min-block-size, 68px);
padding: token("spacing-300");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a transparent border here too, I think

inline-size: var(--swc-upload-artifact-card-thumbnail-inline-size, 32px);
block-size: var(--swc-upload-artifact-card-thumbnail-block-size, 32px);
background: linear-gradient(135deg, #a78bfa, #f472b6);
border-radius: token("corner-radius-75");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also transparent border here, but before border-radius


:host([type="media"]) .swc-UploadArtifact-surface {
flex-direction: column;
gap: token("spacing-100");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think a transparent border here, possibly also the thumbnail slotted img.

@TarunAdobe TarunAdobe force-pushed the ttomar/conversation-ai branch 2 times, most recently from 76d8415 to fa10bb0 Compare April 29, 2026 09:39
@TarunAdobe TarunAdobe force-pushed the ttomar/conversation-ai branch from fa10bb0 to cb208ea Compare April 29, 2026 09:44
@TarunAdobe TarunAdobe added the run_vrt Triggers the Chromatic VRT run for 2nd-gen label Apr 29, 2026
@TarunAdobe TarunAdobe enabled auto-merge (squash) April 29, 2026 14:04
@rubencarvalho rubencarvalho dismissed stale reviews from nikkimk, Rajdeepc, and rise-erpelding April 29, 2026 14:06

Merging initial phase for more atomic PRs

Copy link
Copy Markdown
Contributor

@rubencarvalho rubencarvalho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging initial phase for addressing feedback in smaller, follow-up PRs.

Copy link
Copy Markdown
Contributor

@blunteshwar blunteshwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this for now so feedback can be tracked and addressed through smaller, modular follow-up PRs.

@TarunAdobe TarunAdobe merged commit 668f357 into main Apr 29, 2026
30 of 31 checks passed
@TarunAdobe TarunAdobe deleted the ttomar/conversation-ai branch April 29, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High priority PR review PR is a high priority and should be reviewed ASAP run_vrt Triggers the Chromatic VRT run for 2nd-gen snapshot-release Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants