diff --git a/crates/server/src/routes/projects.rs b/crates/server/src/routes/projects.rs index 5d7141be..6b30b1ab 100644 --- a/crates/server/src/routes/projects.rs +++ b/crates/server/src/routes/projects.rs @@ -61,8 +61,7 @@ pub async fn create_project( tracing::debug!("Creating project '{}'", name); // Validate and setup git repository - // Expand tilde in git repo path if present - let path = expand_tilde(&git_repo_path); + let path = std::path::absolute(expand_tilde(&git_repo_path))?; // Check if git repo path is already used by another project match Project::find_by_git_repo_path(&deployment.db().pool, path.to_string_lossy().as_ref()) .await diff --git a/frontend/src/components/dialogs/projects/ProjectFormDialog.tsx b/frontend/src/components/dialogs/projects/ProjectFormDialog.tsx index 536c4387..68bf45c1 100644 --- a/frontend/src/components/dialogs/projects/ProjectFormDialog.tsx +++ b/frontend/src/components/dialogs/projects/ProjectFormDialog.tsx @@ -107,12 +107,11 @@ export const ProjectFormDialog = NiceModal.create( try { let finalGitRepoPath = gitRepoPath; if (repoMode === 'new') { - // Use home directory (~) if parentPath is empty - const effectiveParentPath = parentPath.trim() || '~'; - finalGitRepoPath = `${effectiveParentPath}/${folderName}`.replace( - /\/+/g, - '/' - ); + const effectiveParentPath = parentPath.trim(); + const cleanFolderName = folderName.trim(); + finalGitRepoPath = effectiveParentPath + ? `${effectiveParentPath}/${cleanFolderName}`.replace(/\/+/g, '/') + : cleanFolderName; } // Auto-populate name from git repo path if not provided const finalName = diff --git a/frontend/src/components/projects/project-form-fields.tsx b/frontend/src/components/projects/project-form-fields.tsx index e97d704c..c6266745 100644 --- a/frontend/src/components/projects/project-form-fields.tsx +++ b/frontend/src/components/projects/project-form-fields.tsx @@ -349,7 +349,7 @@ export function ProjectFormFields({ type="text" value={parentPath} onChange={(e) => setParentPath(e.target.value)} - placeholder="Home" + placeholder="Current Directory" className="flex-1 placeholder:text-secondary-foreground placeholder:opacity-100" />