-
Notifications
You must be signed in to change notification settings - Fork 523
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
base: main
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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'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's prompt to the backend
});
</file context>
name: generateCuteAppName(), // fallback | |
name: "", // let the backend generate a name when empty |
There was a problem hiding this comment.
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 :)
export type CreateAppParams = { | ||
name: string; |
There was a problem hiding this comment.
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.
export type CreateAppParams = { | |
name: string; | |
export type CreateAppParams = { | |
name?: string; |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
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.