Skip to content

Commit 63708eb

Browse files
committed
fix: show correct workspace name during creation, update empty state text
- Track confirmed name separately (creatingWithName) from input field name - Show 'Generating name…' briefly while waitForGeneration completes - Then show the actual name that will be used for the workspace - Simplified welcome text in empty state
1 parent 6bcaea8 commit 63708eb

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

src/browser/components/ChatInput/CreationCenterContent.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import React from "react";
33
interface CreationCenterContentProps {
44
projectName: string;
55
isSending: boolean;
6-
workspaceName?: string;
6+
/** The confirmed workspace name (null while name generation is in progress) */
7+
workspaceName?: string | null;
78
}
89

910
/**
@@ -17,18 +18,21 @@ export function CreationCenterContent(props: CreationCenterContentProps) {
1718
<div className="max-w-xl px-8 text-center">
1819
<div className="bg-accent mb-4 inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent"></div>
1920
<h2 className="text-foreground mb-2 text-lg font-medium">Creating workspace</h2>
20-
{props.workspaceName && (
21-
<p className="text-muted text-sm leading-relaxed">
22-
Creating <code className="bg-separator rounded px-1">{props.workspaceName}</code>
23-
</p>
24-
)}
21+
<p className="text-muted text-sm leading-relaxed">
22+
{props.workspaceName ? (
23+
<>
24+
<code className="bg-separator rounded px-1">{props.workspaceName}</code>
25+
</>
26+
) : (
27+
"Generating name…"
28+
)}
29+
</p>
2530
</div>
2631
) : (
2732
<div className="max-w-2xl px-8 text-center">
2833
<h1 className="text-foreground mb-4 text-2xl font-semibold">{props.projectName}</h1>
2934
<p className="text-muted text-sm leading-relaxed">
30-
Describe what you want to build. A new workspace will be created with an automatically
31-
generated name. Configure runtime and model options below.
35+
Describe what you want to build and a workspace will be created.
3236
</p>
3337
</div>
3438
)}

src/browser/components/ChatInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
11931193
projectName={props.projectName}
11941194
isSending={creationState.isSending || isSending}
11951195
workspaceName={
1196-
creationState.isSending || isSending ? creationState.nameState.name : undefined
1196+
creationState.isSending || isSending ? creationState.creatingWithName : undefined
11971197
}
11981198
/>
11991199
)}

src/browser/components/ChatInput/useCreationWorkspace.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ interface UseCreationWorkspaceReturn {
7171
handleSend: (message: string, imageParts?: ImagePart[]) => Promise<boolean>;
7272
/** Workspace name generation state and actions (for CreationControls) */
7373
nameState: WorkspaceNameState;
74+
/** The confirmed name being used for creation (null until name generation resolves) */
75+
creatingWithName: string | null;
7476
}
7577

7678
/**
@@ -91,6 +93,8 @@ export function useCreationWorkspace({
9193
const [recommendedTrunk, setRecommendedTrunk] = useState<string | null>(null);
9294
const [toast, setToast] = useState<Toast | null>(null);
9395
const [isSending, setIsSending] = useState(false);
96+
// The confirmed name being used for workspace creation (set after waitForGeneration resolves)
97+
const [creatingWithName, setCreatingWithName] = useState<string | null>(null);
9498

9599
// Centralized draft workspace settings with automatic persistence
96100
const {
@@ -143,6 +147,7 @@ export function useCreationWorkspace({
143147

144148
setIsSending(true);
145149
setToast(null);
150+
setCreatingWithName(null);
146151

147152
try {
148153
// Wait for name generation to complete (blocks if still in progress)
@@ -153,6 +158,9 @@ export function useCreationWorkspace({
153158
return false;
154159
}
155160

161+
// Set the confirmed name for UI display
162+
setCreatingWithName(workspaceName);
163+
156164
// Get runtime config from options
157165
const runtimeString = getRuntimeString();
158166
const runtimeConfig: RuntimeConfig | undefined = runtimeString
@@ -250,5 +258,7 @@ export function useCreationWorkspace({
250258
handleSend,
251259
// Workspace name state (for CreationControls)
252260
nameState: workspaceNameState,
261+
// The confirmed name being used for creation (null until waitForGeneration resolves)
262+
creatingWithName,
253263
};
254264
}

0 commit comments

Comments
 (0)