Skip to content

fix(upload): answer a refused file drop, and leave an open Add modal alone - #3347

Merged
vpetersson merged 1 commit into
masterfrom
agent/arm64-claude/drop-feedback-followup
Sep 22, 2026
Merged

vpetersson merged 1 commit into
masterfrom
agent/arm64-claude/drop-feedback-followup

Conversation

@vpetersson-bot

Copy link
Copy Markdown
Contributor

What

Two review findings against the page-wide file drop landed in PR 3334, both in what the page does once it has already claimed the drag. That PR squash-merged before the findings were written up, so they come as a follow-up.

The refused drop was silent

Every dragover on the page is cancelled — it has to be, since an uncancelled one lets the browser navigate the tab to the dropped file and take the page with it. So the cursor spends the whole drag telling the operator this is a drop target.

When an edit form, a preview or a delete prompt owns the screen, acceptsPageDrop() then refused the release without a word: the file appeared to evaporate. It now surfaces an info toast naming the way out ("Close this dialog first, then drop your file to upload it."), the same way the mid-drag overlay already declined to promise an upload it would not start.

A drop reset the Add modal under it

Routing every drop through openAdd() gave it the same reset every other way in gets, which is right when the drop is what opens the modal — the last asset's URL has no business still being in the box. It is wrong when the modal is already up, because that box is where the operator is mid-sentence: a dropped file wiped what they had typed, and reset the Apps pane's config form with it.

openAdd() now runs only on the opens that are actually opens. The drop still moves them to the upload pane, and what they typed is intact when they switch back.

That pane move needed feedback it did not have

The drop overlay stood down for any open modal, so a drag over the "From URL" form — which does take the file — showed nothing at all: the dashed dropzone lives on the upload pane, which is not on screen there. It now shows in a --layered form, the card without a second veil, since the modal already dimmed the page. It still stands down on the upload pane itself, where the dropzone is lit and a second signal would only compete with it.

Testing

Everything below ran locally, integration suite included — the Docker test stack that was unavailable during the original PR builds fine now.

  • bun test — 164 pass. Four new cases: the refusal toast on each of the five blocking overlays, a drop into an open Add modal preserving addUri, and the other half of that rule (a drop that opens the modal still resets the pane).
  • pytest -n auto -m "not integration" — 2208 pass.
  • pytest -m integration --reuse-db — 68 pass, 2 skipped. Two new Playwright cases: a file dropped while the delete prompt is open raises the toast and starts no upload, and a drag over the Add modal's URL pane shows the layered overlay with its own veil suppressed.
  • ruff check ., ruff format --check ., mypy . clean.

Still open, unchanged

The preview iframe's residual drop gap, recorded in .preview-media--frame in _styles.scss. A fast enough flick lands its first sampled position inside the frame and skips the parent document; the frame is sandboxed without allow-top-navigation, so the page behind is untouched and closing the preview restores it. Closing that gap costs either preview interactivity or a click-to-interact shim, both of which cost more than the glitch does.

🤖 Generated with Claude Code

Two gaps from review, both in what the page-wide drop does once it has
claimed the drag.

Every dragover on the page is cancelled — it has to be, since an
uncancelled one lets the browser navigate the tab to the dropped file.
So the cursor spends the whole drag telling the operator this is a drop
target. When an edit form, a preview or a delete prompt owns the
screen, acceptsPageDrop() then refused the release in silence: the file
appeared to evaporate. It now says which way out of it, the same way
the mid-batch overlay already did rather than promising an upload it
would not start.

The other half is the Add modal. Routing every drop through openAdd()
gave it the same reset as every other way in, which is right when the
drop is what opens it — the last asset's URL has no business still
being in the box. It is wrong when the modal is already up, because
that box is where the operator is mid-sentence. Reset only on the
opens that are actually opens; the drop still moves them to the upload
pane, and what they typed is there when they come back.

That pane move needed feedback it did not have. The overlay stood down
for any open modal, so a drag over the "From URL" form — which does
take the file — showed nothing at all, the dashed dropzone being on a
pane that is not on screen. It now shows there in a --layered form:
the card without a second veil, since the modal already dimmed the
page. It still stands down on the upload pane, where the dropzone is
lit and a second signal would only compete with it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
Copilot AI lite review requested due to automatic review settings September 22, 2026 08:03
@vpetersson-bot
vpetersson-bot requested a review from a team as a code owner September 22, 2026 08:03
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vpetersson
vpetersson merged commit 83960d8 into master Sep 22, 2026
10 of 12 checks passed
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.

3 participants