App icon indicating copy to clipboard operation
App copied to clipboard

[$500] [MEDIUM] Feature Request: Auto select the category and/or tag if there is only one option

Open kavimuru opened this issue 1 year ago • 23 comments

Include auto-selection of tags/categories when a single option is available

Problem

Currently, when a receipt is scanned (or manually created) in a workspace that contains only a single category and/or a single task, the system does not automatically select these options. As a result, users are required to manually choose them even after the receipt is smartscanned. This adds unnecessary steps to the receipt upload > Smartscan process since there's a single option to chose from.

Solution

Include an auto-selection process to select the category and/or task when a receipt is scanned in a workspace that has only one option available in each category/tag. This would remove the manual selection process and save a few clicks to the user.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01dd9fec7e03798e66
  • Upwork Job ID: 1750912778352738304
  • Last Price Increase: 2024-01-26
  • Automatic offers:
    • jjcoffee | Reviewer | 28135508
    • dukenv0307 | Contributor | 28135509

kavimuru avatar Jan 25 '24 07:01 kavimuru

Triggered auto assignment to @strepanier03 (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.

melvin-bot[bot] avatar Jan 25 '24 07:01 melvin-bot[bot]

  • I am happy to work on it if it is external

Proposal

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

  • Feature Request: Auto select the category and/or tag if there is only one option

What is the root cause of that problem?

  • NA

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

  • I think we should include an auto-selection process to select the category and/or task in the confirmation screen rather than when a receipt is scanned
  • We can add the useEffect to MoneyTemporaryForRefactorRequestConfirmationList to check if the policyCategories.length is equal to 1 or not, if true, set the initial category to it like below:
    useEffect(() => {
        if (!iouCategory && shouldShowCategories && Object.keys(policyCategories).length === 1) {
            const key = head(Object.keys(policyCategories));
            IOU.setMoneyRequestCategory_temporaryForRefactor(transaction.transactionID, policyCategories[key].name);
        }
    }, [...]);
  • Also, we can consider that if the category field is required or not.
  • Do the same with tag

What alternative solutions did you explore? (Optional)

  • NA

dukenv0307 avatar Jan 25 '24 09:01 dukenv0307

@dukenv0307 FYI the issue has been updated. The proposed solution was not correct previously.

puneetlath avatar Jan 25 '24 15:01 puneetlath

@puneetlath I think we should include an auto-selection process to select the category and/or task in the confirmation screen rather than when a receipt is scanned. What do you think about it? Also, I updated proposal

dukenv0307 avatar Jan 26 '24 10:01 dukenv0307

Yes, agreed. I think the confirmation page in any of the request flows -- manual, scan, distance -- should auto-select categories and/or tags if there is only one option for any of them.

Screenshot 2024-01-26 at 9 17 49 AM Screenshot 2024-01-26 at 9 18 04 AM Screenshot 2024-01-26 at 9 18 40 AM

puneetlath avatar Jan 26 '24 14:01 puneetlath

@puneetlath What do you think about my proposal here?

dukenv0307 avatar Jan 26 '24 15:01 dukenv0307

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

melvin-bot[bot] avatar Jan 26 '24 16:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 26 '24 16:01 melvin-bot[bot]

@dukenv0307 I'll let @jjcoffee weigh in on that first 😄

puneetlath avatar Jan 26 '24 16:01 puneetlath

Hi @puneetlath , i'd like to propose a fix for this is this still requires attention or dukenv0307 solution is accepted

mavrickdeveloper avatar Jan 26 '24 19:01 mavrickdeveloper

📣 @mavrickdeveloper! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Jan 26 '24 19:01 melvin-bot[bot]

@dukenv0307's proposal sounds good to me!

:ribbon::eyes::ribbon: C+ reviewed

jjcoffee avatar Jan 29 '24 09:01 jjcoffee

Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Jan 29 '24 09:01 melvin-bot[bot]

@mavrickdeveloper You're always welcome to make a proposal until you see a comment with C+ reviewed in it - no need to ask!

jjcoffee avatar Jan 29 '24 09:01 jjcoffee

Removing my assignment since it looks like @puneetlath is the assigned internal engineer here!

MariaHCD avatar Jan 29 '24 10:01 MariaHCD

@puneetlath little bump on the proposal review here.

strepanier03 avatar Jan 31 '24 22:01 strepanier03

Sounds good to me. Thanks for the bump.

puneetlath avatar Feb 01 '24 20:02 puneetlath

📣 @jjcoffee 🎉 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] avatar Feb 01 '24 20:02 melvin-bot[bot]

📣 @dukenv0307 🎉 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[bot] avatar Feb 01 '24 20:02 melvin-bot[bot]

I am working on it

dukenv0307 avatar Feb 05 '24 06:02 dukenv0307

@puneetlath, @strepanier03, @jjcoffee, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Feb 05 '24 15:02 melvin-bot[bot]

Not overdue.

jjcoffee avatar Feb 05 '24 15:02 jjcoffee

Calm down Melv. @dukenv0307 is working on it.

puneetlath avatar Feb 05 '24 15:02 puneetlath

@jjcoffee The PR https://github.com/Expensify/App/pull/35862 is ready to review

dukenv0307 avatar Feb 06 '24 01:02 dukenv0307

@puneetlath Just checking, does it make sense to limit this to only auto-select if a category or tag is required for the workspace?

jjcoffee avatar Feb 06 '24 09:02 jjcoffee

It probably makes sense to hold this for https://github.com/Expensify/App/pull/34983 so that we support multi-level tags here too.

jjcoffee avatar Feb 07 '24 12:02 jjcoffee

@puneetlath Just checking, does it make sense to limit this to only auto-select if a category or tag is required for the workspace?

Good question. I think it makes sense to only auto-select if they are required, like you say.

puneetlath avatar Feb 07 '24 16:02 puneetlath

We're just waiting on https://github.com/Expensify/App/pull/34983 here, should be merged today!

jjcoffee avatar Feb 15 '24 10:02 jjcoffee

Nearly there! Just one small issue to iron out on the PR.

jjcoffee avatar Feb 19 '24 14:02 jjcoffee

@puneetlath Another quick question for you, if you don't mind. Currently categories and tags only display as required on FE if the violations beta is enabled. Should we also respect that here so we only auto-select where the category/tag is required and if the beta is enabled, or do we want to just auto-select regardless of the beta?

jjcoffee avatar Feb 22 '24 13:02 jjcoffee