(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: 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 You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3042
-- Commit Summary --
* Improve user experience when creating new projects * Add keybindings for "Project->New from Folder" * Store project files in base directory by default * Make the New Project dialog a little wider
-- File Changes --
M data/geany.glade (17) M src/callbacks.c (8) M src/callbacks.h (2) M src/keybindings.c (5) M src/keybindings.h (2) M src/keyfile.c (2) M src/plugindata.h (2) M src/project.c (77) M src/project.h (2) M src/ui_utils.c (15) M src/ui_utils.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/3042.patch https://github.com/geany/geany/pull/3042.diff
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.
which is likely to be a constant for a user
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.
browsing to the project base directory one more time is just annoys me.
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 directory".
I agree with the goal, but not necessarily with changing the default for ""store project file inside the project base directory", therefore my proposal.
Heck, I could even imagine a (sticky) checkbox or a separate button in the initial file browser to skip the project dialog altogether.
I agree with the goal, but not necessarily with changing the default for ""store project file inside the project base
directory", therefore my proposal.
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 `Edit->Preferences->General->Startup->Paths->Project Files`).
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 Edit->Preferences->General->Startup->Paths->Project Files).
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: 1. Behave nicely to people who store projects outside the project directory (it's not me btw.) so they get what they want even with the new way of opening projects 2. Default to something which is more common in other editors for new users - this can be easily overridden in settings and doesn't depend on the default projects directory
But both are just minor points for me.
Is this going anywhere?
Havn't had a chance to try it, @kugel- @eht16 how does it work for you?
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 ready very good!
What's about my idea? https://github.com/geany/geany/pull/3042#issuecomment-987602950
Tested and works well. Only a minor issue: if "Store project files in base directory by default" is disabled and `local_prefs.project_file_path` is empty, then a newly created project gets `/geany.geany` as project filename because `project_dir` is empty in https://github.com/geany/geany/pull/3042/files#diff-08a2b89559e9135e3864640c....
About the "Store project file inside the project base directory" default: I don't mind about the default value. It's good when it's off or on by default. @techee suggestion to look at the default on other editors sounds good.
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 https://github.com/geany/geany/pull/3042#issuecomment-987602950.
Another idea to even further improve the UX: what if we use the base directory of the currently document for the folder choose dialog? Then this feature would be more like "New project from current folder" and maybe users who instantly want to start a project from where they are currently working, could start right away from the location of the current document.
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 :).
@eht16 commented on this pull request.
@@ -58,7 +58,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously * @c GEANY_API_VERSION was defined as an enum value, not a macro. */ -#define GEANY_API_VERSION 242 +#define GEANY_API_VERSION 243
Geany master already reached 243, so we should bump it again.
{
- base_path = g_strconcat(project_dir, G_DIR_SEPARATOR_S, - name, G_DIR_SEPARATOR_S, NULL); + gchar *name = g_path_get_basename(base_p);
`name` is already declared in 983 and could be just assigned here or is there any reason for re-declaring it here? Same for line 1005.
One more idea to make project creation a little easier: what if we move the question dialog to "Move the current documents into the new project's session?" into a checkbox in the main project creation dialog? I'm no UX expert but I feel that this dialog after the main project creation dialog is rather distracting and confusing, like something like an error or warning message but intead it is just a regular part of the process.
But could be also in its own PR.
@techee suggestion to look at the default on other editors sounds good.
AFAICT for Eclipse the "project" is mostly stored in a directory with the project name in `~/EclipseWorkspace` but there are also some dotfiles in the tree as well which seem to point to the workspace the tree is part of (its XML so I could only look quickly :stuck_out_tongue: ).
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.
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 https://github.com/geany/geany/pull/3042#issuecomment-987602950.
I think @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.
Another idea to even further improve the UX: what if we use the base directory of the currently document for the folder choose dialog?
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.)
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 :).
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.
One more idea to make project creation a little easier:
what if we move the question dialog to "Move the current documents into the new project's session?" into a checkbox in the main project creation dialog? I'm no UX expert but I feel that this dialog after the main project creation dialog is rather distracting and confusing, like something like an error or warning message but intead it is just a regular part of the process.
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.
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)](https://github.com/geany/geany/pull/3042#issuecomment-987602950).
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.
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. Based on the fact that it is probably more often desired to create the project file within the project directory, we could just enable the pref by default, as you already did.
Another idea to even further improve the UX: what if we use the base directory of the currently document for the folder choose dialog?
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.)
:+1: Do you plan to integrate it into this PR or rather a separate one?
One more idea to make project creation a little easier: what if we move the question dialog to "Move the current documents into the new project's session?" into a checkbox in the main project creation dialog? I'm no UX expert but I feel that this dialog after the main project creation dialog is rather distracting and confusing, like something like an error or warning message but intead it is just a regular part of the process.
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.)
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.
@techee commented on this pull request.
{
- base_path = g_strconcat(project_dir, G_DIR_SEPARATOR_S, - name, G_DIR_SEPARATOR_S, NULL); + gchar *name = g_path_get_basename(base_p);
I think I wanted this to be a local variable for the block as it isn't used outside the block and forgot to remove the declaration at the beginning of the function. Will fix.
@techee pushed 5 commits.
ce66dc92231cf7fb4aa47e1846f4ab127b8ee873 Improve user experience when creating new projects 0837989188fa0adcfec4ccf84cd344faae736713 Add keybindings for "Project->New from Folder" 1bc7d8ff4eefc859f9bf2c2bf81d0952f8663c40 Store project files in base directory by default f8768399d32b817ecaccd2f28f43e8e0d55a06e6 Make the New Project dialog a little wider 8abf31d3c6f559df18505fd1c69ac771b23cd94c Improve project directory determination
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).
@techee commented on this pull request.
@@ -58,7 +58,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously * @c GEANY_API_VERSION was defined as an enum value, not a macro. */ -#define GEANY_API_VERSION 242 +#define GEANY_API_VERSION 243
Done.
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
@techee pushed 1 commit.
42273c9dee47dd02fbe61d068ca8bec815c41db5 Update geany.txt with the Project->New from Folder item
@elextr Would you check if the updated documentation looks good to you?
@elextr commented on this pull request.
-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 are two ways of creating new projects, either by using +*Project->New* menu item or by using *Project->New from Folder* menu +item. + +New + This method is more suitable for creating new, empty projects from + scratch at the default location without having any existing sources. + + 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
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.
@elextr commented on this pull request.
-can safely be set to any existing path -- it will not touch the file
-structure contained in it. +There are two ways of creating new projects, either by using +*Project->New* menu item or by using *Project->New from Folder* menu +item. + +New + This method is more suitable for creating new, empty projects from + scratch at the default location without having any existing sources. + + 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 + can safely be set to any existing path -- it will not touch the file + structure contained in it.
But it will add name.geany file there.
@elextr commented on this pull request.
- This method is more suitable for creating new, empty projects from
+ scratch at the default location without having any existing sources. + + 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 + can safely be set to any existing path -- it will not touch the file + structure contained in it. + +New from Folder + This method is more suitable when there is already some folder + 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
... dialog to select the folder containing the sources, and the *Base path* field is set to the same value.
@elextr commented on this pull request.
- 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 + can safely be set to any existing path -- it will not touch the file + structure contained in it. + +New from Folder + This method is more suitable when there is already some folder + 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 + selected. + + Afterwards, Geany shows the same dialog like with the *Project->New*
s/like/as/
@techee couple of comments, otherwise ok at first glance.
@techee commented on this pull request.
-can safely be set to any existing path -- it will not touch the file
-structure contained in it. +There are two ways of creating new projects, either by using +*Project->New* menu item or by using *Project->New from Folder* menu +item. + +New + This method is more suitable for creating new, empty projects from + scratch at the default location without having any existing sources. + + 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 + can safely be set to any existing path -- it will not touch the file + structure contained in it.
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.
@techee commented on this pull request.
-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 are two ways of creating new projects, either by using +*Project->New* menu item or by using *Project->New from Folder* menu +item. + +New + This method is more suitable for creating new, empty projects from + scratch at the default location without having any existing sources. + + 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
The `*`s weren't present before but yeah, better to use them here so I added them for all the field names.
@techee commented on this pull request.
- This method is more suitable for creating new, empty projects from
+ scratch at the default location without having any existing sources. + + 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 + can safely be set to any existing path -- it will not touch the file + structure contained in it. + +New from Folder + This method is more suitable when there is already some folder + 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
Done.
@techee commented on this pull request.
- 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 + can safely be set to any existing path -- it will not touch the file + structure contained in it. + +New from Folder + This method is more suitable when there is already some folder + 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 + selected. + + Afterwards, Geany shows the same dialog like with the *Project->New*
Done.
@techee couple of comments, otherwise ok at first glance.
Thanks!
@techee pushed 1 commit.
81b147b6fed300abd2699ec4b0a900f54f1fdca6 fixup! Update geany.txt with the Project->New from Folder item
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.
Merged #3042 into master.
github-comments@lists.geany.org