feat(experiment): use chevron prompt for text inputs#399
Conversation
zimeg
left a comment
There was a problem hiding this comment.
🔏 A few quick jots for the wonderful reviewers!
| assert.Contains(t, view, "❱ Foo") | ||
| assert.Contains(t, view, style.Chevron()+" Foo") |
There was a problem hiding this comment.
🧱 note: Here we use the style functions to avoid unexpected behaviors between OS!
| // 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) | ||
| }) | ||
| } |
There was a problem hiding this comment.
👜 note: This is moved to a shared theme file!
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #399 +/- ##
==========================================
+ Coverage 67.91% 67.92% +0.01%
==========================================
Files 218 218
Lines 18054 18058 +4
==========================================
+ Hits 12261 12266 +5
+ Misses 4637 4634 -3
- Partials 1156 1158 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🐝 Adding chevron so to |
srtaalej
left a comment
There was a problem hiding this comment.
LGTM and working well! thanks for adding this ⭐
|
@srtaalej Thanks so much! It's in hopes to match selection prompts so I'll merge this now 🚢 💨 |
mwbrooks
left a comment
There was a problem hiding this comment.
praise: The chevron looks great! ❯❯❯
Changelog
Summary
This PR updates text inputs to prompt with a "chevron" icon for a nice and clean prompting experience 📺 ✨
Preview
Requirements