App icon indicating copy to clipboard operation
App copied to clipboard

IOS - Room description input field needs multiple taps before it gets focused

Open IuliiaHerets opened this issue 1 year ago β€’ 2 comments

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: 9.0.73-6 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

  1. Open Expensify app
  2. Create a workspace and a room
  3. Open room and tap on header
  4. Tap on Room description
  5. Tap on room description input field to get it focused

Expected Result:

The room description page gets auto focused and when tapping manually to focus it it does it instantly

Actual Result:

Room description input field becomes unresponsive for a while until it gets focused after multiple taps

Workaround:

Unknown

Platforms:

  • [ ] Android: Standalone
  • [ ] Android: HybridApp
  • [ ] Android: mWeb Chrome
  • [x] iOS: Standalone
  • [x] iOS: HybridApp
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/bf230be1-4b6d-459d-8f3b-5ea7a786ad85

View all open jobs on GitHub

IuliiaHerets avatar Dec 10 '24 13:12 IuliiaHerets

Triggered auto assignment to @muttmuure (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.

melvin-bot[bot] avatar Dec 10 '24 13:12 melvin-bot[bot]

Edited by proposal-police: This proposal was edited at 2024-12-10 14:00:36 UTC.

Proposal

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

IOS - Room description input field needs multiple taps before it gets focused

What is the root cause of that problem?

  • The input is focused twice at the same time, due to which input is not focused correctly and it is causing this issue. https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/pages/RoomDescriptionPage.tsx#L65-L77 https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/pages/RoomDescriptionPage.tsx#L114 https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/libs/updateMultilineInputRange/index.ios.ts#L12-L25
  • The immediate focus was added to solve the scroll issue on IOS, but after applying the main solution the scroll behaviour works fine.

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

  1. Pass false as the second argument to updateMultilineInputRange.
  2. We should also identify other similar components and apply the fix there if the same issue occurs.
  3. Additionally, we can use useAutoFocusInput instead of using useFocusEffect with a timeout.
  4. If I recall correctly, the same issue occurred in the PrivateNotesEditPage component. We will check all components, regardless.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?


What alternative solutions did you explore? (Optional)

  1. We can update useFocusEffect cb to not focus for ios devices instead of passing false to updateMultilineInputRange. We can use getPlatform for that.

Result

https://github.com/user-attachments/assets/6ea08e52-0622-4d04-a64d-e3b6f376391c

Krishna2323 avatar Dec 10 '24 13:12 Krishna2323

@muttmuure Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Dec 16 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 16 '24 20:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 16 '24 20:12 melvin-bot[bot]

@Krishna2323's proposal works here.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed.

akinwale avatar Dec 18 '24 11:12 akinwale

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

melvin-bot[bot] avatar Dec 18 '24 11:12 melvin-bot[bot]

Proposal

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

What is the root cause of that problem?

IOS - Room description input field needs multiple taps before it gets focused

  1. Why does the input require multiple taps to focus?
  • This happens because a TextInputLabel is overlaid on top of the input field, which blocks the tap gesture.
  1. Why doesn’t the input auto-focus when entering the page?

https://github.com/Expensify/App/blob/1466c022e3bb0ab2ffaaab12f78822a2aca827c8/src/pages/RoomDescriptionPage.tsx#L109-L117 https://github.com/Expensify/App/blob/1466c022e3bb0ab2ffaaab12f78822a2aca827c8/src/libs/updateMultilineInputRange/index.ios.ts#L12-L24 https://github.com/Expensify/App/blob/1466c022e3bb0ab2ffaaab12f78822a2aca827c8/src/components/TextInput/BaseTextInput/index.native.tsx#L102-L116

  • We cannot directly call inputRef.focus() in the ref method. As noted in BaseTextInput, the correct approach is to use useEffect combined with setTimeout to call inputRef.focus() after the component has fully loaded.

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

  1. Add the pointerEvents="none" in TextInputLabel for Animated.Text
  2. Replace the updateMultilineInputRange(el) with updateMultilineInputRange(el, false)

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

We could add UI tests to verify that autoFocus works as expected when the page loads, if applicable

What alternative solutions did you explore? (Optional)

As an optimization, we could leverage BaseTextInput's built-in autoFocus and shouldDelayFocus properties instead of manually calling reportDescriptionInputRef?.current?.focus.

hellohublot avatar Dec 18 '24 11:12 hellohublot

Hello, another proposal might not address the root cause of the issue where the input requires multiple taps to gain focus ❀️

hellohublot avatar Dec 18 '24 11:12 hellohublot

πŸ“£ @Krishna2323 πŸŽ‰ 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 Dec 19 '24 16:12 melvin-bot[bot]

@akinwale PR ready for review ^

Krishna2323 avatar Dec 21 '24 10:12 Krishna2323

@akinwale, bump for the review.

Krishna2323 avatar Dec 26 '24 22:12 Krishna2323

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

melvin-bot[bot] avatar Jan 08 '25 02:01 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.81-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/54374

If no regressions arise, payment will be issued on 2025-01-15. :confetti_ball:

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

  • @akinwale requires payment through NewDot Manual Requests
  • @Krishna2323 requires payment automatic offer (Contributor)

melvin-bot[bot] avatar Jan 08 '25 02:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 08 '25 02:01 melvin-bot[bot]

BugZero Checklist:

  • [x] [Contributor] Classify the bug:
Bug classification

Source of bug:

  • [x] 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:

  • [x] 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
  • [x] 3d. QA
  • [ ] 3z. Other:
  • [x] [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: N/A

  • [x] [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

  • [x] [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

Test:

  1. Launch Expensify.
  2. Create a workspace.
  3. Create a chat room in the workspace.
  4. Open the newly created chat room and tap on the header.
  5. Select Room description.
  6. Verify that the input field is automatically focused.

Do we agree πŸ‘ or πŸ‘Ž?

akinwale avatar Jan 16 '25 13:01 akinwale

@muttmuure bump for payment summary / processing. Thanks.

akinwale avatar Jan 16 '25 13:01 akinwale

  • @akinwale C+ $250
  • @Krishna2323 C $250

muttmuure avatar Jan 16 '25 13:01 muttmuure

@puneetlath, @akinwale, @muttmuure, @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Jan 20 '25 09:01 melvin-bot[bot]

$250 approved for @akinwale

JmillsExpensify avatar Jan 20 '25 12:01 JmillsExpensify

@muttmuure, I think I haven't received the payment for this issue. Could you please check? I might be wrong but the Upwork job is still open for me.

Krishna2323 avatar Feb 18 '25 17:02 Krishna2323

^^ can confirm that the offer is accepted but not settled, so I've paid it.

trjExpensify avatar Feb 20 '25 20:02 trjExpensify