Skip to content

Commit 8b9dfcf

Browse files
committed
🤖 feat: improve workspace creation UX with generating state
- Change spinner message from 'Creating workspace...' to 'Generating workspace name...' - Show dimmed preview of user's prompt in quotes above spinner - Dim the input section (50% opacity) when generating - Truncate long prompts to 150 chars with ellipsis _Generated with mux_
1 parent e1117fc commit 8b9dfcf

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

src/browser/components/ChatInput/CreationCenterContent.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,36 @@ import React from "react";
33
interface CreationCenterContentProps {
44
projectName: string;
55
isSending: boolean;
6+
inputPreview?: string;
67
}
78

89
/**
910
* Center content displayed during workspace creation
10-
* Shows either a loading spinner or welcome message
11+
* Shows either a loading state with the user's prompt or welcome message
1112
*/
12-
export function CreationCenterContent({ projectName, isSending }: CreationCenterContentProps) {
13+
export function CreationCenterContent(props: CreationCenterContentProps) {
14+
// Truncate long prompts for preview display
15+
const truncatedPreview =
16+
props.inputPreview && props.inputPreview.length > 150
17+
? props.inputPreview.slice(0, 150) + "..."
18+
: props.inputPreview;
19+
1320
return (
1421
<div className="flex flex-1 items-center justify-center">
15-
{isSending ? (
16-
<div className="text-center">
22+
{props.isSending ? (
23+
<div className="max-w-xl px-8 text-center">
24+
{/* Show dimmed prompt preview */}
25+
{truncatedPreview && (
26+
<p className="text-muted/60 mb-6 text-sm leading-relaxed italic">
27+
&ldquo;{truncatedPreview}&rdquo;
28+
</p>
29+
)}
1730
<div className="bg-accent mb-3 inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent"></div>
18-
<p className="text-muted text-sm">Creating workspace...</p>
31+
<p className="text-muted text-sm">Generating workspace name...</p>
1932
</div>
2033
) : (
2134
<div className="max-w-2xl px-8 text-center">
22-
<h1 className="text-foreground mb-4 text-2xl font-semibold">{projectName}</h1>
35+
<h1 className="text-foreground mb-4 text-2xl font-semibold">{props.projectName}</h1>
2336
<p className="text-muted text-sm leading-relaxed">
2437
Describe what you want to build. A new workspace will be created with an automatically
2538
generated branch name. Configure runtime and model options below.

src/browser/components/ChatInput/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,12 +971,16 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
971971
<CreationCenterContent
972972
projectName={props.projectName}
973973
isSending={creationState.isSending || isSending}
974+
inputPreview={creationState.isSending || isSending ? input : undefined}
974975
/>
975976
)}
976977

977-
{/* Input section */}
978+
{/* Input section - dim when creating workspace */}
978979
<div
979-
className="bg-separator border-border-light relative flex flex-col gap-1 border-t px-[15px] pt-[5px] pb-[15px]"
980+
className={cn(
981+
"bg-separator border-border-light relative flex flex-col gap-1 border-t px-[15px] pt-[5px] pb-[15px]",
982+
variant === "creation" && (creationState.isSending || isSending) && "opacity-50"
983+
)}
980984
data-component="ChatInputSection"
981985
>
982986
<div className="mx-auto w-full max-w-4xl">

0 commit comments

Comments
 (0)