Skip to content

feat: support list of agent actions in ResponseStatus - #10359

Merged
LFDanLu merged 10 commits into
mainfrom
f/response_status_list
Jul 27, 2026
Merged

feat: support list of agent actions in ResponseStatus#10359
LFDanLu merged 10 commits into
mainfrom
f/response_status_list

Conversation

@catherine

@catherine catherine commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

This PR introduces <ExecutionTrace> and <ExecutionTraceItem> - components that render inside a <ResponseStatus> in order to highlight the steps an agent took while crafting its response.

image

@rspbot

rspbot commented Jul 23, 2026

Copy link
Copy Markdown

@catherine
catherine force-pushed the f/response_status_list branch from 238eccc to 19e3229 Compare July 24, 2026 23:16
@rspbot

rspbot commented Jul 24, 2026

Copy link
Copy Markdown

@catherine
catherine marked this pull request as ready for review July 24, 2026 23:24
@catherine
catherine force-pushed the f/response_status_list branch from 19e3229 to 23ca611 Compare July 24, 2026 23:49
@catherine
catherine force-pushed the f/response_status_list branch from 23ca611 to ee22f43 Compare July 24, 2026 23:52
@rspbot

rspbot commented Jul 24, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Jul 24, 2026

Copy link
Copy Markdown

devongovett
devongovett previously approved these changes Jul 25, 2026

@devongovett devongovett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks great!

* Additional detail revealed when the step is expanded, such as tool call input or output.
* If omitted, the row is static and cannot be expanded.
*/
detail?: ReactNode;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might want to move this into children with title/panel wrappers like the RSP Disclosure API at some point


export interface ExecutionTraceItemProps extends DOMProps, AriaLabelingProps {
/** Allows detail content to render but prevents the row from being collapsible. */
isDetailNotCollapsible?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we can debate this name 😄 allowsExpanding could work if the default is false. disallowCollapsing? 😂

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

image Support Left/Right arrow to expand/collapse ??

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a list of disclosures at the moment
https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
No left/right for now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isAlwaysOpen

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 to isAlwaysOpen, allowsExpanding makes it sound like there is a state where it could still be "closed" and just not expandable IMO

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was struggling to name this one 😅 -- I'm also a fan of isAlwaysOpen and have updated to that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note that this doesn't follow our naming guidelines (is is for states) but ok for now

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ah, I see - I hadn't encountered that guidelines doc, thanks for sharing it

@devongovett

devongovett commented Jul 25, 2026

Copy link
Copy Markdown
Member

might want a lil padding around this for the focus ring

image

also when it's expanded there's some extra space on the right

image

Comment thread packages/@react-spectrum/ai/src/ResponseStatus.tsx
const detailTriggerStyles = style({
display: 'block',
paddingY: 4,
marginTop: -2,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's this for? could it be paddingTop:2 and no marginTop instead?

Comment thread packages/@react-spectrum/ai/src/ResponseStatus.tsx Outdated
font: 'body',
display: 'flex',
gap: 8,
marginTop: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there's a lot of margin/paddingTop: +/-2 what's driving all of these?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

initially it was solving some alignment issues between the step's icon/label when there was a hover state -- I'll do a pass to review/remove any that are no longer applicable now since we decided to remove the hover state

'--divider-display': {
type: 'display',
value: {
default: 'flex',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

intention here is display: block, there's no children inside of the line?

const executionTraceItemContentStyles = style({
display: 'flex',
flexDirection: 'column',
paddingBottom: 12,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

last one shouldn't have padding bottom, it's doubled up with the padding from the wrapper of the ol

</RACDisclosure>
) : (
<div
className={mergeStyles(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we can do this at build time, if you put the shared properties into a const, you can spread it into both styles, then we can get rid of the mergeStyles and it'll be a little more declarative

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✅ cleaned up 🧹

Comment thread packages/@react-spectrum/ai/src/ResponseStatus.tsx Outdated
Comment thread packages/@react-spectrum/ai/stories/ResponseStatus.stories.tsx Outdated

export interface ExecutionTraceItemProps extends DOMProps, AriaLabelingProps {
/** Allows detail content to render but prevents the row from being collapsible. */
isDetailNotCollapsible?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isAlwaysOpen


export interface ExecutionTraceItemProps extends DOMProps, AriaLabelingProps {
/** Allows detail content to render but prevents the row from being collapsible. */
isDetailNotCollapsible?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 to isAlwaysOpen, allowsExpanding makes it sound like there is a state where it could still be "closed" and just not expandable IMO

);
}

export interface ExecutionTraceItemProps extends DOMProps, AriaLabelingProps {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should the ExecutionTraceItems also include the ability to set expanded by default/controlled? I don't think I've see that in other chat experiences so no need to add right now until requested by other teams, but maybe something to keep in mind

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

most of the chat experiences I have seen, when the content is collapsible they are closed by default and it's up to the user to take the step to open -- definitely possible to add in here but one I vote to hold off on until we see a need for it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for the future, would be nice to to also have the ExecutionTrace added to the "Chat" stories so we can see how it looks in a chat as a whole

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good idea! [ depending on when this PR merges, I might go ahead and add it in - otherwise an easy follow up ]

@rspbot

rspbot commented Jul 27, 2026

Copy link
Copy Markdown

@yihuiliao yihuiliao added SideNav and removed SideNav labels Jul 27, 2026
@yihuiliao

Copy link
Copy Markdown
Member

ah sorry ignore me adding labels to this PR...i didn't mean to do that


return (
<Button
className={renderProps => mergeStyles(buttonStyles({...renderProps}), detailTriggerStyles)}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

cc @devongovett

might want a lil padding around this for the focus ring

I've nudged the space around the focus ring:

Screenshot 2026-07-27 at 11 11 43 AM

Separately, I will follow up looking into the space that is added when the disclosure is expanded. It's happening both to the top level ResponseStatus disclosure and these new children

Screenshot 2026-07-27 at 11 11 34 AM

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in: #10384

devongovett
devongovett previously approved these changes Jul 27, 2026
devongovett
devongovett previously approved these changes Jul 27, 2026
LFDanLu
LFDanLu previously approved these changes Jul 27, 2026
@devongovett
devongovett enabled auto-merge July 27, 2026 19:46
yihuiliao
yihuiliao previously approved these changes Jul 27, 2026
@rspbot

rspbot commented Jul 27, 2026

Copy link
Copy Markdown

@devongovett
devongovett added this pull request to the merge queue Jul 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jul 27, 2026
@LFDanLu
LFDanLu dismissed stale reviews from yihuiliao, devongovett, and themself via 3bfa4c5 July 27, 2026 20:07
@LFDanLu
LFDanLu enabled auto-merge July 27, 2026 20:08
@rspbot

rspbot commented Jul 27, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Jul 27, 2026

Copy link
Copy Markdown
## API Changes

@react-spectrum/ai

/@react-spectrum/ai:ResponseStatus

 ResponseStatus {
   children: ReactNode
   defaultExpanded?: boolean
   density?: 'compact' | 'regular' | 'spacious' = 'regular'
   id?: Key
   isDisabled?: boolean
   isExpanded?: boolean
   onExpandedChange?: (boolean) => void
-  size?: 'S' | 'M' | 'L' | 'XL' = 'M'
   slot?: string | null
   status?: 'loading' | 'failed' | 'success' = 'loading'
   styles?: StyleString
 }

/@react-spectrum/ai:ResponseStatusProps

 ResponseStatusProps {
   children: ReactNode
   defaultExpanded?: boolean
   density?: 'compact' | 'regular' | 'spacious' = 'regular'
   id?: Key
   isDisabled?: boolean
   isExpanded?: boolean
   onExpandedChange?: (boolean) => void
-  size?: 'S' | 'M' | 'L' | 'XL' = 'M'
   slot?: string | null
   status?: 'loading' | 'failed' | 'success' = 'loading'
   styles?: StyleString
 }

/@react-spectrum/ai:ExecutionTrace

+ExecutionTrace {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  id?: string
+  styles?: StyleString
+}

/@react-spectrum/ai:ExecutionTraceItem

+ExecutionTraceItem {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  detail?: ReactNode
+  icon?: ReactNode
+  id?: string
+  isAlwaysOpen?: boolean
+  styles?: StyleString
+}

/@react-spectrum/ai:ExecutionTraceProps

+ExecutionTraceProps {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  id?: string
+  styles?: StyleString
+}

/@react-spectrum/ai:ExecutionTraceItemProps

+ExecutionTraceItemProps {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  detail?: ReactNode
+  icon?: ReactNode
+  id?: string
+  isAlwaysOpen?: boolean
+  styles?: StyleString
+}

@rspbot

rspbot commented Jul 27, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (2)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/3bfa4c5ea00db37245b7ee0ea6165de7c58e13b6/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/3bfa4c5ea00db37245b7ee0ea6165de7c58e13b6/

@LFDanLu
LFDanLu added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit ccc68e8 Jul 27, 2026
32 checks passed
@LFDanLu
LFDanLu deleted the f/response_status_list branch July 27, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants