osjs-client icon indicating copy to clipboard operation
osjs-client copied to clipboard

Desktop icons

Open andersevenrud opened this issue 6 years ago • 28 comments

Add back the desktop iconview.

  • [x] Add configuration option
  • [x] Create GUI component
  • [x] Implement into Desktop
  • [x] Set up DnD
  • [x] VFS Integration
  • [x] Add configuration option to https://github.com/os-js/osjs-settings-application
  • [x] Figure out DnD bug in File Manager app (possibly GUI component)
  • [x] Shortcut support (including virtual paths)
  • [x] Root contextmenu
  • [ ] Gost droppable (see #74)
  • [ ] Add support for moving instead of copy from contextmenu
  • [x] Add back color invertion from v2 (where backgrounud color would set the mask of selected entry)
  • [x] Enable desktop iconview by default
  • [x] Add VFS watch event trigger (client only at this moment due to no default enable in server)
  • [ ] Grid support

Ref:

  • https://github.com/os-js/osjs-client/pull/73
  • https://github.com/os-js/osjs-client/pull/74

andersevenrud avatar Jan 20 '19 21:01 andersevenrud

@josephjeno This is now almost done. I'm probably getting it out this weekend :)

OS js

andersevenrud avatar May 16 '19 18:05 andersevenrud

Ah it looks great!

josephjeno avatar May 16 '19 18:05 josephjeno

@josephjeno I've included this in the latest releases. I haven't enabled it by default still (from commit log):

Even though added, it's still disabled by default because there's no Settings application integration yet. Hence no minor bump.

Except for that, there's a few more things I need to implement:

  • Directory metadata support (for shortcuts and links to virtual entries)
  • CSS for IE
  • Context menu entry that allows to "open using applicationX" (like in latest filemanager)
  • More testing :D

And a bug I've found:

  • Drag and drop does not work for certain entries in the filemanager app (seems to be input event related)

But, you can give it a go if you want. Just set the iconview enabled setting to true in your client configuration (NB: if you already have stored settings on your user you might need to clear it, or run OSjs.make('osjs/settings').set('osjs/desktop', 'iconview.enabled', true).save() in your console and refresh).

And if you do let me know if there's any trouble :smile:

andersevenrud avatar Jun 14 '19 19:06 andersevenrud

Oh, and if you want to customize the directory, there's a setting for that as well: https://github.com/os-js/osjs-client/commit/d933b8e71e3bd25290c6623bb34e7c17b03a98ec#diff-9d9a6cd82f41984872a66a3ab0d440c4

andersevenrud avatar Jun 14 '19 19:06 andersevenrud

@andersevenrud this is looking great, thanks very much! I know @valp124 used desktop icons in v2 avidly and will be looking forward to this.

josephjeno avatar Jun 17 '19 15:06 josephjeno

Our two main use cases are:

  1. shortcuts to applications on the desktop (currently using menu tray for this, desktop would be better as users could drag their own shortcuts)
  2. saving/dragging files to the desktop (which would open in their respective app)

In the latest release I am able to drag both applications and files to the desktop, however nothing happens when I click them, with the exception of .txt files which do open in Textpad. I encountered the filemanager bug you mentioned, which seems to affect the top 3 entries until one of the navigation controls (back, forward, home) are pressed, at which point the top 6 entries are affected. Let me know if there is anything I can do on my end to assist, including testing, etc!

josephjeno avatar Jun 17 '19 16:06 josephjeno

In V2, double-clicking on a file shortcut on the desktop would prompt the user to choose an app to open this file, and then this choice would be remembered.

valp124 avatar Jun 17 '19 16:06 valp124

In V2, double-clicking on a file shortcut on the desktop would prompt the user to choose an app to open this file, and then this choice would be remembered.

I believe I forgot to put in the application chooser option here. I'll fix that :)

andersevenrud avatar Jun 17 '19 16:06 andersevenrud

@josephjeno

, which seems to affect the top 3 entries until one of the navigation controls (back, forward, home) are pressed, at which point the top 6 entries are affected.

This was a great pointer! I now know what the problem is: When the list updates the create() callback is not called because the rows did not have a key. Fixing this now :)

andersevenrud avatar Jun 17 '19 16:06 andersevenrud

@josephjeno New @osjs/filemanager-application out now that should resolve this.

@valp124 New @osjs/client out now that sets the option so it always asks for which app to open in.

shortcuts to applications on the desktop

This comes in the next update :)

andersevenrud avatar Jun 17 '19 16:06 andersevenrud

@valp124 An edit to my last comment. I misunderstood slightly.... it currently won't "remember" the selected application when launched from the desktop because I added this option. I think I'll do the same as in filemanager where there's a context menu to manually select what app to use (in case a default one was already set).

andersevenrud avatar Jun 17 '19 16:06 andersevenrud

I think I'll do the same as in filemanager

Update published.

andersevenrud avatar Jun 17 '19 17:06 andersevenrud

@josephjeno I've published a new branch called feature/desktop-iconview-shortcuts that now implements the shortcuts we discussed on Gitter.

Full changelog:

  • Holding Shift when dropping a VFS file will bring up context menu so you can chose between copy and create shortcut
  • Bringing up the context menu selects the entry
  • The context menu now changes the label of "delete" based on context
  • Always ensure that the .desktop directory exists when adding an entry
  • Always hide hidden files by default on desktop
  • Add shortcut symbol based on context

What's left:

  • Adding localization
  • Support application shortcuts

So, not much left to be done here before I can release a new update :blush: However, it's getting a bit late over here, so I'll have to resume this tomorrow.

OS js

I'd like to hear your feedback if the drop action should always create a shortcut instead of a hard copy, and invert the behavior :thinking:

andersevenrud avatar Sep 11 '19 20:09 andersevenrud

I actually got the two last points done there and opened up this PR: https://github.com/os-js/osjs-client/pull/73

I'll just have to do a bit of testing, then publish this tomorrow :)

andersevenrud avatar Sep 11 '19 20:09 andersevenrud

Wow that was fast! Definitely prefer for shortcut to be the default action! We actually thought that it was creating shortcuts, I think because the original file remained, and only noticed it was copying after modifying the desktop files and realizing the originals weren't updated. Maybe the copy could be a move instead?

josephjeno avatar Sep 11 '19 20:09 josephjeno

Alright. I'll make shortcuts as default then add move and copy as optional actions in the contextmenu if shift was pressed :)

andersevenrud avatar Sep 11 '19 20:09 andersevenrud

Yeah bitch! Who's awesome :)

Edited by Anders: removed somewhat sensitive information

valp124 avatar Sep 11 '19 20:09 valp124

@josephjeno I've now published @osjs/client 3.1.7 that brings in the following changes: https://github.com/os-js/osjs-client/blob/master/CHANGELOG.md#317

andersevenrud avatar Sep 12 '19 18:09 andersevenrud

@andersevenrud dude thanks so much

josephjeno avatar Sep 12 '19 18:09 josephjeno

No probs! :)

andersevenrud avatar Sep 12 '19 18:09 andersevenrud

The Settings (@osjs/settings-application) application now also has a new tab for the desktop iconview toggling.

andersevenrud avatar Sep 12 '19 21:09 andersevenrud

Pinging @Maho91 and @plungedtoilet because you asked for things related to desktop icons.

andersevenrud avatar Sep 12 '19 21:09 andersevenrud

Hi!

One question: Is possible to move desktop icons to any position?

Thanks in advance. Great work!

weeelfi avatar Sep 29 '19 22:09 weeelfi

Hey @weeelfi. Currently that's not possible, but I actually worked on a prototype that was grid-based a while back. It's possible that I could adopt that code and add an option :thinking:

andersevenrud avatar Sep 29 '19 22:09 andersevenrud

I thought that was possible with draggable option, and store X and Y coords in shortcuts.json when release the mouse click.

But you are the master ^^

weeelfi avatar Sep 29 '19 22:09 weeelfi

That was basically how the prototype I made worked. All the icons was in a pre-set grid and you could set the (x,y) manually, and whenever you dragged a new one it it would occupy the first free spot. The only thing I didn't complete (at least from what I can remember) is doing automatic re-arrangement on resize.

I'll have to dig it out and get back to you :)

andersevenrud avatar Sep 29 '19 22:09 andersevenrud

Good to hear. I will stay tuned!

Os.js is a great work, thanks to you!

weeelfi avatar Oct 01 '19 13:10 weeelfi

@weeelfi I found the prototypes that I worked on and started on the implementation. You can look at the progress here: https://github.com/os-js/osjs-client/pull/74 :)

andersevenrud avatar Oct 11 '19 21:10 andersevenrud