Skip to content

Conversation

@jordanl17
Copy link
Member

@jordanl17 jordanl17 commented Jan 20, 2026

Description

Asset sources without an Uploader property (like sanity-plugin-media) were filtered out by the drag-and-drop system, causing dropped files to be silently ignored.

This PR now substitute a default dataset asset source that has one, allowing the upload to proceed when a dropped file's asset source lacks an Uploader.

Before After
dndFileUploadBEFORE dndFileUploadAFTER

What to review

  • Creates default image/file asset sources with Uploaders (mirroring what UploadPlaceholder.tsx does for click-to-upload)
  • When resolving which asset source to use for a dropped file, falls back to the default source if the resolved one lacks an Uploader

Testing

Verified the fix in a studio provided by support where the original issue could be replicated. Imported the version of sanity as on this branch fix to confirm fix.

Notes for release

Fixes an issue when dragging and dropping a file into a file upload field, where in some instances where an uploader handler was not defined, the file would fail to upload with an error claiming that no handler could be found.

@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
page-building-studio Ready Ready Preview, Comment Jan 26, 2026 2:07pm
test-studio Ready Ready Preview, Comment Jan 26, 2026 2:07pm
3 Skipped Deployments
Project Deployment Review Updated (UTC)
e2e-studio Ignored Ignored Jan 26, 2026 2:07pm
studio-workshop Ignored Ignored Preview Jan 26, 2026 2:07pm
test-next-studio Ignored Ignored Jan 26, 2026 2:07pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

🧪 E2E Preview environment

🔑 Environment Variables for Local Testing

This is the preview URL for the E2E tests: https://e2e-studio-9j4g7w9n4.sanity.dev

To run the E2E tests locally, you can use the following environment variables, then run pnpm test:e2e --ui to open the Playwright test runner.

💬 Remember to build the project first with pnpm build:e2e.

  SANITY_E2E_PROJECT_ID=ittbm412
  SANITY_E2E_BASE_URL=https://e2e-studio-9j4g7w9n4.sanity.dev
  SANITY_E2E_DATASET="update depending the project you want to test (pr-11907-chromium-21360443512 || pr-11907-firefox-21360443512 )"
  SANITY_E2E_DATASET_CHROMIUM=pr-11907-chromium-21360443512
  SANITY_E2E_DATASET_FIREFOX=pr-11907-firefox-21360443512

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

📊 Playwright Test Report

Download Full E2E Report

This report contains test results, including videos of failing tests.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

⚡️ Editor Performance Report

Updated Mon, 26 Jan 2026 14:13:05 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 40.8 efps (25ms) 45.5 efps (22ms) -3ms (-10.2%)
article (body) 53.8 efps (19ms) 53.3 efps (19ms) +0ms (+0.8%)
article (string inside object) 50.0 efps (20ms) 47.6 efps (21ms) +1ms (+5.0%)
article (string inside array) 50.0 efps (20ms) 46.5 efps (22ms) +2ms (+7.5%)
recipe (name) 99.9+ efps (9ms) 99.9+ efps (10ms) +2ms (-/-%)
recipe (description) 55.6 efps (18ms) 55.6 efps (18ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
singleString (stringField) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 58.8 efps (17ms) 58.8 efps (17ms) +0ms (-/-%)
synthetic (string inside object) 55.6 efps (18ms) 57.1 efps (18ms) -1ms (-2.8%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 25ms 29ms 34ms 72ms 22ms 7.2s
article (body) 19ms 23ms 45ms 96ms 283ms 5.2s
article (string inside object) 20ms 22ms 30ms 56ms 13ms 6.2s
article (string inside array) 20ms 26ms 31ms 64ms 0ms 6.4s
recipe (name) 9ms 12ms 17ms 78ms 28ms 5.0s
recipe (description) 18ms 21ms 24ms 52ms 0ms 4.4s
recipe (instructions) 5ms 8ms 9ms 20ms 0ms 2.9s
singleString (stringField) 5ms 8ms 10ms 44ms 0ms 4.4s
synthetic (title) 17ms 21ms 31ms 88ms 571ms 8.3s
synthetic (string inside object) 18ms 22ms 37ms 92ms 470ms 8.1s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 22ms 25ms 32ms 87ms 21ms 7.2s
article (body) 19ms 24ms 45ms 78ms 248ms 5.4s
article (string inside object) 21ms 25ms 51ms 73ms 49ms 6.4s
article (string inside array) 22ms 27ms 36ms 58ms 35ms 6.6s
recipe (name) 10ms 12ms 16ms 38ms 0ms 5.1s
recipe (description) 18ms 21ms 23ms 36ms 0ms 4.3s
recipe (instructions) 5ms 9ms 10ms 17ms 0ms 3.0s
singleString (stringField) 5ms 8ms 9ms 30ms 0ms 4.3s
synthetic (title) 17ms 18ms 22ms 93ms 266ms 7.5s
synthetic (string inside object) 18ms 20ms 24ms 78ms 99ms 7.5s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 35.57% 22288 / 62653
🔵 Statements 30.21% 26910 / 89053
🔵 Functions 34.11% 4550 / 13339
🔵 Branches 23.64% 17539 / 74188
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/form/inputs/files/common/uploadTarget/uploadTarget.tsx 44.25% 46.79% 14.28% 38.46% 79, 108-125, 133-157, 171-199, 215-235, 240-248, 255, 259-266, 271-275, 293, 307, 309, 310, 323-198
packages/sanity/src/core/form/studio/uploads/resolveUploadAssetSources.ts 55.55% 27.27% 100% 52.94% 25-31, 35, 38, 42
Generated in workflow #50820 for commit 0d08b53 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

Preview this PR with pkg.pr.new

Run the Sanity CLI

npx https://pkg.pr.new/@sanity/cli@23db03f <command>

...Or upgrade project dependencies

pnpm logo Using pnpm

📦 sanity
pnpm install https://pkg.pr.new/sanity@0d08b53
📦 @sanity/vision
pnpm install https://pkg.pr.new/@sanity/vision@0d08b53
📦 Other packages…
📦 groq
pnpm install https://pkg.pr.new/groq@0d08b53
📦 @sanity/cli
pnpm install https://pkg.pr.new/@sanity/cli@0d08b53
📦 @sanity/codegen
pnpm install https://pkg.pr.new/@sanity/codegen@0d08b53
📦 @sanity/diff
pnpm install https://pkg.pr.new/@sanity/diff@0d08b53
📦 @sanity/mutator
pnpm install https://pkg.pr.new/@sanity/mutator@0d08b53
📦 @sanity/schema
pnpm install https://pkg.pr.new/@sanity/schema@0d08b53
📦 @sanity/types
pnpm install https://pkg.pr.new/@sanity/types@0d08b53
📦 @sanity/util
pnpm install https://pkg.pr.new/@sanity/util@0d08b53

npm logo Using npm

📦 sanity
npm install https://pkg.pr.new/sanity@0d08b53
📦 @sanity/vision
npm install https://pkg.pr.new/@sanity/vision@0d08b53
📦 Other packages…
📦 groq
npm install https://pkg.pr.new/groq@0d08b53
📦 @sanity/cli
npm install https://pkg.pr.new/@sanity/cli@0d08b53
📦 @sanity/codegen
npm install https://pkg.pr.new/@sanity/codegen@0d08b53
📦 @sanity/diff
npm install https://pkg.pr.new/@sanity/diff@0d08b53
📦 @sanity/mutator
npm install https://pkg.pr.new/@sanity/mutator@0d08b53
📦 @sanity/schema
npm install https://pkg.pr.new/@sanity/schema@0d08b53
📦 @sanity/types
npm install https://pkg.pr.new/@sanity/types@0d08b53
📦 @sanity/util
npm install https://pkg.pr.new/@sanity/util@0d08b53

View Commit (0d08b53)

…ndant uploader resolution and enhancing dependency arrays
Copy link
Contributor

@RitaDias RitaDias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing jumps out at me as something to block it and it feels like a good thing to get out!
A quick question: is there a way of writing a test for making sure the fallback is actually working as expected?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants