-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ai-conversation): add allowAttachments prop #5802
Conversation
🦋 Changeset detectedLatest commit: e7ed523 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
packages/react-ai/src/components/AIConversation/createProvider.tsx
Outdated
Show resolved
Hide resolved
@@ -72,6 +73,7 @@ function AIConversationBase({ | |||
...avatars, | |||
}, | |||
isLoading, | |||
allowAttachments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add this on the createAIConversation
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this comment resolved?
* Will conditionally render the DropZone if allowAttachments | ||
* is true | ||
*/ | ||
const FormWrapper = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit confused on whether this addition is creating deltas between the behaviors of the default AIConversation
and the Amplify UI version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so the Amplify UI version uses the DropZone component that wraps the form so users can drag and drop a file onto the form and it gets attached (in addition to a button which triggers the file picker). So allowAttachments
will affect bot the default component and the Amplify UI one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have drop event handlers configured in the default AiConversation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do now
@@ -113,7 +113,6 @@ exports[`@aws-amplify/ui-react/internal exports should match snapshot 1`] = ` | |||
"useAuth", | |||
"useColorMode", | |||
"useDeprecationWarning", | |||
"useDropZone", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this be a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TECHNICALLY yes and no. It is from our /internal export path, which, as the name suggests is for internal use. I can re-export it from here too just to make sure though
@@ -44,6 +44,8 @@ export { | |||
useTimeout, | |||
useDataState, | |||
DataState, | |||
useDropZone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're doing this to prevent a direct dependency on the react package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
|
||
```jsx | ||
<AIConversation | ||
allowAttachments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention that to keep current behavior customers need to add this prop
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>
Description of changes
Adds
allowAttachment
prop to AIConversation component to let customers choose if they want the chatbot to have attachments or not.Issue #, if available
Description of how you validated changes
Checklist
yarn test
passes and tests are updated/addeddocs
,e2e
,examples
, or other private packages.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.