-
Notifications
You must be signed in to change notification settings - Fork 627
Improve user experience when creating new projects, attempt 2 #3042
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
Conversation
I included the patch storing project files into the base directory by default because I find it to be a better default but I'm ready to give it up if others don't like it. I also made the "New Project" dialog a little wider in the last patch as it turned out that most of the paths I tried didn't fit there - again, if not liked, I can remove it. |
Actually instead of changing the default of "store project file inside the project base directory" I would prefer if the new workflow ignores this setting and always uses the project base directly and confine the existing pref to the existing workflow (perhaps we need to clarify the manual for that). Then there would be a realistic chance that I can use both workflows depending on the situation. What do you think? |
Originally I was going to agree with @kugel- but on thinking about it more the "store project file inside the project base directory" is a user preference, which is likely to be a constant for a user, no matter how they create the project (apart from weirdos like me and @kugel- who do both, of course :-) so both workflows should follow it for the default. Nothing stops us changing the directory of course, and maybe there should be a "Base Dir" pushbutton next to the project file directory to one click load it if its not the default. |
Usually I store project files outside. But there are times when this is inconvenient and browsing to the project base directory one more time is just annoys me. Since we're introducing a new workflow we don't have to attach the existing pref to that new workflow.
I wouldn't necessarily agree with that if the user has two ways to create a project, see my use case above. I wouldn't expect users to use (mostly) one of the project creation options. Instead, I would want them to use both, then additional differentiation besides spawning the file browser initially makes sense IMO. I would really prefer if we make the change according to my proposal and then watch feedback what users think. |
Which is why I suggested a button to insert that directory with one click. |
The intent of this PR is to create projects from folders with minimal effort. The project dialog should be confirmed without any changes most of the time. To achieve that, @techee changes the default for "store project file inside the project base I agree with the goal, but not necessarily with changing the default for ""store project file inside the project base Heck, I could even imagine a (sticky) checkbox or a separate button in the initial file browser to skip the project dialog altogether. |
Ok, I missed that change of default. So if the new workflow ignores that setting and defaults to putting the project in the base directory then it should all "just work" for that use-case. But then it might still be nice to have a one-click to change the project file to the user projects location (as set in |
I don't disagree. From my POV this could be a separate PR by someone who truly wants it, though. I could imagine one could add two fancy buttons inline in the GtkEntry (to fill that path with ~/Projects and project base dir, respectively) |
I don't care that much about neither of the possibilities discussed here, my thinking was basically just:
But both are just minor points for me. |
Is this going anywhere? |
On my side I'm open to anything that increases the chance of this PR getting merged in some form as I hate the current project creation process. I have no problem reverting the "Store project files in base directory by default" patch - this can be done in a separate PR. I personally would find it more consistent to respect the "Store project file inside the project base directory" also with this new project opening mode but I'm ready to give it up if more people think it should always be placed in the base directory. |
I don't have made my mind up on the "Store project file inside the project base directory" setting but I think I can review and test this in the following days. The basic idea of this PR reads very good! |
What's about my idea? #3042 (comment) |
Tested and works well. About the "Store project file inside the project base directory" default: But I don't see how the new project creation dialog here affects the meaning of this setting and why it should not be used. Or I don't understand @kugel-'s suggestion in #3042 (comment). |
Another idea to even further improve the UX: what if we use the base directory of the currently document for the folder choose dialog? Disclaimer: I still don't use projects much, basically I just have one big project to make use of the ProjectOrganizer plugin and its tag management features. So I'm not really part of the target audience of this PR :). |
One more idea to make project creation a little easier: But could be also in its own PR. |
AFAICT for Eclipse the "project" is mostly stored in a directory with the project name in For Vscode everything is in the tree, projects ("workspaces" in VS speak) can be opened by specifying the root directory of the tree or if there are multiple workspaces in that directory then the workspace file. A recents list also allows this by name not path. Like @eht16 I don't use Geany projects much, (C++ coding is in Eclipse or Vscode so no need for Project Organiser, Geany is for editing marked up documents and non C++ languages) but I use separate configuration directories as "projects" usually kept in the directory above the source tree (and so out of git). This allows any setting to be per project and to have several Geanys open with separate "project"s safely. I know project creation confuses/annoys users, so if people who use projects find this to be a step in the right direction then great, further improvements can be added later. |
I think @Kugel (edit: sorry, meant @kugel-) wanted to have this as "the new way to create projects" that always behaves like e.g. VS Code by storing the project file into the project directory but IMO it would cause confusion why this particular project opening behaves this way regardless of the settings.
Sounds good to me. (I don't care much myself about the initial directory as for my use cases it will almost always be incorrect.)
My biggest use case for this is to be able to quickly look at source code downloaded from the Internet - either git cloned or just plain downloaded and be able to use ProjectOrganizer and goto tag definition/declaration to navigate the whole codebase. For projects you use regularly you set them up properly once and this PR isn't so critical but with these "garbage" projects where you actually don't need the project much and create it just to navigate the code, the current workflow is just annoying.
I like this a lot! The question is what should be the default value - checked or unchecked? Also this dialog is shown only when no project is open and you create a new project but what should we do if some project is already open and you create another project? Should we allow project->project open document transfer? (I can imagine this could be useful sometimes.) In any case, I think this is a stuff for a separate PR. |
I agree that it would be rather confusing that creating a project with the previous method will use the existing pref and creating a project with the new method will not use the pref. Ignoring the pref for the new method seems rather random to me.
👍
Or we just show the new checkbox only if the current conditions for the dialog are met. I'd say the default could be on, i.e. the current session is transferred into the project. At least for me, this would be the desired choice but again, I'm not using projects at all. |
At the moment, when creating a project, the user is greeted with the dialog containing: 1. Name 2. Filename 3. Base path The user is expected to type the name of the project into (1), and then, Geany tries to guess the base path and file name. The guess simply takes the project directory specified in settings and appends the name. When the project is located anywhere else than in the projects directory, the guessed values are wrong and have to be entered manually which is quite annoying. In addition, the dialog doesn't make it clear that the user should start with (1), when he starts with (2) or (3), he has to fill in all 3 values manually. This patch adds another method of project creation which is more suitable for creating projects from existing directory with source files. There's a new "Project->New from Folder..." option that in the first step asks user to provide the base path and based on this path fills in the entries in the New Project dialog. With this approach, Project->New from Folder...: a. First pops up a open directory dialog to specify base path b. After that, opens the (currently used) New Project dialog which is pre-filled in the following way: 1. Name: The last directory in base_path 2. Filename: depending on "store project file inside the project base directory" settings either in base_path/(1).geany or projects_dir/(1).geany 3. Base path: path specified in (a) This way, in most cases, the user will only have to select the base directory in the first step and use the pre-filled values without any modification no matter whether the project is stored in the projects directory or not. After this patch, there will be 2 different ways to create projects: 1. Project->New - more suitable for creating empty projects from scratch inside the "projects" directory 2. Project->New from Folder - more suitable for creating projects from existing sources
Project files are, by default, stored inside the configured "projects" directory. The problem is that for new users of Geany, the default ~/projects most probably points to a non-existent directory and then, the project creation experience is not quite optimal. In addition, this is what most editors do and most Geany newcomers will expect this behavior.
With the current width, the created project file name gets hidden even for not-so-long paths. Consider for instance the following path: /home/my_name/projects/project/project.geany It consists of 43 characters where "/home/my_name/projects/" is a typical prefix of someone with not terribly long user name and also "project/project.geany" is fairly normal project name and directory name length. Even though the patch says 40, this 43-character string still fits in on my machine (50 makes the window a little too wide).
When using "New from Folder", open the directory selection dialog at current document's directory to simplify new project creation for opened files. Fall back to "project files" directory if no file opened and if this directory isn't set in preferences, fall back to user's home directory. In addition take into account that the "project files" directory may not be set when filling in entries in the "New Project" dialog and fall back to currently opened document's directory or to home directory when no document is opened.
I re-pushed with the merge conflict fixed and with the various directory determination fixes as suggested by @eht16 which is in the last commit (the other commits are basically identical, fixing just the merge conflict and API bump to updated version number). |
Very nice, tested and works great. I'm ok with changing the default of the "Store project file inside the project base directory". My point only was that the behavior should be consistent across both ways of creating projects. If nobody objects, I'd like to merge this in a few days. |
No objection |
@elextr Would you check if the updated documentation looks good to you? |
doc/geany.txt
Outdated
To create a new project, fill in the *Name* field. By default this | ||
will setup a new project file ``~/projects/name/name.geany``. | ||
|
||
The Base path text field is setup to use ``~/projects/name``. This |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Base or Base path be *ed like Name above? If so also doesn't need "text", you don't put field type on any other field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *
s weren't present before but yeah, better to use them here so I added them for all the field names.
|
||
The Base path text field is setup to use ``~/projects/name``. This | ||
can safely be set to any existing path -- it will not touch the file | ||
structure contained in it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it will add name.geany file there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically just kept the previous text here but I think it's kind of OK - the project filename is editable and can be changed to a different path and it should be clear where that file gets created by checking the Filename field.
doc/geany.txt
Outdated
containing source files for which you want to create a new project. | ||
|
||
When using this method, Geany first opens a directory selection | ||
dialog where the Base path with the folder containing sources is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... dialog to select the folder containing the sources, and the Base path field is set to that value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
doc/geany.txt
Outdated
dialog where the Base path with the folder containing sources is | ||
selected. | ||
|
||
Afterwards, Geany shows the same dialog like with the *Project->New* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/like with/as/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@techee couple of comments, otherwise ok at first glance. |
Thanks! |
I guess after @elextr's final review and squashing, we can merge it!? |
@elextr I slightly forgot about this PR. Does the documentation look good to you after the latest patch? If so, I could then squash the commits. |
Sorry, I didn't know I was supposed to do a final review, @eht16 the text looks ok, merge away. |
I squashed the documentation fix with the previous commit, the rest of the patches make sense separately so I left them that way. If there's no objection, I'll merge this PR in about a week. |
(This is an attempt to address various comments from #3018 - check this pull request for more details.)
Improve user experience when creating new projects
At the moment, when creating a project, the user is greeted with the
dialog containing:
The user is expected to type the name of the project into (1), and then,
Geany tries to guess the base path and file name. The guess simply takes
the project directory specified in settings and appends the name. When the
project is located anywhere else than in the projects directory,
the guessed values are wrong and have to be entered manually which is
quite annoying. In addition, the dialog doesn't make it clear that the
user should start with (1), when he starts with (2) or (3), he has to
fill in all 3 values manually.
This patch adds another method of project creation which is more
suitable for creating projects from existing directory with source
files. There's a new "Project->New from Folder..." option that in
the first step asks user to provide the base path and based on this
path fills in the entries in the New Project dialog.
With this approach, Project->New from Folder...:
a. First pops up a open directory dialog to specify base path
b. After that, opens the (currently used) New Project dialog which
is pre-filled in the following way:
directory" settings either in base_path/(1).geany or projects_dir/(1).geany
This way, in most cases, the user will only have to select the base
directory in the first step and use the pre-filled values without
any modification no matter whether the project is stored in the projects
directory or not.
After this patch, there will be 2 different ways to create projects:
inside the "projects" directory
existing sources