Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

Add ARIA focus behavior docs and focus tests - #47

Closed
tilucasoli wants to merge 1 commit into
mainfrom
test/focus-behavior-tests
Closed

tilucasoli wants to merge 1 commit into
mainfrom
test/focus-behavior-tests

Conversation

@tilucasoli

@tilucasoli tilucasoli commented Jan 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds comprehensive focus behavior tests for Accordion, Button, and Checkbox. Updates NakedDialog to auto-focus the first focusable element on mount. Refines popover and textfield focus handling for ARIA compliance. Minor UI and code improvements in example and popover components.

Related Issues

#46


Checklist

Note: Updating the pubspec.yaml and CHANGELOG.md is not required. These are handled automatically during the release process.

  • My PR includes unit or integration tests for all changed/updated/fixed behaviors.
  • I have updated or added relevant documentation (doc comments with ///).
  • I am prepared to follow up on review comments in a timely manner.

Breaking Change

Does this PR require users of the package to manually update their code?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Introduces ARIA_FOCUS_BEHAVIOR.md detailing WAI-ARIA focus management for naked_ui components. Adds comprehensive focus behavior tests for Accordion, Button, and Checkbox. Updates NakedDialog to auto-focus the first focusable element on mount. Refines popover and textfield focus handling for ARIA compliance. Minor UI and code improvements in example and popover components.
@docs-page

docs-page Bot commented Jan 21, 2026

Copy link
Copy Markdown

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/naked_ui~47

Documentation is deployed and generated using docs.page.

@github-actions

github-actions Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Add ARIA focus behavior docs and focus tests". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@leoafarias

Copy link
Copy Markdown
Contributor

Closing — the library changes are superseded, and one would now regress. The tests are still worth having.

The 3 library files (+44/-30) no longer apply:

  • naked_dialog.dart — already done on main, and more idiomatically. Main focuses the first focusable descendant via FocusTraversalGroup.maybeOf(...) with a fallback; this PR used SchedulerBinding.addPostFrameCallback plus a manual walk.
  • naked_popover.dart — this one is now harmful. It replaces the focus wiring with a bare FocusScope, deleting the Shortcuts/Actions block that supplies dismiss and next/previous-focus intents. Correct in January, a regression against current main.
  • naked_textfield.dart — +6/-8, needs re-checking against the same drift.

The 11 focus test files (~5,200 lines) are still missing. There is no test/focus/ on main — only semantics/, src/, mixins/, and utilities/. Coverage for accordion, button, checkbox, dialog, menu, popover, radio, select, slider, tabs, and textfield focus behaviour has no equivalent today.

Suggested salvage: take the test cases, drop the library diff. They need updating to current APIs rather than re-deriving — though the dialog cases were written against this PR's implementation and will need adjusting to main's FocusTraversalGroup approach. That work belongs with #46.

Thanks for the coverage; it is the part that outlived the branch.

@leoafarias leoafarias closed this Aug 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants