Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload other files then images to whiteboards #278

Merged
merged 11 commits into from
Jan 9, 2025

Conversation

grnd-alt
Copy link
Member

@grnd-alt grnd-alt commented Nov 22, 2024

Proof of concept to show how we could intercept the excalidraw drag'n'drop handling to support more filetypes.

Current state:
Drag and drop from explorer into whiteboard.
image file supported by excalidraw -> normal image render
other filetype -> filename + icon

on click on other filetypes -> sidebar opened with download button

image

⚠️ TODO:

  • moving the element should not result in file download
  • proper design for element in whiteboard (respecting darkmode)
  • use file icons depending on type
  • max file size

handled in follow ups

  • double check files being removed after longer time
  • copy paste into whiteboard
  • Add button to upload a file

@grnd-alt grnd-alt self-assigned this Nov 22, 2024
@grnd-alt grnd-alt requested a review from juliusknorr November 22, 2024 16:41
@grnd-alt grnd-alt force-pushed the feat/uploading-files-to-nextcloud branch from e05b3b8 to e26b418 Compare November 22, 2024 16:45
@grnd-alt grnd-alt force-pushed the feat/uploading-files-to-nextcloud branch 2 times, most recently from b7c29c8 to 2aea305 Compare December 3, 2024 12:54
@grnd-alt
Copy link
Member Author

grnd-alt commented Dec 3, 2024

(@nextcloud/designers do you have input for the file element?, we can use any excalidraw element to display the file, but no html, maybe you can create a design in excalidraw?)

@marcoambrosini
Copy link
Member

@grnd-alt what is needed here exactly? Could you give a bit more context?

@marcoambrosini
Copy link
Member

marcoambrosini commented Dec 4, 2024

Update after call with @grnd-alt

  • we have to use excalidraw limited range of styles and colors
  • we can use our own svg icons for the different file types
  • we should invert colors of icons/text/borders with dark theme

Here's a quick mockup:
Screenshot 2024-12-04 at 11 04 26

Comment on lines 58 to 64
if (Date.now() - lastPointerDown > 200) {
lastPointerDown = Date.now()
return
} else {
lastPointerDown = Date.now()
}
this.downloadFile(clickedElement.customData.meta)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if double click is what we should do here, was rather confusing to me in the first run. We talked about a popup to download the file, maybe that is something to reconsider when we cannot easily have a nice button click behaviour.

Could also be a small bar at the bottom maybe if the "file node" is selected similar to https://m1.material.io/components/snackbars-toasts.html# with a dedicated Download button?

Copy link
Member

Choose a reason for hiding this comment

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

I think that the popup is the best option for now. The snack bar is great for mobile devices but I'm worried that it wouldn't work well on larger displays.

Copy link
Member Author

Choose a reason for hiding this comment

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

@marcoambrosini
I've now implemented it using the toast messages we already have in nextcloud when you click on them the file is downloaded... I don't think it's the best solution, but we can't draw entirely over the canvas with a popup or something because the file-elements are not movable anymore if something is in front of them. Do you think we should design a small new popup or stick with the nextcloud toast message as in the screenshot?

image

src/files/files.ts Outdated Show resolved Hide resolved
src/files/files.ts Outdated Show resolved Hide resolved
@grnd-alt grnd-alt force-pushed the feat/uploading-files-to-nextcloud branch from e2be25c to 0a57c45 Compare January 8, 2025 09:54
@grnd-alt grnd-alt marked this pull request as ready for review January 8, 2025 10:13
@grnd-alt grnd-alt requested a review from hweihwang as a code owner January 8, 2025 10:13
@grnd-alt grnd-alt changed the title PoC: uploading files to nextcloud uploading files to nextcloud Jan 8, 2025
@juliusknorr
Copy link
Member

Added as a follow up to the list in the first post:

  • Add button to upload a file

@juliusknorr juliusknorr force-pushed the feat/uploading-files-to-nextcloud branch from 692a959 to acd94f2 Compare January 9, 2025 13:27
@juliusknorr juliusknorr added the enhancement New feature or request label Jan 9, 2025
@juliusknorr juliusknorr changed the title uploading files to nextcloud Upload other files then images to whiteboards Jan 9, 2025
@juliusknorr juliusknorr merged commit 3ace5f2 into main Jan 9, 2025
27 checks passed
@juliusknorr juliusknorr deleted the feat/uploading-files-to-nextcloud branch January 9, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ☑️ Done
Development

Successfully merging this pull request may close these issues.

3 participants