Skip to content

chore: AI Rules for React Spectrum #8319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

chore: AI Rules for React Spectrum #8319

wants to merge 5 commits into from

Conversation

reidbarber
Copy link
Member

Rules that you can place in your project to help your coding agent (i.e. Cursor) perform better when using various React Spectrum libraries.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@reidbarber reidbarber changed the title AI Rules for React Spectrum chore: AI Rules for React Spectrum May 28, 2025
@reidbarber reidbarber marked this pull request as ready for review June 4, 2025 23:03
@rspbot
Copy link

rspbot commented Jun 4, 2025

Build successful! 🎉

When using server side rendering, the locale prop should be set explicitly on the Provider rather than relying on automatic locale selection.

[Read more here](mdc:https:/react-spectrum.adobe.com/react-spectrum/getting-started.html)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the following when using cursor in quarry for the test utils:

## Test writing and test utils
When using server side rendering, the locale prop should be set explicitly on the Provider rather than relying on automatic locale selection.

When writing tests against apps using React Spectrum components, you should try to use the test utils from the `@react-spectrum/test-utils` package. If you are writing tests against apps using React Aria Components, you should try to use the test utils from `@react-aria/test-utils`.

If you are able to browse the web, docs for the test utils can be found at @https://react-spectrum.adobe.com/react-aria/testing.html#react-aria-test-utils- and
https://react-spectrum.adobe.com/react-spectrum/testing.html#react-spectrum-test-utils- respectively. Supported aria patterns can be found in the https://react-spectrum.adobe.com/react-spectrum/testing.html#patterns
and https://react-spectrum.adobe.com/react-aria/testing.html#patterns sections, with links pointing to documentation for
each individual pattern. Prioritize using these docs and looking at ".test." files as examples in https://github.com/adobe/react-spectrum for the specific "createTester" pattern when looking up the API usage.

### Patterns
- Combobox
- GridList
- ListBox
- Menu
- Select
- Table
- Tabs
- Tree

which seemed to work pretty decently. Happy to get this merged in as is, but if you have any feedback or would like to include this section as well lemme know

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.

4 participants