Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2024-11-01] [$500] Tags - Background report changes to Tags page after clicking Custom tag name in RHP #49883

Closed lanitochka17 closed 1 week ago

lanitochka17 commented 1 month ago

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:

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?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/ffdcd5fd-95ab-47fb-a28b-89238ffd7c5c

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-10-10
  • Automatic offers:
    • paultsimura | Reviewer | 104272735
Issue OwnerCurrent Issue Owner: @Christinadobrzyn
melvin-bot[bot] commented 1 month ago

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[bot] commented 1 month ago

:wave: 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.
melvin-bot[bot] commented 1 month ago

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

roryabraham commented 1 month ago

Looks pretty NAB to me

NJ-2020 commented 1 month ago

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 https://github.com/Expensify/App/blob/3047c1baa21f47825f5c1ffd652184341dd22256/src/pages/workspace/tags/WorkspaceTagsSettingsPage.tsx#L85 https://github.com/Expensify/App/blob/3047c1baa21f47825f5c1ffd652184341dd22256/src/ROUTES.ts#L847-L850 And same when navigating to the Settings page https://github.com/Expensify/App/blob/3047c1baa21f47825f5c1ffd652184341dd22256/src/pages/workspace/tags/WorkspaceTagsPage.tsx#L174-L176 https://github.com/Expensify/App/blob/3047c1baa21f47825f5c1ffd652184341dd22256/src/ROUTES.ts#L843-L846

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

https://github.com/user-attachments/assets/ace8973c-9aed-4812-93d5-a3b78291568b

What alternative solutions did you explore? (Optional)

Christinadobrzyn commented 1 month ago

What does NAB mean?

NJ-2020 commented 1 month ago

@Christinadobrzyn NAB stands for Not a blocker

truph01 commented 1 month ago

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?

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts#L146-L153

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts#L134

hence we push a new full screen navigator to stacks.

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

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts#L112

logic:

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts#L113-L114

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

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts#L146-L147

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/ROUTES.ts#L843-L850

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/pages/workspace/tags/WorkspaceTagsPage.tsx#L175

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

and:

https://github.com/Expensify/App/blob/d18766580c7e35e439ff933f3097366e36c6ceca/src/pages/workspace/tags/WorkspaceTagsSettingsPage.tsx#L85

                        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 commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

Christinadobrzyn commented 1 month ago

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

paultsimura commented 1 month ago

Sure, I will check later today or early tomorrow πŸ‘

Christinadobrzyn commented 1 month ago

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

paultsimura commented 1 month ago

Reviewing now πŸ‘€

paultsimura commented 1 month ago

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

twilight2294 commented 1 month ago

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 https://github.com/Expensify/App/pull/41344. Following similar approach, we can make one for tags as well

Skeleton implementation would be:

    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',
    },
    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,
    },
    .....
    })
[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 commented 1 month ago

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

https://github.com/Expensify/App/blob/a991b39ce9eaa5095040f390931ec4b07e601dcf/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts#L60

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 commented 1 month ago

@twilight294 thanks for your proposal. It looks very generic, could you please add some clarifications, e.g., which specific changes you would copy from https://github.com/Expensify/App/pull/41344?

twilight2294 commented 1 month ago

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

paultsimura commented 1 month ago

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

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

πŸ“£ @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

melvin-bot[bot] commented 1 month ago

πŸ“£ @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 πŸ“–

twilight2294 commented 1 month ago

PR ready for review @paultsimura

twilight2294 commented 1 month ago

@stitesExpensify @Christinadobrzyn can you please take a look at this comment: https://github.com/Expensify/App/pull/50416#issuecomment-2401641633

melvin-bot[bot] commented 1 month ago

Upwork job price has been updated to $500

stitesExpensify commented 1 month ago

Doubling bounty because we are fixing 2 extra bugs

Christinadobrzyn commented 1 month ago

Just an update for melvin that we're working on the PRs

twilight2294 commented 1 month ago

@stitesExpensify the PR is ready for your review

Christinadobrzyn commented 3 weeks ago

PR in the works! https://github.com/Expensify/App/pull/50416

melvin-bot[bot] commented 3 weeks ago

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

melvin-bot[bot] commented 3 weeks ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.53-1 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-11-01. :confetti_ball:

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

melvin-bot[bot] commented 3 weeks ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

Christinadobrzyn commented 2 weeks ago

@paultsimura Do we need a regression for this?

Payouts due:

twilight2294 commented 2 weeks ago

I am paid via Upwork, can you please send me an offer

On Fri, Nov 1, 2024 at 7:37β€―AM Christina Dobrzynski < @.***> wrote:

@paultsimura https://github.com/paultsimura Do we need a regression for this?

Payouts due:

β€” Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/49883#issuecomment-2451158106, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLXFUO2H4T2KI4Z3U2DEQO3Z6LO7RAVCNFSM6AAAAABPAVY3U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRGE2TQMJQGY . You are receiving this because you were mentioned.Message ID: @.***>

Christinadobrzyn commented 2 weeks ago

Ah thanks for letting me know @twilight2294 - can you please accept the offer here

twilight2294 commented 2 weeks ago

I’ve accepted the offer, thank you so much

On Fri, Nov 1, 2024 at 11:02β€―AM Christina Dobrzynski < @.***> wrote:

Ah thanks for letting me know @twilight2294 https://github.com/twilight2294 - can you please accept the offer here https://www.upwork.com/nx/wm/offer/104689344

β€” Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/49883#issuecomment-2451321365, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLXFUO2447ATSA4K7XCLD2LZ6MG5DAVCNFSM6AAAAABPAVY3U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRGMZDCMZWGU . You are receiving this because you were mentioned.Message ID: @.***>

paultsimura commented 2 weeks ago

Regression Test Proposal

Precondition:

Test:

  1. [Device A] Go to a workspace chat
  2. [Device A] Click + > Submit expense > Manual
  3. [Device A] Proceed to the confirmation page and click Tag
  4. [Device B] Go to the workspace settings > Tags
  5. [Device B] Disable all tags
  6. [Device A] Click Edit tags
  7. [Device A] Click Settings > Custom tag name
  8. Verify the report in the background remains unchanged

Do we agree πŸ‘ or πŸ‘Ž

Christinadobrzyn commented 1 week ago

Regression test - https://github.com/Expensify/Expensify/issues/441268

Paid out based on payment summary - https://github.com/Expensify/App/issues/49883#issuecomment-2451158106

But I just checked and there was discussion after the PR went to production- is there a regression that we need to track for this? @twilight2294 @paultsimura

paultsimura commented 1 week ago

Thank you @Christinadobrzyn. That one bug was related to a super edge case that is not even possible to reproduce fully in ND as the multilevel tags are not currently supported, therefore it was missed while testing. IMO, it wouldn't be quite fair to apply the 50% penalty for such a case in the 30-files PR that covers 10+ other navigational scenarios. But if you think otherwise, let's adjust the bounty here.

Christinadobrzyn commented 1 week ago

hi @paultsimura thank you for the additional information. I think it sounds fair to keep the payment as is.

Closing this as complete!

melvin-bot[bot] commented 1 week ago

@stitesExpensify @Christinadobrzyn Be sure to fill out the Contact List!

paultsimura commented 1 week ago

Thank you @Christinadobrzyn.