feat: support list of agent actions in ResponseStatus - #10359
Conversation
|
Build successful! 🎉 |
238eccc to
19e3229
Compare
|
Build successful! 🎉 |
19e3229 to
23ca611
Compare
23ca611 to
ee22f43
Compare
|
Build successful! 🎉 |
|
Build successful! 🎉 |
| * 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
we can debate this name 😄 allowsExpanding could work if the default is false. disallowCollapsing? 😂
There was a problem hiding this comment.
This is a list of disclosures at the moment
https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
No left/right for now
There was a problem hiding this comment.
+1 to isAlwaysOpen, allowsExpanding makes it sound like there is a state where it could still be "closed" and just not expandable IMO
There was a problem hiding this comment.
I was struggling to name this one 😅 -- I'm also a fan of isAlwaysOpen and have updated to that
| textAlign: 'start' | ||
| }); | ||
|
|
||
| const detailTriggerChevronStyles = style({ |
There was a problem hiding this comment.
heads up there may be a merge conflict with #10349 depending the merge order
There was a problem hiding this comment.
👍 thanks for putting that on my radar
| const detailTriggerStyles = style({ | ||
| display: 'block', | ||
| paddingY: 4, | ||
| marginTop: -2, |
There was a problem hiding this comment.
What's this for? could it be paddingTop:2 and no marginTop instead?
| return ( | ||
| <Button | ||
| className={renderProps => | ||
| // TODO: remove size conditional once size is also removed from ResponseStatus |
There was a problem hiding this comment.
can we resolve by removing size?
| font: 'body', | ||
| display: 'flex', | ||
| gap: 8, | ||
| marginTop: { |
There was a problem hiding this comment.
there's a lot of margin/paddingTop: +/-2 what's driving all of these?
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
intention here is display: block, there's no children inside of the line?
| const executionTraceItemContentStyles = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| paddingBottom: 12, |
There was a problem hiding this comment.
last one shouldn't have padding bottom, it's doubled up with the padding from the wrapper of the ol
| </RACDisclosure> | ||
| ) : ( | ||
| <div | ||
| className={mergeStyles( |
There was a problem hiding this comment.
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
| <Provider values={[[IconContext, {styles: iconStyle({size: 'M'})}]]}> | ||
| <CenterBaseline>{icon}</CenterBaseline> | ||
| </Provider> | ||
| <div className={executionTraceItemDividerStyles} /> |
There was a problem hiding this comment.
| <div className={executionTraceItemDividerStyles} /> | |
| <div role="presentation" className={executionTraceItemDividerStyles} /> |
| docs | ||
| </ExecutionTraceItem> | ||
| </ExecutionTrace> | ||
| {/* <div> |
There was a problem hiding this comment.
leftover from a demo - good catch, removed ✅
|
|
||
| export interface ExecutionTraceItemProps extends DOMProps, AriaLabelingProps { | ||
| /** Allows detail content to render but prevents the row from being collapsible. */ | ||
| isDetailNotCollapsible?: boolean; |
|
|
||
| export interface ExecutionTraceItemProps extends DOMProps, AriaLabelingProps { | ||
| /** Allows detail content to render but prevents the row from being collapsible. */ | ||
| isDetailNotCollapsible?: boolean; |
There was a problem hiding this comment.
+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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
- Set `role="presentation”` on vertical item divider - Remove dead code in Storybook example - Clean up styles around row content alignment with leading icon
|
Build successful! 🎉 |
## API Changes
react-aria-components/react-aria-components:GridListHeaderProps-GridListHeaderProps {
- children?: ReactNode
- className?: string
- id?: string
- render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
- style?: CSSProperties
-}@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
+}@react-spectrum/s2/@react-spectrum/s2:SideNav-SideNav <T> {
- UNSAFE_className?: UnsafeClassName
- UNSAFE_style?: CSSProperties
- aria-describedby?: string
- aria-details?: string
- aria-label?: string
- aria-labelledby?: string
- autoFocus?: boolean | FocusStrategy
- children?: ReactNode | (T) => ReactNode
- defaultExpandedKeys?: Iterable<Key>
- dependencies?: ReadonlyArray<any>
- disabledKeys?: Iterable<Key>
- expandedKeys?: Iterable<Key>
- id?: string
- items?: Iterable<T>
- onExpandedChange?: (Set<Key>) => any
- selectedRoute: string
- slot?: string | null
- styles?: StylesPropWithHeight
-}/@react-spectrum/s2:SideNavItem-SideNavItem {
- aria-label?: string
- children: ReactNode
- download?: boolean | string
- hasChildItems?: boolean
- href?: Href
- hrefLang?: string
- id?: Key
- isDisabled?: boolean
- onHoverChange?: (boolean) => void
- onHoverEnd?: (HoverEvent) => void
- onHoverStart?: (HoverEvent) => void
- onPress?: (PressEvent) => void
- onPressChange?: (boolean) => void
- onPressEnd?: (PressEvent) => void
- onPressStart?: (PressEvent) => void
- onPressUp?: (PressEvent) => void
- ping?: string
- referrerPolicy?: HTMLAttributeReferrerPolicy
- rel?: string
- routerOptions?: RouterOptions
- target?: HTMLAttributeAnchorTarget
- textValue: string
-}/@react-spectrum/s2:SideNavItemContent-SideNavItemContent {
- children: ReactNode
-}/@react-spectrum/s2:SideNavItemLink-SideNavItemLink {
- children?: ReactNode
-}/@react-spectrum/s2:SideNavSection-SideNavSection <T extends {}> {
- aria-label?: string
- children?: ReactNode | (T) => ReactElement
- dependencies?: ReadonlyArray<any>
- id?: Key
- items?: Iterable<T>
-}/@react-spectrum/s2:SideNavHeader-SideNavHeader {
- children?: ReactNode
- id?: string
-}/@react-spectrum/s2:SideNavProps-SideNavProps <T> {
- UNSAFE_className?: UnsafeClassName
- UNSAFE_style?: CSSProperties
- aria-describedby?: string
- aria-details?: string
- aria-label?: string
- aria-labelledby?: string
- autoFocus?: boolean | FocusStrategy
- children?: ReactNode | (T) => ReactNode
- defaultExpandedKeys?: Iterable<Key>
- dependencies?: ReadonlyArray<any>
- disabledKeys?: Iterable<Key>
- expandedKeys?: Iterable<Key>
- id?: string
- items?: Iterable<T>
- onExpandedChange?: (Set<Key>) => any
- selectedRoute: string
- slot?: string | null
- styles?: StylesPropWithHeight
-}/@react-spectrum/s2:SideNavItemProps-SideNavItemProps {
- aria-label?: string
- children: ReactNode
- download?: boolean | string
- hasChildItems?: boolean
- href?: Href
- hrefLang?: string
- id?: Key
- isDisabled?: boolean
- onHoverChange?: (boolean) => void
- onHoverEnd?: (HoverEvent) => void
- onHoverStart?: (HoverEvent) => void
- onPress?: (PressEvent) => void
- onPressChange?: (boolean) => void
- onPressEnd?: (PressEvent) => void
- onPressStart?: (PressEvent) => void
- onPressUp?: (PressEvent) => void
- ping?: string
- referrerPolicy?: HTMLAttributeReferrerPolicy
- rel?: string
- routerOptions?: RouterOptions
- target?: HTMLAttributeAnchorTarget
- textValue: string
-}/@react-spectrum/s2:SideNavItemContentProps-SideNavItemContentProps {
- children: ReactNode
-}/@react-spectrum/s2:SideNavItemLinkProps-SideNavItemLinkProps {
- children?: ReactNode
-}/@react-spectrum/s2:SideNavSectionProps-SideNavSectionProps <T> {
- aria-label?: string
- children?: ReactNode | (T) => ReactElement
- dependencies?: ReadonlyArray<any>
- id?: Key
- items?: Iterable<T>
-}/@react-spectrum/s2:SideNavHeaderProps-SideNavHeaderProps {
- children?: ReactNode
- id?: string
-} |
Agent Skills ChangesRemoved (1)
Modified (7)
InstallReact Spectrum S2: React Aria: |
|
ah sorry ignore me adding labels to this PR...i didn't mean to do that |
|
|
||
| return ( | ||
| <Button | ||
| className={renderProps => mergeStyles(buttonStyles({...renderProps}), detailTriggerStyles)} |
There was a problem hiding this comment.
cc @devongovett
might want a lil padding around this for the focus ring
I've nudged the space around the focus ring:
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



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.