feat: Support icon placeholders in Attachment, onToggle, and other PromptField updates - #10416
Open
LFDanLu wants to merge 12 commits into
Open
feat: Support icon placeholders in Attachment, onToggle, and other PromptField updates#10416LFDanLu wants to merge 12 commits into
LFDanLu wants to merge 12 commits into
Conversation
snowystinger
reviewed
Aug 3, 2026
| }; | ||
| } | ||
|
|
||
| export function createFocusableRef<T extends HTMLElement = HTMLElement, D extends HTMLElement = T>( |
Member
There was a problem hiding this comment.
can't we import from the private path? why do we even have this file? there should be a comment in here explaining why we've copied it, haha
Member
Author
There was a problem hiding this comment.
I think we are just mimicking how S2 copies this over from the v3 package to isolate/guard against any possible divergences? Came in from #10095
LFDanLu
marked this pull request as ready for review
August 4, 2026 18:17
|
Build successful! 🎉 |
## API Changes
@react-spectrum/ai/@react-spectrum/ai:PromptTokenField PromptTokenField {
children?: (TokenSegment) => React.ReactElement
completionTrigger?: RegExp
+ menuWidth?: number
onKeyDown?: (React.KeyboardEvent<HTMLDivElement>) => void
pixelLoader?: Array<Cell> | Array<Array<Cell>>
placeholder?: string
renderCompletions?: (string) => Array<React.ReactNode> | null | Promise<Array<React.ReactNode> | null>/@react-spectrum/ai:PromptFieldVoiceButton PromptFieldVoiceButton {
isDisabled?: boolean
lang?: string
onError?: (VoiceInputErrorCode) => void
+ onToggle?: (boolean) => void
}/@react-spectrum/ai:PromptTokenFieldProps PromptTokenFieldProps {
children?: (TokenSegment) => React.ReactElement
completionTrigger?: RegExp
+ menuWidth?: number
onKeyDown?: (React.KeyboardEvent<HTMLDivElement>) => void
pixelLoader?: Array<Cell> | Array<Array<Cell>>
placeholder?: string
renderCompletions?: (string) => Array<React.ReactNode> | null | Promise<Array<React.ReactNode> | null>/@react-spectrum/ai:PromptTokenFieldPopoverProps PromptTokenFieldPopoverProps {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
arrowRef?: RefObject<Element | null>
boundaryElement?: Element = document.body
children?: ChildrenOrFunction<PopoverRenderProps>
containerPadding?: number = 12
crossOffset?: number = 0
defaultOpen?: boolean
filterAnchor?: Position | null
getTargetRect?: (Element) => DOMRect | null | undefined = target.getBoundingClientRect()
hideArrow?: boolean = false
isEntering?: boolean
isExiting?: boolean
isFocused?: boolean
isNonModal?: boolean
isOpen?: boolean
items?: Array<React.ReactNode> | null | Promise<Array<React.ReactNode> | null>
maxHeight?: number
+ menuWidth?: number
offset?: number = 8
onBlurWithin?: (FocusEvent) => void
onFocusWithin?: (FocusEvent) => void
onFocusWithinChange?: (boolean) => void
placement?: Placement = 'bottom'
scrollRef?: RefObject<Element | null> = overlayRef
shouldFlip?: boolean = true
size?: 'S' | 'M' | 'L'
slot?: string | null
styles?: StyleString
trigger?: string
triggerRef?: RefObject<Element | null>
}/@react-spectrum/ai:PromptFieldVoiceButtonProps PromptFieldVoiceButtonProps {
isDisabled?: boolean
lang?: string
onError?: (VoiceInputErrorCode) => void
+ onToggle?: (boolean) => void
} |
Agent Skills ChangesModified (2)
InstallReact Spectrum S2: React Aria: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
more followups for coworker
includes support for icon placeholders in Attachments, onToggle on VoiceInputButton for tracking, exposing PromptField focusable ref so "suggested prompt" buttons can move focus into the PromptField on value injection, and menuWidth to hack around weird popover resizing behavior when opened at edge of screen.
✅ Pull Request Checklist:
📝 Test Instructions:
Test icon placeholders in Attachment stories
Test the suggested prompt buttons in the "Everything" story for PromptField and make sure focus moves into the field. Also test the menuWidth applies to the field's autocomplete menu and that onToggle triggers on voice input button toggle.
🧢 Your Project:
RSP