Skip to content

feat: box layout and resize + anchor observer primitives - #10558

Open
nwidynski wants to merge 3 commits into
adobe:mainfrom
nwidynski:feat-box-layout
Open

nwidynski wants to merge 3 commits into
adobe:mainfrom
nwidynski:feat-box-layout

Conversation

@nwidynski

Copy link
Copy Markdown
Contributor

Closes no issues directly, because this PR is intentionally limited to additions only. Migrating call sites to the new utilities and signatures is to be done in chore follow-ups, because it would otherwise be rather hard to review what changed here.

Disclaimer: This PR is tightly related to #10556! Unfortunately Github doesn't allow for Stacks to be built across forks, so we have to do with this :/

From a high-level, this PR fixes various issues with layout precision and lays the groundwork for an alternative to floating-ui. The primary file to look at is layout.ts, which features a short description.

Will close #7142, #10036, #10131, #9318 and more.

✅ 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
  • I understand every change in this PR and can explain why it's there.
  • If AI-assisted, I followed our AI contribution guidance and pointed my assistant at CLAUDE.md.

📝 Test Instructions:

🧢 Your Project:

@nwidynski

nwidynski commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@LFDanLu This is the PR to look at for floating-ui, although it also addresses various other issues, like the ones coming from scrollbar-gutter: stable in Chrome. Please note that none of my PRs are AI assisted if not explicitly marked as such. I've just been working on these for quite some time so they land at once 😅

@reidbarber reidbarber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is awesome!

Comment thread packages/react-aria/src/utils/layout.ts
Comment thread packages/react-aria/src/utils/layout.ts Outdated
* Similar to `element.getBoundingClientRect()`, but intersected with all ancestors.
*/
public get visibleRect(): DOMRect {
throw new Error('Not implemented yet.');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TODO?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kinda. I don't have a great use case for it yet, besides window scrolling in virtualizer, so it just satisfies the type for now. IIRC it wasn't added in virtualizer because walking the tree would be too costly.

@github-actions github-actions Bot added the RAC label Sep 7, 2026
@nwidynski

Copy link
Copy Markdown
Contributor Author

@LFDanLu Is there anything left to do for me here? I saw the DNM branches got closed yesterday. I've been putting off work on test suites for this this PR and the scroll utilities PR, because they are quite a lot of work, and I haven't really gotten a definitive signal from you guys about whether to proceed here.

@LFDanLu

LFDanLu commented Sep 16, 2026

Copy link
Copy Markdown
Member

@nwidynski heya, the team tested on Monday and had some comments that came out of that as you have seen already on the other branches. I would echo Rob's sentiment here, where the stories you provided for this branch performed well, but the team wasn't quite sure the best way to validate that everything worked together/what other areas this fixed since we don't have visual regression tests nor stories for the linked issues setup already. We'll try and set that up next time

w/ regards to

I understand the dilemma from a reviewers perspective though. It's hard to tell which bugs this fixes without tests, but its also too much work to add tests for something you might not even want

100% agree, its definitely a ton of work to add all of this without knowing if it will be accepted and thank you for understanding our position where its hard to know whether we wanna accept something without that substantial work being done in the first place. Seeing as the goal of this is to eventually enable Navigation Component/Carousel and serve as an alternative for floating ui for overlay positioning, would it be helpful if we pointed these towards a feature branch instead of main so we can merge them together more easily and go from there? Trying to spitball how best to move forward here since this work will be long lived/have many moving parts and thus span multiple release cycles making it hard to merge things in confidently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pinch zooming causes modal overlay to flicker

3 participants