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

[$250] Tags - Background report changes to Tags page after clicking Custom tag name in RHP #49883

Open
2 of 6 tasks
lanitochka17 opened this issue Sep 28, 2024 · 25 comments
Open
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 28, 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.41-2
Reproducible in staging?: Y
Reproducible in production?: N/A Unable to check
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User is logged in to two devices
  • Workspace has tags
  1. Go to staging.new.expensify.com
  2. [Device A] Go to workspace chat
  3. [Device A] Click + > Submit expense > Manual
  4. [Device A] Proceed to confirmation page and click Tag
  5. [Device B] Go to workspace settings > Tags
  6. [Device B] Disable all tags
  7. [Device A] Click Edit tags
  8. [Device A] Click Settings > Custom tag name

Expected Result:

The report in the background will remain after clicking Custom tag name

Actual Result:

The report in the background changes to Tags page after clicking Custom tag name

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

Bug6617841_1727469118066.20240928_042600.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021840631550279932147
  • Upwork Job ID: 1840631550279932147
  • Last Price Increase: 2024-09-30
  • Automatic offers:
    • paultsimura | Reviewer | 104272735
Issue OwnerCurrent Issue Owner: @paultsimura
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Sep 28, 2024
Copy link

melvin-bot bot commented Sep 28, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 28, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Sep 28, 2024

Triggered auto assignment to @stitesExpensify (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@roryabraham
Copy link
Contributor

Looks pretty NAB to me

@roryabraham roryabraham added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API Hourly KSv2 labels Sep 29, 2024
@NJ-2020
Copy link
Contributor

NJ-2020 commented Sep 29, 2024

Proposal

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

Tags - Background report changes to Tags page after clicking Custom tag name in RHP

What is the root cause of that problem?

We're not passing the backTo param when navigating to the Custom tag name page

onPress={() => Navigation.navigate(ROUTES.WORKSPACE_EDIT_TAGS.getRoute(policyID, policyTagLists[0].orderWeight))}

App/src/ROUTES.ts

Lines 847 to 850 in 3047c1b

WORKSPACE_EDIT_TAGS: {
route: 'settings/workspaces/:policyID/tags/:orderWeight/edit',
getRoute: (policyID: string, orderWeight: number) => `settings/workspaces/${policyID}/tags/${orderWeight}/edit` as const,
},

And same when navigating to the Settings page
const navigateToTagsSettings = () => {
Navigation.navigate(ROUTES.WORKSPACE_TAGS_SETTINGS.getRoute(policyID));
};

App/src/ROUTES.ts

Lines 843 to 846 in 3047c1b

WORKSPACE_TAGS_SETTINGS: {
route: 'settings/workspaces/:policyID/tags/settings',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/tags/settings` as const,
},

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

We can add the backTo param inside the getRoute function and pass the backTo param by using route.params.backTo

WORKSPACE_TAGS_SETTINGS: {
    route: 'settings/workspaces/:policyID/tags/settings',
    getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/tags/settings` as const, backTo),
},
WORKSPACE_EDIT_TAGS: {
    route: 'settings/workspaces/:policyID/tags/:orderWeight/edit',
    getRoute: (policyID: string, orderWeight: number, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/tags/${orderWeight}/edit` as const, backTo),
},

WorkspaceTagsPage.tsx when navigating to Settings page

const backTo = route.params.backTo;
const navigateToTagsSettings = () => {
    Navigation.navigate(ROUTES.WORKSPACE_TAGS_SETTINGS.getRoute(policyID, backTo));
};

// ...types for route.params
[SCREENS.WORKSPACE.TAGS]: {
    policyID: string;
    backTo?: Routes;
};

And same for WorkspaceTagsSettingsPage when navigating to Custom tag name page

<MenuItemWithTopDescription
    title={policyTagLists[0]?.name}
    description={translate(`workspace.tags.customTagName`)}
    onPress={() => Navigation.navigate(ROUTES.WORKSPACE_EDIT_TAGS.getRoute(policyID, policyTagLists[0].orderWeight, backTo))}
    shouldShowRightIcon
/>

Result

Screen.Recording.2024-09-28.at.22.57.04.mov

What alternative solutions did you explore? (Optional)

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Sep 30, 2024

What does NAB mean?

@NJ-2020
Copy link
Contributor

NJ-2020 commented Sep 30, 2024

@Christinadobrzyn NAB stands for Not a blocker

@truph01
Copy link
Contributor

truph01 commented Sep 30, 2024

Proposal

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

The report in the background changes to Tags page after clicking Custom tag name

What is the root cause of that problem?

  • We have logic to push a new full screen navigator to the stacks if the RHN is in FULL_SCREEN_TO_RHP_MAPPING list:

// Check for FullScreenNavigator
for (const [fullScreenName, RHPNames] of Object.entries(FULL_SCREEN_TO_RHP_MAPPING)) {
if (RHPNames.includes(route.name)) {
const paramsFromRoute = getParamsFromRoute(fullScreenName);
return createFullScreenNavigator({name: fullScreenName as FullScreenName, params: pick(route.params, paramsFromRoute)});
}
}

  • When we click on "Custom tag name", the custom tag name screen is in FULL_SCREEN_TO_RHP_MAPPING:

hence we push a new full screen navigator to stacks.

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

  • In general, we should add a backTo param to the route when we click "Custom tag name". With this, in:

function getMatchingRootRouteForRHPRoute(route: NavigationPartialRoute): NavigationPartialRoute<CentralPaneName | typeof NAVIGATORS.FULL_SCREEN_NAVIGATOR> | undefined {

logic:

// Check for backTo param. One screen with different backTo value may need diferent screens visible under the overlay.
if (route.params && 'backTo' in route.params && typeof route.params.backTo === 'string') {

is called instead of pushing a new full screen navigator to stacks:

// Check for FullScreenNavigator
for (const [fullScreenName, RHPNames] of Object.entries(FULL_SCREEN_TO_RHP_MAPPING)) {

  • In detail:

  • First, update the getRoute function so that it can receive the additional backTo param:

App/src/ROUTES.ts

Lines 843 to 850 in d187665

WORKSPACE_TAGS_SETTINGS: {
route: 'settings/workspaces/:policyID/tags/settings',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/tags/settings` as const,
},
WORKSPACE_EDIT_TAGS: {
route: 'settings/workspaces/:policyID/tags/:orderWeight/edit',
getRoute: (policyID: string, orderWeight: number) => `settings/workspaces/${policyID}/tags/${orderWeight}/edit` as const,
},

  • Then, update:

Navigation.navigate(ROUTES.WORKSPACE_TAGS_SETTINGS.getRoute(policyID));

    const navigateToTagsSettings = () => {
        Navigation.navigate(ROUTES.WORKSPACE_TAGS_SETTINGS.getRoute(policyID, Navigation.getActiveRoute()));
    };

and:

onPress={() => Navigation.navigate(ROUTES.WORKSPACE_EDIT_TAGS.getRoute(policyID, policyTagLists[0].orderWeight))}

                        onPress={() => Navigation.navigate(ROUTES.WORKSPACE_EDIT_TAGS.getRoute(policyID, policyTagLists[0].orderWeight, Navigation.getActiveRoute()))}

It will add new backTo param to the route when we click "Custom tag name"

What alternative solutions did you explore? (Optional)

@Christinadobrzyn
Copy link
Contributor

Ah thanks @NJ-2020! That makes sense. Given that, I think this can be external so adding the label.

@Christinadobrzyn Christinadobrzyn added the External Added to denote the issue can be worked on by a contributor label Sep 30, 2024
@melvin-bot melvin-bot bot changed the title Tags - Background report changes to Tags page after clicking Custom tag name in RHP [$250] Tags - Background report changes to Tags page after clicking Custom tag name in RHP Sep 30, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

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

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

melvin-bot bot commented Sep 30, 2024

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

@Christinadobrzyn
Copy link
Contributor

@paultsimura can you check out the proposals when you have a moment? TY!

@paultsimura
Copy link
Contributor

Sure, I will check later today or early tomorrow 👍

@Christinadobrzyn
Copy link
Contributor

Thanks @paultsimura! Note for Melvin - we're reviewing proposals.

@paultsimura
Copy link
Contributor

Reviewing now 👀

@paultsimura
Copy link
Contributor

Thanks for the proposals.
@NJ-2020 could you please provide a test branch with your solution?

@twilight294
Copy link
Contributor

twilight294 commented Oct 3, 2024

Edited by proposal-police: This proposal was edited at 2024-10-03 12:44:11 UTC.

Proposal

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

Background report changes to Tags page after clicking Custom tag name in RHP

What is the root cause of that problem?

The bug occurs because we do not have a ModalStackNavigator for tags, here we have not defined the behaviour how the RHP should act if it is coming from another RHP.

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

We created a ModalStackNavigator for categories in this PR #41344. Following similar approach, we can make one for tags as well

Skeleton implementation would be:

  • Like we did for categories, create new screens for tags as well:
    SETTINGS_TAGS: {
        SETTINGS_TAGS_SETTINGS: 'Settings_Tags_Settings',
        SETTINGS_TAG_SETTINGS: 'Settings_Tag_Settings',
        SETTINGS_TAG_Create: 'Settings_Tag_Create',
        SETTINGS_TAG_EDIT: 'Settings_Tag_Edit',
        SETTINGS_TAGS_ROOT: 'Settings_Tags',
    },
  • Then we will create routes for the above screens:
    SETTINGS_TAG_EDIT: {
        route: 'settings/workspaces/:policyID/tag/:orderWeight/:tagName/edit',
        getRoute: (policyID: string, orderWeight: number, tagName: string) => `settings/workspaces/${policyID}/tag/${orderWeight}/${encodeURIComponent(tagName)}/edit` as const,
    },
    .....
    })
  • We also have to update RIGHT_MODAL to add SETTINGS_TAGS, Then in linkingConfig/config.ts, we will update similar to:
[SCREENS.RIGHT_MODAL.SETTINGS_TAGS]: {
                    screens: {
                        [SCREENS.SETTINGS_TAGS.SETTINGS_TAG_EDIT]: {
                            path: ROUTES.SETTINGS_TAG_EDIT.route,
                            parse: {
                                TagName: (tagName: string) => decodeURIComponent(categoryName),
                            },
                        },
                    },
                },
                ...

In RightModalNavigator we also need to map the modal for tags , we would then need to check whether back to is passed if so then use SETTINGS_TAG_SETTINGS else use the original navigation
The above is just rough idea, details will be provided during PR.

What alternative solutions did you explore? (Optional)

.

@ZhenjaHorbach
Copy link
Contributor

Proposal

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

Tags - Background report changes to Tags page after clicking Custom tag name in RHP

What is the root cause of that problem?

When we try to open a RHN screen from FULL_SCREEN_TO_RHP_MAPPING
Workspace screen is used as a fullscreen

[SCREENS.WORKSPACE.TAGS]: [SCREENS.WORKSPACE.TAGS_SETTINGS, SCREENS.WORKSPACE.TAGS_EDIT, SCREENS.WORKSPACE.TAG_CREATE, SCREENS.WORKSPACE.TAG_SETTINGS, SCREENS.WORKSPACE.TAG_EDIT],

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

To fix this issue we can create new routes for tags which we will use in case if we use these screens not from workspace

We did the same for categories

What alternative solutions did you explore? (Optional)

NA

@paultsimura
Copy link
Contributor

@twilight294 thanks for your proposal. It looks very generic, could you please add some clarifications, e.g., which specific changes you would copy from #41344?

@twilight294
Copy link
Contributor

@paultsimura I updated proposal, do you need more details ?

@paultsimura
Copy link
Contributor

Thanks for the update.
The proposal by @twilight294 looks good to me.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 3, 2024

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

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

melvin-bot bot commented Oct 4, 2024

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Oct 4, 2024

📣 @twilight294 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@twilight294
Copy link
Contributor

PR ready for review @paultsimura

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

No branches or pull requests

9 participants