Skip to content

[HOLD for payment 2024-05-09] [$250] Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency #40789

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
1 of 6 tasks
lanitochka17 opened this issue Apr 23, 2024 · 21 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

@lanitochka17
Copy link

lanitochka17 commented Apr 23, 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: 1.4.64-2
Reproducible in staging?: Y
Reproducible in production?: Y
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): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Create a new account and navigate to Account Settings > Preferences > Priority Mode
  2. Note that "Most Recent" is the default selection but is not highlighted or marked, leading to inconsistency with other default selections such as Language and Timezone

Expected Result:

The "Most Recent" default selection should be automatically highlighted and marked, aligning with other default sections like Language and Timezone

Actual Result:

The default priority mode is not highlighted or marked, causing inconsistency with other sections like Language and Timezone

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

Bug6458088_1713825671119.Screen_Recording_2024-04-22_at_3.08.28_PM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014e981393fc9a3ead
  • Upwork Job ID: 1782798557003403264
  • Last Price Increase: 2024-04-23
  • Automatic offers:
    • fedirjh | Reviewer | 0
    • ZhenjaHorbach | Contributor | 0
Issue OwnerCurrent Issue Owner: @puneetlath
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 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.

@lanitochka17
Copy link
Author

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Apr 23, 2024

Proposal

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

Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency

What is the root cause of that problem?

The main problem with issue is that we don't set priorityMode by default when we first open the app
As result we can't focus on any mode

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

We can set initialValue for priorityMode when we get this value from Onyx

    priorityMode: {
        key: ONYXKEYS.NVP_PRIORITY_MODE,
        initialValue: CONST.PRIORITY_MODE.DEFAULT,
        selector: (data) => data ?? CONST.PRIORITY_MODE.DEFAULT;
    },

priorityMode: {
key: ONYXKEYS.NVP_PRIORITY_MODE,
},

What alternative solutions did you explore? (Optional)

As alternative we can update this line like on PriorityModePage for SelectionList

initiallyFocusedOptionKey={priorityModes.find((mode) => mode.isSelected)?.keyForList ?? CONST.PRIORITY_MODE.DEFAULT}

initiallyFocusedOptionKey={priorityModes.find((mode) => mode.isSelected)?.keyForList}

Or set priorityMode by default here

isSelected: priorityMode === mode,

Also we can start implementing useOnyx as we made here

const [priorityMode] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE);

@Krishna2323
Copy link
Contributor

Proposal

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

Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency

What is the root cause of that problem?

When priorityMode is not available, no option is set as selected.

isSelected: priorityMode === mode,

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

We need to add fallback value, just like we do in PreferencesPage.

isSelected: priorityMode || CONST.PRIORITY_MODE.DEFAULT === mode

title={translate(`priorityModePage.priorityModes.${priorityMode ?? CONST.PRIORITY_MODE.DEFAULT}.label`)}

What alternative solutions did you explore? (Optional)

@allgandalf
Copy link
Contributor

Proposal

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

Default priority is not highlighted when we open preferences settings for the first time.

What is the root cause of that problem?

When we create a new account and open the preferences settings, we pass a prop priorityMode to it:

function PriorityModePage({priorityMode}: PriorityModePageProps) {

Now for the very first time, the value of this is undefined:
Screenshot 2024-04-23 at 9 04 56 PM

Now when we decide which option to highlight based on the condition isSelected:

isSelected: priorityMode === mode,

As for the very first time the value of priorityMode is undefined, we do not highlight any option, this is the RCA for the bug.

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

We can add a default prop value to PriorityModePage which will be the default option of the Priority Mode.

Note, this will be safe to assign because for the first time we set the Priority mode to Most Recent, which is also the default value for any profile:

function PriorityModePage({priorityMode = CONST.PRIORITY_MODE.DEFAULT}: PriorityModePageProps) {

What alternative solutions did you explore? (Optional)

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Apr 23, 2024
@melvin-bot melvin-bot bot changed the title Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency [$250] Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

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

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

melvin-bot bot commented Apr 23, 2024

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

@fedirjh
Copy link
Contributor

fedirjh commented Apr 24, 2024

Wouldn't it be more efficient for the backend to simply return the priorityMode key within the openApp command to resolve the issue?

@puneetlath
Copy link
Contributor

We don't store anything if the priority mode isn't gsd, so I think it's easier to have the front-end handle the default in this scenario.

@melvin-bot melvin-bot bot added the Overdue label Apr 26, 2024
@fedirjh
Copy link
Contributor

fedirjh commented Apr 26, 2024

I think @ZhenjaHorbach Proposal looks good to me.

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Apr 26, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2024
@puneetlath
Copy link
Contributor

Great, assigned @ZhenjaHorbach.

Copy link

melvin-bot bot commented Apr 29, 2024

📣 @fedirjh 🎉 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 melvin-bot bot removed the Overdue label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@ZhenjaHorbach
Copy link
Contributor

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

PR will be ready within a few days

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Apr 30, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Apr 30, 2024
@melvin-bot melvin-bot bot changed the title [$250] Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency [HOLD for payment 2024-05-09] [$250] Pronouns - Default Priority Mode Not Highlighted and marked, Causing Inconsistency May 2, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 2, 2024
Copy link

melvin-bot bot commented May 2, 2024

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

Copy link

melvin-bot bot commented May 2, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.69-2 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 2024-05-09. 🎊

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

Copy link

melvin-bot bot commented May 2, 2024

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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] A discussion in #expensify-bugs 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels May 8, 2024
@puneetlath
Copy link
Contributor

@ZhenjaHorbach has been paid.

@fedirjh bump on the checklist.

@fedirjh
Copy link
Contributor

fedirjh commented May 13, 2024

BugZero Checklist:

Regression Test Proposal

1. Create a new account 
2. Navigate to Account Settings > Preferences > Priority Mode
3. Verify that "Most Recent" is selected and highlighted
  • Do we agree 👍 or 👎

@puneetlath
Copy link
Contributor

Issue for regression tests: https://github.com/Expensify/Expensify/issues/395853

Everyone has been paid. Thanks y'all!

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

6 participants