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

PoC: uploading files to nextcloud #278

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

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
  • copy paste into whiteboard
  • proper design for element in whiteboard (respecting darkmode)
  • use file icons depending on type
  • max file size
  • double check files being removed after longer time

@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 from c6db63d to b7c29c8 Compare December 3, 2024 12:43
@grnd-alt grnd-alt force-pushed the feat/uploading-files-to-nextcloud branch 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

add designed download button

Signed-off-by: grnd-alt <[email protected]>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

3 participants