Skip to content

[HOLD FOR PAYMENT 9/26] [Search v2.3] - 3-dot menu is always at fixed position instead of right above the saved search #49206

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.35-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was found when executing this PR: #48566
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Search.
  3. Click Filters.
  4. Add a few filters.
  5. Click Save search.
  6. Repeat Step 3 to 5 a few times to create more saved searches until the list is scrollable.
  7. Click 3-dot menu next to the last saved search.

Expected Result:

3-dot menu should be right above the selected saved search.

Actual Result:

3-dot menu is always at the fixed position instead of right above the selected saved search.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6603097_1726280758510!Screenshot_2024-09-14_at_10 22 48
Bug6603097_1726280758540.20240914_102238.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 14, 2024
  2. melvin-bot commented on Sep 14, 2024

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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.

  3. github-actions commented on Sep 14, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  4. melvin-bot commented on Sep 14, 2024

    @melvin-bot

    Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. ChavdaSachin commented on Sep 14, 2024

    @ChavdaSachin
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    • Saved search - 3-dot menu is always at fixed position

    What is the root cause of that problem?

    What changes do you think we should make in order to solve the problem?

    • we should pass dynamic position for the same as we don on other pages
    • Element reference could be used like here
      threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => {
      setThreeDotsMenuPosition({
      horizontal: x + width,
      vertical: y + height,
      });

    What alternative solutions did you explore? (Optional)

  6. dominictb commented on Sep 14, 2024

    @dominictb
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    • 3-dot menu is always at the fixed position instead of right above the selected saved search.

    What is the root cause of that problem?

    What changes do you think we should make in order to solve the problem?

    • We need to get the popover menu position based on its three-dot position by the following steps:

    • Track the popover menu position: First, we need to determine the position of the popover menu based on the position of the three-dot button in each item. To achieve this, we’ll create a state to store the anchor position and a ref to store references for each three-dot button:

        const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState<AnchorPosition>({horizontal: 0, vertical: 0});
        const threeDotsMenuContainerRef = useRef({});
    • Initialize the ref for each three-dot button: In the code at this line, add the following block to initialize the ref for each three-dot button based on its key:
                if (!threeDotsMenuContainerRef.current?.[key]) {
                    threeDotsMenuContainerRef.current = {...threeDotsMenuContainerRef.current, [key]: createRef()};
                }

    This ensures that each three-dot button has its own ref stored in threeDotsMenuContainerRef.

    • Update the rightComponent to use the ref and measure the position: In the code at this line, update the rightComponent block to assign the correct ref and calculate the position of the popover menu when the three-dot button is pressed::
      rightComponent: (

      to:
    rightComponent: (
                        <View
                            ref={threeDotsMenuContainerRef?.current?.[key]}
                            style={{backgroundColor: 'red'}}
                        >
                            <ThreeDotsMenu
                                onIconPress={() => {
                                    threeDotsMenuContainerRef.current[key].current?.measureInWindow((x, y, width, height) => {
                                        setThreeDotsMenuPosition({
                                            horizontal: x + width,
                                            vertical: y + height,
                                        });
                                    });
                                }}
                                menuItems={getOverflowMenu(item.name, Number(key), item.query)}
                                anchorPosition={threeDotsMenuPosition}
                                anchorAlignment={{
                                    horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
                                    vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
                                }}
                            />
                        </View>
                    ),

    What alternative solutions did you explore? (Optional)

  7. 11 remaining items

  8. moved this from Polish to Done in #expensify-bugson Sep 19, 2024
  9. CortneyOfstad commented on Sep 23, 2024

    @CortneyOfstad
    Contributor

    Issue was deployed production 4 days ago, making the payment date 9/26 — adjusting the title!

  10. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Sep 23, 2024
  11. changed the title [-][Search v2.3] - 3-dot menu is always at fixed position instead of right above the saved search[/-] [+][HOLD FOR PAYMENT 9/26] [Search v2.3] - 3-dot menu is always at fixed position instead of right above the saved search[/+] on Sep 23, 2024
  12. CortneyOfstad commented on Sep 27, 2024

    @CortneyOfstad
    Contributor

    @dominictb — I sent you a payment offer here, please let me know once you accept and I can get that paid ASAP. Thanks!

  13. dominictb commented on Sep 30, 2024

    @dominictb
    Contributor

    @CortneyOfstad Sure, done!

  14. CortneyOfstad commented on Oct 1, 2024

    @CortneyOfstad
    Contributor

    Payment Summary

    @dominictb — paid $250 via Upwork

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions