[A11Y] [Medium] Button missing keyboard event handler in ShellwrightRecording component
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- css, typescript
- Domain
- accessibility, frontend
Research direction
Start with src/components/ShellwrightRecording/ShellwrightRecording.tsx and its CSS module, especially the toggle button and .toggle styles. Tab to the button on a page containing ShellwrightRecording, verify a visible focus indicator, and confirm Enter or Space still toggles the content; done means the focus styles and keyboard behavior meet the listed acceptance criteria.
Written by the indexing model from the issue text.
Description
Accessibility Issue: Button missing keyboard event handler
WCAG Level: A
Severity: Medium
Category: Keyboard Navigation Issues
Issue Description
The toggle button in the ShellwrightRecording component only has an onClick handler but no keyboard event handlers. While standard <button> elements are keyboard accessible by default (responding to Enter and Space), this should be verified to ensure proper functionality for keyboard-only users.
Additionally, the button lacks a visible focus indicator in the CSS - the :focus pseudo-class is not defined for the .toggle class.
User Impact
- Affected Users: Keyboard-only users, users with motor disabilities
- Severity: Users may have difficulty seeing when the button is focused
Violations Found
File: src/components/ShellwrightRecording/ShellwrightRecording.tsx
Lines: 35-42
<button
className={styles.toggle}
onClick={() => setShowPrompt(!showPrompt)}
>
{showPrompt ? 'Show recording' : 'Show prompt'}
</button>
Issue: Button missing visible focus styles (handled in CSS module)
File: src/components/ShellwrightRecording/ShellwrightRecording.module.css
Lines: 32-42
.toggle {
background: none;
border: 1px solid var(--ifm-color-emphasis-300);
border-radius: 4px;
padding: 0.25rem 0.5rem;
font-size: 0.8rem;
cursor: pointer;
color: var(--ifm-color-emphasis-700);
}
.toggle:hover {
background: var(--ifm-color-emphasis-100);
}
Issue: Missing :focus and :focus-visible styles for visible focus indicator
Recommended Fix
.toggle {
background: none;
border: 1px solid var(--ifm-color-emphasis-300);
border-radius: 4px;
padding: 0.25rem 0.5rem;
font-size: 0.8rem;
cursor: pointer;
color: var(--ifm-color-emphasis-700);
}
.toggle:hover {
background: var(--ifm-color-emphasis-100);
}
.toggle:focus {
outline: 2px solid var(--ifm-color-primary);
outline-offset: 2px;
}
.toggle:focus:not(:focus-visible) {
outline: none;
}
.toggle:focus-visible {
outline: 2px solid var(--ifm-color-primary);
outline-offset: 2px;
}
Changes Made:
- Added
:focusstyles for visible focus indicator - Added
:focus-visiblefor better mouse/keyboard differentiation
Testing Instructions
- Navigate to any page with a ShellwrightRecording component
- Use Tab key to focus the "Show prompt" button
- Verify a visible focus ring appears around the button
- Press Enter or Space to activate the button
- Verify the toggle works correctly
Resources
Acceptance Criteria
- Focus styles added to the toggle button
- Keyboard navigation works correctly
- Focus indicator is visible when using keyboard
- Manual testing completed
- Dominant language
- JavaScript
- Stars
- 779
- Forks
- 93
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dwmkerr/effective-shell
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
dwmkerr/effective-shell#384 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dwmkerr/effective-shell#383 ·
-
accessibility severity-low wcag-a
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dwmkerr/effective-shell#417 ·
-
accessibility severity-low wcag-a
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dwmkerr/effective-shell#416 ·
-
accessibility severity-low wcag-a
Difficulty 4/5 3-5 days Newbie friendliness 48/100
dwmkerr/effective-shell#415 ·
All issues in dwmkerr/effective-shell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·