Skip to content

[$1000] App loses focus from concierge compose box when visiting concierge chat after connect bank step 3 #22664

Closed

Description

@kavimuru

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


Action Performed:

  1. Open the app
  2. Open settings
  3. Open workspaces-> any workspace-> bank account-> connect manually->fill in step 1, step 2, step 3 details and continue
  4. On passport page, click on question mark icon in header
  5. Click on chat with concierge and observe that app does not focus on compose box
  6. Open any other report and observe that app does not focus on any compose box anymore

Expected Result:

App should focus on compose box of concierge chat if we visit the chat from 'Chat with concierge' option from workspace help

Actual Result:

App does not focus on compose box of concierge chat if we visit the chat from 'Chat with concierge' option from workspace help after step 3 of connect bank account

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.39-5
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos: Any additional supporting documentation

focus.lost.in.chat.with.concierge.mov
Recording.1255.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688575084802769

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ecac728c74967838
  • Upwork Job ID: 1678833945930260480
  • Last Price Increase: 2023-07-25

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 11, 2023
  2. melvin-bot commented on Jul 11, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jul 11, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. sakluger commented on Jul 11, 2023

    @sakluger
    Contributor

    I think that this happens anytime you click on an in-app link directing you to Concierge, since I was able to reproduce this by going to Settings > Account > Report a bug.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 11, 2023
  6. changed the title [-]App loses focus from concierge compose box when visiting concierge chat after connect bank step 3[/-] [+][$1000] App loses focus from concierge compose box when visiting concierge chat after connect bank step 3[/+] on Jul 11, 2023
  7. melvin-bot commented on Jul 11, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 11, 2023
  9. melvin-bot commented on Jul 11, 2023

    @melvin-bot

    Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.

  10. melvin-bot commented on Jul 11, 2023

    @melvin-bot

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

  11. ginsuma commented on Jul 11, 2023

    @ginsuma
    Contributor

    Proposal

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

    App loses focus from concierge compose box when visiting concierge chat after connect bank step 3

    What is the root cause of that problem?

    When navigating to concierge chat from RHP, we don't dismiss modal before doing it so in Onyx, modal keeps isVisible true => shouldAutoFocus on ReportActionComposer is false

    Navigation.navigate(ROUTES.getReportRoute(conciergeChatReportID));

    this.shouldAutoFocus = !props.modal.isVisible && (this.shouldFocusInputOnScreenFocus || this.isEmptyChat()) && props.shouldShowComposeInput;

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

    Currently, we are using modal for focusing in 3 cases:

    1. When ReportActionCompose mount, this will check if we open RHP by deeplink => modal is visible => not focus.
      this.shouldAutoFocus = !props.modal.isVisible && (this.shouldFocusInputOnScreenFocus || this.isEmptyChat()) && props.shouldShowComposeInput;
    2. When we use composer actions, emoji picker, context menu action and close it, we check if prevProps.modal.isVisible && !this.props.modal.isVisible => focus.
    3. When we open RHP from a report and back to that report, same as 2.
      if (this.willBlurTextInputOnTapOutside && !this.props.modal.isVisible && this.props.isFocused && (prevProps.modal.isVisible || !prevProps.isFocused)) {
      this.focus();
      }

    We shouldn't focus base on modal key.
    We will focus when the active route is CentralPaneNavigator.
    Creating a function in Navigation like below:

    function isCPNRoute() {
        const rootState = navigationRef.getRootState();
        const lastRoute = _.last(rootState.routes);
        return lastRoute.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR;
    }
    1. We will replaced !props.modal.isVisible to Navigation.isCPNRoute() => this will solve that GH.
    this.shouldAutoFocus = Navigation.isCPNRoute() && ...;
    1. I believe we are updating how context menu works with modal here . Therefore, we keep modal in the condition and wait to see the update.
    2. We already have a navigator focus listener here so we can check when focusing, if Navigation.isCPNRoute() => focus.
    this.unsubscribeNavigationFocus = this.props.navigation.addListener('focus', () => {
        if (Navigation.isCPNRoute() && !this.textInput.isFocused()) {
            this.focus();
        }
        ...
    });
  12. Nodebrute commented on Jul 11, 2023

    @Nodebrute
    Contributor

    Proposal

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

    App loses focus from concierge compose box when visiting concierge chat after connect bank step 3

    What is the root cause of that problem?

    We are navigating to concierge hence in Onyx key modal isVisible = true. It will not become false until we open another modal and close it.

    Navigation.navigate(ROUTES.getReportRoute(conciergeChatReportID))
    

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

    We can use Navigation.dismissModal(conciergeChatReportID) instead of navigate methods. In most of the cases we are navigating to concierge from RHP so it's safe to use.

    Or we can add a check if previous stack is RHP then dismiss modal else navigate like this

        const lastRoute = Navigation.getLastRoute();
        if (!conciergeChatReportID) {
          ....
        } else {
            if(lastRoute.name === 'RightModalNavigator'){
                Navigation.dismissModal(conciergeChatReportID);
            }else{
                Navigation.navigate(ROUTES.getReportRoute(conciergeChatReportID));
            }
           
        }
    

    here I have created another function in Navigation to getLastRoute

    function getLastRoute(){
        const rootState = navigationRef.getRootState();
        const lastRoute = _.last(rootState.routes);
        return lastRoute;
    }
    

    What alternative solutions did you explore? (Optional)

  13. 13 remaining items

  14. abdulrahuman5196 commented on Jul 20, 2023

    @abdulrahuman5196
    Contributor

    @sakluger There hasn't been any proposals we have made suitable to approve yet. I think we should increase this bounty.

  15. ginsuma commented on Jul 20, 2023

    @ginsuma
    Contributor
  16. Nodebrute commented on Jul 20, 2023

    @Nodebrute
    Contributor

    @abdulrahuman5196 this is dupe of #21401

  17. abdulrahuman5196 commented on Jul 21, 2023

    @abdulrahuman5196
    Contributor

    Thanks for the reference @Nodebrute

    @sakluger It seems we have a tracking issue for these composer focus kind of issues - #15992

  18. melvin-bot commented on Jul 24, 2023

    @melvin-bot

    @sakluger, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  19. sakluger commented on Jul 25, 2023

    @sakluger
    Contributor

    Good find! I'll leave this open until we hear back from @bondydaa whether this should be included in that tracking issue or not.

  20. melvin-bot commented on Jul 25, 2023

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  21. melvin-bot commented on Jul 25, 2023

    @melvin-bot

    @sakluger @abdulrahuman5196 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  22. bondydaa commented on Jul 26, 2023

    @bondydaa
    Contributor

    throw whatever you want on that tracking issue that's what it's for. no one is assigned to it though so not much is going to get done with it until someone picks it up.

  23. sakluger commented on Jul 27, 2023

    @sakluger
    Contributor

    I added this to the list of related issues on the tracking issue, let's close for now since this will eventually be fixed there.

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions