feat: enhance workspace management and path handling

- Added functionality to set a default workspace directory in Electron, creating it if it doesn't exist.
- Improved project path construction in the New Project Modal to use platform-specific path separators.
- Enhanced error handling in the Templates route for parent directory access, including logging for better debugging.
This commit is contained in:
Kacper
2025-12-13 23:52:14 +01:00
parent bea115d1e4
commit 1bda0259db
3 changed files with 43 additions and 4 deletions

View File

@@ -198,7 +198,10 @@ export function NewProjectModal({
}
};
const projectPath = workspaceDir && projectName ? `${workspaceDir}/${projectName}` : "";
// Use platform-specific path separator
const pathSep = typeof window !== 'undefined' && (window as any).electronAPI ?
(navigator.platform.indexOf('Win') !== -1 ? '\\' : '/') : '/';
const projectPath = workspaceDir && projectName ? `${workspaceDir}${pathSep}${projectName}` : "";
return (
<Dialog open={open} onOpenChange={onOpenChange}>