Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2025-01-13] [$250] mWeb Safari - Workspace chat tooltip not positioned correctly #53976

Closed
1 of 8 tasks
m-natarajan opened this issue Dec 12, 2024 · 20 comments
Closed
1 of 8 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Dec 12, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.74-8
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @rayane-djouah
Slack conversation (hyperlinked to channel name): expensify_bugs

Action Performed:

  1. Log in as User A, an account that owns a workspace
  2. Create a new account B
  3. On A, Invite B to the workspace
  4. On B, open the workspace chat
  5. Verify a tooltip shows over the composer's Create button saying "Get started! Submit your first expense"

Expected Result:

The tooltip should be positioned over the composer's Create button on mWeb Safari same with other platforms

Actual Result:

The tooltip is not correctly positioned on mWeb Safari unlike other platforms

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021867716270354111393
  • Upwork Job ID: 1867716270354111393
  • Last Price Increase: 2024-12-13
Issue OwnerCurrent Issue Owner: @stephanieelliott
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

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

@bernhardoj
Copy link
Contributor

Proposal

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

WS chat tooltip in mobile Safari is positioned incorrectly.

What is the root cause of that problem?

We calculate the position of the tooltip based on the anchor y offset and the tooltip height. The calculation here is already correct.

yOffset - (tooltipHeight + POINTER_HEIGHT) + manualShiftVertical;

However, on iOS, the viewport is scrolled when the keyboard is shown. The viewport scroll explanation and visualization are well explained here: #16082.

Let's use an example. On my simulator, the composer yOffset without keyboard is 666px.

Screenshot 2024-12-12 at 12 54 28

When the keyboard shows, the composer slides up which is closer to the top of the screen, so the yOffset is now 388px.
Screenshot 2024-12-12 at 12 56 04

Let's ignore the tooltip height from the calculation and only use the composer yOffset as the top position of the tooltip. Since top is positioned based on the viewport, it won't be placed correctly above the composer.
image

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

We need to account for the viewport scroll amount for the top calculation. Tooltip has a shift vertical which we can use so we only changes this for WS chat tooltip.

yOffset - (tooltipHeight + POINTER_HEIGHT) + manualShiftVertical;

shiftVertical={variables.composerTooltipShiftVertical}
>

const offsetTop = useViewportOffsetTop();

shiftVertical={variables.composerTooltipShiftVertical + offsetTop}

(or we can apply it to measureTooltipCoordinate so it's applied to all educational tooltip)

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

Or we can use measureLayout and measure it relative to document.body.

export default function measureTooltipCoordinate(target: React.Component & Readonly<NativeMethods>, updateTargetBounds: (rect: LayoutRectangle) => void, showTooltip: () => void) {
return target?.measureInWindow((x, y, width, height) => {
updateTargetBounds({height, width, x, y});
showTooltip();
});
}

return target?.measureLayout(document.body, (x, y, width, height) => {
    updateTargetBounds({height, width, x, y});
    showTooltip();
});

but measureLayout isn't available on the RN 0.76 docs anymore, so not sure if it's safe to use it.

@stephanieelliott
Copy link
Contributor

This is buggy looking, seeing as it covers up workspace information on the page I think this needs to be fixed.

@stephanieelliott stephanieelliott added the External Added to denote the issue can be worked on by a contributor label Dec 13, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021867716270354111393

@melvin-bot melvin-bot bot changed the title mWeb Safari - Workspace chat tooltip not positioned correctly [$250] mWeb Safari - Workspace chat tooltip not positioned correctly Dec 13, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 13, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

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

@hungvu193
Copy link
Contributor

@bernhardoj How do you enable EducationalTooltip when keyboard opens?

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 17, 2024

@hungvu193 you need to open an empty chat, so the composer is focused automatically. (I manually change the show condition to true too)

@hungvu193
Copy link
Contributor

hungvu193 commented Dec 17, 2024

@hungvu193 you need to open an empty chat, so the composer is focused automatically. (I manually change the show condition to true too)

I did the same thing. But on mSafari I didn't see the composer got focused on opening

Update: I can reproduce it with the above step + change the visible status of EducationalTooltip

@flaviadefaria flaviadefaria moved this to First Cohort - CRITICAL in [#whatsnext] #migrate Dec 17, 2024
@hungvu193
Copy link
Contributor

Thanks @bernhardoj. Your proposal looks good to me!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 17, 2024

Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@marcochavezf
Copy link
Contributor

Thanks @hungvu193, assigning @bernhardoj 🚀

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 18, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 19, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @hungvu193

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jan 6, 2025
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jan 6, 2025
@melvin-bot melvin-bot bot changed the title [$250] mWeb Safari - Workspace chat tooltip not positioned correctly [HOLD for payment 2025-01-13] [$250] mWeb Safari - Workspace chat tooltip not positioned correctly Jan 6, 2025
Copy link

melvin-bot bot commented Jan 6, 2025

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 6, 2025
Copy link

melvin-bot bot commented Jan 6, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.80-6 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-01-13. 🎊

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

  • @hungvu193 requires payment through NewDot Manual Requests
  • @bernhardoj requires payment through NewDot Manual Requests
  • @rayane-djouah requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jan 6, 2025

@hungvu193 @stephanieelliott @hungvu193 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]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 13, 2025
Copy link

melvin-bot bot commented Jan 13, 2025

Payment Summary

Upwork Job

BugZero Checklist (@stephanieelliott)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1867716270354111393/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@hungvu193
Copy link
Contributor

hungvu193 commented Jan 14, 2025

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.

    Link to comment: https://github.com/Expensify/App/pull/45390/files#r1914579840

  • [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: IMO, This is not a critical bug and only can reproduce on the first time user creates a new workspace and invite a brand new account.

  • [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.

Regression Test Proposal

Test:

  1. Log in as User A, an account that owns a workspace
  2. Create a new account B.
  3. On A, Invite B to the workspace.
  4. On B, open the workspace chat.
  5. Notice a tooltip shows over the composer's Create button saying "Get started! Submit your first expense".
  6. Verify that the tooltip position is correct.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jan 15, 2025
@stephanieelliott
Copy link
Contributor

Created TR case here: https://github.com/Expensify/Expensify/issues/461367

@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2025
@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

  • Contributor: @bernhardoj $250, please request via ND
  • Contributor+: @hungvu193 $250, please request via ND

@github-project-automation github-project-automation bot moved this from First Cohort - CRITICAL to Done in [#whatsnext] #migrate Jan 15, 2025
@bernhardoj
Copy link
Contributor

Requested in ND.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

5 participants