Skip to content

Conversation

Lelith
Copy link
Collaborator

@Lelith Lelith commented Oct 1, 2025

Summary

This PR replaces the deprecated react-popper package with its actively maintained successor, @floating-ui/react.
floating-ui provides improved flexibility, performance, and more robust positioning behavior for UI elements.

Also contains react 19 upgrades for the following other components

  • Modal
  • Notification
  • Tabs

Affected Components

The following components previously relied directly on react-popper and have been refactored to use floating-ui:

  • Popover
  • Menu
  • Tooltip

Additionally, several components that indirectly depend on these were updated or tested to ensure compatibility:

  • Autocomplete
  • Avatar
  • IconButton
  • Card
  • CopyButton
  • Datepicker
  • EntityList
  • Multiselect
  • Navbar
  • Pill
  • UsageCard

Changes

  • Removed react-popper dependency.
  • Added and configured @floating-ui/react.
  • Refactored Popover, Menu, and Tooltip to use floating-ui.
  • Updated positioning logic and event handling for better consistency and performance.
  • Adjusted tests and stories where necessary to reflect the new implementation.

Breaking Changes

Menu

  • Menu.Submenu has been deprecated.
    • Submenus can now be created using the standard Menu component.
    • See migration guidelines for updated usage examples.

Placement Property

  • The placement prop for Popover, Menu, and Tooltip has changed to match the floating-ui API.
    • Old placement values (e.g. "auto-start", "auto-end") need to be updated.
    • Refer to the migration guide for the full list of valid placement options.

Copy link

changeset-bot bot commented Oct 1, 2025

⚠️ No Changeset found

Latest commit: 102def6

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.

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

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@contentful/f36-website" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

Copy link

vercel bot commented Oct 1, 2025

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

Project Deployment Preview Updated (UTC)
forma-36 Error Error Oct 14, 2025 0:15am

@wiz-inc-38d59fb8d7
Copy link

wiz-inc-38d59fb8d7 bot commented Oct 8, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
SAST Finding SAST Findings 4 Medium
Total 4 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@Lelith Lelith force-pushed the fix/eslint_setup_UFO-2005 branch from 08465e1 to f9e8493 Compare October 8, 2025 14:48
@Lelith Lelith force-pushed the feat/upgrade_react_popper_UFO-1987 branch from 0e26a0b to ed0b5a2 Compare October 8, 2025 14:57
@Lelith Lelith changed the title feat: replace react-popper with floating-ui feat: migrate react-popper to floating-ui Oct 9, 2025
@Lelith Lelith force-pushed the feat/upgrade_react_popper_UFO-1987 branch from 376fe92 to 6d86360 Compare October 10, 2025 13:35
@Lelith Lelith changed the title feat: migrate react-popper to floating-ui feat: migrate react-popper to floating-ui [UFO-1987] Oct 10, 2025
Lelith and others added 15 commits October 14, 2025 14:09
* feat: revive tooltip

* feat: refactor using floatingUI

* docs: update migration guidelines for tooltip, popover and menu

* feat: update tooltip in pill component

* fix: fix auto position of arrow and offset

* test: disable class name tests until emotion/jest is avilable for jest 30

* fix: merge refs and add props in correct order

* feat: re-enable tooltip on IconButton

* feat: re-enable tooltip for clear-all icon

* feat: re-enable menu for card actions

* feat: re-implement tooltip for copy button

* feat: simplify implementation using IconButton

* feat: re-implement tooltip for inline entry card

* feat: implement fallback for rendering tooltip trigger

* feat: re-implement tooltip in UsageCardHeader

* docs: improve story with tooltip

* feat: re-add exports to react-components package

* feat: re-enable entity list and entitylistitem

* feat: export entity-list from react-components package

* feat: re-enable Avatar component

* feat: export Avatar from components package

* docs: update Avatar storybook stories

* fix: fix ability to set individual test-id for Icon with as property

* feat: re-enable card for UsageCard component

* feat:  update emotion imports

* feat: rerfactor BaseCard styles

* feat: update emotion imports

* feat: re-enable navbar
…3194)

* feat: update modal component package to use react 19

* feat: update notification to use react 19
@Lelith Lelith force-pushed the feat/upgrade_react_popper_UFO-1987 branch from ff02d91 to 102def6 Compare October 14, 2025 12:15
@Lelith Lelith changed the title feat: migrate react-popper to floating-ui [UFO-1987] 6️⃣ feat: migrate react-popper to floating-ui [UFO-1987] Oct 14, 2025
@Lelith Lelith changed the title 6️⃣ feat: migrate react-popper to floating-ui [UFO-1987] 6️⃣ feat: Upgrade components [UFO-1987] [UFO-1988] [UFO-1989] [UFO-1992] Oct 14, 2025
@Lelith Lelith changed the title 6️⃣ feat: Upgrade components [UFO-1987] [UFO-1988] [UFO-1989] [UFO-1992] feat: Upgrade components 6️⃣ [UFO-1987] [UFO-1988] [UFO-1989] [UFO-1992] Oct 14, 2025
@Lelith Lelith force-pushed the fix/eslint_setup_UFO-2005 branch from f9e8493 to dc55cf8 Compare October 15, 2025 06:42

if (
sanitizedPlacement.startsWith('right') ||
sanitizedPlacement.toString().startsWith('left') ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sanitizedPlacement.toString().startsWith('left') ||
sanitizedPlacement.startsWith('left') ||

const [isOpen, setIsOpen] = React.useState(isVisible);

let sanitizedPlacement: Placement = 'top';
const middleware = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be wrapped in useMemo to prevent constant rerendering due to the newly created array.

const context = data.context;

const hover = useHover(context, {
delay: { open: showDelay, close: hideDelay },
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s make a lot of friends and use the safe polygon while we’re at it.

handleClose: safePolygon({ requireIntent: false }),

Note: requireIntent should be false to not punish people who are (sometimes) slow with the mouse.

const baseRef = useMergeRefs([propRef, context.refs.setReference]);
const ref = useMergeRefs([childRef, baseRef]);

if (React.isValidElement(children)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we log an error at least in dev mode rather than silently hiding the element?

).toBe('left'),
);
});
// Enable again once emotion/jest is compatible again
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s mark this as an explicit TODO to make sure we find it again.

</MenuItem>,
<li>Copy</li>,
<li>Delete</li>,
// <MenuItem key="copy" onClick={() => alert('copy')}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s add an explicit TODO to fix this.

<MenuItem key="copy">Copy</MenuItem>,
<MenuItem key="delete">Delete</MenuItem>,
]}
actions={[<li key="copy">Copy</li>, <li key="delete">Delete</li>]}
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO

<MenuItem key="copy">Copy</MenuItem>,
<MenuItem key="delete">Delete</MenuItem>,
]}
actions={[<li key="copy">Copy</li>, <li key="delete">Delete</li>]}
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO

<InlineEntryCard
actions={[
<MenuItem key="edit" onClick={handleEditAction}>
<li key="edit" onClick={handleEditAction}>
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO

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.

3 participants