chocolat-public
chocolat-public copied to clipboard
Feature Request: restore open projects/files on launch
I'd love an option to restore open projects & files on launch (i.e. when the app is launched, re-open all files/windows/projects that were open when the app last closed).
It may be a side-effect of me being on Snow Leopard; I'm not sure if this exists on Lion with Lion's fancy app restore stuff.
Apparently it was on at some point in the Alpha and removed in A36 due to Issue 42. This should at least have an option in the preference pane. I tried to reenable it using the defaults write com.chocolatapp.Chocolat NSQuitAlwaysKeepsWindows -bool true
command but it still doesn't remember what Windows I have open.
This should be revisited.
This would be very very useful. Seems every time I open I have to close the blank window, open from recents and then size/move the new window.
Not on launch. I hate that shit. But definitely when you open a project.
So what is the scenario here? I have a couple of projects open and I quit the app. I open the app again. What is shown? Right now it is a blank document. I'd like it to open all the windows I had open when I quit the app (it sucks for apps like Preview.app but in this case it is actually really useful for me).
What do you mean by opening a project. I guess it would be nice to open the project and at least have it remember what files were open previously. Is that what you meant?
+1. This is a very handy feature and should be standard for apps like this.
This is the one thing stopping me from using Chocolat full time.
+1
I generally "hate that shit" too, and have disabled it system-wide in System Preferences > General > Restore windows when quitting and re-opening apps
. (It pissed me off to no end with Preview.app.)
However, for a development environment, I realize I feel differently. I generally have 4-5 tabs open for different aspects of my project (one for current task, one for another task on pause, one for constants, one for shared libraries, etc.), each with 3-5 files open. Which is actually one of the main reasons I use Chocolat -- I love this tabs+files interface.
I now realize that every time I quit and re-open Chocolat (because I need to restart my computer, or whatever), I have to re-create this entire space, opening each directory in turn, and then opening the files. It takes a couple minutes. And since Chocolat doesn't really have the concept of "workspaces" like, IIRC, Visual Studio has (I haven't used it in many years), there's no way for me to save my layout and re-open it later.
I'm not sure what the solution is -- I definitely don't want to see Chocolat create its own workspace file format or anything. But maybe much like Google Chrome asks you, "do you want to restore your tabs from your last session?", Chocolat could have a similar question.
Thanks!
or honour the:
defaults write com.chocolatapp.Chocolat NSQuitAlwaysKeepsWindows -bool true
setting, then users can just pick what behaviour they want
+1 This should be a standard feature. Unlike Preview, one would not realistically have tens or hundreds of separate Chocolat windows open simultaneously.
A blank page on start is useless.
+1 just for fileability's "But definitely when you open a project."
+1, it would help me get coding more quickly
+1 I'd like to see when you open a project for sure, but at least an option for when you open the app.
Status report: I've been approaching this issue from both ends, but they haven't yet met in the middle.
Firstly, as of 2.0.3 the old file state restoration code is gone! This is great because it was exceptionally buggy. It's been replaced with a totally rewritten one, which hopefully improves things a lot. It doesn't capture everything (like folds) but it's pretty good.
I forget exactly when I added it, but Chocolat also now has a database for saving state about projects. Right now that state is limited to the location of the symbol index database, but it's very easy to expand add more data.
And Chocolat already has project state restoration – sort of. If you do cmd-ctrl-T, you'll get a "cloned" tab which goes through the motions of state restoration.
So the last piece of the puzzle is to figure out how to serialise the three bits of project state: active files, file list expansion and selection in the project bar.
Active files turns out to be the hardest bit. Problem is, if the user has 10 active files but only 2 selected, you don't want to open them all when they open the project! It would be a noticeable lag. We need some kind of lazy loading mechanism, and this requires a pretty substantial change in how active files work.
Also I guess if we're serialising paths, we want to do what Xcode does and make them relative to the project root, unless it's not under the project root. Then if the project is moved, everything should then work (alternative is to use bookmarks, but I'm convinced this will lead to strange edge cases).
One last problem, there's a dozen places in Chocolat where we open a window, but I think only a few of them will be eligible for restoration. e.g. when you open a blank workspace, or open a file in a new window, you don't want everything to be "conveniently" restored! But you do if you're doing choc .
Just reopen all the projects (and their window layout) is good enough for me. It is OK not restore active files, file list expansion and selections.
It's not OK for someone trying to switch from Sublime Text. I need at least active files re-opened. I agree about file list expansion and selections being unnecessary, though. :)
@liukun That's never going to happen, sorry. I'm 100% against opening projects on launch, but I'm happy to consider restoring state when you open a project.
When you open Chocolat, you get two things: a blank document, and a recent projects popover. There's a zen-like perfection to this, no need for silly welcome screens with "new file" buttons. Either type in the document (and save it, tada a new project), or open a recent project.
@rfelix2121 The active files are the hardest bit, might as well do the other stuff too :)
@fileability That's very unfortunate.
You agree that restoring state when you open a project makes sense -- after all, I might have 6 different files open in a particular order, and it's nice to be able to quit Chocolat and then go back to where I'd left off, right?
Well one of the most important reasons I use Chocolat is because it gives me tabs in the same window for multiple projects! In fact this, is the #1 reason I started using Chocolat, because no other editor provides that extra layer of "hierarchy". My main project has six different "sections" -- a front-end, a back-end, an admin interface, a content editor, scripting tools, and an associated webapp -- and I always want to have these six projects open, in the same order, too -- just like the files within each project.
Right now, every time I start Chocolat, I have to open each project one-by-one, individually. But the worst part is, I can't even do that from the File menu's "Open Recent Project" submenu, because using that will open each project in a new window.
So every time I start Chocolat, I have to create six new tabs, and then use the OSX file browser six different times to continually navigate up and down directories to get to the six different project directories, and open them. This takes about a full minute, and is pretty ridiculous that I have to go through this each and every time I run Chocolat -- but the rest of the editor is so nice, I do it because it's worth it.
I hope you'll consider the fact that people use Chocolat because of the tab interface, which makes Chocolat unique, and that restoring tabs/projects is exactly as important as restoring files open within projects. You don't have to force the behavior on users -- just provide a preferences option to do it automatically or not, or a "restore previous state" button when it starts up.
@mjbaldwin To be honest, the thought of tabs hadn't even crossed my mind. I don't use them, after all. It's good you're making a case for them because @locks is pushing me to give them the axe ;)
Can you give me an example of the directories you'd have in each of your six tabs? Are they completely different projects, or all subdirectories of one project.
edit: oops I can't read.
front-end, a back-end, an admin interface, a content editor, scripting tools, and an associated webapp
See, if they're all unrelated, then what Chocolat needs is better project-switching. The only advantages of having multiple unrelated projects in one window are A) less clutter and B) easier switching, both can be achieved with one-project-per-window.
If they're related, then what Chocolat needs is some kind of "views" feature to allow you to focus on a particular subdirectory of your project. That's basically what tabs are supposed to be, but the UI leaves much to be desired.
Well the directories within each of the tabs are what you'd expect -- /css, /js, /pages, and so on. Or various scripting tools, or whatnot.
The tabs are all subdirectories of the larger project, but not all at the same level. But if I had to deal with everything in the same folder-hierarchy, it would be a mess, I'd constantly be scrolling up and down, expanding and contracting folders, never able to quickly find anything, it would suck big time. And I'd just have too many files open at once in the active files area. The hierarchy is just too big.
But by being able to choose what is in a tab up top, it lets me both switch rapidly between them (which I'm doing constantly, since any new feature will generally involve a combination of 2 or 3 or 4 of these "subprojects", like the front end, the back end, and the editor software), and keep the relevant files open in each one. It's a lot easier to manage 25 open active files if there are only 5 files open in 5 tabs each. For big projects with a lot of moving parts, a single filesystem hierarchy and single list of active files just isn't enough. The tab strip is essential.
If it weren't for the project tabs + per-tab-folder-hierarchy, I would never have started using Chocolat in the first place, and I might have switched to another editor since. It was the whole reason for switching from Coda.
@fileability Thank you for the reply! You said "I'm 100% against opening projects on launch". Any reason for that?
Most mac apps remember the last opening documents when quit. For example, in Preview
, after opened 3 PDFs, ⌘Q the app. Reopen Preview
will open these 3 files again. Use ⌘W to close 2 PDFs and then ⌘Q, reopen Preview
, it will show 1 PDFs. Close this final one with ⌘W, then ⌘Q and reopen, 'Preview' will show a dialog asking for files to open. TextEdit
did the same, and even keep the Edited
state when reopen if not saved.
TextMate 2 and Sublime Text both restore all project and file state on open (Sublime even restores unsaved edits). I would not switch to an editor that didn't offer that functionality. It makes system reboots and other editor restarts almost painless.
@jheiss very informative. thank you.
@fileability I know this is an older thread now, but I'm struggling with Chocolat lacking this feature at the moment.
I've had a handful of crashes in the past few weeks when I have multiple (5+) projects open, and when I reopen Chocolat, obviously none of it is restored.
So two issues here: one, there's a bug—I've sent the crash reports in. Second, and related to this thread: even if this bug is fixed, there will inevitably be another.
When Chocolat crashes while working on a handful of projects, you're taxing the user by not reopening their projects on relaunch. Applications have bugs, which is why most development tools (browsers, editors, even newer design programs) support restoring state on crash.
I would be okay if the state of the tabs, folders, or files were lost, though that would be great to get those too.
Whether or not it fits in with the "zen" you mentioned above, this is a major feature that Chocolat lacks, compared to other development tools.
I've paid for Chocolat 2 and 3, for whatever that is worth, and love the editor in general—this is my only complaint.
@chriscdg I don't have any problems with the feature in general, I just want the user to have to perform some action besides launching the app. I mean, we could have a "Restore last state" button in the recents popover... there has to be something.
@fileability Oh cool :). I think a button in that popover is a good idea.