From 274a09bbc97657163b2eabf64a5c979987fd64c3 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Wed, 23 Apr 2025 10:11:51 -0400 Subject: [PATCH 01/16] Initial `gh accessibility` command draft This commit captures the initial command along with functionality and description. There is an internal discussion about the appropriate place for some of this content. --- pkg/cmd/accessibility/accessibility.go | 150 +++++++++++++++++++++++++ pkg/cmd/root/help.go | 11 +- pkg/cmd/root/root.go | 2 + 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 pkg/cmd/accessibility/accessibility.go diff --git a/pkg/cmd/accessibility/accessibility.go b/pkg/cmd/accessibility/accessibility.go new file mode 100644 index 00000000000..4992d488b79 --- /dev/null +++ b/pkg/cmd/accessibility/accessibility.go @@ -0,0 +1,150 @@ +package accessibility + +import ( + "fmt" + + "github.com/MakeNowJust/heredoc" + "github.com/cli/cli/v2/internal/browser" + "github.com/cli/cli/v2/internal/text" + "github.com/cli/cli/v2/pkg/cmdutil" + "github.com/cli/cli/v2/pkg/iostreams" + "github.com/spf13/cobra" +) + +const ( + communityURL = "https://github.com/orgs/community/discussions/categories/accessibility" +) + +type AccessibilityOptions struct { + IO *iostreams.IOStreams + Browser browser.Browser + Web bool +} + +func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { + opts := AccessibilityOptions{ + IO: f.IOStreams, + Browser: f.Browser, + } + + cmd := &cobra.Command{ + Use: "accessibility", + Aliases: []string{"a11y"}, + Short: "Learn about GitHub CLI accessibility experience", + Long: longDescription(opts.IO), + Hidden: true, + RunE: func(cmd *cobra.Command, args []string) error { + if opts.Web { + if opts.IO.IsStdoutTTY() { + fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(communityURL)) + } + return opts.Browser.Browse(communityURL) + } + + return cmd.Help() + }, + Example: heredoc.Doc(` + # Open the GitHub Community Accessibility discussions in your browser + $ gh accessibility --web + + # Display color using customizable, 4-bit accessible colors + $ gh config set accessible_colors enabled + + # Display issue and pull request labels using RGB hex color codes in terminals that support 24-bit truecolor + $ gh config set color_labels enabled + + # Use input prompts without redrawing the screen + $ gh config set accessible_prompter enabled + + # Disable motion-based spinners for progress indicators in favor of text + $ gh config set spinner disabled + `), + } + + cmd.Flags().BoolVarP(&opts.Web, "web", "w", false, "Open the GitHub Community Accessibility discussions in the browser") + cmdutil.DisableAuthCheck(cmd) + + return cmd +} + +func longDescription(io *iostreams.IOStreams) string { + cs := io.ColorScheme() + title := cs.Bold("LEARN ABOUT GITHUB CLI ACCESSIBILITY EFFORTS") + color := cs.Bold("CUSTOMIZABLE AND CONTRASTING COLORS") + prompter := cs.Bold("NON-INTERACTIVE USER INPUT PROMPTING") + spinner := cs.Bold("TEXT-BASED SPINNERS") + + return heredoc.Docf(` + %[2]s + + As the home for all developers, we want every developer to feel welcome in our + community and be empowered to contribute to the future of global software + development with everything GitHub has to offer including the GitHub CLI. + + We invite you to join us in improving GitHub CLI accessibility by sharing your + feedback and ideas in the GitHub Community Accessibility discussions: + %[3]s + + + %[4]s + + Color is a common approach to enhance user experiences, however users can find + themselves with a worse experience due to insufficient contrast or + customizability. + + To create an accessible experience, CLIs should use color palettes based on + terminal background appearance and limit colors to 4-bit ANSI color palettes, + which users can customize within terminal preferences. + + With this new experience, the GitHub CLI provides multiple options to address + color usage: + + 1. The GitHub CLI will use 4-bit color palette for increased color contrast based on + dark and light backgrounds including rendering markdown based on GitHub Primer. + + To enable this experience, use one of the following methods: + - Run %[1]sgh config set accessible_colors enabled%[1]s + - Set %[1]sGH_ACCESSIBLE_COLORS=enabled%[1]s environment variable + + 2. The GitHub CLI will display issue and pull request labels' custom RGB colors + in terminals with truecolor support. + + To enable this experience, use one of the following methods: + - Run %[1]sgh config set color_labels enabled%[1]s + - Set %[1]sGH_COLOR_LABELS=enabled%[1]s environment variable + + + %[5]s + + Interactive text user interfaces are an advanced approach to enhance user + experiences, which manipulate the terminal cursor to redraw parts of the screen. + However, this can be difficult for speech synthesizers or braille displays to + accurately detect and read. + + To create an accessible experience, CLIs should give users the ability to disable + this interactivity while providing a similar experience. + + With this new experience, the GitHub CLI will use non-interactive prompts for + user input. + + To enable this experience, use one of the following methods: + - Run %[1]sgh config set accessible_prompter enabled%[1]s + - Set %[1]sGH_ACCESSIBLE_PROMPTER=enabled%[1]s environment variable + + + %[6]s + + Motion-based spinners are a common approach to communicate activity, which + manipulate the terminal cursor to create a spinning effect. However, this can be + difficult for users with motion sensitivity as well as speech synthesizers. + + To create an accessible experience, CLIs should give users the ability to disable + this interactivity while providing a similar experience. + + With this new experience, the GitHub CLI will use text-based progress indicators. + + To enable this experience, use one of the following methods: + - Run %[1]sgh config set spinner disabled%[1]s + - Set %[1]sGH_SPINNER_DISABLED=yes%[1]s environment variable + `, "`", title, communityURL, color, prompter, spinner) +} diff --git a/pkg/cmd/root/help.go b/pkg/cmd/root/help.go index 7f8fb1c2e86..ec6499f214e 100644 --- a/pkg/cmd/root/help.go +++ b/pkg/cmd/root/help.go @@ -109,8 +109,6 @@ func rootHelpFunc(f *cmdutil.Factory, command *cobra.Command, _ []string) { return } - namePadding := 12 - type helpEntry struct { Title string Body string @@ -135,6 +133,12 @@ func rootHelpFunc(f *cmdutil.Factory, command *cobra.Command, _ []string) { helpEntries = append(helpEntries, helpEntry{"ALIASES", strings.Join(BuildAliasList(command, command.Aliases), ", ") + "\n"}) } + // Statically calculated padding for non-extension commands, + // longest is `gh accessibility` with 13 characters + 1 space. + // + // Should consider novel way to calculate this in the future [AF] + namePadding := 14 + for _, g := range GroupedCommands(command) { var names []string for _, c := range g.Commands { @@ -148,6 +152,9 @@ func rootHelpFunc(f *cmdutil.Factory, command *cobra.Command, _ []string) { if isRootCmd(command) { var helpTopics []string + if c := findCommand(command, "accessibility"); c != nil { + helpTopics = append(helpTopics, rpad(c.Name()+":", namePadding)+c.Short) + } if c := findCommand(command, "actions"); c != nil { helpTopics = append(helpTopics, rpad(c.Name()+":", namePadding)+c.Short) } diff --git a/pkg/cmd/root/root.go b/pkg/cmd/root/root.go index c0dad93ec05..8cf30db1be2 100644 --- a/pkg/cmd/root/root.go +++ b/pkg/cmd/root/root.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/MakeNowJust/heredoc" + accessibilityCmd "github.com/cli/cli/v2/pkg/cmd/accessibility" actionsCmd "github.com/cli/cli/v2/pkg/cmd/actions" aliasCmd "github.com/cli/cli/v2/pkg/cmd/alias" "github.com/cli/cli/v2/pkg/cmd/alias/shared" @@ -122,6 +123,7 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) (*cobra.Command, // Child commands cmd.AddCommand(versionCmd.NewCmdVersion(f, version, buildDate)) + cmd.AddCommand(accessibilityCmd.NewCmdAccessibility(f)) cmd.AddCommand(actionsCmd.NewCmdActions(f)) cmd.AddCommand(aliasCmd.NewCmdAlias(f)) cmd.AddCommand(authCmd.NewCmdAuth(f)) From 97a3b70599dcba4aae1c24fc36796362505d39ed Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Sat, 26 Apr 2025 12:57:10 -0400 Subject: [PATCH 02/16] Update to huh@0.7.0, echo mode changes This commit is the initial change around updating to huh@0.7.0; pre-testing changes. --- go.mod | 2 +- go.sum | 12 ++++++++++-- internal/prompter/prompter.go | 9 ++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 31b07f2cf44..3562f24a696 100644 --- a/go.mod +++ b/go.mod @@ -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.1-0.20250409210615-c5906631cbb5 + github.com/charmbracelet/huh v0.7.0 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 diff --git a/go.sum b/go.sum index b312bcf6c5d..2ac25c2f895 100644 --- a/go.sum +++ b/go.sum @@ -110,20 +110,28 @@ github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4p github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk= github.com/charmbracelet/glamour v0.9.2-0.20250319212134-549f544650e3 h1:hx6E25SvI2WiZdt/gxINcYBnHD7PE2Vr9auqwg5B05g= github.com/charmbracelet/glamour v0.9.2-0.20250319212134-549f544650e3/go.mod h1:ihVqv4/YOY5Fweu1cxajuQrwJFh3zU4Ukb4mHVNjq3s= -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/huh v0.7.0 h1:W8S1uyGETgj9Tuda3/JdVkc3x7DBLZYPZc4c+/rnRdc= +github.com/charmbracelet/huh v0.7.0/go.mod h1:UGC3DZHlgOKHvHC07a5vHag41zzhpPFj34U92sOmyuk= 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= github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q= github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k= github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= +github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U= +github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ= +github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA= +github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0= github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ= github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4= github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= +github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY= +github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo= +github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI= +github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4= github.com/cli/browser v1.0.0/go.mod h1:IEWkHYbLjkhtjwwWlwTHW2lGxeS5gezEQBMLTwDHf5Q= github.com/cli/browser v1.3.0 h1:LejqCrpWr+1pRqmEPDGnTZOjsMe7sehifLynZJuqJpo= github.com/cli/browser v1.3.0/go.mod h1:HH8s+fOAxjhQoBUAsKuPCbqUuxZDhQ2/aD+SzsEfBTk= diff --git a/internal/prompter/prompter.go b/internal/prompter/prompter.go index 2a432836668..d5637466504 100644 --- a/internal/prompter/prompter.go +++ b/internal/prompter/prompter.go @@ -137,10 +137,12 @@ func (p *accessiblePrompter) Input(prompt, defaultValue string) (string, error) func (p *accessiblePrompter) Password(prompt string) (string, error) { var result string - // EchoMode(huh.EchoModePassword) doesn't have any effect in accessible mode. + // EchoModeNone and EchoModePassword both result in disabling echo mode + // as password masking is outside of VT100 spec. form := p.newForm( huh.NewGroup( huh.NewInput(). + EchoMode(huh.EchoModeNone). Title(prompt). Value(&result), ), @@ -171,9 +173,12 @@ func (p *accessiblePrompter) Confirm(prompt string, defaultValue bool) (bool, er func (p *accessiblePrompter) AuthToken() (string, error) { var result string + // EchoModeNone and EchoModePassword both result in disabling echo mode + // as password masking is outside of VT100 spec. form := p.newForm( huh.NewGroup( huh.NewInput(). + EchoMode(huh.EchoModeNone). Title("Paste your authentication token:"). // Note: if this validation fails, the prompt loops. Validate(func(input string) error { @@ -183,8 +188,6 @@ func (p *accessiblePrompter) AuthToken() (string, error) { return nil }). Value(&result), - // This doesn't have any effect in accessible mode. - // EchoMode(huh.EchoModePassword), ), ) From 519926b7cf7458df6e12d9f280ae6c2072796e22 Mon Sep 17 00:00:00 2001 From: Antonio Consuegra Date: Mon, 28 Apr 2025 13:54:09 +0200 Subject: [PATCH 03/16] Fix expected error output of TestRepo/repo-set-default --- acceptance/testdata/repo/repo-set-default.txtar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/testdata/repo/repo-set-default.txtar b/acceptance/testdata/repo/repo-set-default.txtar index 4f7fa327303..de4eda11f6a 100644 --- a/acceptance/testdata/repo/repo-set-default.txtar +++ b/acceptance/testdata/repo/repo-set-default.txtar @@ -7,7 +7,7 @@ defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING # Ensure that no default is set cd $SCRIPT_NAME-$RANDOM_STRING exec gh repo set-default --view -stderr 'no default repository has been set; use `gh repo set-default` to select one' +stderr 'No default remote repository has been set. To learn more about the default repository, run: gh repo set-default --help' # Set the default exec gh repo set-default $ORG/$SCRIPT_NAME-$RANDOM_STRING From a53b6c074ce66b8df7dd7abddcc713abf15efa1b Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 28 Apr 2025 08:55:47 -0400 Subject: [PATCH 04/16] Assert password and auth token not displayed This commit expands existing tests (thanks to @babakks) to assert whether the echo mode is actually disabled for password and auth token prompts. --- internal/prompter/accessible_prompter_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/prompter/accessible_prompter_test.go b/internal/prompter/accessible_prompter_test.go index 619eb14f131..63f253331aa 100644 --- a/internal/prompter/accessible_prompter_test.go +++ b/internal/prompter/accessible_prompter_test.go @@ -134,6 +134,11 @@ func TestAccessiblePrompter(t *testing.T) { passwordValue, err := p.Password("Enter password") require.NoError(t, err) require.Equal(t, dummyPassword, passwordValue) + + // Ensure the dummy password is not printed to the screen, + // asserting that echo mode is disabled without OS-level tests. + _, err = console.ExpectString(" \r\n\r\n") + require.NoError(t, err) }) t.Run("Confirm", func(t *testing.T) { @@ -192,6 +197,11 @@ func TestAccessiblePrompter(t *testing.T) { authValue, err := p.AuthToken() require.NoError(t, err) require.Equal(t, dummyAuthToken, authValue) + + // Ensure the dummy password is not printed to the screen, + // asserting that echo mode is disabled without OS-level tests. + _, err = console.ExpectString(" \r\n\r\n") + require.NoError(t, err) }) t.Run("AuthToken - blank input returns error", func(t *testing.T) { @@ -220,6 +230,11 @@ func TestAccessiblePrompter(t *testing.T) { authValue, err := p.AuthToken() require.NoError(t, err) require.Equal(t, dummyAuthTokenForAfterFailure, authValue) + + // Ensure the dummy password is not printed to the screen, + // asserting that echo mode is disabled without OS-level tests. + _, err = console.ExpectString(" \r\n\r\n") + require.NoError(t, err) }) t.Run("ConfirmDeletion", func(t *testing.T) { From 9fa00c350bb4a09dca6ed76d607ed8baef3d9d2e Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 28 Apr 2025 10:17:23 -0400 Subject: [PATCH 05/16] Update accessible tests based on huh@0.7.0 changes --- internal/prompter/accessible_prompter_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/prompter/accessible_prompter_test.go b/internal/prompter/accessible_prompter_test.go index 63f253331aa..2211d7720c9 100644 --- a/internal/prompter/accessible_prompter_test.go +++ b/internal/prompter/accessible_prompter_test.go @@ -38,7 +38,7 @@ func TestAccessiblePrompter(t *testing.T) { go func() { // Wait for prompt to appear - _, err := console.ExpectString("Choose:") + _, err := console.ExpectString("Input a number between 1 and 3:") require.NoError(t, err) // Select option 1 @@ -57,7 +57,7 @@ func TestAccessiblePrompter(t *testing.T) { go func() { // Wait for prompt to appear - _, err := console.ExpectString("Select a number") + _, err := console.ExpectString("Input a number between 0 and 3:") require.NoError(t, err) // Select options 1 and 2 @@ -340,7 +340,7 @@ func TestAccessiblePrompter(t *testing.T) { require.NoError(t, err) // Expect a notice to enter something valid since blank is disallowed. - _, err = console.ExpectString("invalid input. please try again") + _, err = console.ExpectString("Invalid: must be between 1 and 1") require.NoError(t, err) // Send a 1 to select to open the editor. This will immediately exit @@ -367,7 +367,7 @@ func TestAccessiblePrompter(t *testing.T) { require.NoError(t, err) // Expect a notice to enter something valid since blank is disallowed. - _, err = console.ExpectString("invalid input. please try again") + _, err = console.ExpectString("Invalid: must be between 1 and 1") require.NoError(t, err) // Send a 1 to select to open the editor since skip is invalid and From 2d66877d6c447ffb20a602c338e6aab13c916035 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 28 Apr 2025 11:15:28 -0400 Subject: [PATCH 06/16] Update internal/prompter/accessible_prompter_test.go --- internal/prompter/accessible_prompter_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/prompter/accessible_prompter_test.go b/internal/prompter/accessible_prompter_test.go index 2211d7720c9..3c8420cdec4 100644 --- a/internal/prompter/accessible_prompter_test.go +++ b/internal/prompter/accessible_prompter_test.go @@ -136,7 +136,7 @@ func TestAccessiblePrompter(t *testing.T) { require.Equal(t, dummyPassword, passwordValue) // Ensure the dummy password is not printed to the screen, - // asserting that echo mode is disabled without OS-level tests. + // asserting that echo mode is disabled. _, err = console.ExpectString(" \r\n\r\n") require.NoError(t, err) }) From df0aedbe3c0e5e474f7b5238354cf2ba22eecd3a Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 28 Apr 2025 11:16:35 -0400 Subject: [PATCH 07/16] Update internal/prompter/prompter.go --- internal/prompter/prompter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/prompter/prompter.go b/internal/prompter/prompter.go index d5637466504..c3281efbf06 100644 --- a/internal/prompter/prompter.go +++ b/internal/prompter/prompter.go @@ -137,8 +137,8 @@ func (p *accessiblePrompter) Input(prompt, defaultValue string) (string, error) func (p *accessiblePrompter) Password(prompt string) (string, error) { var result string - // EchoModeNone and EchoModePassword both result in disabling echo mode - // as password masking is outside of VT100 spec. + // EchoModePassword is not used as password masking is unsupported in huh. + // EchoModeNone and EchoModePassword have the same effect of hiding user input. form := p.newForm( huh.NewGroup( huh.NewInput(). From 88d52ebf97bcbfe48a064206709e0adcb0c92922 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 28 Apr 2025 11:20:17 -0400 Subject: [PATCH 08/16] Fix other disabled echo mode comments --- internal/prompter/accessible_prompter_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/prompter/accessible_prompter_test.go b/internal/prompter/accessible_prompter_test.go index 3c8420cdec4..c95d379e357 100644 --- a/internal/prompter/accessible_prompter_test.go +++ b/internal/prompter/accessible_prompter_test.go @@ -199,7 +199,7 @@ func TestAccessiblePrompter(t *testing.T) { require.Equal(t, dummyAuthToken, authValue) // Ensure the dummy password is not printed to the screen, - // asserting that echo mode is disabled without OS-level tests. + // asserting that echo mode is disabled. _, err = console.ExpectString(" \r\n\r\n") require.NoError(t, err) }) @@ -232,7 +232,7 @@ func TestAccessiblePrompter(t *testing.T) { require.Equal(t, dummyAuthTokenForAfterFailure, authValue) // Ensure the dummy password is not printed to the screen, - // asserting that echo mode is disabled without OS-level tests. + // asserting that echo mode is disabled. _, err = console.ExpectString(" \r\n\r\n") require.NoError(t, err) }) From d7e2468286db92630a0393386d717aec3c46f0fb Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 28 Apr 2025 15:01:15 -0400 Subject: [PATCH 09/16] Update a11y text based on draft feedback --- pkg/cmd/accessibility/accessibility.go | 89 +++++++++++++------------- pkg/cmd/root/help.go | 1 + 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/pkg/cmd/accessibility/accessibility.go b/pkg/cmd/accessibility/accessibility.go index 4992d488b79..1d4a8009f06 100644 --- a/pkg/cmd/accessibility/accessibility.go +++ b/pkg/cmd/accessibility/accessibility.go @@ -12,7 +12,7 @@ import ( ) const ( - communityURL = "https://github.com/orgs/community/discussions/categories/accessibility" + feedbackURL = "https://accessibility.github.com/feedback" ) type AccessibilityOptions struct { @@ -30,27 +30,27 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "accessibility", Aliases: []string{"a11y"}, - Short: "Learn about GitHub CLI accessibility experience", + Short: "Learn about GitHub CLI accessibility experiences", Long: longDescription(opts.IO), Hidden: true, RunE: func(cmd *cobra.Command, args []string) error { if opts.Web { if opts.IO.IsStdoutTTY() { - fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(communityURL)) + fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(feedbackURL)) } - return opts.Browser.Browse(communityURL) + return opts.Browser.Browse(feedbackURL) } return cmd.Help() }, Example: heredoc.Doc(` - # Open the GitHub Community Accessibility discussions in your browser + # Open the GitHub Accessibility site in your browser $ gh accessibility --web # Display color using customizable, 4-bit accessible colors $ gh config set accessible_colors enabled - # Display issue and pull request labels using RGB hex color codes in terminals that support 24-bit truecolor + # Display issue and pull request labels using RGB hex color codes in terminals that support 24-bit true color $ gh config set color_labels enabled # Use input prompts without redrawing the screen @@ -61,7 +61,7 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { `), } - cmd.Flags().BoolVarP(&opts.Web, "web", "w", false, "Open the GitHub Community Accessibility discussions in the browser") + cmd.Flags().BoolVarP(&opts.Web, "web", "w", false, "Open the GitHub Accessibility site in your browser") cmdutil.DisableAuthCheck(cmd) return cmd @@ -69,10 +69,11 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { func longDescription(io *iostreams.IOStreams) string { cs := io.ColorScheme() - title := cs.Bold("LEARN ABOUT GITHUB CLI ACCESSIBILITY EFFORTS") - color := cs.Bold("CUSTOMIZABLE AND CONTRASTING COLORS") - prompter := cs.Bold("NON-INTERACTIVE USER INPUT PROMPTING") - spinner := cs.Bold("TEXT-BASED SPINNERS") + title := cs.Bold("Learn about GitHub CLI accessibility experiences") + color := cs.Bold("Customizable and contrasting colors") + prompter := cs.Bold("Non-interactive user input prompting") + spinner := cs.Bold("Text-based spinners") + feedback := cs.Bold("Join the conversation") return heredoc.Docf(` %[2]s @@ -81,70 +82,66 @@ func longDescription(io *iostreams.IOStreams) string { community and be empowered to contribute to the future of global software development with everything GitHub has to offer including the GitHub CLI. - We invite you to join us in improving GitHub CLI accessibility by sharing your - feedback and ideas in the GitHub Community Accessibility discussions: %[3]s + Text interfaces often use color for various purposes, but insufficient contrast + or customizability can leave some users unable to benefit. - %[4]s - - Color is a common approach to enhance user experiences, however users can find - themselves with a worse experience due to insufficient contrast or - customizability. - - To create an accessible experience, CLIs should use color palettes based on - terminal background appearance and limit colors to 4-bit ANSI color palettes, - which users can customize within terminal preferences. + To create a more accessible experience, the GitHub CLI will use color palettes + based on terminal background appearance and limit colors to 4-bit ANSI color + palettes, which users can customize within terminal preferences. With this new experience, the GitHub CLI provides multiple options to address color usage: - 1. The GitHub CLI will use 4-bit color palette for increased color contrast based on - dark and light backgrounds including rendering markdown based on GitHub Primer. + 1. The GitHub CLI will use 4-bit color palette for increased color contrast based + on dark and light backgrounds including rendering Markdown based on the + GitHub Primer design system. To enable this experience, use one of the following methods: - Run %[1]sgh config set accessible_colors enabled%[1]s - Set %[1]sGH_ACCESSIBLE_COLORS=enabled%[1]s environment variable 2. The GitHub CLI will display issue and pull request labels' custom RGB colors - in terminals with truecolor support. + in terminals with true color support. To enable this experience, use one of the following methods: - Run %[1]sgh config set color_labels enabled%[1]s - Set %[1]sGH_COLOR_LABELS=enabled%[1]s environment variable + %[4]s - %[5]s - - Interactive text user interfaces are an advanced approach to enhance user - experiences, which manipulate the terminal cursor to redraw parts of the screen. - However, this can be difficult for speech synthesizers or braille displays to - accurately detect and read. - - To create an accessible experience, CLIs should give users the ability to disable - this interactivity while providing a similar experience. + Interactive text user interfaces manipulate the terminal cursor to redraw parts + of the screen, which can be difficult for speech synthesizers or braille displays + to accurately detect and read. - With this new experience, the GitHub CLI will use non-interactive prompts for - user input. + To create a more accessible experience, the GitHub CLI gives users the ability to + disable this interactivity while providing a similar experience using + non-interactive prompts for user input. To enable this experience, use one of the following methods: - Run %[1]sgh config set accessible_prompter enabled%[1]s - Set %[1]sGH_ACCESSIBLE_PROMPTER=enabled%[1]s environment variable + %[5]s - %[6]s - - Motion-based spinners are a common approach to communicate activity, which - manipulate the terminal cursor to create a spinning effect. However, this can be - difficult for users with motion sensitivity as well as speech synthesizers. - - To create an accessible experience, CLIs should give users the ability to disable - this interactivity while providing a similar experience. + Motion-based spinners communicate in-progress activity by manipulating the + terminal cursor to create a spinning effect, which can be difficult for users + with motion sensitivity or miscommunicate information to speech synthesizers. - With this new experience, the GitHub CLI will use text-based progress indicators. + To create a more accessible experience, the GitHub CLI gives users the ability to + disable this interactivity while providing a similar experience using text-based + progress indicators. To enable this experience, use one of the following methods: - Run %[1]sgh config set spinner disabled%[1]s - Set %[1]sGH_SPINNER_DISABLED=yes%[1]s environment variable - `, "`", title, communityURL, color, prompter, spinner) + + %[6]s + + We invite you to join us in improving GitHub CLI accessibility by sharing your + feedback and ideas through GitHub Accessibility feedback channels: + + %[7]s + `, "`", title, color, prompter, spinner, feedback, feedbackURL) } diff --git a/pkg/cmd/root/help.go b/pkg/cmd/root/help.go index ec6499f214e..2676cdd1517 100644 --- a/pkg/cmd/root/help.go +++ b/pkg/cmd/root/help.go @@ -190,6 +190,7 @@ func rootHelpFunc(f *cmdutil.Factory, command *cobra.Command, _ []string) { Use %[1]sgh --help%[1]s for more information about a command. Read the manual at https://cli.github.com/manual Learn about exit codes using %[1]sgh help exit-codes%[1]s + Learn about accessibility experiences using %[1]sgh help accessibility%[1]s `, "`")}) out := f.IOStreams.Out From 9ed733fa5e751be1196f133b086e8981a835ee31 Mon Sep 17 00:00:00 2001 From: Azeem Sajid Date: Tue, 29 Apr 2025 15:48:20 +0500 Subject: [PATCH 10/16] Add `closingIssuesReferences` JSON field to `pr view` (#10544) * [gh pr view] Support `closingIssuesReferences` JSON field * Support pagination * Support pagination * Fix typo * Add more fields --- api/export_pr.go | 19 +++++++++++ api/export_pr_test.go | 64 ++++++++++++++++++++++++++++++++++++ api/queries_pr.go | 22 +++++++++++++ api/query_builder.go | 22 +++++++++++++ pkg/cmd/pr/shared/finder.go | 44 +++++++++++++++++++++++++ pkg/cmd/pr/view/view_test.go | 1 + 6 files changed, 172 insertions(+) diff --git a/api/export_pr.go b/api/export_pr.go index bb33108118a..7ae1a4ff4e9 100644 --- a/api/export_pr.go +++ b/api/export_pr.go @@ -139,6 +139,25 @@ func (pr *PullRequest) ExportData(fields []string) map[string]interface{} { } } data[f] = &requests + case "closingIssuesReferences": + items := make([]map[string]interface{}, 0, len(pr.ClosingIssuesReferences.Nodes)) + for _, n := range pr.ClosingIssuesReferences.Nodes { + items = append(items, map[string]interface{}{ + + "id": n.ID, + "number": n.Number, + "url": n.URL, + "repository": map[string]interface{}{ + "id": n.Repository.ID, + "name": n.Repository.Name, + "owner": map[string]interface{}{ + "id": n.Repository.Owner.ID, + "login": n.Repository.Owner.Login, + }, + }, + }) + } + data[f] = items default: sf := fieldByName(v, f) data[f] = sf.Interface() diff --git a/api/export_pr_test.go b/api/export_pr_test.go index b7f4dcddbed..09a1dffe870 100644 --- a/api/export_pr_test.go +++ b/api/export_pr_test.go @@ -245,6 +245,70 @@ func TestPullRequest_ExportData(t *testing.T) { } `), }, + { + name: "linked issues", + fields: []string{"closingIssuesReferences"}, + inputJSON: heredoc.Doc(` + { "closingIssuesReferences": { "nodes": [ + { + "id": "I_123", + "number": 123, + "url": "https://github.com/cli/cli/issues/123", + "repository": { + "id": "R_123", + "name": "cli", + "owner": { + "id": "O_123", + "login": "cli" + } + } + }, + { + "id": "I_456", + "number": 456, + "url": "https://github.com/cli/cli/issues/456", + "repository": { + "id": "R_456", + "name": "cli", + "owner": { + "id": "O_456", + "login": "cli" + } + } + } + ] } } + `), + outputJSON: heredoc.Doc(` + { "closingIssuesReferences": [ + { + "id": "I_123", + "number": 123, + "repository": { + "id": "R_123", + "name": "cli", + "owner": { + "id": "O_123", + "login": "cli" + } + }, + "url": "https://github.com/cli/cli/issues/123" + }, + { + "id": "I_456", + "number": 456, + "repository": { + "id": "R_456", + "name": "cli", + "owner": { + "id": "O_456", + "login": "cli" + } + }, + "url": "https://github.com/cli/cli/issues/456" + } + ] } + `), + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/api/queries_pr.go b/api/queries_pr.go index aa493b5e98e..5b941bb428a 100644 --- a/api/queries_pr.go +++ b/api/queries_pr.go @@ -93,6 +93,8 @@ type PullRequest struct { Reviews PullRequestReviews LatestReviews PullRequestReviews ReviewRequests ReviewRequests + + ClosingIssuesReferences ClosingIssuesReferences } type StatusCheckRollupNode struct { @@ -107,6 +109,26 @@ type CommitStatusCheckRollup struct { Contexts CheckContexts } +type ClosingIssuesReferences struct { + Nodes []struct { + ID string + Number int + URL string + Repository struct { + ID string + Name string + Owner struct { + ID string + Login string + } + } + } + PageInfo struct { + HasNextPage bool + EndCursor string + } +} + // https://docs.github.com/en/graphql/reference/enums#checkrunstate type CheckRunState string diff --git a/api/query_builder.go b/api/query_builder.go index 2112367e321..4c45da3c1b2 100644 --- a/api/query_builder.go +++ b/api/query_builder.go @@ -132,6 +132,25 @@ var prCommits = shortenQuery(` } `) +var prClosingIssuesReferences = shortenQuery(` + closingIssuesReferences(first: 100) { + nodes { + id, + number, + url, + repository { + id, + name, + owner { + id, + login + } + } + } + pageInfo{hasNextPage,endCursor} + } +`) + var autoMergeRequest = shortenQuery(` autoMergeRequest { authorEmail, @@ -287,6 +306,7 @@ var PullRequestFields = append(sharedIssuePRFields, "baseRefName", "baseRefOid", "changedFiles", + "closingIssuesReferences", "commits", "deletions", "files", @@ -366,6 +386,8 @@ func IssueGraphQL(fields []string) string { q = append(q, StatusCheckRollupGraphQLWithoutCountByState("")) case "statusCheckRollupWithCountByState": // pseudo-field q = append(q, StatusCheckRollupGraphQLWithCountByState()) + case "closingIssuesReferences": + q = append(q, prClosingIssuesReferences) default: q = append(q, field) } diff --git a/pkg/cmd/pr/shared/finder.go b/pkg/cmd/pr/shared/finder.go index 6d36ef816e4..e6bb7d66a63 100644 --- a/pkg/cmd/pr/shared/finder.go +++ b/pkg/cmd/pr/shared/finder.go @@ -239,6 +239,11 @@ func (f *finder) Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, err return preloadPrComments(httpClient, f.baseRefRepo, pr) }) } + if fields.Contains("closingIssuesReferences") { + g.Go(func() error { + return preloadPrClosingIssuesReferences(httpClient, f.baseRefRepo, pr) + }) + } if fields.Contains("statusCheckRollup") { g.Go(func() error { return preloadPrChecks(httpClient, f.baseRefRepo, pr) @@ -452,6 +457,45 @@ func preloadPrComments(client *http.Client, repo ghrepo.Interface, pr *api.PullR return nil } +func preloadPrClosingIssuesReferences(client *http.Client, repo ghrepo.Interface, pr *api.PullRequest) error { + if !pr.ClosingIssuesReferences.PageInfo.HasNextPage { + return nil + } + + type response struct { + Node struct { + PullRequest struct { + ClosingIssuesReferences api.ClosingIssuesReferences `graphql:"closingIssuesReferences(first: 100, after: $endCursor)"` + } `graphql:"...on PullRequest"` + } `graphql:"node(id: $id)"` + } + + variables := map[string]interface{}{ + "id": githubv4.ID(pr.ID), + "endCursor": githubv4.String(pr.ClosingIssuesReferences.PageInfo.EndCursor), + } + + gql := api.NewClientFromHTTP(client) + + for { + var query response + err := gql.Query(repo.RepoHost(), "closingIssuesReferences", &query, variables) + if err != nil { + return err + } + + pr.ClosingIssuesReferences.Nodes = append(pr.ClosingIssuesReferences.Nodes, query.Node.PullRequest.ClosingIssuesReferences.Nodes...) + + if !query.Node.PullRequest.ClosingIssuesReferences.PageInfo.HasNextPage { + break + } + variables["endCursor"] = githubv4.String(query.Node.PullRequest.ClosingIssuesReferences.PageInfo.EndCursor) + } + + pr.ClosingIssuesReferences.PageInfo.HasNextPage = false + return nil +} + func preloadPrChecks(client *http.Client, repo ghrepo.Interface, pr *api.PullRequest) error { if len(pr.StatusCheckRollup.Nodes) == 0 { return nil diff --git a/pkg/cmd/pr/view/view_test.go b/pkg/cmd/pr/view/view_test.go index e7f572c7663..2cd4066b84b 100644 --- a/pkg/cmd/pr/view/view_test.go +++ b/pkg/cmd/pr/view/view_test.go @@ -37,6 +37,7 @@ func TestJSONFields(t *testing.T) { "changedFiles", "closed", "closedAt", + "closingIssuesReferences", "comments", "commits", "createdAt", From d8512a90666afc2e247506777b3319b2ddb820e8 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:35:04 -0600 Subject: [PATCH 11/16] fix(prompter): respect default MultiSelect a11y prompter --- internal/prompter/accessible_prompter_test.go | 21 +++++++++++++++++++ internal/prompter/prompter.go | 9 ++++++++ 2 files changed, 30 insertions(+) diff --git a/internal/prompter/accessible_prompter_test.go b/internal/prompter/accessible_prompter_test.go index 619eb14f131..a7326752d38 100644 --- a/internal/prompter/accessible_prompter_test.go +++ b/internal/prompter/accessible_prompter_test.go @@ -76,6 +76,27 @@ func TestAccessiblePrompter(t *testing.T) { assert.Equal(t, []int{0, 1}, multiSelectValue) }) + t.Run("MultiSelect - default values are respected by being pre-selected", func(t *testing.T) { + console := newTestVirtualTerminal(t) + p := newTestAccessiblePrompter(t, console) + + go func() { + // Wait for prompt to appear + _, err := console.ExpectString("Select a number") + require.NoError(t, err) + + // Don't select anything because the default should be selected. + + // This confirms selections + _, err = console.SendLine("0") + require.NoError(t, err) + }() + + multiSelectValue, err := p.MultiSelect("Select a number", []string{"2"}, []string{"1", "2", "3"}) + require.NoError(t, err) + assert.Equal(t, []int{1}, multiSelectValue) + }) + t.Run("Input", func(t *testing.T) { console := newTestVirtualTerminal(t) p := newTestAccessiblePrompter(t, console) diff --git a/internal/prompter/prompter.go b/internal/prompter/prompter.go index 2a432836668..322270086a7 100644 --- a/internal/prompter/prompter.go +++ b/internal/prompter/prompter.go @@ -2,6 +2,7 @@ package prompter import ( "fmt" + "slices" "strings" "github.com/AlecAivazis/survey/v2" @@ -100,6 +101,14 @@ func (p *accessiblePrompter) MultiSelect(prompt string, defaults []string, optio var result []int formOptions := make([]huh.Option[int], len(options)) for i, o := range options { + // If this option is in the defaults slice, + // let's add it's index to the result slice and huh + // will treat it as a default selection. + // TODO: does an invalid default value constitute a panic? + if slices.Contains(defaults, o) { + result = append(result, i) + } + formOptions[i] = huh.NewOption(o, i) } From 00c930d50957c1bededbf6a40b243be4e5a71bab Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 30 Apr 2025 08:04:16 -0600 Subject: [PATCH 12/16] doc(prompter): small typo --- internal/prompter/prompter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/prompter/prompter.go b/internal/prompter/prompter.go index 2c5c221b063..1e4f5592a56 100644 --- a/internal/prompter/prompter.go +++ b/internal/prompter/prompter.go @@ -102,7 +102,7 @@ func (p *accessiblePrompter) MultiSelect(prompt string, defaults []string, optio formOptions := make([]huh.Option[int], len(options)) for i, o := range options { // If this option is in the defaults slice, - // let's add it's index to the result slice and huh + // let's add its index to the result slice and huh // will treat it as a default selection. // TODO: does an invalid default value constitute a panic? if slices.Contains(defaults, o) { From 096106a3d703ce9c8177b6608b58f6338f5478f0 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Wed, 30 Apr 2025 14:20:16 -0400 Subject: [PATCH 13/16] Apply suggestions from code review Co-authored-by: Melissa Xie --- pkg/cmd/accessibility/accessibility.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/cmd/accessibility/accessibility.go b/pkg/cmd/accessibility/accessibility.go index 1d4a8009f06..f05bc7bcc6a 100644 --- a/pkg/cmd/accessibility/accessibility.go +++ b/pkg/cmd/accessibility/accessibility.go @@ -30,7 +30,7 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "accessibility", Aliases: []string{"a11y"}, - Short: "Learn about GitHub CLI accessibility experiences", + Short: "Learn about GitHub CLI's accessibility experiences", Long: longDescription(opts.IO), Hidden: true, RunE: func(cmd *cobra.Command, args []string) error { @@ -87,7 +87,7 @@ func longDescription(io *iostreams.IOStreams) string { Text interfaces often use color for various purposes, but insufficient contrast or customizability can leave some users unable to benefit. - To create a more accessible experience, the GitHub CLI will use color palettes + For a more accessible experience, the GitHub CLI can use color palettes based on terminal background appearance and limit colors to 4-bit ANSI color palettes, which users can customize within terminal preferences. @@ -115,8 +115,7 @@ func longDescription(io *iostreams.IOStreams) string { of the screen, which can be difficult for speech synthesizers or braille displays to accurately detect and read. - To create a more accessible experience, the GitHub CLI gives users the ability to - disable this interactivity while providing a similar experience using + For a more accessible experience, the GitHub CLI can provide a similar experience using non-interactive prompts for user input. To enable this experience, use one of the following methods: @@ -126,12 +125,11 @@ func longDescription(io *iostreams.IOStreams) string { %[5]s Motion-based spinners communicate in-progress activity by manipulating the - terminal cursor to create a spinning effect, which can be difficult for users + terminal cursor to create a spinning effect, which may cause discomfort to users with motion sensitivity or miscommunicate information to speech synthesizers. - To create a more accessible experience, the GitHub CLI gives users the ability to - disable this interactivity while providing a similar experience using text-based - progress indicators. + For a more accessible experience, this interactivity can be disabled in favor + of text-based progress indicators. To enable this experience, use one of the following methods: - Run %[1]sgh config set spinner disabled%[1]s From 2fd1a45a81ae6466dea5598ce9825f984a6fb770 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Wed, 30 Apr 2025 14:21:02 -0400 Subject: [PATCH 14/16] Update pkg/cmd/accessibility/accessibility.go --- pkg/cmd/accessibility/accessibility.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/accessibility/accessibility.go b/pkg/cmd/accessibility/accessibility.go index f05bc7bcc6a..d37631d25ef 100644 --- a/pkg/cmd/accessibility/accessibility.go +++ b/pkg/cmd/accessibility/accessibility.go @@ -69,7 +69,7 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { func longDescription(io *iostreams.IOStreams) string { cs := io.ColorScheme() - title := cs.Bold("Learn about GitHub CLI accessibility experiences") + title := cs.Bold("Learn about GitHub CLI's accessibility experiences") color := cs.Bold("Customizable and contrasting colors") prompter := cs.Bold("Non-interactive user input prompting") spinner := cs.Bold("Text-based spinners") From c20138d8442457c5c6f326fdbd13d73e47b06a32 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Wed, 30 Apr 2025 14:35:35 -0400 Subject: [PATCH 15/16] Update pkg/cmd/accessibility/accessibility.go --- pkg/cmd/accessibility/accessibility.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/cmd/accessibility/accessibility.go b/pkg/cmd/accessibility/accessibility.go index d37631d25ef..19fb813a45b 100644 --- a/pkg/cmd/accessibility/accessibility.go +++ b/pkg/cmd/accessibility/accessibility.go @@ -50,9 +50,6 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { # Display color using customizable, 4-bit accessible colors $ gh config set accessible_colors enabled - # Display issue and pull request labels using RGB hex color codes in terminals that support 24-bit true color - $ gh config set color_labels enabled - # Use input prompts without redrawing the screen $ gh config set accessible_prompter enabled From 830335d9209d399ae1415ec927dd4d00ea1e0ab2 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Wed, 30 Apr 2025 15:05:07 -0400 Subject: [PATCH 16/16] PR feedback --- pkg/cmd/accessibility/accessibility.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/accessibility/accessibility.go b/pkg/cmd/accessibility/accessibility.go index 19fb813a45b..c5de6c1a481 100644 --- a/pkg/cmd/accessibility/accessibility.go +++ b/pkg/cmd/accessibility/accessibility.go @@ -12,7 +12,7 @@ import ( ) const ( - feedbackURL = "https://accessibility.github.com/feedback" + webURL = "https://accessibility.github.com/conformance/cli/" ) type AccessibilityOptions struct { @@ -36,9 +36,9 @@ func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { if opts.Web { if opts.IO.IsStdoutTTY() { - fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(feedbackURL)) + fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(webURL)) } - return opts.Browser.Browse(feedbackURL) + return opts.Browser.Browse(webURL) } return cmd.Help() @@ -125,7 +125,7 @@ func longDescription(io *iostreams.IOStreams) string { terminal cursor to create a spinning effect, which may cause discomfort to users with motion sensitivity or miscommunicate information to speech synthesizers. - For a more accessible experience, this interactivity can be disabled in favor + For a more accessible experience, this interactivity can be disabled in favor of text-based progress indicators. To enable this experience, use one of the following methods: @@ -138,5 +138,5 @@ func longDescription(io *iostreams.IOStreams) string { feedback and ideas through GitHub Accessibility feedback channels: %[7]s - `, "`", title, color, prompter, spinner, feedback, feedbackURL) + `, "`", title, color, prompter, spinner, feedback, webURL) }