Skip to content

feat(experiment): inline sample descriptions in plain text#400

Open
zimeg wants to merge 1 commit intomainfrom
zimeg-feat-charm-sample-description
Open

feat(experiment): inline sample descriptions in plain text#400
zimeg wants to merge 1 commit intomainfrom
zimeg-feat-charm-sample-description

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Mar 15, 2026

Changelog

Nothing for this time 🍀 ✨

Summary

This PR inlines sample descriptions in plain text for the samples command and moves docs reference to help text and also removes emojis from descriptions to avoid output issues.

Preview

Before

before

After

after

Requirements

@zimeg zimeg added this to the Next Release milestone Mar 15, 2026
@zimeg zimeg self-assigned this Mar 15, 2026
@zimeg zimeg requested a review from a team as a code owner March 15, 2026 04:53
@zimeg zimeg added enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment labels Mar 15, 2026
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.91%. Comparing base (35e1743) to head (2ad9485).

Files with missing lines Patch % Lines
cmd/project/create_samples.go 40.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
+ Coverage   67.90%   67.91%   +0.01%     
==========================================
  Files         218      218              
  Lines       18050    18060      +10     
==========================================
+ Hits        12256    12265       +9     
  Misses       4640     4640              
- Partials     1154     1155       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes and questions for the kind reader 🧠 💡

Comment on lines -135 to -137
Description: func(value string, index int) string {
return optionsForCategory[index].Description
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 note: These descriptions aren't used for create selections so it's removed with these changes!

🪬 question: I notice samples does use descriptions and this causes outputs between "values" and "descriptions" different and am curious if we'd prefer to match that here?

func getSelectionOptions(clients *shared.ClientFactory, categoryID string) []promptObject {
if strings.TrimSpace(categoryID) == "" {
categoryID = "slack-cli#getting-started"
}
// App categories and templates
templatePromptObjects := map[string]([]promptObject){
"slack-cli#getting-started": []promptObject{
{
Title: fmt.Sprintf("Bolt for JavaScript %s", style.Secondary("Node.js")),
Repository: "slack-samples/bolt-js-starter-template",
},
{
Title: fmt.Sprintf("Bolt for Python %s", style.Secondary("Python")),
Repository: "slack-samples/bolt-python-starter-template",
},
},
"slack-cli#automation-apps": {
{
Title: fmt.Sprintf("Bolt for JavaScript %s", style.Secondary("Node.js")),
Repository: "slack-samples/bolt-js-custom-function-template",
},
{
Title: fmt.Sprintf("Bolt for Python %s", style.Secondary("Python")),
Repository: "slack-samples/bolt-python-custom-function-template",
},
{
Title: fmt.Sprintf("Deno Slack SDK %s", style.Secondary("Deno")),
Repository: "slack-samples/deno-starter-template",
},
},
"slack-cli#ai-apps": {
{
Title: fmt.Sprintf("Bolt for JavaScript %s", style.Secondary("Node.js")),
Repository: "slack-samples/bolt-js-assistant-template",
},
{
Title: fmt.Sprintf("Bolt for Python %s", style.Secondary("Python")),
Repository: "slack-samples/bolt-python-assistant-template",
},
},
}
return templatePromptObjects[categoryID]
}
func getSelectionOptionsForCategory(clients *shared.ClientFactory) []promptObject {
return []promptObject{
{
Title: fmt.Sprintf("Starter app %s", style.Secondary("Getting started Slack app")),
Repository: "slack-cli#getting-started",
},
{
Title: fmt.Sprintf("AI Agent app %s", style.Secondary("Slack agents and assistants")),
Repository: "slack-cli#ai-apps",
},
{
Title: fmt.Sprintf("Automation app %s", style.Secondary("Custom steps and workflows")),
Repository: "slack-cli#automation-apps",
},
{
Title: "View more samples",
Repository: viewMoreSamples,
},
}
}

if desc := cfg.Description(opt, len(opts)); desc != "" {
key = opt + "\n " + desc
if desc := style.RemoveEmoji(cfg.Description(opt, len(opts))); desc != "" {
key = opt + " - " + desc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐭 note: It'd be curious in a different separator but am unsure what reads best for most descriptions...

Help string // Optional help text displayed below the select title
PageSize int // The number of options displayed before the user needs to scroll
Required bool // If a response is required
Template string // Custom formatting of the selection prompt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👾 note: I'm hoping to follow up with a refactor to move parts of iostreams/survey to a new iostreams/prompts package that separates these interfaces from the survey implementations.

🪓 ramble: And hoping alongside that we can move toward stable experiments:

Suggested change
Template string // Custom formatting of the selection prompt
Template string // DEPRECATED: Custom formatting of the selection prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant