Skip to content

feat(experiment): use chevron prompt for text inputs#399

Open
zimeg wants to merge 1 commit intomainfrom
zimeg-fix-charm-chevron
Open

feat(experiment): use chevron prompt for text inputs#399
zimeg wants to merge 1 commit intomainfrom
zimeg-fix-charm-chevron

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Mar 15, 2026

Changelog

N/A - Experimental 🍀

ab0b535d8d286b021402c1d732c145593765032b480a1cae0cc357af3d2db564-502035577

Summary

This PR updates text inputs to prompt with a "chevron" icon for a nice and clean prompting experience 📺 ✨

Preview

demo

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 00:50
@zimeg zimeg added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented 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
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.

🔏 A few quick jots for the wonderful reviewers!

Comment on lines -139 to +149
assert.Contains(t, view, "❱ Foo")
assert.Contains(t, view, style.Chevron()+" Foo")
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: Here we use the style functions to avoid unexpected behaviors between OS!

Comment on lines -187 to -209
// SurveyIcons returns customizations to the appearance of prompts
func SurveyIcons() survey.AskOpt {
if !isStyleEnabled {
core.DisableColor = true
}

cursor := ">"
// Unfortunately "❱" does not display on Windows Powershell
// Limit "❱" to macOS until support is known for other operating systems
if isStyleEnabled && runtime.GOOS == "darwin" {
cursor = "❱"
}

// Customize the appearance of each survey prompt
return survey.WithIcons(func(icons *survey.IconSet) {
icons.SelectFocus.Text = cursor
icons.SelectFocus.Format = fmt.Sprintf("%d+b", blue)
icons.MarkedOption.Format = fmt.Sprintf("%d+b", blue)

icons.Question.Text = "?"
icons.Question.Format = fmt.Sprintf("%d+hb", gray)
})
}
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: This is moved to a shared theme file!

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.89%. Comparing base (35e1743) to head (c105559).

Files with missing lines Patch % Lines
internal/style/theme.go 58.82% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
- Coverage   67.90%   67.89%   -0.01%     
==========================================
  Files         218      218              
  Lines       18050    18054       +4     
==========================================
+ Hits        12256    12258       +2     
- Misses       4640     4642       +2     
  Partials     1154     1154              

☔ 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.

@zimeg zimeg changed the title fix(experiment): use chevron prompt for text inputs feat(experiment): use chevron prompt for text inputs Mar 15, 2026
@zimeg zimeg added enhancement M-T: A feature request for new functionality and removed bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented labels Mar 15, 2026
@zimeg
Copy link
Member Author

zimeg commented Mar 15, 2026

🐝 Adding chevron so to input might be more exciting addition in release notes! I changed the label for this.

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