Skip to content

[Due for payment 2025-09-22] [Due for payment 2025-08-15] [$250] Optimize the PopoverWithMeasuredContent bottom_docked modal performance #67034

Closed

Description

@mountiny

Coming from the proposal here

Proposal

Wrap PopoverWithMeasuredContent with a wrapper that returns BOTTOM_DOCKED modal on small screens.

Background

PopoverWithMeasuredContent is a wrapper around the regular Popover component that allows us to use a more sophisticated positioning schema responsively (without having to provide a static width and height for the popover content). This way, we can shift the position of popover so that the content is anchored where we want it relative to the anchor position.

Problem

Right now in Popover component (that PopoverWithMeasuredContent uses) returns BOTTOM_DOCKED Modal whenever we have isSmallScreenWidth. All the logic of popover measurement calculation is useless, yet it executes. It includes rendering invisible popover to measure it.

Solution

When we know were on a small screen we can return BOTTOM_DOCKED modal earlier, thus skipping expensive position calculation logic.
Perfomance gains
5 - 15 % in a following scenario (see screens):

Prerequisites:

  • narrow screen
  1. Start from "Inbox".
  2. Press "Reports"
  3. Open "Date" filter
  4. Close "Date" filter
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021948304149496243134
  • Upwork Job ID: 1948304149496243134
  • Last Price Increase: 2025-07-24
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. added
    External
    Daily
    Bug
    on Jul 24, 2025
  2. changed the title [-]Optimize the PopoverWithMeasuredContent bottom_docked modal performance[/-] [+][$250] Optimize the PopoverWithMeasuredContent bottom_docked modal performance[/+] on Jul 24, 2025
  3. melvin-bot commented on Jul 24, 2025

    @melvin-bot
  4. added
    Help Wanted
    on Jul 24, 2025
  5. melvin-bot commented on Jul 24, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (External)

  6. melvin-bot commented on Jul 24, 2025

    @melvin-bot

    Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  7. removed
    Help Wanted
    on Jul 24, 2025
  8. 40 remaining items

  9. changed the title [-][Due for payment 2025-08-15] [$250] Optimize the PopoverWithMeasuredContent bottom_docked modal performance[/-] [+][Due for payment 2025-09-22] [Due for payment 2025-08-15] [$250] Optimize the PopoverWithMeasuredContent bottom_docked modal performance[/+] on Sep 15, 2025
  10. removed
    Reviewing
    on Sep 15, 2025
  11. melvin-bot commented on Sep 15, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  12. melvin-bot commented on Sep 15, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.13-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-09-22. 🎊

    For reference, here are some details about the assignees on this issue:

    • @jmusial does not require payment (Contractor)
    • @ZhenjaHorbach requires payment through NewDot Manual Requests
  13. melvin-bot commented on Sep 15, 2025

    @melvin-bot

    @ZhenjaHorbach @isabelastisser The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. isabelastisser commented on Sep 15, 2025

    @isabelastisser
    Contributor

    BugZero Checklist:

    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • ZhenjaHorbach The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

    • ZhenjaHorbach If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • ZhenjaHorbach If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  15. isabelastisser commented on Sep 15, 2025

    @isabelastisser
    Contributor

    Payment summary:

    @jmusial does not require payment (Contractor)
    @ZhenjaHorbach requires payment through NewDot Manual Requests for C+ review $250

  16. melvin-bot commented on Sep 22, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    • Contributor: @jmusial is from an agency-contributor and not due payment
    • Reviewer: @ZhenjaHorbach owed $250 via NewDot

    BugZero Checklist (@isabelastisser)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1948304149496243134/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  17. ZhenjaHorbach commented on Sep 23, 2025

    @ZhenjaHorbach
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    This isn't a bug
    It's the performance issue

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: NA

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    I'm not sure tests are needed here since it's the performance issue

  18. ZhenjaHorbach commented on Sep 24, 2025

    @ZhenjaHorbach
    Contributor

    @isabelastisser
    I think we are ready to close this issue!

  19. isabelastisser commented on Sep 24, 2025

    @isabelastisser
    Contributor

    All set!

  20. ZhenjaHorbach commented on Sep 24, 2025

    @ZhenjaHorbach
    Contributor

    Requested in ND!

  21. flaviadefaria commented on Oct 2, 2025

    @flaviadefaria
    Contributor

    $250 approved for @ZhenjaHorbach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugExternalWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions