Skip to content

Commit 1b76262

Browse files
zimegClaude
andcommitted
feat: update create command prompt titles for clarity
Rename interactive selection prompts to better describe each step: - "Select an app:" becomes "Select a category:" - "Select a language:" becomes "Select a framework:" for non-AI apps - "Select a language:" becomes "Select a framework:" for the framework step of AI apps - AI apps keep "Select a template:" for the template selection step Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 89d8085 commit 1b76262

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

cmd/project/create_template.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func promptTemplateSelection(cmd *cobra.Command, clients *shared.ClientFactory,
144144
}
145145
} else {
146146
// Prompt for the category
147-
promptForCategory := "Select an app:"
147+
promptForCategory := "Select a category:"
148148
optionsForCategory := getSelectionOptionsForCategory(clients)
149149
titlesForCategory := make([]string, len(optionsForCategory))
150150
for i, m := range optionsForCategory {
@@ -196,7 +196,7 @@ func promptTemplateSelection(cmd *cobra.Command, clients *shared.ClientFactory,
196196
}
197197

198198
// Prompt for the example template
199-
prompt := "Select a language:"
199+
prompt := "Select a framework:"
200200
if categoryID == "slack-cli#ai-apps" {
201201
prompt = "Select a template:"
202202
}
@@ -229,7 +229,7 @@ func promptTemplateSelection(cmd *cobra.Command, clients *shared.ClientFactory,
229229
for i, opt := range examples {
230230
choices[i] = opt.Title
231231
}
232-
choice, err := clients.IO.SelectPrompt(ctx, "Select a language:", choices, iostreams.SelectPromptConfig{
232+
choice, err := clients.IO.SelectPrompt(ctx, "Select a framework:", choices, iostreams.SelectPromptConfig{
233233
Description: func(value string, index int) string {
234234
return examples[index].Description
235235
},

cmd/project/create_test.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ func TestCreateCommand(t *testing.T) {
4646
"creates a bolt application from prompts": {
4747
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
4848
cm.IO.On("IsTTY").Return(true)
49-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
49+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
5050
Return(
5151
iostreams.SelectPromptResponse{
5252
Prompt: true,
5353
Index: 0,
5454
},
5555
nil,
5656
)
57-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
57+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
5858
Return(
5959
iostreams.SelectPromptResponse{
6060
Prompt: true,
@@ -83,15 +83,15 @@ func TestCreateCommand(t *testing.T) {
8383
CmdArgs: []string{"--template", "slack-samples/deno-starter-template"},
8484
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
8585
cm.IO.On("IsTTY").Return(true)
86-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
86+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
8787
Return(
8888
iostreams.SelectPromptResponse{
8989
Flag: true,
9090
Option: "slack-samples/deno-starter-template",
9191
},
9292
nil,
9393
)
94-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
94+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
9595
Return(
9696
iostreams.SelectPromptResponse{
9797
Flag: true,
@@ -129,7 +129,7 @@ func TestCreateCommand(t *testing.T) {
129129
},
130130
nil,
131131
)
132-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
132+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
133133
Return(
134134
iostreams.SelectPromptResponse{
135135
Prompt: true,
@@ -152,7 +152,7 @@ func TestCreateCommand(t *testing.T) {
152152
}
153153
createClientMock.AssertCalled(t, "Create", mock.Anything, mock.Anything, expected)
154154
// Verify that category prompt was NOT called
155-
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything)
155+
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything)
156156
cm.IO.AssertCalled(t, "InputPrompt", mock.Anything, "Name your app:", mock.Anything)
157157
},
158158
},
@@ -168,7 +168,7 @@ func TestCreateCommand(t *testing.T) {
168168
},
169169
nil,
170170
)
171-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
171+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
172172
Return(
173173
iostreams.SelectPromptResponse{
174174
Prompt: true,
@@ -189,19 +189,19 @@ func TestCreateCommand(t *testing.T) {
189189
}
190190
createClientMock.AssertCalled(t, "Create", mock.Anything, mock.Anything, expected)
191191
// Verify that category prompt was NOT called
192-
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything)
192+
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything)
193193
// Verify that name prompt was NOT called since name was provided as arg
194194
cm.IO.AssertNotCalled(t, "InputPrompt", mock.Anything, "Name your app:", mock.Anything)
195195
},
196196
},
197197
"creates a pydantic ai agent app": {
198198
CmdArgs: []string{"my-pydantic-app"},
199199
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
200-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
200+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
201201
Return(iostreams.SelectPromptResponse{Prompt: true, Index: 1}, nil)
202202
cm.IO.On("SelectPrompt", mock.Anything, "Select a template:", mock.Anything, mock.Anything).
203203
Return(iostreams.SelectPromptResponse{Prompt: true, Index: 0}, nil)
204-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
204+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
205205
Return(iostreams.SelectPromptResponse{Prompt: true, Index: 2}, nil)
206206
createClientMock = new(CreateClientMock)
207207
createClientMock.On("Create", mock.Anything, mock.Anything, mock.Anything).Return("", nil)
@@ -222,15 +222,15 @@ func TestCreateCommand(t *testing.T) {
222222
"creates an app named agent when template flag is provided": {
223223
CmdArgs: []string{"agent", "--template", "slack-samples/bolt-js-starter-template"},
224224
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
225-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
225+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
226226
Return(
227227
iostreams.SelectPromptResponse{
228228
Flag: true,
229229
Option: "slack-samples/bolt-js-starter-template",
230230
},
231231
nil,
232232
)
233-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
233+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
234234
Return(
235235
iostreams.SelectPromptResponse{
236236
Flag: true,
@@ -258,15 +258,15 @@ func TestCreateCommand(t *testing.T) {
258258
CmdArgs: []string{"--name", "agent"},
259259
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
260260
// Should prompt for category since agent shortcut is NOT triggered
261-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
261+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
262262
Return(
263263
iostreams.SelectPromptResponse{
264264
Prompt: true,
265265
Index: 0, // Select starter app
266266
},
267267
nil,
268268
)
269-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
269+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
270270
Return(
271271
iostreams.SelectPromptResponse{
272272
Prompt: true,
@@ -287,7 +287,7 @@ func TestCreateCommand(t *testing.T) {
287287
}
288288
createClientMock.AssertCalled(t, "Create", mock.Anything, mock.Anything, expected)
289289
// Verify that category prompt WAS called (shortcut was not triggered)
290-
cm.IO.AssertCalled(t, "SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything)
290+
cm.IO.AssertCalled(t, "SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything)
291291
// Verify that name prompt was NOT called since --name flag was provided
292292
cm.IO.AssertNotCalled(t, "InputPrompt", mock.Anything, "Name your app:", mock.Anything)
293293
},
@@ -304,7 +304,7 @@ func TestCreateCommand(t *testing.T) {
304304
},
305305
nil,
306306
)
307-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
307+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
308308
Return(
309309
iostreams.SelectPromptResponse{
310310
Prompt: true,
@@ -325,21 +325,21 @@ func TestCreateCommand(t *testing.T) {
325325
}
326326
createClientMock.AssertCalled(t, "Create", mock.Anything, mock.Anything, expected)
327327
// Verify that category prompt was NOT called (shortcut was triggered)
328-
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything)
328+
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything)
329329
},
330330
},
331331
"name flag overrides positional app name argument": {
332332
CmdArgs: []string{"my-project", "--name", "my-name"},
333333
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
334-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
334+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
335335
Return(
336336
iostreams.SelectPromptResponse{
337337
Prompt: true,
338338
Index: 0, // Select starter app
339339
},
340340
nil,
341341
)
342-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
342+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
343343
Return(
344344
iostreams.SelectPromptResponse{
345345
Prompt: true,
@@ -375,7 +375,7 @@ func TestCreateCommand(t *testing.T) {
375375
},
376376
nil,
377377
)
378-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
378+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
379379
Return(
380380
iostreams.SelectPromptResponse{
381381
Prompt: true,
@@ -396,23 +396,23 @@ func TestCreateCommand(t *testing.T) {
396396
}
397397
createClientMock.AssertCalled(t, "Create", mock.Anything, mock.Anything, expected)
398398
// Verify that category prompt was NOT called (agent shortcut was triggered)
399-
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything)
399+
cm.IO.AssertNotCalled(t, "SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything)
400400
// Verify that name prompt was NOT called since --name flag was provided
401401
cm.IO.AssertNotCalled(t, "InputPrompt", mock.Anything, "Name your app:", mock.Anything)
402402
},
403403
},
404404
"name prompt includes placeholder with generated name": {
405405
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
406406
cm.IO.On("IsTTY").Return(true)
407-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
407+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
408408
Return(
409409
iostreams.SelectPromptResponse{
410410
Prompt: true,
411411
Index: 0,
412412
},
413413
nil,
414414
)
415-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
415+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
416416
Return(
417417
iostreams.SelectPromptResponse{
418418
Prompt: true,
@@ -436,15 +436,15 @@ func TestCreateCommand(t *testing.T) {
436436
"user accepts default name from prompt": {
437437
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
438438
cm.IO.On("IsTTY").Return(true)
439-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
439+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
440440
Return(
441441
iostreams.SelectPromptResponse{
442442
Prompt: true,
443443
Index: 0,
444444
},
445445
nil,
446446
)
447-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
447+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
448448
Return(
449449
iostreams.SelectPromptResponse{
450450
Prompt: true,
@@ -471,15 +471,15 @@ func TestCreateCommand(t *testing.T) {
471471
CmdArgs: []string{"--template", "slack-samples/bolt-js-starter-template"},
472472
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
473473
// IsTTY defaults to false via AddDefaultMocks, simulating piped output
474-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
474+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
475475
Return(
476476
iostreams.SelectPromptResponse{
477477
Flag: true,
478478
Option: "slack-samples/bolt-js-starter-template",
479479
},
480480
nil,
481481
)
482-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
482+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
483483
Return(
484484
iostreams.SelectPromptResponse{
485485
Flag: true,
@@ -503,15 +503,15 @@ func TestCreateCommand(t *testing.T) {
503503
"positional arg skips name prompt": {
504504
CmdArgs: []string{"my-project"},
505505
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
506-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
506+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
507507
Return(
508508
iostreams.SelectPromptResponse{
509509
Prompt: true,
510510
Index: 0,
511511
},
512512
nil,
513513
)
514-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
514+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
515515
Return(
516516
iostreams.SelectPromptResponse{
517517
Prompt: true,
@@ -549,15 +549,15 @@ func TestCreateCommand(t *testing.T) {
549549
"passes subdir flag to create function": {
550550
CmdArgs: []string{"--template", "slack-samples/bolt-js-starter-template", "--subdir", "apps/my-app"},
551551
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
552-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
552+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
553553
Return(
554554
iostreams.SelectPromptResponse{
555555
Flag: true,
556556
Option: "slack-samples/bolt-js-starter-template",
557557
},
558558
nil,
559559
)
560-
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
560+
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
561561
Return(
562562
iostreams.SelectPromptResponse{
563563
Flag: true,

cmd/project/samples_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestSamplesCommand(t *testing.T) {
6363
},
6464
nil,
6565
)
66-
cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
66+
cm.IO.On("SelectPrompt", mock.Anything, "Select a category:", mock.Anything, mock.Anything).
6767
Return(
6868
iostreams.SelectPromptResponse{
6969
Option: "slack-samples/deno-starter-template",

0 commit comments

Comments
 (0)