Skip to content

refactor: remove survey package and permanently enable huh prompts#425

Draft
srtaalej wants to merge 10 commits intomainfrom
ale-remove-survey
Draft

refactor: remove survey package and permanently enable huh prompts#425
srtaalej wants to merge 10 commits intomainfrom
ale-remove-survey

Conversation

@srtaalej
Copy link
Contributor

Changelog

The internal/iostreams/survey.go file has been deleted, removing all survey-based prompt implementations, custom templates, color helpers, and the SurveyOptions configuration function. The five prompt methods in prompts.go (ConfirmPrompt, InputPrompt, MultiSelectPrompt, PasswordPrompt, SelectPrompt) no longer check experiment.Huh and 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.Huh flag 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

make test testdir=internal/iostreams   # and verify all prompt form tests pass including the ThemeSurvey and ThemeSlack theme assertions
make test testdir=internal/style   # and confirm TestThemeSlack, TestThemeSurvey, and TestChevron pass without the removed TestSurveyIcons
make test testdir=internal/experiment    # and confirm the Test_Includes assertion no longer expects "huh" to be a registered experiment
make test testdir=cmd/project    # to verify the sample selection flow works without experiment gating
make lint     # to confirm zero issues
slack create    # interactively and verify prompts render with the expected cursor, selection indicators, and color scheme
slack env add MY_VAR    # without a --value flag and verify the mimicked input line still appears before the password prompt

Requirements

@srtaalej srtaalej self-assigned this Mar 20, 2026
@srtaalej srtaalej 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 20, 2026
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.86%. Comparing base (fae6821) to head (1e01d49).

Files with missing lines Patch % Lines
internal/iostreams/prompts.go 58.33% 5 Missing ⚠️
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.
📢 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.

@srtaalej srtaalej marked this pull request as ready for review March 23, 2026 20:29
@srtaalej srtaalej requested a review from a team as a code owner March 23, 2026 20:29
Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

👍🏻 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.

Comment on lines +29 to +38
// 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),
)
}

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@srtaalej srtaalej marked this pull request as draft March 24, 2026 13:56
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.

2 participants