-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Prototype using charmbracelet/huh for prompter #166
base: trunk
Are you sure you want to change the base?
Conversation
Relates cli/cli#8084 Relates #164 With go-survey/survey being unmaintained, this is an initial prototype of using https://github.com/charmbracelet/huh as an optional prompting experience including support for accessiblity needs. Additionally, this commit includes a simple example to demo the existing and new experiences in `examples/prompter/main.go`: - by default, the existing go-survey/survey experience - specifying `GH_PROMPTER=accessible`, the new charmbracelet/huh experience in rich mode - specifying `ACCESSIBLE=1` with `GH_PROMPTER=accessible`, the new charmbracelet/huh experience in accessible mode
stderr io.Writer | ||
} | ||
|
||
func NewAccessiblePrompter(stdin io.Reader, stdout io.Writer, stderr io.Writer) *AccessiblePrompter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from @maaslalani : rename this to something like GlamorousPrompter
stderr FileWriter | ||
} | ||
|
||
func NewLegacyPrompter(stdin FileReader, stdout FileWriter, stderr FileWriter) *LegacyPrompter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternate naming option: GoSurveyPrompter
@@ -32,103 +34,40 @@ type FileReader interface { | |||
|
|||
// New instantiates a new Prompter. | |||
func New(stdin FileReader, stdout FileWriter, stderr FileWriter) *Prompter { | |||
// TODO: Enhance logic to look at configuration for prompter type. | |||
prompterType := os.Getenv("GH_PROMPTER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea from @maaslalani : what if we forced GH_PROMPTER
to the new glamorous prompter experience if ACCESSIBLE=1
?
main concern about how the user's experience with 3rd party extensions would play out when they eventually upgrade cli/go-gh
but didn't consider the changes 🤔
Relates cli/cli#8084
Relates #164
With go-survey/survey being unmaintained, this is an initial prototype of using https://github.com/charmbracelet/huh as an optional prompting experience including support for accessiblity needs.
Additionally, this commit includes a simple example to demo the existing and new experiences in
examples/prompter/main.go
:GH_PROMPTER=accessible
, the new charmbracelet/huh experience in rich modeACCESSIBLE=1
withGH_PROMPTER=accessible
, the new charmbracelet/huh experience in accessible modeScreenshare.-.2024-06-03.10_26_38.AM.mp4