style(conversation-ai): define WHCM, typography utils, CSS patterns#6223
style(conversation-ai): define WHCM, typography utils, CSS patterns#6223aramos-adobe wants to merge 21 commits into
Conversation
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen 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: If the changes are expected, update the |
5t3ph
left a comment
There was a problem hiding this comment.
Great progress on this!
A few general comments (numbered for ease of reference in replies):
- Suggest updating the "full pattern demo" block size to
90vbvs.100vbso it is more likely to fit in the viewable area for the sake of the story. - Will you update buttons to use the button component when it's available? It would be good not to have multiple extra components and a unified styling surface. I think the variants and icon support cover your needs.
- Throughout stories, you could update the sublabel for variants within the same story to use
swc-Detail swc-Detail--sizeSclasses instead of inline styles. - Multi-artifact examples feel hidden on the Prompt Field page. Perhaps show how to populate that area there, then link over to Upload Artifact and show even more examples of multi-artifact display there? That would help us validate styles for more mutations, too.
- For artifacts:
a. We should makebackground-imagemore explicitly supported and document assigning it, possibly via an explicit attribute. This would support consumers injecting a derived thumbnail, as for 5.c.
b. We need to test/show support of a slotted image, not just the styled divs, as those require different styles.
c. Maybe a question to design or for the backlog: do we need to anticipate video upload, and capturing a frame to use as the thumbnail?
d. We really should support a "loading" state with injecting the progress circle until it's swapped with a thumbnail.
rise-erpelding
left a comment
There was a problem hiding this comment.
A few comments!
I noticed the disclosure fixes come in as I was reviewing, those look nice!
Also, one thing that didn't touch the code here that I noticed: conversation-turn.css sets up a container query that doesn't appear to be used (container-name: swc-conversation-turn;), is it still needed?
5t3ph
left a comment
There was a problem hiding this comment.
GitHub didn't save some of my comments yesterday, so a few more things!
rubencarvalho
left a comment
There was a problem hiding this comment.
LGTM!! However I can't verify WHCM (my browserstack isn't working)
| } | ||
|
|
||
| .swc-PromptField-artifacts[hidden] { | ||
| display: none !important; |
There was a problem hiding this comment.
just curious, do we need display: none on the hidden attribute?
There was a problem hiding this comment.
@rubencarvalho Yes we do. @5t3ph called this one out. This container renders in the DOM at zero height and full width before any artifacts is uploaded without this CSS modification.
There was a problem hiding this comment.
yup! the browser rule on [hidden] is weak specificity, and so the display applied for this class prevents it actually working, so we have to strengthen it. Strictly speaking it could be attached to the attribute and not need to repeat the class since !important is... well... the important part 😅
| inline-size: 100%; | ||
| min-block-size: 0; | ||
| background: token("gray-100"); | ||
| border-radius: token("corner-radius-200"); |
| } | ||
|
|
||
| .swc-PromptField-artifacts[hidden] { | ||
| display: none !important; |
There was a problem hiding this comment.
yup! the browser rule on [hidden] is weak specificity, and so the display applied for this class prevents it actually working, so we have to strengthen it. Strictly speaking it could be attached to the attribute and not need to repeat the class since !important is... well... the important part 😅
| @@ -256,48 +288,8 @@ export const Artifact: Story = { | |||
There was a problem hiding this comment.
I was going to suggest moving the inline styles for your thumbnails (that aren't providing style like hte gradients) to prompt-field.css but it looks like you do have some styles there that these are repeating. Try removing all inline styles that aren't instance-specific, I think your ::slotted() styles have you covered.
…t/upload-artifact.css Co-authored-by: Stephanie Eckles <seckles@adobe.com>
…/stories/system-message.stories.ts Co-authored-by: Stephanie Eckles <seckles@adobe.com>
5t3ph
left a comment
There was a problem hiding this comment.
A couple adjustments to the typography considerations.
…/stories/system-message.stories.ts Co-authored-by: Stephanie Eckles <seckles@adobe.com>
…/stories/system-message.stories.ts Co-authored-by: Stephanie Eckles <seckles@adobe.com>
| <swc-upload-artifact slot="artifact" type="card" dismissible> | ||
| <div | ||
| slot="thumbnail" | ||
| style="background:var(--swc-gray-200);" |
There was a problem hiding this comment.
There are at least a couple of instances here of this background color being set inline, but it looks like the CSS styles it as --swc-gray-100 in upload-artifact.css, do we want to fall back to that instead of using the inline style?
| * Rich AI body copy should use Spectrum typography **utility classes** on semantic HTML. Applications must load **`typography.css`** from | ||
| * `@adobe/spectrum-wc` after design tokens. See **Typography** and the typography [consumer migration guide](/docs/components-typography-consumer-migration-guide--readme). | ||
| * | ||
| * - **Wrapper** — Root container: `class="swc-conversationalAi-systemProse swc-Typography--prose"`. |
There was a problem hiding this comment.
Does the class swc-conversationalAi-systemProse do anything? I think those styles were removed, right? It might be a good idea to clean this up a little.

Description
This PR focuses on the UI and styling of the conversational AI components which include:
Motivation and context
#6170 The goal here is to continue refining the conversational AI work and have 100% parity between the design and engineering work done in the UI.
Figma
React Spectrum Prototype
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Prompt field — This PR:
1px solid transparenton the field shell and toolbar buttons so dimensions stay stable under forced-colors.Upload artifact — This PR: tokenized gray thumbnail surfaces, transparent borders on card/media/dismiss,
overflow: hiddenon the media surface; Playground swaps the thumbnail slot whentypeiscardvsmedia; Media story shows optional title/subtitle under the preview.typebetweencardandmediaand confirm the thumbnail region matches each layout.Response status — No CSS in this diff; regression.
Message feedback — This PR: transparent borders on buttons;
@media (forced-colors: active)setsoutline-color: CanvasTexton:focus-visible.Message sources — Regression.
Conversation turn — Regression.
User message — This PR: transparent border on the bubble for sizing under forced-colors.
Suggestion item — This PR: transparent border; forced-colors
outline-color: CanvasTexton:focus-visible.Suggestion group — Regression (contains suggestion items).
System message — Stories / demo: rich slot content uses
swc-Typography--prose;system-prose-demo.cssremoved.Conversation thread — This PR: vertical
gapusestoken("spacing-100")instead of a16pxfallback.Device review
Accessibility testing checklist
Required: Complete each applicable item and document your testing steps (replace the placeholders with your component-specific instructions).
Keyboard (required — document steps below) — What to test for: Focus order is logical; Tab reaches the component and all interactive descendants; Enter/Space activate where appropriate; arrow keys work for tabs, menus, sliders, etc.; no focus traps; Escape dismisses when applicable; focus indicator is visible.
Screen reader (required — document steps below) — What to test for: Role and name are announced correctly; state changes (e.g. expanded, selected) are announced; labels and relationships are clear; no unnecessary or duplicate announcements.