Skip to content

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

Merged
merged 6 commits into from
May 13, 2022

Conversation

techee
Copy link
Member

@techee techee commented Dec 4, 2021

(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

@techee
Copy link
Member Author

techee commented Dec 4, 2021

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.

@kugel-
Copy link
Member

kugel- commented Dec 7, 2021

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?

@elextr
Copy link
Member

elextr commented Dec 7, 2021

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.

@kugel-
Copy link
Member

kugel- commented Dec 7, 2021

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.

@elextr
Copy link
Member

elextr commented Dec 7, 2021

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.

@kugel-
Copy link
Member

kugel- commented Dec 7, 2021

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.

@elextr
Copy link
Member

elextr commented Dec 7, 2021

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).

@kugel-
Copy link
Member

kugel- commented Dec 7, 2021

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)

@techee
Copy link
Member Author

techee commented Dec 7, 2021

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.

@kugel-
Copy link
Member

kugel- commented Feb 12, 2022

Is this going anywhere?

@elextr
Copy link
Member

elextr commented Feb 12, 2022

Havn't had a chance to try it, @kugel- @eht16 how does it work for you?

@techee
Copy link
Member Author

techee commented Feb 12, 2022

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.

@eht16
Copy link
Member

eht16 commented Feb 13, 2022

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!

@kugel-
Copy link
Member

kugel- commented Feb 16, 2022

What's about my idea? #3042 (comment)

@eht16
Copy link
Member

eht16 commented Feb 18, 2022

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-08a2b89559e9135e3864640c098dc6367f44fdf0816a023ec7aab4a2edaa251cR1014.

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 #3042 (comment).

@eht16
Copy link
Member

eht16 commented Feb 18, 2022

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
Copy link
Member

eht16 commented Feb 18, 2022

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.

@elextr
Copy link
Member

elextr commented Feb 18, 2022

@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 😛 ).

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.

@techee
Copy link
Member Author

techee commented Feb 18, 2022

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).

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.

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.

@eht16
Copy link
Member

eht16 commented Feb 20, 2022

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).

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.)

👍
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 added 5 commits March 15, 2022 20:44
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.
@techee
Copy link
Member Author

techee commented Mar 19, 2022

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).

@eht16
Copy link
Member

eht16 commented Apr 3, 2022

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.

@elextr
Copy link
Member

elextr commented Apr 3, 2022

No objection

@techee
Copy link
Member Author

techee commented Apr 5, 2022

@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
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

@elextr elextr Apr 5, 2022

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.

Copy link
Member Author

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*
Copy link
Member

@elextr elextr Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/like with/as/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@elextr
Copy link
Member

elextr commented Apr 5, 2022

@techee couple of comments, otherwise ok at first glance.

@techee
Copy link
Member Author

techee commented Apr 6, 2022

@techee couple of comments, otherwise ok at first glance.

Thanks!

@eht16
Copy link
Member

eht16 commented Apr 10, 2022

I guess after @elextr's final review and squashing, we can merge it!?

@techee
Copy link
Member Author

techee commented Apr 28, 2022

@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.

@elextr
Copy link
Member

elextr commented Apr 28, 2022

Sorry, I didn't know I was supposed to do a final review, @eht16 the text looks ok, merge away.

@techee
Copy link
Member Author

techee commented Apr 28, 2022

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.

@techee techee merged commit 4b573b7 into geany:master May 13, 2022
@b4n b4n added this to the 1.39/2.0 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants