Repository navigation
Conversation
… a resize Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
The PopoverMenu mock assigned the rendered anchorPosition to a module-level object during render, which React Compiler rejects with 'This value cannot be modified' under both Babel and OXC. Record renders with a jest.fn spy instead and read the last open render's anchorPosition from its call log. Also apply the oxfmt import-group spacing the formatter expects. Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
🤖 Android test steps verification results: The PR's view run · no recording available |
|
Fixed and pushed in React Compiler Compliance — the Oxfmt check — the file was missing the blank line oxfmt puts between the All checks now pass except Verification run locally
The first lint pass after the rewrite surfaced two more errors that I also fixed in the same commit: No production code changed — the diff is confined to the test file. |
|
🤖 Web test steps verification results: The PR's view run · no recording available |
|
@MelvinBot, merge the latest main |
Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com> # Conflicts: # config/eslint/eslint.seatbelt.tsv # src/components/ThreeDotsMenu/index.tsx
|
@codex, review |
|
Merged the latest Is it still reproducible? Based on the code, yes. On current Were there PRs merged that would fix it? No. Since this branch was created, the only Merge conflict resolution
I couldn't run lint or Jest locally because of sandbox limits. Existing tests failed the same way, so CI is the check here. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 922d9e09cf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| afterEach(() => { | ||
| jest.useRealTimers(); | ||
| }); |
There was a problem hiding this comment.
Add Given/When/Then sections to each new test
Both added it blocks omit the required literal // Given, // When, and // Then sections explaining why their setup, action, and assertions exist. Add all three documented sections to each test so this regression coverage follows the repository's mandatory test-documentation convention.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The failing check is unrelated to this PR, so I didn't push a change. Analysis: Evidence
Next step: Re-run the failed job. It should pass, or it will once that fix PR merges. |
|
Nothing has changed since my last comment, so there's still no fix to push. The ESLint check has since passed. The only real failure is still Next step: Re-run the failed job here. I wasn't able to start the re-run myself. The other two failures ( |











Explanation of Change
When a popover menu is open and the viewport is resized,
ThreeDotsMenure-measures its anchor button in auseLayoutEffectand writes the result straight back as the popover'sanchorPosition. On the Wallet page each row lives inside aFlashList, whose absolutely-positioned cells are re-laid-out asynchronously after the resize. On webmeasureInWindowresolves on asetTimeout(0), which lands before that re-layout — so the effect reads pre-resize coordinates and pins the open menu to a stale position. Nothing re-measures afterwards, so the popover stays detached from its row.This is the same failure mode the Wallet page used to guard against itself: #32492 and later #62668 both repositioned the menu on resize, debounced by
CONST.TIMING.RESIZE_DEBOUNCE_TIME. That page-level handler was removed when the popup moved into the genericThreeDotsMenu, and nothing replaced it.CopilotPage.tsxstill carries a working copy of the original pattern.The fix puts that behavior back in the shared component rather than adding a third page-level copy:
src/components/ThreeDotsMenu/index.tsx— the re-measure is debounced byCONST.TIMING.RESIZE_DEBOUNCE_TIMEso it runs once the surrounding layout has settled, and is cancelled on cleanup.getMenuPosition, which most callers give a new identity on every render (anchorAlignmentis an inline object literal at nearly every call site), so the effect re-fired on every render and each run'ssetPositionproduced a fresh object that triggered the next run — a self-sustaining render loop while a menu was open.getMenuPositionis now read through a ref, andsetPositionkeeps the previous object when the measurement is unchanged.src/pages/settings/Wallet/WalletPage/index.tsx— removespaymentMethodButtonRef, the anchor ref that the deleted resize handler used to measure. It was still being assigned but never read.Regression coverage lives with the shared component now, in
tests/unit/ThreeDotsMenuRepositionTest.tsx.Fixed Issues
$ #100882
PROPOSAL: #100882 (comment)
Tests
// TODO: The human co-author must fill out the tests they ran before marking this PR as "ready for review".
// Please describe what tests you performed that validate the change works.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
// TODO: The human co-author must fill out the QA steps before marking this PR as "ready for review".
// Please describe what QA needs to do to validate this change and which areas they should test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari