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

Remember last session/canvas #67

Closed
Yagich opened this issue Oct 4, 2021 · 6 comments · Fixed by #78
Closed

Remember last session/canvas #67

Yagich opened this issue Oct 4, 2021 · 6 comments · Fixed by #78
Labels
enhancement New feature or request

Comments

@Yagich
Copy link
Contributor

Yagich commented Oct 4, 2021

Hey! First off, love the tool. I had switched to linux as my daily driver and I've been missing an app like this that looks nice and feels good to use. Coming from Windows, there is a program called Milton which is similar in a few ways. That said...
Feature/enhancement description:
I think it would be useful for Lorien to remember the last session(s) the user had open. This removes the need for a "save" nag screen and, in my opinion, helps the simplicity and non-intrusiveness aspect of Lorien.

I can think of two ways to implement this off the top of my head:

  1. Have a default session/file that is saved in the user:// directory. This could be most useful for people like me who like to sketch on a single canvas and don't use different files much.
  2. Save every unsaved session into user:// or the custom directory set in the settings on quit, perhaps with a setting to turn it on or off. This would eliminate the "save on quit" dialog entirely, potentially at the cost of higher load if the user has a number of canvases open.

I was going to fork this and implement it in the near future anyway and wondered if this is something you'd like to have in the base repo. Let me know what you think!

@Yagich Yagich added the enhancement New feature or request label Oct 4, 2021
@mbrlabs
Copy link
Owner

mbrlabs commented Oct 5, 2021

Hello, glad you find it useful! :)

I am familiar with Milton and how it handles saving files and to be honest i don't really like it. I want to be in control when to save a file and where. That being said, i do want a feature that opens up all files of the previous session. Like if you have 3 files open and then close Lorien. Then the next time you open it these 3 files should load automatically.

So basically: yes to restoring sessions/previously opened files, but no to mandatory auto-saving without asking the user where the files should be saved to. This could be implemented via a simple list of strings (saved to user://session.cfg alongside user://settings.cfg) pointing to the absolute paths of the files. If you close Lorien all open files (that have already been saved) will be referenced in there and when you open Lorien it first reads this files and the loads all .lorien files it points to.

"Normal" auto-save can still be implemented at a later stage (should be possibile to enable/disable in settings though).

@Yagich
Copy link
Contributor Author

Yagich commented Oct 5, 2021

Thanks for the feedback! To clarify, this is how I would envision the flow:

  1. The user has open files they have not saved (either at all or made changes to existing files), and they close the window.
  2. Lorien saves the files that have a path (files that exist on disk already) with the newer version.
  3. Lorien saves the dirty files that haven't been saved before to either the default project folder (most likely within a subfolder to prevent confusion) or to user:// (again, to a subfolder)
  4. On reopening Lorien, all of these open back, and the files that haven't been saved before get marked as dirty to let the user know they haven't saved them (depending on the implementation, this may break backwards compatibility, eg. if the dirty bit is set in the project file)

If I understand you correctly, you are against the third point and the second half of the fourth?

@mbrlabs
Copy link
Owner

mbrlabs commented Oct 5, 2021

Yes exactly. Basically everything would stay the same except open files would be loaded automatically if Lorien is reopened. So i guess i'm also against point 2 for now as that is a different feature (see below)

Once that is implemented we can add auto-save (disabled by default) for files with a path (already on disk) in a seperate PR:

  • Based on a timed interval (like every 5 min)
  • When the user exits Lorien

That would cover most of your features except the saving of not explicitly saved files to a project folder or somthing...i don't really like that.

@mbrlabs
Copy link
Owner

mbrlabs commented Oct 5, 2021

Also if you want to work on this: i plan to release a new version this weekend which would include the new color palette feature i'm currently working on. Would be cool if this could make it in as well :)

But don't worry if you need more time, there is always a next version.

@Yagich
Copy link
Contributor Author

Yagich commented Oct 5, 2021

Yeah I don't think I can make it in time haha. I am still getting familiar to the codebase, plus I don't have much free time lately. But who knows, we'll see how it goes :)

@mbrlabs
Copy link
Owner

mbrlabs commented Oct 5, 2021

No worries. Let me know if you have more questions!

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants