Skip to content

[$250] Thread - The compose box is not focused after starting a thread #58874

Closed

Description

@mitarachim

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: 9.1.16-1
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: n/a
Email or phone of affected tester (no customers): n/a
Issue reported by: Applause Internal Team
Device used: iPhone 13 / 18.3.2
App Component: Chat Report View

Action Performed:

  1. Open the app or navigate to https://staging.new.expensify.com
  2. Navigate to a 1:1 conversation
    3.Start a thread in an owned message

Expected Result:

The compose box is focused after starting a thread

Actual Result:

The compose box is not focused after starting a thread

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6777503_1742513865978.ScreenRecording_03-20-2025_18-33-59_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021903068815363671624
  • Upwork Job ID: 1903068815363671624
  • Last Price Increase: 2025-03-21
Issue OwnerCurrent Issue Owner: @s77rt

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 21, 2025
  2. melvin-bot commented on Mar 21, 2025

    @melvin-bot

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

  3. daledah commented on Mar 21, 2025

    @daledah
    Contributor

    Proposal

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

    The compose box is not focused after starting a thread

    What is the root cause of that problem?

    The logic to focus the composer automatically is in

    const shouldAutoFocus = shouldFocusInputOnScreenFocus && !modal?.isVisible && shouldShowComposeInput && areAllModalsHidden() && isFocused && !didHideComposerInput;

    and shouldFocusInputOnScreenFocus is false for small screen.

    We don't have the logic to focus after user starting a thread

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

    We should add the condition to check if they want to start the thread. That means it's the empty thread

        const isEmptyThread = isThread(report) && isEmptyReport(report)
        const shouldAutoFocus = (shouldFocusInputOnScreenFocus || isEmptyThread) && !modal?.isVisible && shouldShowComposeInput && areAllModalsHidden() && isFocused && !didHideComposerInput;
    

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

    None

    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.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 21, 2025
  5. changed the title [-]Thread - The compose box is not focused after starting a thread[/-] [+][$250] Thread - The compose box is not focused after starting a thread[/+] on Mar 21, 2025
  6. melvin-bot commented on Mar 21, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 21, 2025
  8. melvin-bot commented on Mar 21, 2025

    @melvin-bot

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

  9. s77rt commented on Mar 21, 2025

    @s77rt
    Member

    This is not a bug, that's expected. @NicMendonca Can we close this?

  10. daledah commented on Mar 22, 2025

    @daledah
    Contributor

    Why do you think it's expected? When we start a thread, that means we want to reply, so opening the keyboard looks right cc @NicMendonca

  11. s77rt commented on Mar 23, 2025

    @s77rt
    Member

    @daledah Same thing when you open a chat with any user we don't show up the keyboard. Maybe we should check with the QA team why this is reported (e.g. check if it was caught as part of a regression test)

  12. daledah commented on Mar 24, 2025

    @daledah
    Contributor

    Same thing when you open a chat with any user we don't show up the keyboard

    IMO, when open the chat on small screen, the users may want to read the message only so always showing the keyboard doesn't necessary. But in this case after reply in a thread, the user actually want to type something so opening the keyboard makes more sense. Please let me know your idea @NicMendonca

  13. FitseTLT commented on Mar 24, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Thread - The compose box is not focused after starting a thread

    What is the root cause of that problem?

    autoFocus will be false because and shouldFocusInputOnScreenFocus is false for small screen (canUseTouchScreen)

    const shouldAutoFocus = shouldFocusInputOnScreenFocus && !modal?.isVisible && shouldShowComposeInput && areAllModalsHidden() && isFocused && !didHideComposerInput;

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

    We initially used to auto focus for mobile if the report is empty chat report but not transaction thread

    const resetKeyboardInput = useCallback(() => {
    if (!RNTextInputReset) {
    return;
    }
    RNTextInputReset.resetKeyboardInput(findNodeHandle(textInputRef.current));
    }, [textInputRef]);

    This is because we normally don't auto focus for mobile to avoid keyboard opening disturbing user experience but if the report is empty there is nothing to see unless it is transaction thread so we auto-focus.
    But in here we removed (shouldFocusInputOnScreenFocus || (isEmptyChat && !ReportActionsUtils.isTransactionThread(parentReportAction))) && to auto focus but only avoid the keyboard opening
    But another problem arose and we readded shouldFocusInputOnScreenFocus condition in here to avoid auto focus on mobile So in the process we lost the important condition || (isEmptyChat && !ReportActionsUtils.isTransactionThread(parentReportAction)).
    Therefor we should re-apply it

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

    N / A

    What alternative solutions did you explore? (Optional)

  14. jayeshmangwani commented on Mar 25, 2025

    @jayeshmangwani
    Contributor

    This is intended behavior. We are intentionally not opening the keyboard under any condition. Tagging the @Expensify/design team for their input.

  15. shawnborton commented on Mar 25, 2025

    @shawnborton
    Contributor

    That is indeed correct, I think we can close.

    I could see an argument that if you are going to start a thread, you might want the compose box immediately focused but I don't feel too strongly - I think this is a case where I would prefer consistency and that we don't auto focus. Let's see what the other designers think though!

  16. FitseTLT commented on Mar 25, 2025

    @FitseTLT
    Contributor

    @shawnborton What about our previous logic of autoFocusing for empty chats which is:

    We normally don't auto focus for mobile to avoid keyboard opening disturbing user experience but if the report is empty there is nothing to see unless it is transaction thread so the user likely opened the chat to compose a message so we auto-focus.

  17. dannymcclain commented on Mar 25, 2025

    @dannymcclain
    Contributor

    I would prefer to never autofocus—even when starting a new chat/thread.

  18. shawnborton commented on Mar 25, 2025

    @shawnborton
    Contributor

    Okay cool, I say we close then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions