Skip to content

refactor(www): adopt RAC 1.20 TokenField and context menu trigger - #554

Open
mehdibha wants to merge 2 commits into
mainfrom
claude/react-aria-tokenfield-migrate-404891
Open

refactor(www): adopt RAC 1.20 TokenField and context menu trigger#554
mehdibha wants to merge 2 commits into
mainfrom
claude/react-aria-tokenfield-migrate-404891

Conversation

@mehdibha

Copy link
Copy Markdown
Owner

React Aria Components 1.20.0 (released today) ships the two features we were carrying workarounds for: the official TokenField and native context menu support in MenuTrigger. This PR updates the packages and deletes both workarounds.

Package update

  • react-aria-components ^1.19.0 → ^1.20.0, react-aria → ^3.51.0, react-stately → ^3.49.0.
  • @internationalized/date → ^3.12.3 — required to dedupe: keeping 3.12.2 alongside react-aria's 3.12.3 produced two class identities and ~60 Time is not assignable to ZonedDateTime type errors.
  • All five packages released 2026-07-31, so they're pinned in minimumReleaseAgeExclude (replacing the previous versions' entries).

TokenField: vendored copy deleted

www/src/registry/lib/react-aria-token-field/ (vendored from adobe/react-spectrum#10318) is gone; ui/token-field and ui/mention now import from react-aria-components/TokenField. The shipped API matches the PR except for renames, applied across base files, types, demos, docs, and the landing ai-prompt showcase:

  • TokenSegmentListTokenFieldValue
  • standalone Direction enum → TokenFieldValue.Direction
  • positionToDOMRangetokenFieldPositionToDOMRange

The token-field docs no longer describe the primitive as vendored and link to the official TokenField page. Demo subclasses renamed to match (TagFieldValue, HashtagFieldValue).

ContextMenu: registry item deleted, folded into Menu

MenuTriggerProps now includes trigger: 'press' | 'longPress' | 'contextMenu', and our Menu wrapper already extends it — so the entire ui/context-menu item (including the ~340-line use-context-menu-trigger hook) is replaced by the native trigger. The upstream implementation opens the menu at the pointer, and handles touch long-press, macOS Ctrl+Enter, and closing on outside right-click.

  • The standalone Context Menu docs page is removed; the Menu docs gain a Triggers section covering longPress and contextMenu, with a live demo (menu/demos/context-menu.tsx). Non-button trigger areas wrap in React Aria's Pressable with role/tabIndex.
  • The two www usages (landing logo brand-assets menu, docs composition animation) were rewritten on the new pattern.

Verification

  • pnpm check, pnpm typecheck green; build:registry + build:references regenerated and committed.
  • Verified in the browser: token fields render tokens and accept typing; mention suggestions open, filter, and insert tokens; the context-menu demo opens exactly at the pointer (popover corner lands on the click point); the landing logo right-click menu works; console free of Pressable/a11y warnings.
  • One pre-existing quirk (not a regression): selecting a mention suggestion via ArrowDown/Enter doesn't move virtual focus into the menu under the browser tool's key injection — production behaves identically. Worth a manual keyboard check.

@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dotui Ready Ready Preview Jul 31, 2026 10:00pm

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: www The dotui.org app: site, landing, docs pages area: registry Registry source and generated output (www/src/registry) labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: registry Registry source and generated output (www/src/registry) area: www The dotui.org app: site, landing, docs pages documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant