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
[P0] Send attachment on send #5123
Merged
Merged
Conversation
This file contains 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
compulim
force-pushed
the
feat-pending-upload-2
branch
from
April 6, 2024 14:45
5248a1e
to
4fb2386
Compare
compulim
commented
Apr 7, 2024
compulim
requested review from
a-b-r-o-w-n,
cwhitten,
srinaath,
tdurnford and
beyackle2
as code owners
April 7, 2024 05:30
cwhitten
approved these changes
Apr 8, 2024
11 tasks
OEvgeny
pushed a commit
that referenced
this pull request
Apr 8, 2024
* Add style option to allow for file type narrowing * Rename and add multi upload prop * Add e2e test to validate <input> * Resolve comments * Revert to true * Add style option * Add hook * Pass text through to activity * Add file state to context * Pass text to sendFiles * Finalize upload and sendbox action * Only send text if defined * Add changelog entry * Add e2e test * Bump version * Switch to check icon * Initialize as undefined * Store the upload button ref in context and clear after sending * Fix types and pass ref directly to send box * Update icon and sizing * Smaller icon * Updated send box icons per design * Use Redux and sendMessage, instead of useState and sendFile * Reformat * Update DOCTYPE * Add deprecation warning * Rename to attach in sendAttachmentOn * Fix test * Remove deprecation note * Clean up * Expose updated useSendMessage hook * Add tests * Add tests * Delete test * Add test for speech * Comments on ignoreErrors * Revert icon changes * Fix test * Add telemetry * Migrate test * Use older icon * Fix flakiness * Revert screenshots * Remove uploadButtonRef * Dispatch should return void * Sort imports * Sort imports * Remove uploadButtonRef * Sort imports * Sort imports * Add test * Add screenshots * Use exact version for production dependencies * Sort imports * Update comment * Update deps * Remove empty line * Update exact version * Revert unnecessary changes * Sort imports * Simplify typing of SendBoxAttachment * Clean up * Remove unused file * Sort * Revert * Update useSendMessage * Update content type * Fix flaky * Fix tests * Fix flakiness * Add sendAttachmentOn * Fix test * Fix test * Fix test * Revert behavior * Backward compatibility * Add custom thumbnail * Add notes * Revert * Revert API useSendFiles * Add typings * Remove satisfies --------- Co-authored-by: Jordan Berger <jordanberger@microsoft.com>
11 tasks
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.
Changelog Entry
Breaking changes
useSendMessage
hook is updated to support sending attachments with a message. To reduce complexity, theuseSendFiles
hook is being deprecated. The hook will be removed on or after 2026-04-03styleOptions.uploadThumbnailHeight
andstyleOptions.uploadThumbnailWidth
must be anumber
of pixelsAdded
sendAttachmentOn
style option to send attachments and text in a single activity, by @ms-jb and @compulimuseSendMessage
hook is updated to support sending attachments with a messageuseSendBoxAttachments
hook is added to get/set attachments in the send boxDescription
Added a new
styleOption.sendAttachmentOn
that enables attachments and message text to be sent in a single activity. If enabled, uploaded files are retained until the Send button is pressed to allow for message text to be optionally included. Standalone text works as before.Design
useSendFiles
vs.useSendMessage
As
useSendMessage
hook now supports sending attachments in the message, theuseSendFiles
hook can be obsoleted.We choose to add attachments to
useSendMessage
overuseSendFiles
because if we add text message touseSendFiles
, it will become an uber hook and we would need to deprecateuseSendMessage
. This is undesirable.sendBoxAttachments
hookNew
useSendBoxAttachments
to get/set the attachments in the send box before it is being sent. This works nicely with speech recognition.Simplifying attachments
Some philosophies we applied to simply the SDK design:
{ blob: Blob | File, thumbnailURL?: URL }
, as minimal/intuitive as possible{ iconURL?: URL }
botframework-webchat-component
will help making thumbnails when possibleuseSendMessage
will accept userland attachment. When the hook is called, thumbnails will be generated on-the-flyuseSendFiles
will remain the same and acceptBlob | File
. When the hook is called, thumbnails will be generated on-the-flyuseSendBoxAttachments
will accept userland attachment. However, it will not automatically generate thumbnailsSpecific Changes
useSendBoxAttachments
hook to get/set attachments in the send boxuseSendMessage
hook to addattachments
useSendFiles
hook<UploadButton>
to show checkmark when files are attachedstyleOptions.sendAttachmentOn
"attach"
will send the message with attachment when files are attached (legacy)"send"
will send the message with attachment when the send button is tapped (default)CHANGELOG.md
Review Checklist
z-index
)package.json
andpackage-lock.json
reviewed