Commit cdeac77
authored
accessibility improvements (#1386)
* Add keyboard navigation, focus management and accessibility improvements
- Add KeyboardShortcutsDialog component and a global shortcut handler hook
- Implement useKeyboardNavigation and useGlobalKeyboardShortcuts hooks for consistent keyboard handling
- Add focusManager utility (focus history, focus trap, helpers) for centralized focus control
- Wire keyboard support into FeedbackBoard, FeedbackColumn, FeedbackItem and FeedbackItemGroup:
- column and item navigation (arrow keys, Home/End, 1-9 to jump columns)
- actions via keys (create/edit/delete/vote/group/move/add action/timer, expand/collapse groups)
- register and manage item refs, roving focus behavior and programmatic focus/focus cleanup
- Improve ARIA semantics and attributes (roles, aria-labels, aria-expanded, aria-controls, roledescription, live regions)
- Update CSS to expose visible focus styles and dialog styles for accessibility
- Remove/cleanup event listeners on unmount
- Add .playwright-mcp to .gitignore
* Enhance accessibility: expand feedback item aria-label to include title, creator, creation date and vote details
* Improve focus preservation when feedback items change
- Add focus preservation and restoration in FeedbackColumn (getSnapshotBeforeUpdate, componentDidUpdate)
- Preserve active element, selection ranges for inputs/textareas and cursor position for contentEditable
- Restore focus and selection after items are added/removed/reordered
- Add data-feedback-item-id to FeedbackItem root to reliably locate items for focus restoration
* Add arrow key navigation between feedback cards
Handle ArrowUp/ArrowDown in item keydown handler (prevent default) and add navigateToAdjacentCard implementation that finds visible items in the column and moves focus to the previous/next feedback item via its data-feedback-item-id.
* Add keyboard shortcuts menu item and dialog to extension settings
* Add accessibility, keyboard navigation and focus tests for dialogs, columns, items and FocusManager
* Add comprehensive FeedbackColumn tests for keyboard navigation, focus, dialogs, DnD and item lifecycle
- Add keyboard navigation tests (ArrowUp/Down, Home, End, 'n', 'e', 'i') including cases when inputs or dialogs block handling
- Add focus preservation tests for focus restoration, input selection, and contenteditable cursor retention after rerender
- Add dialog management tests for opening/closing edit and info dialogs and editing column notes
- Add drag-and-drop tests for dragover and drop handling on the column
- Add item registration/unregistration tests for item refs
- Add createEmptyFeedbackItem tests for Collect/Vote phase behavior and duplicate prevention
* Add tests: EditableText click-outside/save/escape behavior and event cleanup; SelectorCombo mobile/callout selection and header visibility; trim whitespace in FeedbackColumn tests
* Add tests: EditableText Ctrl+Enter empty validation; FeedbackCarousel sorting/aggregation/multi-column; FeedbackItemGroup keyboard, focus, drag/drop, aria and cleanup; SelectorCombo multi-list/empty-list cases; WorkflowStage non-Enter early return
* Add tests: FeedbackBoard keyboard navigation, FocusManager edge cases, EffectivenessMeasurementRow vote edge cases
- Add comprehensive keyboard navigation/shortcut tests for FeedbackBoard (?, arrow/number keys, modifiers, input/textarea/contentEditable/dialog guards)
- Expand FocusManager tests for findNextFocusableElement and createFocusTrap (visibility mocking, wrap behavior, non-Tab keys, empty containers, verify preventDefault)
- Add EffectivenessMeasurementRow tests for votes with undefined or empty responses arrays
- Remove unused React require in mocked FeedbackColumn
* Accessibility: simplify vote button aria-labels; include title in group aria-label
- Simplify vote action button aria-labels to remove the full feedback title and use concise phrasing ("Vote up/Vote down. Current vote count is X").
- Update feedback group aria-label to prepend the main item's title (falls back to "Untitled feedback") while retaining item count and expanded/collapsed state.
- Add unit tests covering simplified vote labels (including zero votes and hidden items) and group aria-label scenarios (title presence, untitled fallback, expansion state, and item counts).
* chore(deps): bump @types/react/@types/react-dom, cssnano, rimraf and related postcss packages
* Accessibility: move aria-live from container to error span and add role=alert
* Accessibility: simplify WorkflowStage aria-label to only display text; use aria-selected to indicate state; add aria-label to tablist; update tests
* Accessibility: make FeedbackColumn tabbable and handle immediate keyboard navigation; add tests
- Set column tabIndex to 0 so the column is keyboard-focusable.
- Fix navigateItems/prev logic to handle negative focused index and bail out when no valid target.
- Ensure keyboard handlers gracefully process ArrowDown/Home/End/ArrowUp even when nothing is focused.
- Add unit tests covering immediate-focus keyboard behavior (tabIndex, ArrowDown, Home, End, ArrowUp).
* Accessibility: mark obscured feedback as aria-hidden and add tests
- Set aria-hidden on feedback item root when hideFeedbackItems is true so screen
readers ignore obscured items.
- Apply aria-hidden to related child title when the child item is hidden.
- Add unit tests covering obscured feedback scenarios (hidden items, visible
items, owner-exempt items, and grouped child visibility).
- Add userIdentityHelper mock in tests to support owner-checking logic.
* Accessibility: move focus-within highlight to .feedback-column-header and remove column border color changes
* Accessibility: move focus-within highlight from .feedback-column-header to .feedback-column1 parent 7fcb9cf commit cdeac77
File tree
33 files changed
+4236
-114
lines changed- src/frontend
- components
- __tests__
- css
- utilities
- __tests__
33 files changed
+4236
-114
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
166 | 335 | | |
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
216 | 250 | | |
217 | 251 | | |
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
67 | 78 | | |
68 | 79 | | |
69 | 80 | | |
| |||
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
178 | 217 | | |
179 | 218 | | |
180 | 219 | | |
| |||
0 commit comments