Skip to content

feat(upload): support pasting clipboard files - #626

Open
JustinShetty wants to merge 6 commits into
C4illin:mainfrom
JustinShetty:feat/clipboard-file-paste
Open

JustinShetty wants to merge 6 commits into
C4illin:mainfrom
JustinShetty:feat/clipboard-file-paste

Conversation

@JustinShetty

@JustinShetty JustinShetty commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a paste event listener which infers files types for files based on their MIME type, or takes the existing name if it has one already.

image image image

Summary by cubic

Adds support for pasting files from the clipboard in the upload drop zone.

  • Ignores pastes in editable fields (inputs, textareas, selects, and contenteditable) so text pasting is unaffected.
  • Keeps the pasted file's name when it includes an extension; otherwise generates a timestamped name from its MIME type, falling back to .bin.
  • Renders file names as plain text to prevent HTML injection.
  • Updates the drop zone hint and loads the MIME mapping from WEBROOT.

Written for commit b79d914. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread public/script.js
Comment thread public/script.js Outdated
Comment thread public/script.js Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread public/script.js Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread public/mime-types.js Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread public/script.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant