Skip to content

fix(aria): address issue #1037 item 3 - #1041

Merged
domgan-oai merged 2 commits into
octanejs:mainfrom
openai-oss-forks:codex/fix-aria-issue-1037
Sep 10, 2026
Merged

domgan-oai merged 2 commits into
octanejs:mainfrom
openai-oss-forks:codex/fix-aria-issue-1037

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Why

The virtualizer dropped its size observation prop, native child keyboard events reached the grid list row press handler, shortcut callbacks received raw events instead of BaseEvent, and the public prop types rejected supported use. Plain TypeScript callers could also collide when they passed distinct slots to the converted hooks.

Changes

  • Forward shouldObserveItemSize to useVirtualizerItem and exercise a simulated content resize through ResizeObserver.
  • Guard grid list row press handling with native cancelBubble; run user keyboard callbacks within the shortcut path's BaseEvent wrapper.
  • Restore FocusableProps on TokenField and the TreeSectionProps<T> signature, with public JSX type checks included in Aria typechecking.
  • Thread the dialog content slot and honor explicit caller slots in the thirteen .tsx hooks. A plain .ts two-menu-trigger regression verifies distinct IDs and ARIA links.
  • Keep getSelection: the pinned upstream root entry point explicitly exports it.

Validation

  • pnpm exec tsgo --noEmit -p packages/aria/tsconfig.json
  • pnpm exec vitest run --project aria --reporter=dot (386 tests)
  • pnpm exec vitest run --project aria-differential --project aria-ssr --reporter=dot (49 + 9 tests)
  • pnpm --dir packages/aria exports:check; node packages/aria/scripts/check-upstream-crosswalk.mjs
  • pnpm sync; scoped pnpm format:files:check on all changed files; git diff --check
  • Full repo pnpm test and pnpm typecheck (current-head CI will cover the broader matrix)

Risk / follow-ups

The explicit-slot branch runs only for calls that supply a slot; the emitted normal compiled caller passes the original arguments and stays on the existing body path, adding one conditional with no closure or second hook invocation. Item-size observation is tested with a simulated observer callback; the new regression does not measure real browser layout.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Changes keyboard propagation, row selection guards, and slot-scoped hook/ID behavior across many interaction hooks; regressions could affect menus, overlays, and accessibility wiring.

Overview
This patch release for @octanejs/aria fixes several Octane-native integration bugs from #1037 and tightens public types.

Virtualizer again passes shouldObserveItemSize through VirtualizerItem into useVirtualizerItem, with a new test that simulates ResizeObserver remeasurement.

Keyboard and grid list behavior switches grid list row handling to native cancelBubble so Space/Enter on embedded controls do not trigger row selection. useKeyboard runs user onKeyDown/onKeyUp inside the same BaseEvent wrapper as shortcut handling so propagation controls work consistently.

Types and dialog IDs: AriaTokenFieldProps extends FocusableProps; TreeSection is typed with TreeSectionProps<T> instead of grid header props. useDialog scopes the content description ID with an explicit slot. Thirteen Aria hooks delegate to withSlot when callers pass an explicit slot, keeping hook state and generated IDs distinct for plain TypeScript (covered by a two-menu-trigger fixture).

New typetests and audit entries register the virtualizer and public component type checks.

Reviewed by Cursor Bugbot for commit 76d7d0c. Bugbot is set up for automated code reviews on this repo. Configure here.

@domgan-oai
domgan-oai marked this pull request as ready for review September 10, 2026 20:08
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant