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 2023-05-29] [$1000] ‘Message’ input field is not auto-focused even though it is the only input field in the page #18371

Closed
1 of 6 tasks
kavimuru opened this issue May 3, 2023 · 39 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

@kavimuru
Copy link

kavimuru commented May 3, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Click on ‘Profile’ avatar
  2. Click on ‘Workspaces’ link
  3. Open an existing workspace
  4. Click on ‘Manage members’ link
  5. Click on ‘Invite’ button
  6. Enter email address > select user > click on ‘Next’ button

Expected Result:

Message input field should be auto-focused

Actual Result:

Message input field is not auto-focused

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.9-14
Reproducible in staging?: y
Reproducible in production?:
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
Notes/Photos/Videos: Any additional supporting documentation

2023-05-03.04.42.18.mp4
Recording.470.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683078396397269

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0144056c8fb602a0e4
  • Upwork Job ID: 1655570989713260544
  • Last Price Increase: 2023-05-08
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 3, 2023
@MelvinBot
Copy link

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

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

@PrashantMangukiya
Copy link
Contributor

Proposal

Posting proposal early as per new guidelines

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

Within workspace invite message page, Message input field is not auto-focused even though it is the only input field in this page.

What is the root cause of that problem?

Message input field is rendered via this code.

<TextInput
inputID="welcomeMessage"
label={this.props.translate('workspace.inviteMessage.personalMessagePrompt')}
autoCompleteType="off"
autoCorrect={false}
numberOfLines={4}
textAlignVertical="top"
multiline
containerStyles={[styles.workspaceInviteWelcome]}
defaultValue={this.state.welcomeNote}
value={this.state.welcomeNote}
onChangeText={text => this.setState({welcomeNote: text})}
/>

We can see that text input component is not focused by any way on this page. This is the root cause of the problem.

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

We have to create ref for text input and autofocus it at transition end. i.e. We have to pass onEntryTransitionEnd prop to ScreenWrapper component as shown below. Also there is default text value exist within text input, so we have to put cursor at end of the message via setSelectionRange() as shown below.

<ScreenWrapper
    onEntryTransitionEnd={() => {
        if (!this.welcomeMessageInputRef) {
            return;
        }
        this.welcomeMessageInputRef.focus();
        const length = this.welcomeMessageInputRef.value.length;
        this.welcomeMessageInputRef.setSelectionRange(length, length);
    }}
    ...
>
   ....
  <TextInput
      ref={el => this.welcomeMessageInputRef = el}
      ...
  />
   ...
</ScreenWrapper>

So this will solve the issue as shown in result video.

Note: We can also keep existing text as selected while focus the text input by using this.welcomeMessageInputRef.select() or this.welcomeMessageInputRef.setSelectionRange(0, length) if need.

What alternative solutions did you explore? (Optional)

We can also set autoFoucs and shouldDelayFocus as shown below, but it will not put cursor at the end of the existing message, so not suggested.

<TextInput
    autoFocus
    shouldDelayFocus
    ...
/>
Results
18371-InviteMemberAutoFocus.mov

@melvin-bot melvin-bot bot added the Overdue label May 8, 2023
@abekkala abekkala added the External Added to denote the issue can be worked on by a contributor label May 8, 2023
@melvin-bot melvin-bot bot changed the title ‘Message’ input field is not auto-focused even though it is the only input field in the page [$1000] ‘Message’ input field is not auto-focused even though it is the only input field in the page May 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

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

1 similar comment
@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

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

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

melvin-bot bot commented May 8, 2023

Triggered auto assignment to @hayata-suenaga (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@hayata-suenaga
Copy link
Contributor

not overdue external label was just added now

@melvin-bot melvin-bot bot removed the Overdue label May 8, 2023
@rasulkhan-work
Copy link

Proposal

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

Invite Message input field should be auto focussed at the end of the invite message.

What is the root cause of that problem?

No real autofocusing prop was used in the TextInput field where the message is rendered.

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

The problem can be solved by adding 2 extra props on the faulty TextInput field.

<TextInput
   autoFocus
   selection={{ start: this.state.welcomeNote.length, end: this.state.welcomeNote.length }}
   ...
/>
expensifyrecord.mov

@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

📣 @rasulkhan-work! 📣
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>

@rasulkhan-work
Copy link

Contributor details
Your Expensify account email: rasulkhan.business@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01b5b21debef186743

@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

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

@melvin-bot melvin-bot bot added the Overdue label May 10, 2023
@hayata-suenaga
Copy link
Contributor

@mollfpr when you have chance, can you review the proposals?

@mollfpr
Copy link
Contributor

mollfpr commented May 11, 2023

Reviewing now!

@mollfpr
Copy link
Contributor

mollfpr commented May 11, 2023

@hayata-suenaga proposal from @PrashantMangukiya looks good to me! We should use the onEntryTransitionEnd; if not, it will have weird animation between transitioning the page and focusing on the input. I think we're not needed to select the text.

🎀 👀 🎀 C+ reviewed!

@hayata-suenaga
Copy link
Contributor

@mollfpr thank you for the review. I agree. assigning @PrashantMangukiya

@hayata-suenaga
Copy link
Contributor

reviewing now

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

@PrashantMangukiya @abekkala @mollfpr @hayata-suenaga this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@hayata-suenaga
Copy link
Contributor

ops forgot to update I'm approving the PR now

@hayata-suenaga
Copy link
Contributor

hayata-suenaga commented May 18, 2023

@abekkala I belive this issue should be considered as a bonus issue as @PrashantMangukiya finished his PR within three days. I was taking time to check something in his PR but it turned out the PR is alright

if no regression arises during the wait period, that is

@hayata-suenaga
Copy link
Contributor

merged!

@PrashantMangukiya
Copy link
Contributor

@hayata-suenaga Thank you. I think there is some automation glitch here, because Reviewing label not applied by Melvin-bot, can you please apply the Reviewing label for the issue. Have a nice day.

@hayata-suenaga hayata-suenaga added the Reviewing Has a PR in review label May 18, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 22, 2023
@melvin-bot melvin-bot bot changed the title [$1000] ‘Message’ input field is not auto-focused even though it is the only input field in the page [HOLD for payment 2023-05-29] [$1000] ‘Message’ input field is not auto-focused even though it is the only input field in the page May 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.16-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 2023-05-29. 🎊

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 22, 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:

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

@abekkala
Copy link
Contributor

Payments to be made on May 29:

@abekkala
Copy link
Contributor

@mollfpr I have sent the contracts - once the checklist is done above and contracts accepted I can initiate the payments.

@mollfpr
Copy link
Contributor

mollfpr commented May 29, 2023

Thanks @abekkala

I will complete the checklist within hours.

@mollfpr
Copy link
Contributor

mollfpr commented May 29, 2023

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] 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:

No offending PR. This is an improvement for the invite workspace member page; we have yet to set the autofocus before the form refactor here #18791.

[@mollfpr] 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:

The regression step should be enough to catch this bug.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.

Propose regression step

  1. Go to Settings > Workspace > Manage Members
  2. Tap Invite button (Green)
  3. Select member(s) to invite
  4. Tap Next button
  5. Verify that Message field is auto-focused
  6. 👍 or 👎

@abekkala
Copy link
Contributor

@mollfpr and @PrashantMangukiya Payments have been made and contracts ended - Thank you! 🎉

@Natnael-Guchima once you accept the contract offer in Upwork I can send your payment!

@Natnael-Guchima
Copy link

Natnael-Guchima commented May 29, 2023

@abekkala it seems you have sent me a $1000 offer for bug reporting bonus. I think it should be 250.

Screenshot_20230529_221336_Chrome.jpg

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 29, 2023
@abekkala
Copy link
Contributor

Hmm, ok, I thought I changed it to $250. I can redo it!

@abekkala
Copy link
Contributor

@Natnael-Guchima updated to $250!

@Natnael-Guchima
Copy link

@abekkala accepted. Thanks.

@abekkala
Copy link
Contributor

@Natnael-Guchima paid and contract ending - thank you! 🎉
Closing!

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

8 participants