Skip to content

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

Closed

Description

@m-natarajan

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 21, 2024
  2. melvin-bot commented on Nov 21, 2024

    @melvin-bot

    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.

  3. nkdengineer commented on Nov 21, 2024

    @nkdengineer
    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

  4. jayeshmangwani commented on Nov 21, 2024

    @jayeshmangwani
    Contributor

    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()}

  5. bernhardoj commented on Nov 21, 2024

    @bernhardoj
    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))}

  6. melvin-bot commented on Nov 25, 2024

    @melvin-bot

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

  7. melvin-bot commented on Nov 27, 2024

    @melvin-bot

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

  8. melvin-bot commented on Nov 29, 2024

    @melvin-bot

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

  9. melvin-bot commented on Dec 3, 2024

    @melvin-bot

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

  10. melvin-bot commented on Dec 5, 2024

    @melvin-bot

    @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!

  11. melvin-bot commented on Dec 5, 2024

    @melvin-bot

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

  12. 55 remaining items

  13. melvin-bot commented on Jan 23, 2025

    @melvin-bot

    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:

  14. melvin-bot commented on Jan 23, 2025

    @melvin-bot

    @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]

  15. eh2077 commented on Jan 31, 2025

    @eh2077
    Contributor

    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 👎

  16. melvin-bot commented on Feb 4, 2025

    @melvin-bot

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

  17. melvin-bot commented on Feb 6, 2025

    @melvin-bot

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

  18. melvin-bot commented on Feb 10, 2025

    @melvin-bot

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

  19. eh2077 commented on Feb 11, 2025

    @eh2077
    Contributor

    @anmurali Friendly bump!

  20. melvin-bot commented on Feb 12, 2025

    @melvin-bot

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

  21. mallenexpensify commented on Feb 14, 2025

    @mallenexpensify
    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.

  22. JmillsExpensify commented on Feb 17, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @eh2077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions