4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.82k stars 848 forks source link

Automatically re-open the last opened project #1356

Closed blurymind closed 3 years ago

blurymind commented 4 years ago

So I recently added a feature like this to my svete+electron app and this is something that really makes it nice to use it imo. Basically the idea is: If you are using electron and you closed the app without closing the project before that, next time you start it, electron remembers your last opened project and utomatically loads it - so you are straight in it without the need to navigate to its folder.

If you close the project and then close the app, when you start it, the next time you start it - you are offered the standard dialog to create/open a project. This also happens if the autoload fails to load the project because it was moved (path changed)

This is kind of something we take for granted in most programming Ides and some other game engines. With vscode or gitkracken for example, when you open it, you are straight back in your project - you dont have to navigate to it.

Additionally nice to have would be a file> recent menu where one can reopen one of the 5 last edited projects

Bouh commented 4 years ago

Additionally nice to have would be a file> recent menu where one can reopen one of the 5 last edited projects

I vote for it and the rest too!

blurymind commented 4 years ago

That would make extension development much nicer too, since we will no longer have to navigate to the test project over and over on each refresh, GD will just load it for you

4ian commented 4 years ago

I would be keen to have it in this order:

  1. A file > recent menu. Note that this menu can also be displayed when we click on an arrow that is on the right of the "Open a project" button in the Start page (it's not supported by Material-UI as a "Split button": https://material-ui.com/components/buttons/#split-button).
  2. Then if it's something that is interesting, we can add a preference "If the editor is closed while a project is opened, automatically re-open it at the next startup". Alternatively a button in the start page to quickly re-open the last opened project (but a preference might be better)

Note that we can do this without being electron specific :) The list of "recent" projects can be saved in preferences - which are saved in localstorage in the web-app (precisely, this will be a list of FileMetadata - it's "just" an object containing the path and in the future maybe additional information).

When we click on the button to open a project, we'll re-open the file with the "StorageProvider" that was used to open it the first time. This means that we will be able to store in this list of recent projects a file opened from Google Drive (or later from Dropbox, OneDrive, etc...) or a local file.

How does that work with Electron? => The storage provider for local files in Electron is this one: https://github.com/4ian/GDevelop/blob/master/newIDE/app/src/ProjectsStorage/LocalFileStorageProvider/index.js

Two last things:

https://github.com/4ian/GDevelop/blob/ee1e67a3677447d583c3bbbf0aece55cc4dd8b55/newIDE/app/src/MainFrame/index.js#L145

blurymind commented 4 years ago

added card here https://trello.com/c/EUCMh9Po/394-add-option-to-autoload-previously-opened-project-when-starting-the-ide-similar-to-vscodes-default-behavior

@4ian I am mostly interested in having the option to make the editor automatically load with the project for me when reloaded - requiring zero clicks, zero steps. I would like to add that. That would massively improve dev iteration. it is currently a pain in the neck for making extensions.

Imagine a world where we would not need to navigate to the same project over and over again every time we make a change we would like to test.. yes, its a much nicer world :smile: I think @Bouh agrees too.

Thats probably why it is the default behaviour of most programming IDEs (not just vscode)

My suggestion is not only to have the option, but also to turn it on by default.

The recent files menu is nice too, but is secondary in importance for me. The problem I want to solve is not only for making it easier to load recent projects. The main problem is that of steps the dev must undertake between iteration when working on the ide or an extension. I want those steps gone. No clicking on buttons or menus. Just reload the ide with the project it had loaded before. I press ctrl+r, it reloads and I'm back in.

It might sound like I am being picky and complaining about a minor thing here, but if you stop and think about how many times we reload and do this navigating back to the project when working on anything - you will see how ridiculous it is that we still need to do that by default. The ide can be doing that for us. This can potentially save us so much time

4ian commented 4 years ago

So I think in this case what we need is something a bit more evolved: re-open the project that was opened and the tabs that were opened as well as set active the proper tab that was last active at the time the software was closed?

On Sun, 12 Jan 2020, 16:25 Todor Imreorov, notifications@github.com wrote:

added card here

https://trello.com/c/EUCMh9Po/394-add-option-to-autoload-previously-opened-project-when-starting-the-ide-similar-to-vscodes-default-behavior

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/4ian/GDevelop/issues/1356?email_source=notifications&email_token=AAJYRAQYP72QMOJUFD7BJYLQ5M76LA5CNFSM4KEY2ZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIW6A4I#issuecomment-573431921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYRAXC7Q7KNEBEALF6E6DQ5M76LANCNFSM4KEY2ZUA .

blurymind commented 4 years ago

So I think in this case what we need is something a bit more evolved: re-open the project that was opened and the tabs that were opened as well as set active the proper tab that was last active at the time the software was closed?

Yes indeed if it also remembers the ui's state that would be a huge improvement too 👍 We might already have an issue raised for the tab state somewhere.