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

[SMARTSCAN] [HOLD for payment 2023-11-02] [$500] LOW: Keyboard shouldn't be active/enabled automatically for request details #26702

Closed
JmillsExpensify opened this issue Sep 4, 2023 · 67 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor SmartScan Wave5-free-submitters Weekly KSv2

Comments

@JmillsExpensify
Copy link

JmillsExpensify commented Sep 4, 2023

We automatically enable the mobile keyboard for requests, which is inconsistent with the behavior for reports. Given that a comment is completely optional, let's bring request details inline with reports and not enable the keyboard until the comment input is tapped.

Example of the inconsistency in behavior (note: I specifically tapped in the report comment input, but did not do the same for the request details, yet the keyboard was automatically enabled.

RPReplay_Final1693851386.MP4
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011deba88779e69bde
  • Upwork Job ID: 1698762396132085760
  • Last Price Increase: 2023-09-04
  • Automatic offers:
    • Pujan92 | Contributor | 26521898
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2023
@JmillsExpensify JmillsExpensify self-assigned this Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

Current assignee @JmillsExpensify is eligible for the Bug assigner, not assigning anyone new.

@melvin-bot melvin-bot bot changed the title Keyboard shouldn't be active/enabled automatically for request details [$500] Keyboard shouldn't be active/enabled automatically for request details Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@Pujan92
Copy link
Contributor

Pujan92 commented Sep 4, 2023

I think it is intentional to focus the input when the report chat is empty.

const isEmptyChat = useMemo(() => _.size(reportActions) === 1, [reportActions]);
const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || isEmptyChat) && shouldShowComposeInput;

@jeet-dhandha
Copy link
Contributor

Proposal

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

  • Distance Request Details Page opening keyborad automatically which is not required.

What is the root cause of that problem?

  • isEmptyChat is getting triggered on page load, which autoFocuse's ComposerWithSuggestions component.

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

  • We can first get the transaction for current reportID in ComposerWithSuggestions component.
transaction: {
    key: ({reportID}) => {
        const report = ReportUtils.getReport(reportID);
        const parentReportAction = ReportActionsUtils.getParentReportAction(report);
        const transactionID = lodashGet(parentReportAction, ['originalMessage', 'IOUTransactionID'], 0);
        return `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`;
    },
},
  • Then we can check if the transaction is distance request or not.
const isDistanceRequest = TransactionUtils.isDistanceRequest(transaction);
  • Then we update the shouldAutoFocus constant and check if its not a distance request.

const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || isEmptyChat) && shouldShowComposeInput;

- const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || isEmptyChat) && shouldShowComposeInput;
+ const shouldAutoFocus = !isDistanceRequest && !modal.isVisible && (shouldFocusInputOnScreenFocus || isEmptyChat) && shouldShowComposeInput;

What alternative solutions did you explore? (Optional)

  • N/A

@crisps0914
Copy link

Hi
I want to contribute to Expensify.

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

📣 @crisps0914! 📣
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. 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.
  2. 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.
  3. 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>

@Pujan92
Copy link
Contributor

Pujan92 commented Sep 4, 2023

Proposal

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

Don't focus input for transaction threads

What is the root cause of that problem?

We are currently focusing the input whenever the report chat is empty irrespective of any report type.

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

We can add a condition to prevent focusing the input when the report is a transaction thread even if it is empty. I think the transaction/money request details usually user only checks instead of replying over there so makes sense to avoid focusing the input specific to this scenario.

const parentReportAction = ReportActionsUtils.getParentReportAction(report);

With isEmptyChat add, (isEmptyChat && !ReportActionsUtils.isTransactionThread(parentReportAction))

const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || isEmptyChat) && shouldShowComposeInput;

@JmillsExpensify
Copy link
Author

@Pujan92 we're focusing the input on chat reports, which I think makes sense. However, I'm not sure that it makes sense for expense report chats and same for the request details view – at least on small screen sizes. @trjExpensify do you agree?

@trjExpensify
Copy link
Contributor

I think what @Pujan92 is saying is that any report type that's empty, the composer is focused. Presumably, that's because you're navigating to it for the first time to start a conversation.

So I agree, for the request transaction thread the composer shouldn't be focused just because there aren't any report comments or system messages in it. You could (and probably more likely) be there to edit a field, just view the request data etc.

@JmillsExpensify
Copy link
Author

Cool, agreed. @Pujan92 let us know if you have any other questions!

@sagarguhe
Copy link

Hi, I want to contribute to Expensify

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

📣 @sagarguhe! 📣
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. 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.
  2. 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.
  3. 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>

@sagarguhe
Copy link

Contributor details
Your Expensify account email: sagarguhe@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/sagarguhe

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@trjExpensify
Copy link
Contributor

Hi, I want to contribute to Expensify

Hi, @sagarguhe, you can follow the steps in the contributing.md file to join our slack channels to submit bugs and check out the format for proposals.

@trjExpensify
Copy link
Contributor

@Santhosh-Sellavel - are you available now to review this proposal and progress the PR review?

@allroundexperts
Copy link
Contributor

Thanks for your proposal @jeet-dhandha. We don't want to tie this specifically to the distance requests. Rather we're interested in applying this to all the transaction threads.

@Pujan92's proposal makes more sense looks good to me!

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@jeet-dhandha
Copy link
Contributor

Yes i agree @allroundexperts and i have noticed @Pujan92 keeps it more generalised and detailed when it comes to solving any bug, which I should also incorporate in my solutions moving further 😎👍

Thanks for the new learning @Pujan92.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 9, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Oct 9, 2023

Ohh, I wasn't aware of the revert.
Raised new PR here @allroundexperts.

@dylanexpensify
Copy link
Contributor

@allroundexperts can we get review asap? 🙇‍♂️

@dylanexpensify
Copy link
Contributor

bump @allroundexperts

@JmillsExpensify
Copy link
Author

Looks like this is now with @srikarparsi for review.

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @Pujan92 got assigned: 2023-09-06 07:35:45 Z
  • when the PR got merged: 2023-10-24 18:04:13 UTC
  • days elapsed: 34

On to the next one 🚀

@JmillsExpensify
Copy link
Author

Linked PR is merged, waiting for it to hit production.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 26, 2023
@melvin-bot melvin-bot bot changed the title [$500] LOW: Keyboard shouldn't be active/enabled automatically for request details [HOLD for payment 2023-11-02] [$500] LOW: Keyboard shouldn't be active/enabled automatically for request details Oct 26, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.91-8 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 2023-11-02. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@dylanexpensify dylanexpensify changed the title [HOLD for payment 2023-11-02] [$500] LOW: Keyboard shouldn't be active/enabled automatically for request details [SMARTSCAN] [HOLD for payment 2023-11-02] [$500] LOW: Keyboard shouldn't be active/enabled automatically for request details Nov 7, 2023
@dylanexpensify dylanexpensify added the SmartScan Wave5-free-submitters label Nov 7, 2023
@JmillsExpensify
Copy link
Author

@allroundexperts Do you mind kicking off the BZ checklist and we can get payments issued?

@melvin-bot melvin-bot bot removed the Overdue label Nov 8, 2023
@allroundexperts
Copy link
Contributor

allroundexperts commented Nov 8, 2023

Checklist

  1. I think this was more of a feature request / behaviour change. So there is no PR that is to be pinned.
  2. N/A
  3. N/A
  4. A regression test would help.

Regression test

  1. On iOS Safari, request money from any user.
  2. Open the chat -> IOU report -> IOU details.
  3. Verify that the comment field on the details page is not auto focused.

Do we 👍 or 👎 ?

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
@JmillsExpensify
Copy link
Author

JmillsExpensify commented Nov 22, 2023

Payment summary:

Issue reporter: N/A
Contributor: $750 @Pujan92
Contributor+: $750 @allroundexperts

If that looks good to everyone I'll issue payment.

@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2023
@allroundexperts
Copy link
Contributor

@JmillsExpensify This PR was merged within 3 days. However, there was a false alarm that this PR was associated with a deploy blocker and was reverted. We had re-create this PR and merge it again. That's why you see 34 days 😄

@JmillsExpensify
Copy link
Author

Ok, thanks! I checked the PR and that makes sense. I've updated the payment summary as a result.

@JmillsExpensify
Copy link
Author

Alright, paid @Pujan92 the difference, created regression test, and @allroundexperts is paid via NewDot. Closing this issue out.

@JmillsExpensify
Copy link
Author

$750 payment approved for @allroundexperts based on this comment.

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. External Added to denote the issue can be worked on by a contributor SmartScan Wave5-free-submitters Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

10 participants