Skip to content

Web: keep a picked file on the document and slide that asked for it - #479

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:cursor/web-file-target-414-49c9
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:cursor/web-file-target-414-49c9

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Summary

The browser file picker queued only a file name and its bytes. When the read finished, DeckCraft guessed the command from the name and ran it on whichever document and slide were active. Switching slides or presentations while a file was being read, or having two picks finish out of order, could insert a picture, sound, video or outline into the wrong place.

A pick or a drop now records the document, the slide (or master/layout), the operation that was requested, and a cancellation id. The file is applied to that target when it arrives. If the presentation or slide is gone, or the picker was dismissed, the file is dropped instead of landing in whatever is open.

Test plan

  • cargo test -p deckcraft-ui-egui --lib inbox_tests covers a picture and an audio clip finishing in reverse order after a slide and document change, an outline staying on the document that opened it, a video request that does not insert a PNG as a picture, a deleted slide, a closed presentation, a dismissed picker, and a drop
  • cargo clippy -p deckcraft-ui-egui --all-targets -- -D warnings
  • cargo fmt --all -- --check, cargo xtask assets, cargo xtask layers
  • cargo check -p deckcraft-web --target wasm32-unknown-unknown and cargo check -p deckcraft-ui-egui --target wasm32-unknown-unknown
  • In the browser, Insert → Picture, change slide while the file is read, and confirm the picture is on the slide that asked for it

Closes #414

The browser file picker only queued a name and bytes. When the read
finished, DeckCraft guessed the command and ran it on whichever
document and slide were active, so a picture, sound or outline could
land in the wrong place, and a later pick could finish first.

The request now keeps the document, the slide or master, the operation
and a cancellation id. A completion applies there, or is dropped when
that target is gone or the picker was dismissed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 5fbdb6c into storytold:main Oct 14, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
…aster views (#479)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
… on land-r5 (#644 #652 #655 #702 #571 #539 #674 #648 #697 #479 #369 #368)

# Conflicts:
#	crates/ui-egui/src/canvas.rs
#	crates/ui-egui/src/ribbon.rs
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @NikitkaRa! It has landed on main and will ship in the next DeckCraft release.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

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.

[Audit] Browser file picker completion inserts into the active document instead of the original target

3 participants