Skip to content

Commit 8fe752e

Browse files
committed
🤖 fix: only show start message textarea when provided
The start message textarea now only appears when initialStartMessage is provided (i.e., from /new command flow). In the normal modal flow where users manually create workspaces, the field is hidden since users can just send a message after workspace creation. This reduces visual clutter and makes the modal more focused for the common case. Generated with `cmux`
1 parent 4010dc1 commit 8fe752e

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/components/NewWorkspaceModal.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,18 @@ const NewWorkspaceModal: React.FC<NewWorkspaceModalProps> = ({
267267
</div>
268268
)}
269269

270-
<div className="[&_label]:text-foreground [&_textarea]:bg-modal-bg [&_textarea]:border-border-medium [&_textarea]:focus:border-accent mb-5 [&_label]:mb-2 [&_label]:block [&_label]:text-sm [&_textarea]:w-full [&_textarea]:rounded [&_textarea]:border [&_textarea]:px-3 [&_textarea]:py-2 [&_textarea]:text-sm [&_textarea]:text-white [&_textarea]:focus:outline-none [&_textarea]:disabled:cursor-not-allowed [&_textarea]:disabled:opacity-60 [&_textarea]:resize-y [&_textarea]:min-h-[80px]">
271-
<label htmlFor="startMessage">Start Message (optional):</label>
272-
<textarea
273-
id="startMessage"
274-
value={startMessage}
275-
onChange={(event) => setStartMessage(event.target.value)}
276-
disabled={isLoading}
277-
placeholder="Enter a message to send after creating the workspace..."
278-
/>
279-
</div>
270+
{initialStartMessage && (
271+
<div className="[&_label]:text-foreground [&_textarea]:bg-modal-bg [&_textarea]:border-border-medium [&_textarea]:focus:border-accent mb-5 [&_label]:mb-2 [&_label]:block [&_label]:text-sm [&_textarea]:w-full [&_textarea]:rounded [&_textarea]:border [&_textarea]:px-3 [&_textarea]:py-2 [&_textarea]:text-sm [&_textarea]:text-white [&_textarea]:focus:outline-none [&_textarea]:disabled:cursor-not-allowed [&_textarea]:disabled:opacity-60 [&_textarea]:resize-y [&_textarea]:min-h-[80px]">
272+
<label htmlFor="startMessage">Start Message (optional):</label>
273+
<textarea
274+
id="startMessage"
275+
value={startMessage}
276+
onChange={(event) => setStartMessage(event.target.value)}
277+
disabled={isLoading}
278+
placeholder="Enter a message to send after creating the workspace..."
279+
/>
280+
</div>
281+
)}
280282

281283
<ModalInfo id={infoId}>
282284
<p>This will create a workspace at:</p>

0 commit comments

Comments
 (0)