refactor: PureReportActionItem, lazy MiniReportActionContextMenu#89589
refactor: PureReportActionItem, lazy MiniReportActionContextMenu#89589LukasMod wants to merge 4 commits intoExpensify:mainfrom
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@roryabraham I just saw your work on #83784. It's a huge WIP PR with a few bugs still to fix. Do you think it's still worth proceeding with my small PR in the meantime? It's low risk, very small, and can easily be removed once your PR finally lands. WDYT? This PR is part of #77176 |
|
Yeah, that's fine. I think I'm going to split up #83784 into smaller PRs |
Explanation of Change
MiniReportActionContextMenuopens ~25 Onyx subscriptions per chat row but is only visible on hover. We skip mounting it until a row is first hovered, dropping per-row subscriptions to zero on un-hovered rows.Result: −53% total subs, −18% send latency in a 60-message chat.
No
MiniReportActionContextMenufor mobile web/mobile native at all (no hover)Tested the useState-based latch (
hasEverHovered) solution, no visible UX difference vs. live hovered, but it slowly accumulates unused mounted components as the session grows since each hovered row keeps itsMiniReportActionContextMenusubtree mounted forever. Switched to live hovered instead so rows mount the menu only while actively hovered and unmount immediately on hover-out, keeping the component count flat across long sessions.Fixed Issues
$
PROPOSAL:
Tests
Only reproduce on desktop web
Test 1 — Mini bar appears on hover
Test 2 — Mini icons work
main.Test 3 — Right-click full popover not regressed
Test 4 — Emoji picker survives hover-out
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
N/A
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
BEFORE CHANGE (4x CPU slowdown):
https://github.com/user-attachments/assets/fe824927-fa85-48a7-9755-b31bc12cb189
AFTER CHANGE (4x CPU slowdown):
https://github.com/user-attachments/assets/19feab53-3b22-41a6-9c67-c1a683224883