buddypond icon indicating copy to clipboard operation
buddypond copied to clipboard

Entire Desktop should support Drag and Drop Event and understand Desktop's active app and context

Open Marak opened this issue 3 years ago • 2 comments

A buddy should be able to drag a file anywhere onto the desktop window and be able to import that file into the desktop.

This drag and drop action should be context aware and know what the current active application is, what the current context is, and if that application supports the type of file being uploaded.

If there is no active app or context, the drag and drop should present a file preview window which shows metadata about the file and provides options to send the file to an application or perform other actions.

Examples:

Drag Drop Event - A buddy drags a png image file into the desktop app with no apps or windows open
Result - The file is opened in `App.Paint`
Drag Drop Event - A buddy drags an animated GIF file into the desktop app with no apps or windows open
Result - The file is opened in `App.GifStudio`
Drag Drop Event - A buddy drags an mp3 or wav sound file into the desktop app with no apps or windows open
Result - The file is opened in `App.SoundRecorder`
Drag Drop Event - A buddy drags an animated GIF file into the desktop app while chat window with another buddy is open and active. 
Results - Desktop is aware of context ( chatting with Buddy ) and the file is sent to the buddy via chat message. 

Marak avatar Apr 04 '22 02:04 Marak

This should be relatively easy to do.

To get current active window element:

console.log(desktop.ui.getActiveWindow())

Then that element should have data() attributes for app and context.

console.log(desktop.ui.getActiveWindow().data('app'))
console.log(desktop.ui.getActiveWindow().data('context'))

Marak avatar Apr 04 '22 02:04 Marak