Skip to content

feat(feed): support feed role article focus management - #241

Open
AdamMagued wants to merge 1 commit into
guidepup:mainfrom
AdamMagued:feat/feed-role-focus-behaviour
Open

AdamMagued wants to merge 1 commit into
guidepup:mainfrom
AdamMagued:feat/feed-role-focus-behaviour

Conversation

@AdamMagued

Copy link
Copy Markdown
Contributor

Description

Resolves #13.

This PR implements W3C WAI-ARIA feed role focus management according to the ARIA 1.2/1.3 specification:

  • When the virtual cursor transitions into an article belonging to a feed (role="feed") or moves between different articles within a feed, user agent focus (.focus()) is set on the containing article.
  • If the reading cursor lands directly on a focusable element inside the article, focus is set on that element in lieu of setting focus on the containing article.
  • Moving within the same article does not repeatedly re-trigger focus unless changing to a focusable element.
  • Non-feed articles do not trigger feed-specific focus shifts.
  • Internal focus shifts are tracked to avoid disrupting reading cursor state.

Verification

  • Added unit tests for focusable selector detection (test/isFocusable.test.ts).
  • Added comprehensive integration tests (test/int/feedRole.int.test.ts) covering all specification focus behaviors.
  • Ran full CI suite (yarn ci), passing with 100% test pass rate (59 suites, 349 tests), clean linting, and full typechecks.

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.

feat: support feed role focus behaviour

1 participant