Skip to content

feat: generate project names from initial prompt #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blondon1
Copy link

@blondon1 blondon1 commented Aug 2, 2025

The goal of this commit is to implement the requested feature on issue #711 to replace the random name generator with an AI-powered one. The backend now uses the initial user prompt to ask a language model for a descriptive, kebab-case name. The main goal of this code is to help users that use this application heavily like @dank-ubiq have a seamless experience by making projects easy to identify and manage, resolving the issue of a cluttered project list with non-descriptive names.

The goal of this commit is to implement the requested feature on
issue dyad-sh#711 to replace the random name generator with an AI-powered one. The
backend now uses the initial user prompt to ask a language model for a
descriptive, kebab-case name. The main goal of this code is to help
users that use this application heavily like @dank-ubiq have a seamless
experience by making projects easy to identify and manage, resolving
the issue of a cluttered project list with non-descriptive names.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

1 issue found across 4 files • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@@ -118,7 +118,8 @@ export default function HomePage() {
setIsLoading(true);
// Create the chat and navigate
const result = await IpcClient.getInstance().createApp({
name: generateCuteAppName(),
name: generateCuteAppName(), // fallback
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supplying generateCuteAppName() here prevents the backend from generating an AI-based project name; an empty string should be sent instead so createAppLogic can fall back correctly. (Based on your team's feedback about ensuring new features are not accidentally short-circuited by default values.)

Prompt for AI agents
Address the following comment on src/pages/home.tsx at line 121:

<comment>Supplying generateCuteAppName() here prevents the backend from generating an AI-based project name; an empty string should be sent instead so createAppLogic can fall back correctly. (Based on your team&#39;s feedback about ensuring new features are not accidentally short-circuited by default values.)</comment>

<file context>
@@ -118,7 +118,8 @@ export default function HomePage() {
       setIsLoading(true);
       // Create the chat and navigate
       const result = await IpcClient.getInstance().createApp({
-        name: generateCuteAppName(),
+        name: generateCuteAppName(), // fallback
+        prompt: inputValue,         // sends the user&#39;s prompt to the backend
       });
</file context>
Suggested change
name: generateCuteAppName(), // fallback
name: "", // let the backend generate a name when empty

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bril;liant idea, I feel like this is something I suffer from too. I make multiple apps a day in dyad lmao. I will be following this :)

Comment on lines +43 to 44
export type CreateAppParams = {
name: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name property is marked as required in the type definition, but the implementation in app_handlers.ts treats it as optional by checking params.name || (await generateNameFromPrompt(params.prompt)). To align the type with the implementation, consider changing this to name?: string; to properly indicate that the name parameter is optional.

Suggested change
export type CreateAppParams = {
name: string;
export type CreateAppParams = {
name?: string;

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants