Skip to content

Use insertAttachmentPreview instead of insertAttachment on pasting or… - #8916

Closed
hiobjan wants to merge 2 commits into
nextcloud:mainfrom
Dataport:issue/8745-drag-drop-preview
Closed

hiobjan wants to merge 2 commits into
nextcloud:mainfrom
Dataport:issue/8745-drag-drop-preview

Conversation

@hiobjan

@hiobjan hiobjan commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

📝 Summary

Problem / Usecase
When adding a file to a text via drag and drop, no preview window is generated. It also isn't possible to optionally enable the preview.

Solution
Use the same behaviour/code as by inserting via smartpicker. I didnt change the behaviour of images, because the attachment-view is better than the attachment-preview. #8774

🖼️ Screenshots

🏚️ Before
image
🏡 After
image

🚧 TODO

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

… droping non-image-files

Signed-off-by: Janina Hiob <user-y5tppt@dev.dataport.de>
Assisted-by: GPT-5.3-Codex
@hiobjan
hiobjan force-pushed the issue/8745-drag-drop-preview branch from 39c0c36 to dcb9afa Compare July 27, 2026 10:26
@mejo-

mejo- commented Aug 3, 2026

Copy link
Copy Markdown
Member

Thanks a lot for the contribution @hiobjan. I wholehearted agree that it's confusing to have different representations of attachments in Text and that it's not possible to toggle between them.

I see that your PR improves the UX when a user drags and drops a file into the editor and expects a file preview. On the other hand, this means that inserting attachments via drag and drop behaves differently than inserting attachments via menubar, which is something we should avoid in my opinion.

I'd prefer to first discuss this topic in and issue and decide on a way forward, ideally together with the design team. I opened #8948 and would be curious about your thoughts there.

I'll therefore close this PR for now.

@mejo- mejo- closed this Aug 3, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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.

Paste PDF files with preview by default + add option to toggle mode

2 participants