Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The reveal animation uses scaled height measurements that clip items and cause visual jumps, and its clipping region can obscure keyboard-opened submenus while focus moves into them.
2 open issues
What changed in this PR
Adds a reveal animation to the shared internal popover menu used by ActionPopover, MultiActionButton, SplitButton, Select, and Search.
Changes:
- Separates menu positioning from animated content, measures reveal height, and respects reduced-motion preferences.
- Adds transition completion handling and a timeout fallback.
- Updates unit tests for reveal behavior and the new content wrapper.
| File | Description |
|---|---|
src/components/action-popover/action-popover.test.tsx |
Moves padding assertions to the menu content wrapper. |
src/__internal__/popover-menu/popover-menu.test.tsx |
Adds reveal, reduced-motion, and transition completion tests. |
src/__internal__/popover-menu/popover-menu.component.tsx |
Implements reveal styling, height measurement, lifecycle handling, and wrapper references. |
Review effort: Balanced
00f5c28 to
0a2e299
Compare
Adds reveal animation to internal popover-menu component, which is consumed by ActionPopover, MultiActionButton, SplitButton, Select, Search.
There was a problem hiding this comment.
🟡 Changes recommended
The reveal transition lacks targeted Playwright coverage for height, clipping, and placement, leaving browser layout regressions unchecked near viewport edges, selected-option visibility untested when reopening a virtualised Select, and reduced-motion behavior unverified. The new padding: 0 also bypasses the spacing token scale; use var(--global-space-none) as the component already does elsewhere.
2 open issues
2 resolved since last review
Review effort: Balanced
| transition: | ||
| height ${revealEasing}, | ||
| padding-top ${revealEasing}, | ||
| padding-bottom ${revealEasing}; |
| ${$contentHeight === undefined | ||
| ? css` | ||
| height: 0; | ||
| padding: 0; |
DipperTheDan
left a comment
There was a problem hiding this comment.
Nothing more to add from me. Just address the comments left by Copilot and I'll approve the work 👍🏻
|
|
||
| test("when reopening the select after selecting an option, the selected option is visible", async ({ | ||
| // skip due to flakiness - FE-7905 | ||
| test.skip("when reopening the select after selecting an option, the selected option is visible", async ({ |
There was a problem hiding this comment.
comment: I don't think we can skip this as this PR is adding the change that's causing the regression. It leaves 18px clipped after the animation ends. I think it's that you removed max-width: 100% on the inner container, the list can initially render wider, scroll the selected option into view, then wrap text when its final width applies.
There was a problem hiding this comment.
suggestion (non-blocking): add the following before we scroll in this test as it will prevent flakiness
await expect(page.getByTestId("menu-content")).toHaveCSS(
"transition-duration",
"0s",
);
| useResizeObserver(internalListRef, updateContentHeight, !isRevealingActive); | ||
|
|
||
| // restarts on each content height change so the reveal ends once the latest transition completes | ||
| useEffect(() => { |
There was a problem hiding this comment.
comment: The reveal should run once when the menu opens, with a fixed completion time. Depending on contentHeight here restarts the timeout on each resize and can extend the reveal beyond that window. Could we start the timer on the first measurement and avoid resetting it for subsequent height changes?
const hasMeasuredContent = contentHeight !== undefined;
useEffect(() => {
if (!isRevealingActive || !hasMeasuredContent) return undefined;
const timeoutId = setTimeout(
() => setIsRevealing(false),
REVEAL_DURATION + 50,
);
return () => clearTimeout(timeoutId);
}, [isRevealingActive, hasMeasuredContent]);
| rectSpy.mockRestore(); | ||
| }); | ||
|
|
||
| describe("when animating the menu", () => { |
There was a problem hiding this comment.
comment: I think we need to add a test that covers that resizes partway through the opening reveal and verify that it does not restart the timer: revealing should end at the original deadline. Also verify that content changes after completion do not reactivate the animation.


Proposed behaviour
Adds reveal animation to internal popover-menu component, which is consumed by ActionPopover, MultiActionButton, SplitButton, Select, Search.
Current behaviour
Checklist
d.tsfile added or updated if requiredQA
Additional context
Testing instructions