godot icon indicating copy to clipboard operation
godot copied to clipboard

Create new proyect with default "Create folder" selected, not working in Godot 4.3.*

Open jjmontes opened this issue 1 year ago • 1 comments

Tested versions

  • Reproducible in: v4.3.dev5.official [c9c17d6ca], v4.3.dev6.official [64520fe67], v4.3.beta1.official [a4f2ea91a], v4.3.beta2.official [b75f0485b]
  • Not reproducible in: previously versions (is a new attribute)

System information

Ubuntu 22.04.4 LTS - Godot v4.3.beta2.official [b75f0485b]

Issue description

When creating a new project, the "Create Folder" option is selected by default, but it is not working. New proyect

If I leave the option checked (as it comes) and press the CREATE AND EDIT button, it creates the project without creating a new folder with the project's name. However, if before pressing the CREATE AND EDIT button I uncheck and recheck the "Create Folder" option, in that case, it does create the folder. Video for new proyect

Steps to reproduce

Test 1

  1. Start Godot
  2. Press the button to create a new project
  3. If necessary, change the project's name (if a project with the default name already exists)
  4. Press the Create and Edit button
  5. Verify that the project was created in the "Project Path" folder and not within the "Project Name" folder.

Test 2

  1. Start Godot
  2. Press the button to create a new project
  3. If necessary, change the project's name (if a project with the default name already exists)
  4. Uncheck the "Create Folder" option
  5. Recheck the "Create Folder" option
  6. Press the Create and Edit button
  7. Verify that the project was created in the "Project Name" folder within the "Project Path" folder (Expected behavior)

Possible fixes:

  1. Have the "Create Folder" option appear unchecked by default.
  2. Ensure the internal value used by the editor is set to TRUE when the screen starts.

Minimal reproduction project (MRP)

no MRP, only video to see bug Grabación de pantalla desde 05-07-24 11:27:01.webm

jjmontes avatar Jul 05 '24 14:07 jjmontes

Reproducible on 4.3.beta2 & 4.3 master [b97110c] on macOS 15.0. The issue seems to only occur when a trailing slash is included in the project path:

https://github.com/godotengine/godot/assets/29121925/3179f6e9-9d77-412f-a9bb-ab558638d098

Perhaps some form of sanitization could make the behavior consistent.

Grublady avatar Jul 05 '24 19:07 Grublady

The bug continue in 4.3 rc 2. Folder is not empty, "Ruta de proyecto" hasn't end with slash and "Crear carpeta" option is checked: imagen

but when I push "Crear y editar" button, show the next popup: imagen

If I push "OK" button, then the proyect is created in folder "Ruta de proyecto" (/media/jjmontes/SeagateExpansionDrive/jjmoa/Godot/4.3.0-rc 2/Proyectos/) imagen

The expected behavior was that it would be created within the indicated folder (/media/jjmontes/SeagateExpansionDrive/jjmoa/Godot/4.3.0-rc 2/Proyectos/LogiFive)

jjmontes avatar Aug 02 '24 13:08 jjmontes

This looks like there may be a discrepancy in expected behavior—

  • The current implementation uses the Project Path/Ruta del Proyecto field as the source of truth for the destination folder, and uses the Create Folder/Crear Carpeta toggle as a means to control this field.
  • The issue seems to expect that the destination folder is dynamically produced from the Project Path/Ruta del Proyecto and the state of the Create Folder/Crear Carpeta toggle; ie Project Path does not directly correspond to the destination folder.

Is it documented somewhere how this is supposed to behave?

Grublady avatar Aug 02 '24 17:08 Grublady

Until version 4.2.stable, when you indicated that you wanted to create a new project, the screen that appeared was this one: imagen

If you notice, the difference between version 4.2.stable and 4.3 RC 2 is that in 4.2.stable there was a button ("Create Folder") that, when pressed, created the "Project Name" folder in the "Project Path"; in version 4.3 RC 2, the "Create Folder" button was removed and a "checkbox" was added to indicate whether or not you want to create a folder. I infer, based on what existed in version 4.2 compared to what is now, that if it is checked, the project is created in "Project Path" + "Project Name," and if it is unchecked, it is created in the "Project Path."

I haven't found documentation about this regarding version 4.3.

jjmontes avatar Aug 02 '24 18:08 jjmontes

It looks like this functionality was proposed in https://github.com/godotengine/godot-proposals/issues/4749.

According to that proposal, the current implementation works correctly.

A similar concern about this feature being unintuitive was raised in this comment on the related PR.

Perhaps the proposal should be reopened for further discussion? I'm somewhat unfamiliar with Godot's proposal process, maybe a maintainer can clarify

Grublady avatar Aug 03 '24 06:08 Grublady

Reproducible on Godot 4.3RC2 on Windows 10. It seems to be an error when you write the path to the selected folder. If you choose it with the modal of choose folder it works

Gearyandres94 avatar Aug 06 '24 17:08 Gearyandres94

Create Folder button toggles appending the project name to path:

https://github.com/user-attachments/assets/11c7bd79-5628-402c-bb2c-aa4f1bb9a08c

The project name is appended automatically when you Browse path:

https://github.com/user-attachments/assets/8413bbd6-5cd3-4d07-b99b-7d99c934cc1f

The only case when it "doesn't work" is when you manually modify the Path field.

We can:

  • disable Path field when Create Folder is enabled
  • use the Path only as base, not a final path

Note that for the latter option we still need to show the project's folder name somehow, so it would be a new label somewhere.

KoBeWi avatar Aug 07 '24 15:08 KoBeWi

I would think of it differently; instead of appending the "Project name" input box text to the "Project path" input box text, simply, at the moment of pressing the "Create & Edit" button:

  • If the "Create folder" toggle is active, create the folder "Project name"/"Project name" and save the Godot project files inside it.
  • Otherwise (if the toggle is inactive), create the "Project name" folder and save the Godot project files inside it.

This way, it would work well for all cases.

jjmontes avatar Aug 07 '24 15:08 jjmontes

The project name appended to path follows the project naming style set in editor settings. Thus having a preview of the name is needed, otherwise users would be confused why their folder is named differently.

KoBeWi avatar Aug 07 '24 15:08 KoBeWi

The UX problem here is that "Create Folder" does two things:

  • Generate a folder name based on the project name
  • Create the folder

Users may want to create a folder, but customize the name of that folder.

So I think it should behave somewhat like this:

  • The generated folder name should be shown in the path
  • The path can be edited manually
  • "Create folder" creates the folder regardless of whether it's generated or not

What would prevent this from working currently?

akien-mga avatar Aug 07 '24 15:08 akien-mga

The generated folder name should be shown in the path

You mean like it does currently? The problem is that the path can be changed to an existing, non-empty folder. Currently it results in a warning. We can't modify the Path field when user changes it manually.

KoBeWi avatar Aug 07 '24 15:08 KoBeWi

@KoBeWi

What do you think about if a user manually inserts a shared path for their projects folder from the clipboard and with the "Create folder" option enabled, the project name is added at the end of the project path field?

comminux avatar Aug 07 '24 15:08 comminux

LineEdit has no signal for pasting text from clipboard, so manually appending something would make it impossible to write in the field (the text would change each time you type a character).

KoBeWi avatar Aug 07 '24 15:08 KoBeWi

It turns out that then it will be possible to update the path after insertion only when using text_submitted signal (Paste the copied path and confirm with the Enter key)?

comminux avatar Aug 07 '24 15:08 comminux

image

KoBeWi avatar Aug 07 '24 18:08 KoBeWi

image

Perhaps the folder text field should be enabled so the user can edit its name? I don't think there is any reason to have it disabled, and I could imagine it being a minor workflow improvement.

Also it may be more intuitive to have the text field disabled when the toggle is disabled, and vice versa.

Edit: moved to https://github.com/godotengine/godot/pull/95262#issuecomment-2274528672

Grublady avatar Aug 07 '24 21:08 Grublady

I always type in the project base path, so the "Create Folder" checkbox has legit never worked for me. The old button worked. I would expect it to just tack on the project name as a subdirectory of whatever I typed in. Not being able to type in the directory if I want to have it generate the folder is a pain, especially since it defaults to the documents directory and I have a godot projects directory I have all my quick test projects in.

Can't you just tack it on as soon as you go out of the project path edit box or change the project name? Could possibly even add it to the right of the cursor as you're typing, as long as the string to the right matched the new folder string. Just feels super janky and broken right now.

Edit: Also, if I type in "E:\projects\godot" then click browse to quickly fix the directory not creating, it brings up the file dialogue to "E:\projects". If "Create Folder" is unchecked, it will open to "E:\projects\godot" as expected.

jitspoe avatar Oct 23 '24 05:10 jitspoe