refactor: remove survey package and permanently enable huh prompts#425
refactor: remove survey package and permanently enable huh prompts#425
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
+ Coverage 70.31% 70.86% +0.54%
==========================================
Files 220 219 -1
Lines 18497 18350 -147
==========================================
- Hits 13006 13003 -3
+ Misses 4319 4180 -139
+ Partials 1172 1167 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mwbrooks
left a comment
There was a problem hiding this comment.
👍🏻 The code changes are looking good!
🧪 I haven't taken this for a test run yet.
❓ Should this PR be set to Draft until we're ready to merge it. Before merging, we'll want to test the new prompts thoroughly as a team.
| // MimicInputPrompt formats a message and value to appear as a prompted input | ||
| func MimicInputPrompt(message string, value string) string { | ||
| return fmt.Sprintf( | ||
| "%s %s %s", | ||
| style.Darken("?"), | ||
| style.Highlight(message), | ||
| style.Input(value), | ||
| ) | ||
| } | ||
|
|
There was a problem hiding this comment.
question: Why was this added? A quick search doesn't show that it's called anywhere.
Since this PR is focused on removing survey, if we need to add MimicInputPrompt then we should probably do it in a separate PR to keep this one focused on removal.
There was a problem hiding this comment.
its used in @add.go env add command to display variable names. since it was in survey.go i figured i should move it to prompt.go but perhaps it makes more sense to have it directly in add.go...
Changelog
The
internal/iostreams/survey.gofile has been deleted, removing all survey-based prompt implementations, custom templates, color helpers, and theSurveyOptionsconfiguration function. The five prompt methods inprompts.go(ConfirmPrompt,InputPrompt,MultiSelectPrompt,PasswordPrompt,SelectPrompt) no longer checkexperiment.Huhand instead call their huh form counterparts directly.Summary
This PR completes the migration from the survey library to Charm's huh package for interactive prompts.
The
experiment.Huhflag and all survey-based prompt code have been removed, making huh the permanent and only prompt implementation.The
ThemeSurvey()theme (introduced in the parent PR) ensures visual continuity by matching the legacy survey styling when the Lipgloss experiment is off.Test Steps
Requirements