Skip to content

fix(a11y): consistent confirm/cancel button ordering (#474)#507

Open
Whiznificent wants to merge 1 commit into
Predictify-org:mainfrom
Whiznificent:fix/474-button-order
Open

fix(a11y): consistent confirm/cancel button ordering (#474)#507
Whiznificent wants to merge 1 commit into
Predictify-org:mainfrom
Whiznificent:fix/474-button-order

Conversation

@Whiznificent

Copy link
Copy Markdown

Make DOM, visual, and Tab order match for every dialog/alert-dialog and mobile drawer to satisfy WCAG 2.4.3 Focus Order and provide a thumb-friendly mobile primary action at the bottom.

Changes:

  • AlertDialogFooter / DialogFooter: drop flex-col-reverse so cancel renders above the action visually on mobile, while keeping the desktop right-aligned row layout. Replace sm:space-x-2 with sm:gap-3 and add vertical gap-2 so spacing is consistent across viewports.
  • AlertDialogCancel: drop leftover mt-2 sm:mt-0 now handled by the parent gap.
  • BetConfirmPattern / DisputeActionPattern mobile DrawerFooter: reorder so Cancel precedes the primary/destructive action in the DOM so the visual order matches Tab order.
  • docs/BUTTON_ORDER.md: new canonical rule document.
  • docs/a11y-status.md: add audit row referencing Add accessible confirm/cancel button ordering #474 and the new doc.
  • components/ui/tests/dialog-footer.test.tsx: focused tests asserting DOM order, Tab order, and absence of flex-col-reverse.

Pull Request

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)
  • Style/UI changes
  • Test updates
  • CI/CD changes
  • Security improvements

Related Issues

Changes Made

Files Modified

  • [List specific files and changes made]
  • [Include file paths and line numbers if relevant]

Key Changes

  • [Describe the main changes and their impact]
  • [Include any architectural decisions made]

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing completed
  • Cross-browser testing (if applicable)
  • Mobile responsiveness tested (if applicable)
  • Accessibility testing completed
  • Performance testing (if applicable)

Test Coverage

  • New code is covered by tests
  • Existing tests still pass
  • Test coverage meets project standards

Screenshots/Videos

Minimum screenshots for UI/design PRs

  • Desktop default state
  • Mobile default state
  • One stressed state: error, empty, loading, success, validation, open menu, or open modal
  • Focus-visible screenshot for the primary interactive element (required when focus behavior changed)
  • Open overlay screenshot for modal, drawer, popover, select, or date picker (required when applicable)
  • Quick actions closed and open states (required for toolbar, FAB, or bottom-sheet action changes)
  • Keyboard-open mobile screenshot and desktop sticky state (required for sticky action panel changes)

Before

After

Pre-submission Checklist

Code Quality

  • Code follows project style guidelines
  • Self-review completed
  • Code is self-documenting
  • No console errors or warnings
  • No linting errors
  • No TypeScript errors (if applicable)

Functionality

  • All tests pass
  • Feature works as expected
  • No breaking changes introduced
  • Performance impact assessed

Documentation

  • README updated (if applicable)
  • Code comments added where necessary
  • API documentation updated (if applicable)
  • Changelog updated (if applicable)

Security & Accessibility

  • Security considerations addressed
  • Accessibility standards met
  • No sensitive data exposed
  • Input validation implemented

Breaking Changes

Breaking Changes:

  • [List any breaking changes]

Migration Steps:

  • [Provide steps for users to migrate]

Additional Notes

Dependencies

  • No new dependencies added
  • Dependencies updated (list changes)
  • Security vulnerabilities addressed

Performance Impact

  • No performance impact
  • Performance improved
  • Performance impact documented

Browser/Device Support

  • Tested on Chrome
  • Tested on Firefox
  • Tested on Safari
  • Tested on Edge
  • Tested on mobile devices

Labels

  • feature - for new features
  • bugfix - for bug fixes
  • documentation - for documentation changes
  • enhancement - for improvements
  • breaking-change - for breaking changes
  • frontend - for frontend changes
  • backend - for backend changes
  • ui/ux - for design changes

Reviewers

  • Frontend team review
  • Backend team review (if applicable)
  • Design team review (if applicable)
  • Security review (if applicable)

Closes #474

Note: Please ensure all checkboxes are completed before submitting this PR. This helps maintain code quality and speeds up the review process.

)

Make DOM, visual, and Tab order match for every dialog/alert-dialog
and mobile drawer to satisfy WCAG 2.4.3 Focus Order and provide a
thumb-friendly mobile primary action at the bottom.

Changes:
* AlertDialogFooter / DialogFooter: drop `flex-col-reverse` so cancel
  renders above the action visually on mobile, while keeping the
  desktop right-aligned row layout. Replace `sm:space-x-2` with
  `sm:gap-3` and add vertical `gap-2` so spacing is consistent across
  viewports.
* AlertDialogCancel: drop leftover `mt-2 sm:mt-0` now handled by the
  parent gap.
* BetConfirmPattern / DisputeActionPattern mobile DrawerFooter:
  reorder so Cancel precedes the primary/destructive action in the
  DOM so the visual order matches Tab order.
* docs/BUTTON_ORDER.md: new canonical rule document.
* docs/a11y-status.md: add audit row referencing Predictify-org#474 and the new doc.
* components/ui/__tests__/dialog-footer.test.tsx: focused tests
  asserting DOM order, Tab order, and absence of `flex-col-reverse`.
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 23, 2026

Copy link
Copy Markdown

@Whiznificent Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add accessible confirm/cancel button ordering

1 participant