Skip to content

Conversation

tidy-dev
Copy link
Contributor

@tidy-dev tidy-dev commented Aug 13, 2024

xref: https://github.com/github/accessibility-audits/issues/5637

Description

This PR adds input labels to the squash dialog so that the inputs are consistent with our other dialogs and therefore more accessible by providing visual labeling of the inputs. (Not relying on placeholders that are not visible on dialog open because the inputs are pre-populated).

Context: This is reusing the component from the changes view. Thus, it does appear differently than our other dialogs. Unlike in the changes view, the summary input is focused on open meaning a user may not see the placeholder label.

Screenshots

Squash Dialog:
Showing summary and description labels on inputs of squash dialog.

Changes List (Showing unchanged):
Showing that the form at the bottom of the changes dialog is unchanged.

Release notes

Notes: [Improved] The squash dialog provides input labels.

@tidy-dev tidy-dev requested a review from sergiou87 August 13, 2024 14:54
Comment on lines +1398 to +1412
{this.props.showInputLabels === true && (
<label htmlFor="commit-message-description">Description</label>
)}
<FocusContainer
className="description-focus-container"
onClick={this.onFocusContainerClick}
>
<AutocompletingTextArea
inputId="commit-message-description"
className={descriptionClassName}
screenReaderLabel="Commit description"
screenReaderLabel={
this.props.showInputLabels !== true
? 'Commit description'
: undefined
}
Copy link
Contributor Author

@tidy-dev tidy-dev Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are wondering why I pulled the label out... I didn't want to :D

The FocusContainer there is a faux input border so that the text area and co author inputs look like one input. Thus, adding a label directly above the actual textarea input resulted in it being included inside the faux input border.

@tidy-dev tidy-dev enabled auto-merge August 14, 2024 15:38
Copy link
Member

@sergiou87 sergiou87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you! 💖

@tidy-dev tidy-dev merged commit c6543c8 into development Aug 14, 2024
7 checks passed
@tidy-dev tidy-dev deleted the squash-dialog-input-labels branch August 14, 2024 15:50
@tidy-dev tidy-dev added the accessibility Issues related to accessibility improvements label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Issues related to accessibility improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants