Skip to content

chore: patch useOverlayPosition#40284

Open
gabriellsh wants to merge 2 commits intodevelopfrom
patch/useOverlayPosition
Open

chore: patch useOverlayPosition#40284
gabriellsh wants to merge 2 commits intodevelopfrom
patch/useOverlayPosition

Conversation

@gabriellsh
Copy link
Copy Markdown
Member

@gabriellsh gabriellsh commented Apr 23, 2026

Proposed changes (including videos or screenshots)

This PR patches useOverlayPosition hook from react-aria package in order to get the correct document and window reference of where the element is being used (popup window for example), instead of relying in the global window object, which can be different from the actual window that the element is being rendered on (such as a popup window with React portals).

Issue(s)

SSGA-9

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Updated dependency resolution configuration: pinned a specific patched build for an overlay package and reformatted an existing resolution entry. No other dependency or public API changes.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 23, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

⚠️ No Changeset found

Latest commit: 6a26b00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Walkthrough

Reformatted an existing Yarn resolutions entry for xml-encryption/@xmldom/xmldom and added a new @react-aria/overlays@npm:^3.25.0 resolution in package.json pointing to a .yarn/patches artifact; no other dependencies or configuration changed.

Changes

Cohort / File(s) Summary
Yarn resolutions
package.json
Reformatted xml-encryption/@xmldom/xmldom entry (trailing comma) and added @react-aria/overlays@npm:^3.25.0 resolution that applies a patched build via .yarn/patches.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The PR title 'chore: patch useOverlayPosition' accurately reflects the main change, which is patching the useOverlayPosition hook from react-aria via a Yarn resolution entry.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • SSGA-9: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
package.json (2)

53-54: Redundant @react-aria/i18n resolution entries — consolidate.

Lines 53 and 54 both map to the exact same patched target (@react-aria/i18n@npm%3A3.12.5#...-435edff786.patch). If only ^3.12.5 is actually resolved in the dep graph now, the nightly-tagged entry on line 53 is dead config and can be dropped; otherwise keep both but add a brief comment explaining why two descriptor keys are needed. Worth verifying via yarn why @react-aria/i18n`` before removing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 53 - 54, The package.json contains two resolution
keys for the same patched target:
"@react-aria/i18n@npm:^3.0.0-nightly-fb28ab3b4-241024" and
"@react-aria/i18n@npm:^3.12.5" both pointing to the same patch; run `yarn why
`@react-aria/i18n`` to confirm which descriptor is actually used, then either
remove the dead/nightly key
("@react-aria/i18n@npm:^3.0.0-nightly-fb28ab3b4-241024") if unused, or keep both
but add a short comment explaining why both descriptors are required; update the
resolutions section to only include necessary keys that map to
"patch:`@react-aria/i18n`@npm%3A3.12.5#~/.yarn/patches/@react-aria-i18n-npm-3.12.5-435edff786.patch".

55-55: Track upstream and add a maintenance note.

Carrying a patch against @react-aria/overlays@3.25.0 means every bump to this dep will need a manual patch refresh (or it will silently fail to apply). Recommendations:

  • Open/link an upstream issue or PR in adobe/react-spectrum referencing SSGA-9 so this patch can be retired.
  • Add a short README/header comment inside the .patch file explaining what it fixes and the upstream tracking link, so the next person bumping react-aria knows whether to drop it.
  • Consider pinning the descriptor more tightly (e.g. ~3.25.0) to avoid a future ^ bump silently picking up a version the patch no longer cleanly applies to.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 55, The package.json entry carrying a patch for
"@react-aria/overlays@npm:^3.25.0" should be documented and made easier to
maintain: open an upstream issue/PR in the adobe/react-spectrum repo referencing
SSGA-9 asking to accept or upstream the fix so the local patch can be retired;
add a short header comment at the top of the existing patch file named
".yarn/patches/@react-aria-overlays-npm-3.25.0-2628866e6e.patch" describing what
it fixes and a link to the upstream issue/PR; and tighten the package descriptor
in package.json from "^3.25.0" to a more conservative range (e.g. "~3.25.0" or
an exact pin) so future dependency bumps don’t silently break patch application.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 55: The patch correctly computes actualWindow in
getWindowAndVisualViewport (using targetNode?.ownerDocument.defaultView) but
still reads visualViewport from the global window; update the visualViewport
assignment to use actualWindow instead of window so listeners subscribe to the
correct viewport for overlays in popups/iframes—i.e., inside
getWindowAndVisualViewport, set visualViewport = actualWindow?.visualViewport ||
null and ensure all references to visualViewport come from that returned value
used by the overlay code (functions/methods that call
getWindowAndVisualViewport).

---

Nitpick comments:
In `@package.json`:
- Around line 53-54: The package.json contains two resolution keys for the same
patched target: "@react-aria/i18n@npm:^3.0.0-nightly-fb28ab3b4-241024" and
"@react-aria/i18n@npm:^3.12.5" both pointing to the same patch; run `yarn why
`@react-aria/i18n`` to confirm which descriptor is actually used, then either
remove the dead/nightly key
("@react-aria/i18n@npm:^3.0.0-nightly-fb28ab3b4-241024") if unused, or keep both
but add a short comment explaining why both descriptors are required; update the
resolutions section to only include necessary keys that map to
"patch:`@react-aria/i18n`@npm%3A3.12.5#~/.yarn/patches/@react-aria-i18n-npm-3.12.5-435edff786.patch".
- Line 55: The package.json entry carrying a patch for
"@react-aria/overlays@npm:^3.25.0" should be documented and made easier to
maintain: open an upstream issue/PR in the adobe/react-spectrum repo referencing
SSGA-9 asking to accept or upstream the fix so the local patch can be retired;
add a short header comment at the top of the existing patch file named
".yarn/patches/@react-aria-overlays-npm-3.25.0-2628866e6e.patch" describing what
it fixes and a link to the upstream issue/PR; and tighten the package descriptor
in package.json from "^3.25.0" to a more conservative range (e.g. "~3.25.0" or
an exact pin) so future dependency bumps don’t silently break patch application.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bba6eea1-04fa-4a70-b1c3-37fb3913d82b

📥 Commits

Reviewing files that changed from the base of the PR and between 87e3923 and 7df960c.

⛔ Files ignored due to path filters (2)
  • .yarn/patches/@react-aria-overlays-npm-3.25.0-2628866e6e.patch is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.

Applied to files:

  • package.json

Comment thread package.json
@gabriellsh gabriellsh force-pushed the patch/useOverlayPosition branch from d3e3b07 to 6a26b00 Compare April 23, 2026 19:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.80%. Comparing base (87e3923) to head (6a26b00).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #40284   +/-   ##
========================================
  Coverage    69.80%   69.80%           
========================================
  Files         3296     3296           
  Lines       119173   119173           
  Branches     21435    21446   +11     
========================================
+ Hits         83183    83187    +4     
  Misses       32684    32684           
+ Partials      3306     3302    -4     
Flag Coverage Δ
e2e 59.73% <ø> (+0.01%) ⬆️
e2e-api 46.22% <ø> (-0.01%) ⬇️
unit 70.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gabriellsh gabriellsh changed the title fix: patch useOverlayPosition chore: patch useOverlayPosition Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant