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 2024-12-05] [$250] First QAB missing tooltip for new user #51987

Closed
1 of 8 tasks
m-natarajan opened this issue Nov 4, 2024 · 31 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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 4, 2024

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.57-0
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: @ishpaul777
Slack conversation (hyperlinked to channel name): Expensify-bugs

Action Performed:

Sign up with new account
Open FAB, complete scan receipt flow
Open FAB again

Expected Result:

you see a QAB with tooltip

Actual Result:

you see a QAB without tooltip

Workaround:

unknown

Slack 2024-11-05 16 06 03

this is the tooltip that should be visible ^

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
Recording.729.mp4

Expected tooltip:
Screenshot 2024-11-04 at 10 43 24 PM (1)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021853953365086766977
  • Upwork Job ID: 1853953365086766977
  • Last Price Increase: 2024-11-06
  • Automatic offers:
    • rayane-djouah | Reviewer | 104869466
Issue OwnerCurrent Issue Owner: @mallenexpensify
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

@Nodebrute
Copy link
Contributor

Proposal

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

First QAB missing tooltip for new user

What is the root cause of that problem?

This issue began after the changes in this PR. In this PR, we updated EducationalTooltip by adding a new variable, shouldShow, which included two additional checks: !modal?.willAlertModalBecomeVisible && !modal?.isVisible.

const shouldShow = !modal?.willAlertModalBecomeVisible && !modal?.isVisible && shouldRender;

The problem arises because when we open the FAB, willAlertModalBecomeVisible is set to true, which causes shouldShow to be evaluated as false, preventing the tooltip from displaying.

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

We can change the condition so when isPopover is true we ignore these !modal?.willAlertModalBecomeVisible && !modal?.isVisible

const shouldShow = !modal?.willAlertModalBecomeVisible && !modal?.isVisible && shouldRender;

we can do something like this

const shouldShow = shouldRender && (modal?.isPopover || (!modal?.willAlertModalBecomeVisible && !modal?.isVisible));

Note: This is just pseudo code. We can achieve the same results by passing props

What alternative solutions did you explore? (Optional)

We can remove !modal?.willAlertModalBecomeVisible from here

const shouldShow = !modal?.willAlertModalBecomeVisible && !modal?.isVisible && shouldRender;

@bernhardoj
Copy link
Contributor

Proposal

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

The QAB toolltip doesn't show for new user.

What is the root cause of that problem?

This happens after #49682 where we prevent the tooltip to show in a modal. The issue that they are trying to solve is that the tooltip doesn't hide when we open a modal (or RHP).

const shouldShow = !modal?.willAlertModalBecomeVisible && !modal?.isVisible && shouldRender;

But using that condition means that the tooltip isn't allowed to show in a modal.

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

Because we want to close the tooltip when a modal will show, we need to change the logic a bit. What we should do instead is, if a modal is previously not shown, but now is visible, then close the tooltip. We can do that inside this onyx subscription.

const unsubscribeOnyxModal = onyxSubscribe({
key: ONYXKEYS.MODAL,
callback: (modalArg) => {
if (modalArg === undefined) {
return;
}
setModal(modalArg);
},
});
return () => {

let prevModal: Modal;
const unsubscribeOnyxModal = onyxSubscribe({
    key: ONYXKEYS.MODAL,
    callback: (modal) => {
        if (modal === undefined) {
            return;
        }
        if (!prevModal) {
            prevModal = modal;
        } else if ((!prevModal.willAlertModalBecomeVisible && modal.willAlertModalBecomeVisible) || (!prevModal.isVisible && modal.isVisible)) {
            clearTimeout(showTimer.current);
            clearTimeout(autoCloseTimer.current);
            closeTooltip();
        }
    },
});

// If we want to replace above with useOnxy hooks (we use the above logic so it will re-render based on modal only when visible)
// const [modal] = useOnyx(ONYXKEYS.MODAL);
// const prevModal = usePrevious(modal)
// useEffect(() => {
//     if ((!prevModal?.willAlertModalBecomeVisible && modal?.willAlertModalBecomeVisible) || (!prevModal?.isVisible && modal?.isVisible)) {
//         clearTimeout(showTimer.current);
//         clearTimeout(autoCloseTimer.current);
//         closeTooltip();
//     }
// }, [modal, prevModal, closeTooltip]);

And when we close the tooltip, we need to make sure we cancel both the timeout of show and auto close/dismiss.

// Automatically hide tooltip after 5 seconds if shouldAutoDismiss is true
const timerID = setTimeout(() => {
closeTooltip();
}, 5000);
return () => {
clearTimeout(timerID);
};

const timerID = setTimeout(() => {
show.current?.();
didShow.current = true;
}, 500);
return () => {
clearTimeout(timerID);
};

That's why we need to store it on a ref so we can use it later. Then, we can remove this shouldShow and this logic.

const shouldShow = !modal?.willAlertModalBecomeVisible && !modal?.isVisible && shouldRender;

// If the modal is open, hide the tooltip immediately and clear the timeout
if (!shouldShow) {
closeTooltip();
return;
}

Also, replaces all shouldShow with shouldRender back.

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

@melvin-bot melvin-bot bot changed the title First QAB missing tooltip for new user [$250] First QAB missing tooltip for new user Nov 6, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Nov 6, 2024

@ishpaul777 can you provide more details plz?

Sign up with new account

Which do you select here?
SnagitHelper2024 2024-11-05 16 07 50

Open FAB, complete scan receipt flow

Track expense or Submit expense?

Thx

@mallenexpensify mallenexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 6, 2024
@ishpaul777
Copy link
Contributor

Track expense or Submit expense?

Submit expense, not only scan receipt but the any of the submit flow will work

@mallenexpensify
Copy link
Contributor

Was able to reproduce

SnagitHelper2024 2024-11-06 11 03 15

Video

2024-11-06_10-59-43.mp4

@mallenexpensify mallenexpensify added Help Wanted Apply this label when an issue is open to proposals by contributors and removed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 6, 2024
@mallenexpensify mallenexpensify removed their assignment Nov 6, 2024
@mallenexpensify mallenexpensify added the Bug Something is broken. Auto assigns a BugZero manager. label Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

@mallenexpensify mallenexpensify self-assigned this Nov 6, 2024
@mallenexpensify
Copy link
Contributor

@sakluger , I'm off the next week, can you please keep an eye on this issue til I'm back? Thx

@sakluger
Copy link
Contributor

sakluger commented Nov 8, 2024

@rayane-djouah could you please check the two proposals we got already to see if they would work? Thanks!

@rayane-djouah
Copy link
Contributor

Reviewing 👀

@rayane-djouah
Copy link
Contributor

@Nodebrute Thank you for the proposal. However, the proposed solution will not be effective in scenarios where a tooltip is already displayed and a modal (popover) containing another tooltip is opened subsequently:

Screen.Recording.2024-11-09.at.10.07.48.PM.mov

Also, the tooltip will not be closed when we click on the three dots menu in saved searches:

Screen.Recording.2024-11-09.at.11.15.46.PM.mov

@rayane-djouah
Copy link
Contributor

@bernhardoj Thank you for your proposal. I agree with your root cause analysis and the solution you've suggested.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 9, 2024

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

@melvin-bot melvin-bot bot added the Weekly KSv2 label Nov 13, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @rayane-djouah

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 28, 2024
@melvin-bot melvin-bot bot changed the title [$250] First QAB missing tooltip for new user [HOLD for payment 2024-12-05] [$250] First QAB missing tooltip for new user Nov 28, 2024
Copy link

melvin-bot bot commented Nov 28, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 28, 2024
Copy link

melvin-bot bot commented Nov 28, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.67-9 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 2024-12-05. 🎊

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

Copy link

melvin-bot bot commented Nov 28, 2024

@rayane-djouah @mallenexpensify @rayane-djouah 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]

@rayane-djouah
Copy link
Contributor

rayane-djouah commented Nov 29, 2024

BugZero Checklist:

  • 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
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
  • 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/49682/files#r1863654116

  • 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: N/A

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

  • [@mallenexpensify] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

#### Precondition:

- N/A

#### Test:

1. Log in as a new user.
2. Submit a new expense to any user.
3. Press the FAB (Floating Action Button).
4. Verify that a tooltip is shown for the QAB (Quick Access Bar).
5. Verify that the tooltip auto-hides after 5 seconds.

Do we agree 👍 or 👎

@mallenexpensify
Copy link
Contributor

Thanks @rayane-djouah
Test case created

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 5, 2024
@ishpaul777
Copy link
Contributor

This seems to be not fixed on mobile screen size

Screen.Recording.2024-12-09.at.10.13.41.PM.mov
Screen.Recording.2024-12-09.at.10.16.32.PM.mov

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Dec 9, 2024
@rayane-djouah
Copy link
Contributor

rayane-djouah commented Dec 9, 2024

@ishpaul777 This appears to be a recent regression, reproducible only on staging, and it seems unrelated to our PR, which is already in production:

Screen.Recording.2024-12-09.at.7.09.36.PM.mov

Reported on Slack: https://expensify.slack.com/archives/C049HHMV9SM/p1733768184773589

@rayane-djouah
Copy link
Contributor

Resolved: #53777 (comment)

@rayane-djouah
Copy link
Contributor

@mallenexpensify This is ready for payment

@mallenexpensify
Copy link
Contributor

Contributor: @bernhardoj due $250 via NewDot
Contributor+: @rayane-djouah paid $250 via Upwork.

Thanks!

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants