Repository navigation
fix(web): screen readers hear the add-project submit shortcut #32576
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
Changes from all commits
fe59342
2cb4003
2ac1b7d
c7e32d7
73598a6
5128f80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,7 @@ import { openThreadFind } from "./chat/threadFindStore"; | |
| import { | ||
| useDeferredValue, | ||
| useEffect, | ||
| useId, | ||
| useReducer, | ||
| useRef, | ||
| useState, | ||
|
|
@@ -2784,9 +2785,17 @@ function OpenCommandPaletteDialog(props: { | |
| await handleAddProject(pickedPath); | ||
| }; | ||
|
|
||
| const submitButtonId = useId(); | ||
| const browseSubmitLabel = | ||
| isCloneDestinationStep && !canCloneProject | ||
| ? "This connection needs permission to write source control and add projects." | ||
| : canCreateProject | ||
| ? `${submitActionLabel} (${addShortcutLabel})` | ||
| : "This connection cannot add projects."; | ||
| const inputAccessory = | ||
| newProjectFlow !== null ? ( | ||
| <CommandPaletteSubmitButton | ||
| id={submitButtonId} | ||
| label={isCreatingNewProject ? "Creating" : "Create"} | ||
| shortcutLabel={createShortcutLabel} | ||
| ariaLabel={`Create (${createShortcutLabel})`} | ||
|
|
@@ -2798,6 +2807,7 @@ function OpenCommandPaletteDialog(props: { | |
| /> | ||
| ) : addProjectCloneFlow?.step === "repository" ? ( | ||
| <CommandPaletteSubmitButton | ||
| id={submitButtonId} | ||
| label={isRemoteProjectPending ? "Working" : remoteProjectButtonLabel} | ||
| shortcutLabel="Enter" | ||
| ariaLabel={`${remoteProjectButtonLabel ?? "Continue"} (Enter)`} | ||
|
|
@@ -2809,16 +2819,11 @@ function OpenCommandPaletteDialog(props: { | |
| /> | ||
| ) : isBrowsing ? ( | ||
| <CommandPaletteSubmitButton | ||
| id={submitButtonId} | ||
| label={isCloneDestinationStep && isRemoteProjectPending ? "Cloning" : submitActionLabel} | ||
| shortcutLabel={addShortcutLabel} | ||
| ariaLabel={`${submitActionLabel} (${addShortcutLabel})`} | ||
| tooltip={ | ||
| isCloneDestinationStep && !canCloneProject | ||
| ? "This connection needs permission to write source control and add projects." | ||
| : canCreateProject | ||
| ? `${submitActionLabel} (${addShortcutLabel})` | ||
| : "This connection cannot add projects." | ||
| } | ||
| ariaLabel={browseSubmitLabel} | ||
| tooltip={browseSubmitLabel} | ||
| disabled={ | ||
| !canCreateProject || | ||
| !canCreateProjectInEnvironment(browseEnvironment?.connection.phase) || | ||
|
|
@@ -2886,6 +2891,7 @@ function OpenCommandPaletteDialog(props: { | |
| }) | ||
| : undefined, | ||
| placeholder: inputPlaceholder, | ||
| "aria-describedby": inputAccessory ? submitButtonId : undefined, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ...(isSubmenu | ||
| ? { | ||
| startAddon: ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.