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

[$250] Hybrid - Android -Chat - Keyboard blocks composer after leaving it open and selecting another user for DM #55159

Open
1 of 8 tasks
IuliiaHerets opened this issue Jan 13, 2025 · 7 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Overdue

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Jan 13, 2025

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


Version Number: v9.0.84-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
Email or phone of affected tester (no customers): luongquocvu92@gmail.com
Issue reported by: Applause Internal Team
Device used: Pixel 7 Pro /Android 15
App Component: Other

Action Performed:

Precondition: have something typed (but not sent) to someone else in ND

  1. Open the Android Hybrid app
  2. Select any user to DM
  3. Enter some texts on the composer and send it
  4. Tap on the search button
  5. Select another user to DM from the recent list (with the precondition fulfilled)
  6. See that the keyboard now blocks composer

Expected Result:

The keyboard should not block the composer and should focus on the composer to allow text entry.

Actual Result:

The keyboard blocks the composer after entering text, leaving the keyboard open, and selecting another user to DM from the recent list

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6712789_1736740810015.Block.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021878988628495834641
  • Upwork Job ID: 1878988628495834641
  • Last Price Increase: 2025-01-14
Issue OwnerCurrent Issue Owner: @getusha
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 13, 2025
Copy link

melvin-bot bot commented Jan 13, 2025

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

@kadiealexander
Copy link
Contributor

iOS <> Android bug swap.

@jliexpensify
Copy link
Contributor

@IuliiaHerets the steps are incomplete, they should be:

Precondition: have something typed (but not sent) to someone else in ND

  1. Open the Android Hybrid app
  2. Select any user to DM
  3. Enter some texts on the composer and send it
  4. Tap on the search button
  5. Select another user to DM from the recent list (with the precondition fulfilled)
  6. See that the keyboard now blocks composer

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Jan 14, 2025
@melvin-bot melvin-bot bot changed the title Hybrid - Android -Chat - Keyboard blocks composer after leaving it open and selecting another user for DM [$250] Hybrid - Android -Chat - Keyboard blocks composer after leaving it open and selecting another user for DM Jan 14, 2025
Copy link

melvin-bot bot commented Jan 14, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 14, 2025
Copy link

melvin-bot bot commented Jan 14, 2025

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

@daledah
Copy link
Contributor

daledah commented Jan 14, 2025

Proposal

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

Hybrid - Android -Chat - Keyboard blocks composer after leaving it open and selecting another user for DM

What is the root cause of that problem?

After step 5, the search modal is closed first:

At this point, the keyboard will reopen if it was already active before step 4. Then, it navigates to another report:

if (item?.reportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));
} else if ('login' in item) {
ReportUserActions.navigateToAndOpenReport(item.login ? [item.login] : [], false);
}

Here, since the keyboard remains visible from the previous report screen, it continues to be displayed on the new screen. And because the condition to use the keyboard avoiding view:

shouldEnableKeyboardAvoidingView={(isTopMostReportId || isInNarrowPaneModal) && (!isComposerFocus || showSoftInputOnFocus)}

is false, leads to the bug "Keyboard blocks composer after leaving it open and selecting another user for DM"

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

Keyboard should not be opened when navigating to a new report until we click on the composer. So, we can update this one:

                KeyboardUtils.dismiss().then(() => {
                    if (item?.reportID) {
                        Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));
                    } else if ('login' in item) {
                        ReportUserActions.navigateToAndOpenReport(item.login ? [item.login] : [], false);
                    }
                });

It can make sure the keyboard is closed successfully before navigating to new report.

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

What alternative solutions did you explore? (Optional)

@huult
Copy link
Contributor

huult commented Jan 16, 2025

Proposal

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

Keyboard overlaps the composer when starting a new thread with keyboard open

What is the root cause of that problem?

This issue occurs because shouldEnableKeyboardAvoidingView is disabled.

shouldEnableKeyboardAvoidingView={(isTopMostReportId || isInNarrowPaneModal) && (!isComposerFocus || showSoftInputOnFocus)}

shouldEnableKeyboardAvoidingView is disabled when isTopMostReportId is false or showSoftInputOnFocus is false.

Here is the log:

  • Image
  • Image

#55136 is related this issue

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

To fix this issue in all cases, I think shouldEnableKeyboardAvoidingView should always be enabled when the keyboard is open. To implement this, something like:

import keyboardHeight

  const {keyboardHeight} = useKeyboardState();

shouldEnableKeyboardAvoidingView={(isTopMostReportId || isInNarrowPaneModal) && (!isComposerFocus || showSoftInputOnFocus)}

Update condition to enable shouldEnableKeyboardAvoidingView to:

  shouldEnableKeyboardAvoidingView={((isTopMostReportId || isInNarrowPaneModal) && (!isComposerFocus || showSoftInputOnFocus)) || !!keyboardHeight}

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

This is a UI bug; no UI test is needed.

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@melvin-bot melvin-bot bot added the Overdue label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Overdue
Projects
Status: No status
Development

No branches or pull requests

6 participants