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

[HOLD for payment 2025-01-30] [$250] The checkmark isn't displayed when back to access level page for copilot #52903

Closed
1 of 8 tasks
m-natarajan opened this issue Nov 21, 2024 · 44 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 21, 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.64-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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
Expensify/Expensify Issue URL:
Issue reported by: @DylanDylann
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs

Action Performed:

  1. Go to Security Page
  2. Add copilot
  3. Select an user
  4. Select "Full" option
  5. Click back button

Expected Result:

The checkmark should be displayed when back to access level page for the access level selected

Actual Result:

The checkmark isn't displayed when back to access level page , selected level is highlighted

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
BUG-copilot.mov
Recording.774.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021869142030241454978
  • Upwork Job ID: 1869142030241454978
  • Last Price Increase: 2025-01-14
  • Automatic offers:
    • nkdengineer | Contributor | 105700456
Issue OwnerCurrent Issue Owner: @anmurali
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

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

@nkdengineer
Copy link
Contributor

Proposal

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

The checkmark isn't displayed when back to access level page

What is the root cause of that problem?

Currently we are using the goBack function here to navigate when the user presses the back button

onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_DELEGATE_ROLE.getRoute(login, role))}

But before that route params in route were undefined so route.params.role here will be undefined

isSelected: role === route.params.role,

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

We should set value to role params before we navigate to confirm page

        Navigation.setParams({
            role: option.value,
        });
        Navigation.navigate(ROUTES.SETTINGS_DELEGATE_CONFIRM.getRoute(login, option.value));

What alternative solutions did you explore? (Optional)

Or we can use navigate function instead of goBack function here

@jayeshmangwani
Copy link
Contributor

jayeshmangwani commented Nov 21, 2024

Proposal

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

The previously selected role isn't displayed as selected when navigating back to the Access Level page using the header back button from the Add Copilot page.

What is the root cause of that problem?

On the SelectDelegateRolePage, we rely on the role parameter from the route passed from the previous screen using this condition:isSelected: role === route.params.role.

const roleOptions = Object.values(CONST.DELEGATE_ROLE).map((role) => ({
value: role,
text: translate('delegate.role', {role}),
alternateText: translate('delegate.roleDescription', {role}),
isSelected: role === route.params.role,

However, when navigating back from the Add Copilot page using the header back button, the checkmark for the previously selected user isn’t displayed because the parameter isn’t passed in this case. On the other hand, if the "Access Level" item on the Add Copilot page is clicked, the pre-selection is displayed since the parameter is passed during navigation.

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

Instead of relying solely on the route.params.role, we can manage the selection locally using useState. For example:

const [currentRole, setCurrentRole] = useState(route.params.role);

When generating roleOptions, compare the role with currentRole to determine the value of isSelected.

On row selection (onSelectRow), update the local state (setCurrentRole), and then invoke the existing Navigation.navigate method.

What alternative solutions did you explore? (Optional)

Replace Navigation.goBack() with explicit navigation that ensures the necessary parameters are passed. For example:

Navigation.navigate(
  ROUTES.SETTINGS_DELEGATE_ROLE.getRoute(option?.login ?? '')
);

onBackButtonPress={() => Navigation.goBack()}

@bernhardoj
Copy link
Contributor

Proposal

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

The checkmark isn't displayed on the previously selected role.

What is the root cause of that problem?

We show the selected icon only if the route params role equals the role itself.

const roleOptions = Object.values(CONST.DELEGATE_ROLE).map((role) => ({
value: role,
text: translate('delegate.role', {role}),
alternateText: translate('delegate.roleDescription', {role}),
isSelected: role === route.params.role,

But when we open the select role for the first time, the role is undefined. As mentioned by the others, when we press back, we actually call goBack with a fallback of the select role page with the selected role passed to the param.

onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_DELEGATE_ROLE.getRoute(login, role))}

But this just simply goes back, unless you refresh the page first. But the thing I want to focus on here is that I think we shouldn't show the selected icon in a new delegate flow (when we are going to select the role for the first time), just like when you select the delegate user, there is no selected icon. Because it's a single list selection, the selected icon feels like I'm editing the option.

But the reason QA expects the selected icon is maybe because of the highlighted background of the role. It's because we pass shouldUpdateFocusedIndex which updates the focused item to the pressed item.

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

If we agree with what I explain above, then we can remove shouldUpdateFocusedIndex (or set it to false when role is undefined)

And update the confirm role page to not pass the role when going back.

<HeaderPageLayout
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_DELEGATE_ROLE.getRoute(login, role))}

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

Copy link

melvin-bot bot commented Nov 27, 2024

@anmurali Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Nov 29, 2024

@anmurali 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Dec 3, 2024

@anmurali 10 days overdue. I'm getting more depressed than Marvin.

Copy link

melvin-bot bot commented Dec 5, 2024

@anmurali this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Dec 5, 2024

@anmurali 12 days overdue. Walking. Toward. The. Light...

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

This issue has not been updated in over 14 days. @anmurali eroding to Weekly issue.

@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 17, 2024
@anmurali anmurali added the External Added to denote the issue can be worked on by a contributor label Dec 17, 2024
@melvin-bot melvin-bot bot changed the title The checkmark isn't displayed when back to access level page for copilot [$250] The checkmark isn't displayed when back to access level page for copilot Dec 17, 2024
Copy link

melvin-bot bot commented Dec 17, 2024

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

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

melvin-bot bot commented Dec 17, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Weekly KSv2 labels Dec 17, 2024
Copy link

melvin-bot bot commented Dec 19, 2024

@anmurali @eh2077 this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@nkdengineer
Copy link
Contributor

nkdengineer commented Dec 23, 2024

@eh2077 could you please look at the proposals when you get a chance?

Copy link

melvin-bot bot commented Jan 14, 2025

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

📣 @nkdengineer 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 15, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 23, 2025
@melvin-bot melvin-bot bot changed the title [$250] The checkmark isn't displayed when back to access level page for copilot [HOLD for payment 2025-01-30] [$250] The checkmark isn't displayed when back to access level page for copilot Jan 23, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 23, 2025
Copy link

melvin-bot bot commented Jan 23, 2025

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

Copy link

melvin-bot bot commented Jan 23, 2025

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

If no regressions arise, payment will be issued on 2025-01-30. 🎊

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

Copy link

melvin-bot bot commented Jan 23, 2025

@eh2077 @anmurali @eh2077 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@eh2077
Copy link
Contributor

eh2077 commented Jan 31, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: https://github.com/Expensify/App/pull/47353/files#r1937423476

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

NA

Test:

  1. Go to Security Page
  2. Add copilot
  3. Select an user
  4. Select "Full" option
  5. Click back button
  6. Verify that: The checkmark should be displayed when back to access level page for the access level selected

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Feb 3, 2025
Copy link

melvin-bot bot commented Feb 4, 2025

@AndrewGable, @anmurali, @eh2077, @nkdengineer Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Feb 6, 2025

@AndrewGable, @anmurali, @eh2077, @nkdengineer Still overdue 6 days?! Let's take care of this!

Copy link

melvin-bot bot commented Feb 10, 2025

@AndrewGable, @anmurali, @eh2077, @nkdengineer 10 days overdue. Is anyone even seeing these? Hello?

@eh2077
Copy link
Contributor

eh2077 commented Feb 11, 2025

@anmurali Friendly bump!

Copy link

melvin-bot bot commented Feb 12, 2025

@AndrewGable, @anmurali, @eh2077, @nkdengineer 12 days overdue now... This issue's end is nigh!

@mallenexpensify
Copy link
Contributor

Contributor: @nkdengineer paid $250 via Upwork
Contributor+: @eh2077 due $250 via NewDot

Test case created, thx

It states above that @DylanDylann is due, it's an error, likely leftover from when we paid for reporting bugs. If I see it happen again I'll create an issue to fix.

@JmillsExpensify
Copy link

$250 approved for @eh2077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants