Skip to content

[PAYMENT DUE] [$500] mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker #35756

Closed

Description

@lanitochka17

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: 1.4.36-0
Reproducible in staging?: Y
**Reproducible in production?:**Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4279504
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Log in to New Expensify
  2. Navigate to any chat
  3. Open emoji picker
  4. Use device back button (twice if keyboard is opened)

Expected Result:

Emoji picker should be closed, user should remain in chat history

Actual Result:

User is redirected back to LHN

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6365936_1706965847633.Record_2024-02-02-20-31-24.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0156cc7a92d86433bd
  • Upwork Job ID: 1753804975067238400
  • Last Price Increase: 2024-02-24

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 3, 2024
  2. changed the title [-] mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker[/-] [+][$500] mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker[/+] on Feb 3, 2024
  3. melvin-bot commented on Feb 3, 2024

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 3, 2024
  5. melvin-bot commented on Feb 3, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 3, 2024

    @melvin-bot

    Triggered auto assignment to @zanyrenney (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  7. lanitochka17 commented on Feb 3, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp
    CC @quinthar

  8. Krishna2323 commented on Feb 3, 2024

    @Krishna2323
    Contributor

    Proposal

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

    mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker

    What is the root cause of that problem?

    We are call Navigation.goBack when back button is pressed.

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

    Before navigating check if the emoji picker is visible or not, if visible close it and do not navigate. We can get emojiPicker status from EmojiPickerAction and call hideEmojiPicker.

    Result

  9. suneox commented on Feb 3, 2024

    @suneox
    Contributor

    Proposal

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

    mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker

    What is the root cause of that problem?

    When emoji modal open we don't update window history state after that user clicks on "The browser back button" or "Device Back Button" it will navigate back to the previous page (base on browser history)

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

    We will handle update the history state for Modal Web and to make sure this change only affects some the modals we can add new props shouldHandleNavigationBack for Modal

    ```diff
    +function Modal({fullscreen = true, onModalHide = () => {}, type, onModalShow = () => {}, children, shouldHandleNavigationBack, ...rest}: BaseModalProps) {
        const theme = useTheme();
        const StyleUtils = useStyleUtils();
        const [previousStatusBarColor, setPreviousStatusBarColor] = useState<string>();
    
        const setStatusBarColor = (color = theme.appBG) => {
            if (!fullscreen) {
                return;
            }
    
            StatusBar.setBackgroundColor(color);
        };
    
        const hideModal = () => {
            setStatusBarColor(previousStatusBarColor);
            onModalHide();
    +       if (window.history.state.shouldGoBack) {
    +           window.history.back();
    +       }
        };
    
    +   const handlePopStateRef = useRef(() => {
    +       rest.onClose();
    +   });
    
        const showModal = () => {
            const statusBarColor = StatusBar.getBackgroundColor() ?? theme.appBG;
    
            ....
    
    +       if (shouldHandleNavigationBack) {
    +           window.history.pushState({shouldGoBack: true}, '', null);
    +           window.addEventListener('popstate', handlePopStateRef.current);
    +       }
            onModalShow?.();
        };
    
    +   useEffect(
    +       () => () => {
    +           window.removeEventListener('popstate', handlePopStateRef.current);
    +       },
    +       [],
    +   );
    
        return (
            <BaseModal
              ...

    At EmojiPicker pass props shouldHandleNavigationBack to Popover with condition is Browser.isMobile()

    POC

    Screen.Recording.2024-02-12.at.23.29.35.mov

    testing branch

    What alternative solutions did you explore? (Optional)

  10. jeremy-croff commented on Feb 3, 2024

    @jeremy-croff
    Contributor

    Well opening up an emoji picker is not a navigation action.

    Naturally clicking the back button would navigate back to the previous screen.

    This is working as intended.

    The only thing I see is that the background has a disabled state. We could improve the user experience if desired to disable all clicks and only close the emoji picker when clicking outside of it. But this is not what the Issue is asking for.

  11. hayata-suenaga commented on Feb 4, 2024

    @hayata-suenaga
    Contributor

    This issue should be handled in this issue

    Thank you everyone for your proposals, but we're closing this issue 🙇

  12. 95 remaining items

  13. Julesssss commented on Apr 29, 2024

    @Julesssss
    Contributor

    Hey @zanyrenney, just wanted to check you've seen this payment request?

  14. zanyrenney commented on May 7, 2024

    @zanyrenney
    Contributor

    on it, didn't see this with the lack of date automation.

  15. changed the title [-][$500] mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker[/-] [+][PAYMENT DUE] [$500] mWeb - Device back button with emoji picker opened leads to LHN instead of closing picker[/+] on May 7, 2024
  16. zanyrenney commented on May 7, 2024

    @zanyrenney
    Contributor

    payment summary

    @sobitneupane owed $500 - needs to request through NewDot (manual requests)
    @suneox needs $500 from upwork.

  17. zanyrenney commented on May 7, 2024

    @zanyrenney
    Contributor

    @suneox I can't find you on upwork.
    2024-05-07_12-30-36

    2024-05-07_12-30-52

    Please can you manually apply to the job? https://www.upwork.com/jobs/~01386bcc6b2c6f0fdf

    Feel free to DM me in slack when you have and i'll process the payment ASAP.

  18. suneox commented on May 7, 2024

    @suneox
    Contributor

    @suneox I can't find you on upwork.

    Here is my profile

  19. zanyrenney commented on May 7, 2024

    @zanyrenney
    Contributor

    Invited, please accept !

  20. suneox commented on May 7, 2024

    @suneox
    Contributor

    Invited, please accept !

    I have accept this job, Thank you

  21. zanyrenney commented on May 7, 2024

    @zanyrenney
    Contributor

    payment summary

    @sobitneupane owed $500 - needs to request through NewDot (manual requests)
    @suneox PAID $500 from upwork.

  22. melvin-bot commented on May 7, 2024

    @melvin-bot
  23. JmillsExpensify commented on May 12, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @sobitneupane

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2DesignEngineeringInternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions