Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
202c1ad
feat(prompter): add accessible prompter support
BagToad Mar 31, 2025
7b0c095
feat(md prompter): md prompt respects blankAllowed
BagToad Mar 31, 2025
e973ee3
fix(md prompter): accessible prompt allows blank
BagToad Mar 31, 2025
92b1a8e
test(prompter): remove t.parallel calls
BagToad Mar 31, 2025
88a98ea
feat(prompter): include `no` as false-y value
BagToad Apr 2, 2025
f7de9e0
test(prompter): `go-expect` based prompter tests
BagToad Apr 2, 2025
94bbd26
fix(prompter): rename huhprompter
BagToad Apr 2, 2025
0d7fd36
test(prompter): replace assert with require
BagToad Apr 2, 2025
e42af35
tests(prompter): rename huhprompter
BagToad Apr 2, 2025
e299b56
test(prompter): remove needless variable declaration
BagToad Apr 2, 2025
8827803
test(prompter): skip vt10x tests on Windows
BagToad Apr 2, 2025
88e6285
test(prompter): move to external package
BagToad Apr 3, 2025
02fc12e
fix(linter): linter errors
BagToad Apr 3, 2025
49ddacf
docs(prompter): doc prompter interface
BagToad Apr 3, 2025
a30df14
refactor(prompter): rename env var for speech synthesizer friendly pr…
BagToad Apr 3, 2025
5b0d49c
test(prompter): more tests for bad input
BagToad Apr 4, 2025
4cf048a
fix(prompter): input returns default when blank
BagToad Apr 4, 2025
5c39e0b
fix(prompter): notes about Confirm default
BagToad Apr 4, 2025
2e48cad
fix(prompter): remove impossible condition
BagToad Apr 4, 2025
0b49522
refactor(prompter): less magic strings
BagToad Apr 4, 2025
f897001
doc(prompter): clarify comments
BagToad Apr 4, 2025
5996f88
doc(envs): speech synthesis prompter
BagToad Apr 7, 2025
2a851e3
test(prompter): fix race conditions
BagToad Apr 7, 2025
0543aac
test(prompter): add basic survey prompter test
BagToad Apr 7, 2025
6640740
doc: comment typos and formatting
BagToad Apr 7, 2025
c5ffb3c
test: use example.com in tests
BagToad Apr 7, 2025
fb80b5b
test(prompter): remove needless NO_COLOR set
BagToad Apr 7, 2025
d8d3874
fix(prompter): use os.lookupenv for accessible prompter
BagToad Apr 8, 2025
ef58e62
test(prompter): timeout for tests is 1s
BagToad Apr 8, 2025
c4be95a
refactor(prompter): remove unused variable
BagToad Apr 8, 2025
8821f77
doc(prompter): remove senseless comment
BagToad Apr 8, 2025
9cf3413
refactor(prompter): explicit return values
BagToad Apr 8, 2025
19387b8
fix(prompter): rename GH_ACCESSIBLE_PROMPTER
BagToad Apr 8, 2025
fa03157
doc(help): label GH_ACCESSIBLE_PROMPTER as preview
BagToad Apr 8, 2025
d230b08
test(prompter): re-add skipped test for accessible confirm default
BagToad Apr 8, 2025
8615632
Merge branch 'trunk' into kw/first-pass-accessible-prompter
BagToad Apr 9, 2025
3b2e7f7
chore: go mod tidy
BagToad Apr 9, 2025
a34c9ea
doc(prompter env): accessible prompter includes braille reader
BagToad Apr 9, 2025
8fc8486
refactor(prompter): rename speechSynthesizerFriendlyPrompter to acces…
BagToad Apr 9, 2025
2f5e896
fix(prompter): update `huh` and fix tests
BagToad Apr 9, 2025
fab0de5
fix(prompter): pass io to `huh` and refactor tests
BagToad Apr 9, 2025
4615069
chore: go mod tidy
BagToad Apr 9, 2025
47d6032
test(prompter): use *testing.T instead
BagToad Apr 10, 2025
8b70870
test(prompter): describe why echo is editorcmd
BagToad Apr 10, 2025
9eee77a
test(prompter): doc how accessible prompter tests work
BagToad Apr 10, 2025
20ff409
fix(prompter): remove needless default value assignment
BagToad Apr 10, 2025
b8cd094
Ensure markdown confirm prompt shows editor name
andyfeller Apr 10, 2025
8cd3992
test(prompter): fix race condition
BagToad Apr 10, 2025
70537de
test(prompter): fix invalid comment
BagToad Apr 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(prompter): update huh and fix tests
  • Loading branch information
BagToad committed Apr 9, 2025
commit 2f5e8965355bd120364cccb52e6f973a6e85718c
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/briandowns/spinner v1.18.1
github.com/cenkalti/backoff/v4 v4.3.0
github.com/charmbracelet/glamour v0.9.2-0.20250319212134-549f544650e3
github.com/charmbracelet/huh v0.6.0
github.com/charmbracelet/huh v0.6.1-0.20250409210615-c5906631cbb5
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc
github.com/cli/go-gh/v2 v2.12.0
github.com/cli/go-internal v0.0.0-20241025142207-6c48bcd5ce24
Expand Down Expand Up @@ -71,8 +71,8 @@ require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/catppuccin/go v0.2.0 // indirect
github.com/charmbracelet/bubbles v0.20.0 // indirect
github.com/catppuccin/go v0.3.0 // indirect
github.com/charmbracelet/bubbles v0.21.0 // indirect
github.com/charmbracelet/bubbletea v1.3.4 // indirect
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ github.com/briandowns/spinner v1.18.1 h1:yhQmQtM1zsqFsouh09Bk/jCjd50pC3EOGsh28gL
github.com/briandowns/spinner v1.18.1/go.mod h1:mQak9GHqbspjC/5iUx3qMlIho8xBS/ppAL/hX5SmPJU=
github.com/catppuccin/go v0.2.0 h1:ktBeIrIP42b/8FGiScP9sgrWOss3lw0Z5SktRoithGA=
github.com/catppuccin/go v0.2.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc=
github.com/catppuccin/go v0.3.0 h1:d+0/YicIq+hSTo5oPuRi5kOpqkVA5tAsU6dNhvRu+aY=
github.com/catppuccin/go v0.3.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE=
github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU=
github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs=
github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
github.com/charmbracelet/bubbletea v1.3.4 h1:kCg7B+jSCFPLYRA52SDZjr51kG/fMUEoPoZrkaDHyoI=
github.com/charmbracelet/bubbletea v1.3.4/go.mod h1:dtcUCyCGEX3g9tosuYiut3MXgY/Jsv9nKVdibKKRRXo=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
Expand All @@ -112,6 +116,8 @@ github.com/charmbracelet/glamour v0.9.2-0.20250319212134-549f544650e3 h1:hx6E25S
github.com/charmbracelet/glamour v0.9.2-0.20250319212134-549f544650e3/go.mod h1:ihVqv4/YOY5Fweu1cxajuQrwJFh3zU4Ukb4mHVNjq3s=
github.com/charmbracelet/huh v0.6.0 h1:mZM8VvZGuE0hoDXq6XLxRtgfWyTI3b2jZNKh0xWmax8=
github.com/charmbracelet/huh v0.6.0/go.mod h1:GGNKeWCeNzKpEOh/OJD8WBwTQjV3prFAtQPpLv+AVwU=
github.com/charmbracelet/huh v0.6.1-0.20250409210615-c5906631cbb5 h1:uOnMxWghHfEYm2DPMeIHHAEirV/TduBVC9ZRXGcX9Q8=
github.com/charmbracelet/huh v0.6.1-0.20250409210615-c5906631cbb5/go.mod h1:xl27E/xNaX3WwdkqpvBwjJcGWhupkU52CWLC5hReBTw=
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc h1:nFRtCfZu/zkltd2lsLUPlVNv3ej/Atod9hcdbRZtlys=
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc/go.mod h1:aKC/t2arECF6rNOnaKaVU6y4t4ZeHQzqfxedE/VkVhA=
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
Expand Down
4 changes: 0 additions & 4 deletions internal/prompter/accessible_prompter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ func TestAccessiblePrompter(t *testing.T) {
wg.Wait()
})

// This test currently fails because the value is
// not respected as the default in accessible mode.
// See https://github.com/charmbracelet/huh/issues/615
t.Run("Confirm - blank input returns default", func(t *testing.T) {
t.Skip("Skipped due to https://github.com/charmbracelet/huh/issues/615")
go func() {
// Wait for prompt to appear
_, err := console.ExpectString("Are you sure")
Expand Down
7 changes: 1 addition & 6 deletions internal/prompter/prompter.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ func (p *accessiblePrompter) MultiSelect(prompt string, defaults []string, optio
return nil, err
}

mid := len(result) / 2
return result[:mid], nil
return result, nil
}

func (p *accessiblePrompter) Input(prompt, defaultValue string) (string, error) {
Expand Down Expand Up @@ -164,10 +163,6 @@ func (p *accessiblePrompter) Password(prompt string) (string, error) {
}

func (p *accessiblePrompter) Confirm(prompt string, defaultValue bool) (bool, error) {
// This is currently an ineffectual assignment because the value is
// not respected as the default in accessible mode. Leaving this in here
// because it may change in the future.
// See https://github.com/charmbracelet/huh/issues/615
result := defaultValue
form := p.newForm(
huh.NewGroup(
Expand Down