Commit 2a3d1d3
feat: Add clipboard paste and drag-and-drop file support to both themes (#5829)
* feat: Add clipboard paste and drag-and-drop file support to both themes
Add paste and drag-and-drop support for file attachments in the send box,
consistent across both basic and fluent themes. Users can now paste files
from the clipboard or drag files onto the chat to attach them.
- Basic theme: Add onPaste handler, DropZone component, and handleAddFiles helper
- Fluent theme: Add onPaste handler (drag-and-drop already existed)
- All file types supported, respects disableFileUpload style option
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: Destructure props in DropZone to satisfy ESLint rule
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: Address PR review feedback
- Gate paste and drop on uiState === 'disabled' in both themes
- Respect sendAttachmentOn: 'attach' in basic theme handleAddFiles
- Hide DropZone when UI is disabled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
test: Add E2E tests for paste and drag-and-drop in basic theme
- Add pasteFile.html: tests pasting files into send box, verifies
attachment bar shows items and multiple pastes accumulate
- Add dragAndDrop.upload.html: tests drag-and-drop flow in basic theme,
verifies drop zone appears, files are attached on drop
- Add sendBoxDropZone test ID to basic theme DropZone component
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: Remove snapshot assertions from new E2E tests
New tests cannot include baseline snapshot images without running in the
CI Docker environment. Use assertion-only checks instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
test: Restore snapshot assertions for consistency with existing tests
Baseline snapshot images need to be generated in the CI Docker
environment. The tests will fail until baselines are committed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
test: Add baseline snapshots and fix pasteFile test
- Generate baseline snapshot images for both E2E tests using Docker
Selenium environment
- Fix pasteFile test to use text/plain files instead of fake image/png
to avoid thumbnail decode errors in browser
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: Regenerate snapshots via jest-server for correct 360x640 viewport
Previous snapshots used wrong viewport (780x441) because they bypassed
the jest-server which sets the window to 360x640. Now generated through
the jest-server proxy matching CI configuration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: Update snapshots for position:relative on send box main div
The DropZone component requires position:relative on .webchat__send-box__main
for its absolute positioning overlay. This causes minor rendering differences
in existing snapshot tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Check
WIP
Changelog and use js ext
* Changelog
* Remove width constraint
* Fix types
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @OEvgeny
* Fix snaps
* Fix nits
* Fix tsd
* Review
* Fix props type
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 8fcd02a commit 2a3d1d3
29 files changed
Lines changed: 518 additions & 118 deletions
File tree
- __tests__/html2
- basic
- styleOptions
- suggestedActions
- packages
- bundle/src/boot/actual/hook
- component
- src
- SendBox
- Styles/StyleSet
- boot
- fluent-theme/src/components
- dropZone
- sendBox
- react-hooks/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
Loading
Loading
0 commit comments