diff --git a/e2e-tests/github-import.spec.ts b/e2e-tests/github-import.spec.ts index a3cec26..e5e3cfd 100644 --- a/e2e-tests/github-import.spec.ts +++ b/e2e-tests/github-import.spec.ts @@ -102,9 +102,6 @@ test("should import from repository list", async ({ po }) => { await expect( po.page.getByRole("heading", { name: "Import App" }), ).not.toBeVisible(); - - // Verify AI_RULES generation prompt - await po.snapshotMessages(); }); test("should support advanced options with custom commands", async ({ po }) => { diff --git a/src/components/ImportAppDialog.tsx b/src/components/ImportAppDialog.tsx index 629d2fe..8ab8256 100644 --- a/src/components/ImportAppDialog.tsx +++ b/src/components/ImportAppDialog.tsx @@ -298,383 +298,429 @@ export function ImportAppDialog({ isOpen, onClose }: ImportAppDialogProps) { const hasInstallCommand = installCommand.trim().length > 0; const hasStartCommand = startCommand.trim().length > 0; const commandsValid = hasInstallCommand === hasStartCommand; - // Add this component inside the ImportAppDialog.tsx file, before the main component + return ( - - + + Import App - + Import existing app from local folder or clone from Github. - - - - - App import is an experimental feature. If you encounter any issues, - please report them using the Help button. - - - - - Local Folder - Your GitHub Repos - GitHub URL - - -
- {!selectedPath ? ( - - ) : ( -
-
-
-
-

Selected folder:

-

- {selectedPath} -

-
- -
-
- -
- {nameExists && ( -

- An app with this name already exists. Please choose a - different name: -

+
+ + + + App import is an experimental feature. If you encounter any + issues, please report them using the Help button. + + + + + + Local Folder + + + Your GitHub Repos + GitHub Repos + + + GitHub URL + + + +
+ {!selectedPath ? ( +
- - - - - Advanced options - - -
- - setInstallCommand(e.target.value)} - placeholder="pnpm install" - disabled={importAppMutation.isPending} - /> -
-
- - setStartCommand(e.target.value)} - placeholder="pnpm dev" - disabled={importAppMutation.isPending} - /> -
- {!commandsValid && ( -

- Both commands are required when customizing. + {selectFolderMutation.isPending + ? "Selecting folder..." + : "Select Folder"} + + ) : ( +

+
+
+
+

+ Selected folder:

- )} - - - - - {hasAiRules === false && ( - - - - - - - -

- AI_RULES.md lets Dyad know which tech stack to use - for editing the app -

-
-
-
- - No AI_RULES.md found. Dyad will automatically generate - one after importing. - -
- )} - - {importAppMutation.isPending && ( -
- - Importing app... -
- )} -
- )} -
- - - - - - - - {!isAuthenticated ? ( - undefined} - expanded={false} - /> - ) : ( - <> - {loading && ( -
- -
- )} - -
- - - {isCheckingGithubName && ( -
- -
- )} - {githubNameExists && ( -

- An app with this name already exists. Please choose a - different name. -

- )} -
- -
- {!loading && repos.length === 0 && ( -

- No repositories found -

- )} - {repos.map((repo) => ( -
-
-

{repo.name}

-

- {repo.full_name} -

+

+ {selectedPath} +

+
+ +
+
+ +
+ {nameExists && ( +

+ An app with this name already exists. Please choose a + different name: +

+ )} +
+ + + {isCheckingName && ( +
+ +
+ )}
-
- ))} -
- {repos.length > 0 && ( - <> - + Advanced options
- + setInstallCommand(e.target.value) } placeholder="pnpm install" - disabled={importing} + className="text-sm" + disabled={importAppMutation.isPending} />
- + setStartCommand(e.target.value)} placeholder="pnpm dev" - disabled={importing} + className="text-sm" + disabled={importAppMutation.isPending} />
{!commandsValid && ( -

+

Both commands are required when customizing.

)}
- + + {hasAiRules === false && ( + + + + + + + +

+ AI_RULES.md lets Dyad know which tech stack to + use for editing the app +

+
+
+
+ + No AI_RULES.md found. Dyad will automatically generate + one after importing. + +
+ )} + + {importAppMutation.isPending && ( +
+ + Importing app... +
+ )} +
)} - - )} -
- -
- - setUrl(e.target.value)} - disabled={importing} - onBlur={handleUrlBlur} - /> -
-
- - - {isCheckingGithubName && ( -
- -
- )} - {githubNameExists && ( -

- An app with this name already exists. Please choose a - different name. -

- )} -
+
- - - - Advanced options - - -
- - setInstallCommand(e.target.value)} - placeholder="pnpm install" - disabled={importing} - /> -
-
- - setStartCommand(e.target.value)} - placeholder="pnpm dev" - disabled={importing} - /> -
- {!commandsValid && ( -

- Both commands are required when customizing. -

- )} -
-
-
- - + + + + + {!isAuthenticated ? ( + undefined} + expanded={false} + /> ) : ( - "Import" + <> + {loading && ( +
+ +
+ )} + +
+ + + {isCheckingGithubName && ( +
+ +
+ )} + {githubNameExists && ( +

+ An app with this name already exists. Please choose a + different name. +

+ )} +
+ +
+ {!loading && repos.length === 0 && ( +

+ No repositories found +

+ )} + {repos.map((repo) => ( +
+
+

+ {repo.name} +

+

+ {repo.full_name} +

+
+ +
+ ))} +
+ + {repos.length > 0 && ( + <> + + + + Advanced options + + +
+ + + setInstallCommand(e.target.value) + } + placeholder="pnpm install" + className="text-sm" + disabled={importing} + /> +
+
+ + + setStartCommand(e.target.value) + } + placeholder="pnpm dev" + className="text-sm" + disabled={importing} + /> +
+ {!commandsValid && ( +

+ Both commands are required when customizing. +

+ )} +
+
+
+ + )} + )} - -
- + + +
+ + setUrl(e.target.value)} + disabled={importing} + onBlur={handleUrlBlur} + className="text-sm break-all" + /> +
+
+ + + {isCheckingGithubName && ( +
+ +
+ )} + {githubNameExists && ( +

+ An app with this name already exists. Please choose a + different name. +

+ )} +
+ + + + + Advanced options + + +
+ + setInstallCommand(e.target.value)} + placeholder="pnpm install" + className="text-sm" + disabled={importing} + /> +
+
+ + setStartCommand(e.target.value)} + placeholder="pnpm dev" + className="text-sm" + disabled={importing} + /> +
+ {!commandsValid && ( +

+ Both commands are required when customizing. +

+ )} +
+
+
+ + +
+ +
);