diff --git a/ACHIEVEMENTS.md b/ACHIEVEMENTS.md index 647a074c5d..9bb4ce7118 100644 --- a/ACHIEVEMENTS.md +++ b/ACHIEVEMENTS.md @@ -45,6 +45,15 @@ A curated list of major achievements by the Web Chat team. This document celebra ## 🎨 UI & Theming +### 📎 Attachment Preview for `sendAttachmentOn: "send"` + +**Goal:** Improve multi-file upload UX by introducing persistent attachment previews. +**By:** [@compulim](https://github.com/compulim) in [PR #5464](https://github.com/microsoft/BotFramework-WebChat/pull/5464) + +- Added `SendBoxAttachmentBar` to allow users to preview and remove attachments before sending. +- Previews switch between thumbnails and list mode based on count and accessibility settings. +- Enhances multi-folder upload workflows and aligns with modern messaging UX. + ### 🧾 Code Block Rendering & Highlighting System **Goal:** Unify and polish code block rendering across Markdown and UI components. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a39f3f111..bd90734047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,8 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Existing behavior will be kept and activities will be grouped by `sender` followed by `status` - `useGroupActivitiesByName` is favored over the existing `useGroupActivities` hook for performance reason - Middleware which support the new grouping name init argument should only compute the grouping if they match the grouping name, or the grouping name is not specified, otherwise, should do nothing and call the downstream middleware +- Resolved [#5463](https://github.com/microsoft/BotFramework-WebChat/issues/5463). Added attachment preview for `sendAttachmentOn: "send"`, in PR [#5464](https://github.com/microsoft/BotFramework-WebChat/pull/5464), by [@compulim](https://github.com/compulim) + - Attaching files will no longer remove previously attached files ### Changed diff --git a/__tests__/__image_snapshots__/html/on-send-js-with-send-attachment-on-of-send-should-send-attachments-when-the-send-button-is-clicked-1-snap.png b/__tests__/__image_snapshots__/html/on-send-js-with-send-attachment-on-of-send-should-send-attachments-when-the-send-button-is-clicked-1-snap.png index 7f290e4037..42e60134b2 100644 Binary files a/__tests__/__image_snapshots__/html/on-send-js-with-send-attachment-on-of-send-should-send-attachments-when-the-send-button-is-clicked-1-snap.png and b/__tests__/__image_snapshots__/html/on-send-js-with-send-attachment-on-of-send-should-send-attachments-when-the-send-button-is-clicked-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/simple-js-with-send-attachment-on-unset-should-send-attachments-when-the-send-button-is-clicked-1-snap.png b/__tests__/__image_snapshots__/html/simple-js-with-send-attachment-on-unset-should-send-attachments-when-the-send-button-is-clicked-1-snap.png index 7f290e4037..42e60134b2 100644 Binary files a/__tests__/__image_snapshots__/html/simple-js-with-send-attachment-on-unset-should-send-attachments-when-the-send-button-is-clicked-1-snap.png and b/__tests__/__image_snapshots__/html/simple-js-with-send-attachment-on-unset-should-send-attachments-when-the-send-button-is-clicked-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-2-snap.png b/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-2-snap.png index df26f8a083..42e60134b2 100644 Binary files a/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-2-snap.png and b/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-2-snap.png differ diff --git a/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-3-snap.png b/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-3-snap.png index 854959e267..8bdf239e57 100644 Binary files a/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-3-snap.png and b/__tests__/__image_snapshots__/html/simple-keyboard-only-js-with-send-attachment-on-unset-and-use-keyboard-for-the-flow-should-send-attachments-when-the-send-button-is-clicked-3-snap.png differ diff --git a/__tests__/__image_snapshots__/html/use-send-box-attachments-js-call-use-send-box-attachments-hook-should-get-set-and-upload-attachments-1-snap.png b/__tests__/__image_snapshots__/html/use-send-box-attachments-js-call-use-send-box-attachments-hook-should-get-set-and-upload-attachments-1-snap.png index aeb10c88f6..855a8dd435 100644 Binary files a/__tests__/__image_snapshots__/html/use-send-box-attachments-js-call-use-send-box-attachments-hook-should-get-set-and-upload-attachments-1-snap.png and b/__tests__/__image_snapshots__/html/use-send-box-attachments-js-call-use-send-box-attachments-hook-should-get-set-and-upload-attachments-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/with-message-js-with-send-attachment-on-unset-should-send-attachments-with-a-message-1-snap.png b/__tests__/__image_snapshots__/html/with-message-js-with-send-attachment-on-unset-should-send-attachments-with-a-message-1-snap.png deleted file mode 100644 index 7f290e4037..0000000000 Binary files a/__tests__/__image_snapshots__/html/with-message-js-with-send-attachment-on-unset-should-send-attachments-with-a-message-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/html/with-message-js-with-send-attachment-on-unset-should-send-attachments-with-a-message-2-snap.png b/__tests__/__image_snapshots__/html/with-message-js-with-send-attachment-on-unset-should-send-attachments-with-a-message-2-snap.png deleted file mode 100644 index 79c39f275d..0000000000 Binary files a/__tests__/__image_snapshots__/html/with-message-js-with-send-attachment-on-unset-should-send-attachments-with-a-message-2-snap.png and /dev/null differ diff --git a/__tests__/html/assets/uploads/forzahorizon5.jpg b/__tests__/html/assets/uploads/forzahorizon5.jpg new file mode 100644 index 0000000000..8cae87a2ed Binary files /dev/null and b/__tests__/html/assets/uploads/forzahorizon5.jpg differ diff --git a/__tests__/html/assets/uploads/haloinfinite.jpg b/__tests__/html/assets/uploads/haloinfinite.jpg new file mode 100644 index 0000000000..dc890be74c Binary files /dev/null and b/__tests__/html/assets/uploads/haloinfinite.jpg differ diff --git a/__tests__/html/assets/uploads/minecraftdungeons.jpg b/__tests__/html/assets/uploads/minecraftdungeons.jpg new file mode 100644 index 0000000000..61116a2ea4 Binary files /dev/null and b/__tests__/html/assets/uploads/minecraftdungeons.jpg differ diff --git a/__tests__/html/sendAttachmentOn/useSendBoxAttachments.html b/__tests__/html/sendAttachmentOn/useSendBoxAttachments.html index b996aad966..6b1c0b680a 100644 --- a/__tests__/html/sendAttachmentOn/useSendBoxAttachments.html +++ b/__tests__/html/sendAttachmentOn/useSendBoxAttachments.html @@ -54,7 +54,7 @@ const fileReader = new FileReader(); fileReader.onerror = reject; - fileReader.onload = () => resolve(fileReader.result); + fileReader.onload = () => resolve(new URL(fileReader.result)); fileReader.readAsDataURL(thumbnailBlob); }); @@ -64,7 +64,7 @@ useSendBoxAttachments()[1](attachmentsRef.current); }); - // THEN: It should show checkmark on the button. + // THEN: It should show checkmark on the button and file preview. await host.snapshot(); // WHEN: `useSendBoxAttachments` hook is called to get the attachments. diff --git a/__tests__/html/sendAttachmentOn/withMessage.js b/__tests__/html/sendAttachmentOn/withMessage.js deleted file mode 100644 index d9de69f19c..0000000000 --- a/__tests__/html/sendAttachmentOn/withMessage.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ - -describe('with "sendAttachmentOn" unset', () => { - test('should send attachments with a message', () => runHTML('sendAttachmentOn/withMessage')); -}); diff --git a/__tests__/html2/avatar/layout.default.html b/__tests__/html2/avatar/layout.default.html index 78a28ae013..f809362bf2 100644 --- a/__tests__/html2/avatar/layout.default.html +++ b/__tests__/html2/avatar/layout.default.html @@ -56,6 +56,8 @@ await pageObjects.sendMessageViaSendBox('no avatar'); await pageConditions.numActivitiesShown(6); + await pageConditions.allOutgoingActivitiesSent(); + await host.snapshot('local', { skipCheckAccessibility: true }); await renderWebChat({ diff --git a/__tests__/html2/bubble/fixedWidth.html b/__tests__/html2/bubble/fixedWidth.html index 3daaa580f2..676e72ff55 100644 --- a/__tests__/html2/bubble/fixedWidth.html +++ b/__tests__/html2/bubble/fixedWidth.html @@ -109,6 +109,8 @@ await pageConditions.numActivitiesShown(5); + await pageConditions.allImagesLoaded(); + await host.snapshot('local'); }); diff --git a/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html new file mode 100644 index 0000000000..aa3dbe9625 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html @@ -0,0 +1,70 @@ + + +
+ + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-1.png new file mode 100644 index 0000000000..8d857983d5 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-2.png b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-2.png new file mode 100644 index 0000000000..22e5f04aa6 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-2.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-3.png b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-3.png new file mode 100644 index 0000000000..9711ca603c Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/clearAfterSend.html.snap-3.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/deleteButton.html b/__tests__/html2/sendBox/previewBeforeSend/deleteButton.html new file mode 100644 index 0000000000..231443ebf0 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/deleteButton.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/deleteButton.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/deleteButton.html.snap-1.png new file mode 100644 index 0000000000..ef517bd036 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/deleteButton.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/deleteButtonInTextMode.html b/__tests__/html2/sendBox/previewBeforeSend/deleteButtonInTextMode.html new file mode 100644 index 0000000000..063ec11017 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/deleteButtonInTextMode.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/deleteButtonInTextMode.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/deleteButtonInTextMode.html.snap-1.png new file mode 100644 index 0000000000..8bab288416 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/deleteButtonInTextMode.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html b/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html new file mode 100644 index 0000000000..a8f42447d2 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html.snap-1.png new file mode 100644 index 0000000000..f7a945f7a3 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html.snap-2.png b/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html.snap-2.png new file mode 100644 index 0000000000..8d857983d5 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/escapeKey.html.snap-2.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/filePreview.html b/__tests__/html2/sendBox/previewBeforeSend/filePreview.html new file mode 100644 index 0000000000..27518303d3 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/filePreview.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/filePreview.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/filePreview.html.snap-1.png new file mode 100644 index 0000000000..c9ec39de05 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/filePreview.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html new file mode 100644 index 0000000000..03b0525713 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html.snap-1.png new file mode 100644 index 0000000000..aa4d823528 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html.snap-2.png b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html.snap-2.png new file mode 100644 index 0000000000..9575089038 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.maxHeight.html.snap-2.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.two.html b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.two.html new file mode 100644 index 0000000000..cde966bee1 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.two.html @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.two.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.two.html.snap-1.png new file mode 100644 index 0000000000..1f66b26da6 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.two.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.zero.html b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.zero.html new file mode 100644 index 0000000000..0f8de66bfb --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.zero.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/styleOptions.zero.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.zero.html.snap-1.png new file mode 100644 index 0000000000..ba55e85531 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/styleOptions.zero.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/textOnly.html b/__tests__/html2/sendBox/previewBeforeSend/textOnly.html new file mode 100644 index 0000000000..61ea9ce7dc --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/textOnly.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/textOnly.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/textOnly.html.snap-1.png new file mode 100644 index 0000000000..9be850ff3a Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/textOnly.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/textOnlyMaxHeight.html b/__tests__/html2/sendBox/previewBeforeSend/textOnlyMaxHeight.html new file mode 100644 index 0000000000..3f7453d797 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/textOnlyMaxHeight.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/textOnlyMaxHeight.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/textOnlyMaxHeight.html.snap-1.png new file mode 100644 index 0000000000..7eefde618b Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/textOnlyMaxHeight.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html b/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html new file mode 100644 index 0000000000..692fd621ab --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html @@ -0,0 +1,9 @@ + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html.snap-1.png new file mode 100644 index 0000000000..b8a465a32d Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html.snap-2.png b/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html.snap-2.png new file mode 100644 index 0000000000..7497718a27 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/threeImages.dark.html.snap-2.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/threeImages.html b/__tests__/html2/sendBox/previewBeforeSend/threeImages.html new file mode 100644 index 0000000000..ee2187ebd1 --- /dev/null +++ b/__tests__/html2/sendBox/previewBeforeSend/threeImages.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + diff --git a/__tests__/html2/sendBox/previewBeforeSend/threeImages.html.snap-1.png b/__tests__/html2/sendBox/previewBeforeSend/threeImages.html.snap-1.png new file mode 100644 index 0000000000..b8a465a32d Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/threeImages.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/previewBeforeSend/threeImages.html.snap-2.png b/__tests__/html2/sendBox/previewBeforeSend/threeImages.html.snap-2.png new file mode 100644 index 0000000000..7497718a27 Binary files /dev/null and b/__tests__/html2/sendBox/previewBeforeSend/threeImages.html.snap-2.png differ diff --git a/__tests__/html2/sendBox/sendAttachmentOn/focus-indicator.css b/__tests__/html2/sendBox/sendAttachmentOn/focus-indicator.css new file mode 100644 index 0000000000..2100b6da4c --- /dev/null +++ b/__tests__/html2/sendBox/sendAttachmentOn/focus-indicator.css @@ -0,0 +1,4 @@ +*:focus { + background-color: yellow !important; + outline: dashed 2px Red !important; +} diff --git a/__tests__/html/sendAttachmentOn/withMessage.html b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html similarity index 57% rename from __tests__/html/sendAttachmentOn/withMessage.html rename to __tests__/html2/sendBox/sendAttachmentOn/withMessage.html index 5c71c3360f..a3d6315478 100644 --- a/__tests__/html/sendAttachmentOn/withMessage.html +++ b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html @@ -10,11 +10,24 @@ diff --git a/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-1.png b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-1.png new file mode 100644 index 0000000000..c67e4df211 Binary files /dev/null and b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-1.png differ diff --git a/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-2.png b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-2.png new file mode 100644 index 0000000000..af48e12eae Binary files /dev/null and b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-2.png differ diff --git a/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-3.png b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-3.png new file mode 100644 index 0000000000..cc40ab8855 Binary files /dev/null and b/__tests__/html2/sendBox/sendAttachmentOn/withMessage.html.snap-3.png differ diff --git a/__tests__/setup/elements/getSendBoxTextBox.js b/__tests__/setup/elements/getSendBoxTextBox.js index 9e7337354e..aa62a77fd7 100644 --- a/__tests__/setup/elements/getSendBoxTextBox.js +++ b/__tests__/setup/elements/getSendBoxTextBox.js @@ -1,6 +1,6 @@ import { By } from 'selenium-webdriver'; -const CSS_SELECTOR = '[role="form"] > * > form > input[type="text"]'; +const CSS_SELECTOR = `[data-testid="send box text area"]`; export default async function getSendBoxTextBox(driver) { return await driver.findElement(By.css(CSS_SELECTOR)); diff --git a/__tests__/setup/local/forzahorizon5.jpg b/__tests__/setup/local/forzahorizon5.jpg new file mode 100644 index 0000000000..8cae87a2ed Binary files /dev/null and b/__tests__/setup/local/forzahorizon5.jpg differ diff --git a/__tests__/setup/local/haloinfinite.jpg b/__tests__/setup/local/haloinfinite.jpg new file mode 100644 index 0000000000..dc890be74c Binary files /dev/null and b/__tests__/setup/local/haloinfinite.jpg differ diff --git a/__tests__/setup/local/minecraftdungeons.jpg b/__tests__/setup/local/minecraftdungeons.jpg new file mode 100644 index 0000000000..61116a2ea4 Binary files /dev/null and b/__tests__/setup/local/minecraftdungeons.jpg differ diff --git a/html2-test-transformer.js b/html2-test-transformer.js index 1fa24c2f73..81c76cb521 100644 --- a/html2-test-transformer.js +++ b/html2-test-transformer.js @@ -5,10 +5,11 @@ const testRoot = resolve(__dirname, './__tests__/html2/'); module.exports = { process: (_, sourcePath) => { const html = relative(testRoot, sourcePath); + const shouldSkip = sourcePath.endsWith('.skip.html'); return { code: ` - test(${JSON.stringify(html)}, () => + test${shouldSkip ? '.skip' : ''}(${JSON.stringify(html)}, () => runHTML(${JSON.stringify(`/__tests__/html2/${html}`)})); ` }; diff --git a/minecraftdungeons.jpg b/minecraftdungeons.jpg new file mode 100644 index 0000000000..61116a2ea4 Binary files /dev/null and b/minecraftdungeons.jpg differ diff --git a/packages/api/src/StyleOptions.ts b/packages/api/src/StyleOptions.ts index 8fee5fd7b0..1891eadd02 100644 --- a/packages/api/src/StyleOptions.ts +++ b/packages/api/src/StyleOptions.ts @@ -961,6 +961,21 @@ type StyleOptions = { * To add new groupings, configure `groupActivitiesMiddleware` to output extra groups. Then, add the group names to `styleOptions.groupActivitiesBy`. */ groupActivitiesBy?: readonly string[] | undefined; + + /** + * Send box: maximum number of attachment item to preview as thumbnail before showing as text-only. + * Send box: maximum height of the attachment bar. + * + * @default 114 + */ + sendBoxAttachmentBarMaxHeight?: number; + + /** + * Send box: maximum number of attachment item to preview as thumbnail before showing as list item. + * + * @default 3 + */ + sendBoxAttachmentBarMaxThumbnail?: number; }; // StrictStyleOptions is only used internally in Web Chat and for simplifying our code: diff --git a/packages/api/src/defaultStyleOptions.ts b/packages/api/src/defaultStyleOptions.ts index 5303f9d583..b8806d5c56 100644 --- a/packages/api/src/defaultStyleOptions.ts +++ b/packages/api/src/defaultStyleOptions.ts @@ -311,7 +311,11 @@ const DEFAULT_OPTIONS: Required