Skip to content

fix(web): show unsupported-file toast and filter non-images in the collage tool - #2890

Merged
snapotter-hq merged 3 commits into
snapotter-hq:mainfrom
drakeo338:claude/2863-fix
Oct 21, 2026
Merged

snapotter-hq merged 3 commits into
snapotter-hq:mainfrom
drakeo338:claude/2863-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #2863.

The collage tool's upload area and "add more" button passed picked or dropped files straight to the store, with no unsupported-file feedback (the dropzone shows a toast, collage did not). The change filters non-images in the file-picker paths and shows the existing unsupported-file toast when nothing usable was chosen. Added a test file covering all four paths.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • New translation or i18n update
  • Documentation update
  • Test improvement
  • Refactor (no functional change)

Checklist

  • I have read CONTRIBUTING.md
  • I have signed the CLA (the bot will prompt you if not)
  • My changes follow the project's code style (Biome passes) (not run)
  • I have added or updated tests for my changes
  • All existing tests pass locally (pnpm test) (only the new test file was run: 4 passed)
  • TypeScript compiles without errors (pnpm typecheck) (not run)
  • My PR is focused on a single concern (under 400 lines of change)
  • I have not modified CI, release, or linter configuration files

Screenshots (if applicable)

None.

snapotter-hq and others added 3 commits October 21, 2026 14:08
…llage tool (snapotter-hq#2863)

Closes snapotter-hq#2863

The collage upload area drop handler dropped non-image files silently, and the
upload area click picker and the thumbnail strip add button passed whatever the
file dialog returned straight to the store, so a text file picked there was
added as a collage image.

All three entry points now filter with isImageFile. When files were chosen or
dropped but none are images, showUnsupportedFileType(t.dropzone.unsupportedFileType)
is shown, the same as the other tool intake paths in tool-page.tsx. A mixed
selection keeps the images and does not toast.
@snapotter-hq
snapotter-hq merged commit c598be2 into snapotter-hq:main Oct 21, 2026
27 checks passed
@snapotter-hq

Copy link
Copy Markdown
Owner

Review findings disposition:

  • Fixed in this PR: exported expandAccept from apps/web/src/components/common/dropzone.tsx (adding .tiff,.tif) and wired both CollagePreview file pickers to expandAccept("image/*") ?? "image/*", so the native file dialog offers the full 55+ extension list accepted by isImageFile instead of only image/*,.avif,.heic,.heif,.hif.
  • Fixed in this PR: tightened tests/unit/web/collage-preview-unsupported-intake.test.tsx to assert the intake-unsupported-file-type toast ID, verify toastErrorSpy does not fire on mixed picks or empty/cancelled picks, verify input.accept includes expanded extensions, and use vi.spyOn(URL, ...) instead of overwriting the global URL constructor.
  • Filed as fix(web): guard CollagePreview file-picker onchange during processing and label ImageStrip add button #3236: CollagePreview detached file pickers bypass useIntakeGuard when a pick finishes after processing starts, and the ImageStrip + button lacks an aria-label.

@snapotter-hq

Copy link
Copy Markdown
Owner

Thanks for fixing #2863, @drakeo338.

Before merging, we exported expandAccept from dropzone.tsx (including .tiff,.tif) and shared it with both CollagePreview file pickers so the native dialog allows every format isImageFile accepts, and tightened a few assertions in the new unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(web): CollagePreview UploadArea and ImageStrip silently drop or accept non-image files

2 participants