Skip to content

[$250] Workspace - Inbox briefly displayed when creating WS from selector and going back #50850

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

Closed
3 of 6 tasks
IuliiaHerets opened this issue Oct 16, 2024 · 36 comments
Closed
3 of 6 tasks
Assignees
Labels
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

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 16, 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.49-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/5088507&group_by=cases:section_id&group_order=asc&group_id=296775
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the Expensify app.
  2. Tap on the workspace selector on the top left corner.
  3. Tap on the "+" icon to add a new workspace.
  4. Once navigated to workspace menu, tap on the arrow on the top left corner.
  5. Verify you are redirected to workspace selector again.

Expected Result:

After the workspace is created and the user should be navigated to the new workspace menu, and when the back arrow is tapped, the app should return to workspace selector.

Actual Result:

When the user lands on new workspace menu and tap the back arrow to return to workspace selector, the inbox is displayed for a second, before the user lands on selector again.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6636021_1729047532680.Selector.mp4
bandicam.2024-10-16.09-28-01-383.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849140571510923303
  • Upwork Job ID: 1849140571510923303
  • Last Price Increase: 2024-10-30
  • Automatic offers:
    • huult | Contributor | 104756734
    • dominictb | Contributor | 104771074
Issue OwnerCurrent Issue Owner: @aimane-chnaif
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 16, 2024
Copy link

melvin-bot bot commented Oct 16, 2024

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

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@IuliiaHerets
Copy link
Author

@puneetlath FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@daledah
Copy link
Contributor

daledah commented Oct 16, 2024

Edited by proposal-police: This proposal was edited at 2024-10-16 11:38:54 UTC.

Proposal

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

When the user lands on new workspace menu and tap the back arrow to return to workspace selector, the inbox is displayed for a second, before the user lands on selector again.

What is the root cause of that problem?

When we click back button, it calls:

Navigation.resetToHome();
Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route));

Navigation.navigate(route.params?.backTo as Route) is only called when the navigation is ready after Navigation.resetToHome() is called. Hence the inbox is displayed for a second, before the user lands on selector again.

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

Just need to update

Navigation.resetToHome();
Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route));

                            if (isSmallScreenWidth) {
                                Navigation.navigate(route.params?.backTo as Route);
                            } else {
                                Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route));
                            }

With this change, we can remove the "inbox is displayed for a second, before the user lands on selector again." in small screen.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Oct 21, 2024
Copy link

melvin-bot bot commented Oct 21, 2024

@puneetlath Huh... This is 4 days overdue. Who can take care of this?

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Oct 23, 2024
@melvin-bot melvin-bot bot changed the title Workspace - Inbox briefly displayed when creating WS from selector and going back [$250] Workspace - Inbox briefly displayed when creating WS from selector and going back Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2024
@skg0525
Copy link

skg0525 commented Oct 24, 2024

Edited by proposal-police: This proposal was edited at 2024-10-25 14:29:43 UTC.

Proposal

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

When the user lands on new workspace menu and tap the back arrow to return to workspace selector, the inbox is displayed for a second, before the user lands on selector again.

What is the root cause of that problem?

We are reseting the navigation to home before we navigate to workspace-switcher. and hence for a second we see inbox for a second

Navigation.resetToHome();
Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route));

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

We need to remove Navigation.resetToHome(); from WorkspaceInitialPage.tsx and

modify WorkspaceSwitcherPage to remove
Navigation.goBack and add Navigation.resetToHome instead

onBackButtonPress={Navigation.goBack}

Also need to modify callback and remove Navigation.goBack(); and add Navigation.resetToHome();

Navigation.goBack();

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@huult
Copy link
Contributor

huult commented Oct 28, 2024

Proposal

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

Inbox briefly displayed when creating WS from selector and going back

What is the root cause of that problem?

The reason we briefly see Inbox is that when we tap the back arrow, the function called includes Navigation.resetToHome();. As a result, Inbox appears for a short time before we proceed to call Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route)); to navigate to the workspace switcher.

onBackButtonPress={() => {
if (route.params?.backTo) {
Navigation.resetToHome();
Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route));
} else {

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

To fix this issue, we should navigate directly to the workspace switcher without calling Navigation.resetToHome(); to avoid seeing the Inbox. After reaching the workspace switcher, when we go back, we can add Navigation.resetToHome(); to return to the home screen. Something like this:

//.src/pages/workspace/WorkspaceInitialPage.tsx#L380
        onBackButtonPress={() => {
              if (route.params?.backTo) {
-                  Navigation.resetToHome();
-                  Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route));
+                  Navigation.isNavigationReady().then(() => Navigation.navigate(`${route.params?.backTo}?resetToHome=true` as Route));
              } else {
                  Navigation.dismissModal();
              }
          }}

//.src/pages/WorkspaceSwitcherPage/index.tsx#L38
-        function WorkspaceSwitcherPage() {
+        function WorkspaceSwitcherPage({route: {params}}) {

//.src/pages/WorkspaceSwitcherPage/index.tsx#L93
    const selectPolicy = useCallback(
        (option?: WorkspaceListItem) => {
            ...
+            if (params?.resetToHome === 'true') {
+                Navigation.resetToHome();
+            }
            ...
        },
        [activeWorkspaceID, setActiveWorkspaceID],
    );

//.src/pages/WorkspaceSwitcherPage/index.tsx#L168
-        onBackButtonPress={Navigation.goBack}
+        onBackButtonPress={() => {
+              if (params?.resetToHome === 'true') {
+                  Navigation.resetToHome();
+              }
+              Navigation.goBack();
+        }}      
POC
Screen.Recording.2024-10-28.at.15.27.29.mov

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

@puneetlath, @aimane-chnaif Eep! 4 days overdue now. Issues have feelings too...

@aimane-chnaif
Copy link
Contributor

@huult please avoid code diff in proposal

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2024
@huult
Copy link
Contributor

huult commented Oct 29, 2024

@aimane-chnaif Yes, I will improve the next proposal.

@aimane-chnaif
Copy link
Contributor

@daledah thanks for the proposal. If you see video in OP, this also happens on web (wide screen). But your solution is only for mobile.

@daledah @huult the logic was added in #46939.
Please make sure to cover regression test of #46816 which that PR fixes.

@huult
Copy link
Contributor

huult commented Oct 30, 2024

@aimane-chnaif Yes, sure. I tested the case you mentioned, and my proposal worked.

Copy link

melvin-bot bot commented Oct 30, 2024

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

Copy link

melvin-bot bot commented Oct 30, 2024

@puneetlath @aimane-chnaif 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!

@aimane-chnaif
Copy link
Contributor

@skg0525's proposal seems working fine to me.
@huult are you able to find any regression with that solution?

@huult
Copy link
Contributor

huult commented Nov 1, 2024

@huult are you able to find any regression with that solution?

@aimane-chnaif Yes, the other proposal has an issue: when we are on the search page, open the workspace switcher, and click the back arrow, it resets to the home page. That’s why, in my proposal, I use params to determine whether we need to reset to the home page or not

Video
Screen.Recording.2024-11-01.at.06.59.44.mov

@aimane-chnaif
Copy link
Contributor

@huult's proposal looks good to me.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 1, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Nov 4, 2024

@puneetlath, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Nov 4, 2024
@huult
Copy link
Contributor

huult commented Nov 5, 2024

Waiting for @puneetlath

@aimane-chnaif
Copy link
Contributor

I am out sick at the moment. Please reassign C+ for PR review

@melvin-bot melvin-bot bot removed the Overdue label Nov 5, 2024
@aimane-chnaif aimane-chnaif removed their assignment Nov 5, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 5, 2024
Copy link

melvin-bot bot commented Nov 5, 2024

📣 @huult 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dominictb
Copy link
Contributor

dominictb commented Nov 6, 2024

@puneetlath I can take this over given @aimane-chnaif is OOO.

Copy link

melvin-bot bot commented Nov 6, 2024

📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@dominictb
Copy link
Contributor

dominictb commented Nov 19, 2024

The plus icon to create the new WS is removed in #52623. I think we can close the PR cc @puneetlath @huult

@huult
Copy link
Contributor

huult commented Nov 19, 2024

@dominictb I think this ticket is still valid because we have the Get Started case where, if we don't have any workspace, we can create a workspace (click get started) in the same way as using the plus icon. Therefore, I believe the PR is still valid and ready to be merged. I will test that case once the server is back.

@huult
Copy link
Contributor

huult commented Nov 19, 2024

@dominictb I tested, and we have an issue when going back. Do you agree that we continue with this pull request?

Screen.Recording.2024-11-19.at.16.11.14.mov

@dominictb
Copy link
Contributor

@huult I don't see any problem in your video above, can you elaborate?

@huult
Copy link
Contributor

huult commented Nov 20, 2024

I made a mistake. This is not related to this ticket, so I will close this pull request. Thank you.

@dominictb
Copy link
Contributor

@puneetlath If so we can process payment and close this issue cc @huult

@huult
Copy link
Contributor

huult commented Nov 21, 2024

@puneetlath FYI

@puneetlath
Copy link
Contributor

Ah interesting ok.

@puneetlath
Copy link
Contributor

Ok, I've paid out the contracts. Closing. Thanks y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

8 participants