Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

Merge remote-tracking branch 'origin/main' into fix/gallery-upload-media-formats

Lincoln Steinc013ad50989d
diff --cc invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx
index 625282f41b,e2fa004b3e..9acc9f0606
--- a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx
@@@ -1080,35 -1113,8 +1114,35 @@@ describe('GalleryImageGrid upload drop
expect(clickSpy).toHaveBeenCalledOnce();
});
+ it('offers every container and audio format the upload route ingests', async () => {
+ await renderGallery(createGallery({ items: [], pendingPlaceholders: [] }));
+
+ const accept = host?.querySelector<HTMLInputElement>('input[type="file"]')?.accept.split(',');
+
+ // The gallery once offered video/mp4 alone, so the OS picker greyed out every clip
+ // and audio file the server ingests. Parity with the video panel's reference upload.
+ expect(accept).toEqual(expect.arrayContaining(['image/png', 'video/*', 'audio/*', '.mov', '.mkv', '.mp3', '.wav']));
+ });
+
+ // Not a fix for the accept-list bug -- the drop path never consulted `accept` and already
+ // forwarded every format. This pins that: the handler must stay a pass-through, because
+ // filtering here by the picker's list would re-hide exactly what the picker just stopped
+ // hiding, and the classifier downstream is the single place that decides.
+ it('hands a dropped audio file to the upload action', async () => {
+ await renderGallery(createGallery({ items: [], pendingPlaceholders: [] }));
+
+ const dropTarget = host?.querySelector('[role="button"]');
+ const dataTransfer = new DataTransfer();
+ const song = new File(['audio'], 'song.mp3', { type: 'audio/mpeg' });
+
+ dataTransfer.items.add(song);
+ await interact(() => dropTarget?.dispatchEvent(new DragEvent('drop', { bubbles: true, dataTransfer })));
+
+ expect(actionMocks.uploadFiles).toHaveBeenCalledWith([song]);
+ });
+
it('keeps the no-match message for a search with no results instead of the upload target', async () => {
- await renderGallery(createGallery({ items: [], pendingPlaceholders: [], searchTerm: 'nope' }));
+ await renderGallery(createGallery({ items: [], searchTerm: 'nope' }));
expect(host?.textContent).toContain('No items');
expect(host?.querySelector('[role="button"]')).toBeNull();