You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Thread - The compose box is not focused after starting a thread #58874
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
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.
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
@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)
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
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)
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!
@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.
Activity
melvin-bot commentedon Mar 21, 2025
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.daledah commentedon Mar 21, 2025
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
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Line 271 in c9c9d1e
and
shouldFocusInputOnScreenFocusis 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
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.
[-]Thread - The compose box is not focused after starting a thread[/-][+][$250] Thread - The compose box is not focused after starting a thread[/+]melvin-bot commentedon Mar 21, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021903068815363671624
melvin-bot commentedon Mar 21, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)s77rt commentedon Mar 21, 2025
This is not a bug, that's expected. @NicMendonca Can we close this?
daledah commentedon Mar 22, 2025
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
s77rt commentedon Mar 23, 2025
@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)
daledah commentedon Mar 24, 2025
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
FitseTLT commentedon Mar 24, 2025
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)
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Line 271 in c9c9d1e
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
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 301 to 307 in acc2e84
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 openingBut another problem arose and we readded
shouldFocusInputOnScreenFocuscondition 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)
s77rt commentedon Mar 25, 2025
Asked in slack https://expensify.slack.com/archives/C01GTK53T8Q/p1742871897616699?thread_ts=1740682679.344749&cid=C01GTK53T8Q
jayeshmangwani commentedon Mar 25, 2025
This is intended behavior. We are intentionally not opening the keyboard under any condition. Tagging the @Expensify/design team for their input.
shawnborton commentedon Mar 25, 2025
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!
FitseTLT commentedon Mar 25, 2025
@shawnborton What about our previous logic of autoFocusing for empty chats which is:
dannymcclain commentedon Mar 25, 2025
I would prefer to never autofocus—even when starting a new chat/thread.
shawnborton commentedon Mar 25, 2025
Okay cool, I say we close then.