Skip to content

Investigate upgrading to the latest charmbracelet/huh release (v0.7.0) #10852

Description

@babakks

In order to upgrade gh dependency on charmbracelet/huh to the latest version (v0.7.0, as of now), we have to investigate the changes made to the module and make sure the accessibility support in gh is not impacted.

Expected Output

  • Create improvement issues in cli/cli or charmbracelet/huh, if required.
  • Upgrade huh to 0.7.0 if feasible

Activity

  1. added
    coreThis issue is not accepting PRs from outside contributors
    dependenciesPull requests that update a dependency file
    on Apr 23, 2025
  2. BagToad commented on Apr 23, 2025

    @BagToad
    Member

    With the changes coming in from huh, there are a few places where we commented out the echo mode code for future use - we can uncomment those lines and test out the behavior:

    func (p *accessiblePrompter) Password(prompt string) (string, error) {
    var result string
    // EchoMode(huh.EchoModePassword) doesn't have any effect in accessible mode.
    form := p.newForm(
    huh.NewGroup(
    huh.NewInput().
    Title(prompt).
    Value(&result),
    ),
    )

    func (p *accessiblePrompter) AuthToken() (string, error) {
    var result string
    form := p.newForm(
    huh.NewGroup(
    huh.NewInput().
    Title("Paste your authentication token:").
    // Note: if this validation fails, the prompt loops.
    Validate(func(input string) error {
    if input == "" {
    return fmt.Errorf("token is required")
    }
    return nil
    }).
    Value(&result),
    // This doesn't have any effect in accessible mode.
    // EchoMode(huh.EchoModePassword),
    ),
    )
    err := form.Run()
    return result, err
    }

  3. self-assigned this
    on Apr 25, 2025
  4. andyfeller commented on Apr 25, 2025

    @andyfeller
    Contributor

    Changes in GitHub CLI user experience

    Note

    WIP

    Input prompts leave cursor on same line as prompt

    • huh v0.7.0

      $ GH_ACCESSIBLE_PROMPTER=1 GH_SPINNER_DISABLED=1 bin/gh issue create
      
      Creating issue in cli/cli
      
      Title (required) () This is just a title
      
      Choose a template 
      1. 🐛 Bug report
      2. 📣 Feedback
      3. 🎨 Submit a design proposal
      4. ⭐ Submit a request
      5. Open a blank issue
      Input a number between 1 and 5: 
    • huh v0.6.0

      $ GH_ACCESSIBLE_PROMPTER=1 GH_SPINNER_DISABLED=1 gh issue create 
      
      Creating issue in cli/cli
      
      Title (required) ()
      
      Input: This is just a title
      Input: This is just a title
                                 
      Choose a template
      1. 🐛 Bug report
      2. 📣 Feedback
      3. 🎨 Submit a design proposal
      4. ⭐ Submit a request
      5. Open a blank issue
      
      Choose: 

    Select and MultiSelect prompts contain actionable instructions

    In v2.71.0, the accessible select and multiselect prompt simply stated Choose whereas the new v0.7.0 release of huh has provided a more actionable prompt. Additionally, the 0 option to confirm selection now appears within the list of options rather than being a note on the prompt.

    • huh v0.7.0

      $ GH_ACCESSIBLE_PROMPTER=1 GH_SPINNER_DISABLED=1 bin/gh issue create
      
      Creating issue in cli/cli
      
      Title (required) () This is just a title
      
      Choose a template 
      1. 🐛 Bug report
      2. 📣 Feedback
      3. 🎨 Submit a design proposal
      4. ⭐ Submit a request
      5. Open a blank issue
      Input a number between 1 and 5: 5
      
      Body 
      1. Launch vim
      2. Skip
      Input a number between 1 and 2: 2
      
      What's next? 
      1. Submit
      2. Continue in browser
      3. Add metadata
      4. Cancel
      Input a number between 1 and 4: 3
      
      What would you like to add? 
      Select up to 4 options.
      1.   Assignees
      2.   Labels
      3.   Projects
      4.   Milestone
      0.   Confirm selection
      Input a number between 0 and 4: 
    • huh v0.6.0

      $ GH_ACCESSIBLE_PROMPTER=1 GH_SPINNER_DISABLED=1 gh issue create
      
      Creating issue in cli/cli
      
      Title (required) ()
      
      Input: This is just a title
      Input: This is just a title
                                 
      Choose a template
      1. 🐛 Bug report
      2. 📣 Feedback
      3. 🎨 Submit a design proposal
      4. ⭐ Submit a request
      5. Open a blank issue
      
      Choose: 5
      Chose: Open a blank issue
                               
      Body
      1. Launch vim
      2. Skip
      
      Choose: 2
      Chose: Skip
                 
      What's next?
      1. Submit
      2. Continue in browser
      3. Add metadata
      4. Cancel
      
      Choose: 3
      Chose: Add metadata
                         
      What would you like to add?
      1.   Assignees
      2.   Labels
      3.   Projects
      4.   Milestone
      
      Select up to 4 options. 0 to continue.
      Select: 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

accessibilitycoreThis issue is not accepting PRs from outside contributorsdependenciesPull requests that update a dependency file

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions