Add option to save default project path#1281
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
ChangesProjectDialog UI Refactoring and Default Path Persistence
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@editor/project_manager/project_dialog.cpp`:
- Around line 777-782: Remove trailing whitespace from all lines in the code
block containing the btn_save_default_path check and related EditorSettings
calls in the project_dialog.cpp file. Additionally, check and remove trailing
whitespace from lines 891 and lines 1013-1016 as mentioned in the review
comment. Ensure all lines end without any trailing spaces to pass the
static-checks CI validation.
- Around line 778-779: The condition in the if statement checking
btn_save_default_path->is_pressed() currently includes MODE_IMPORT and
MODE_DUPLICATE alongside MODE_NEW and MODE_INSTALL, which may cause the default
project path to be unintentionally overwritten when importing an existing
project from an arbitrary location or duplicating a project into a one-off
folder. If this behavior is not intended and the feature should only apply to
newly created projects, remove MODE_IMPORT and MODE_DUPLICATE from the mode
check, leaving only MODE_NEW and MODE_INSTALL in the condition.
- Around line 1000-1003: The line_edit_project_name LineEdit control is missing
an accessibility name configuration, while similar controls like
line_edit_project_path and line_edit_install_path have accessibility names set.
After creating line_edit_project_name and setting its virtual keyboard and size
flags, add a call to set_accessibility_name() on line_edit_project_name with an
appropriate descriptive name for screen readers, using the same pattern as the
other line edit fields to maintain consistency.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: de2ed121-9a25-485d-9ecc-979faa327d96
📒 Files selected for processing (2)
editor/project_manager/project_dialog.cppeditor/project_manager/project_dialog.h
| if (btn_save_default_path->is_pressed() && | ||
| (mode == MODE_NEW || mode == MODE_IMPORT || mode == MODE_INSTALL || mode == MODE_DUPLICATE)) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Confirm MODE_IMPORT/MODE_DUPLICATE should overwrite the default project path.
The PR intent is to remember the parent of a newly created project, but this branch also fires for import and duplicate. Importing an existing project from an arbitrary location (or duplicating into a one-off folder) will silently overwrite the user's configured default_project_path with that unrelated parent. If that's intended, ignore; otherwise consider limiting this to MODE_NEW/MODE_INSTALL.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@editor/project_manager/project_dialog.cpp` around lines 778 - 779, The
condition in the if statement checking btn_save_default_path->is_pressed()
currently includes MODE_IMPORT and MODE_DUPLICATE alongside MODE_NEW and
MODE_INSTALL, which may cause the default project path to be unintentionally
overwritten when importing an existing project from an arbitrary location or
duplicating a project into a one-off folder. If this behavior is not intended
and the feature should only apply to newly created projects, remove MODE_IMPORT
and MODE_DUPLICATE from the mode check, leaving only MODE_NEW and MODE_INSTALL
in the condition.
0975f9d to
bbe384c
Compare
|
Something I just thought of, this doesn't save the state of the actual toggle I added to make this optional. I will look tomorrow, that seems like something I should add. |
cb51c5e to
a3f9e99
Compare
a3f9e99 to
264067e
Compare
|
Ok, to sorta close the loop I opened, this PR now also saves the state of the new toggle as an internal editor setting. |
Currently, every time you create a new project, you have to navigate to the folder you want to create it in each time.
There is a "Recent" folders store that minimizes this pain, but I think this reduces the friction further, by storing the parent folder of the project as the default project path (stored in the editor settings resource file).
It looks like any values that are different from their defaults are already saved in that resource file automatically, but the default project path is never written back to, so it's not included.
This PR will store that path when the user creates the project. I have made it optional, adding a toggle:

I've defaulted it to true, but if we decided we wanted false, it can be changed here in /editor/project_manager/project_dialog.cpp (~line 1000, 1015 as of this PR):
I also renamed some variables that were a little confusing/unclear around the affected code.
Summary by CodeRabbit
Summary by CodeRabbit
project.godot) and more accurate ZIP destination behavior.