Closed m-natarajan closed 5 months ago
Job added to Upwork: https://www.upwork.com/jobs/~011ebf704e63731d68
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary (External
)
Triggered auto assignment to @jliexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
We (Applause) think this bug might be related to #vip-vsb
@ntdiary I got assigned a similar action (i.e. shaking occurs when tapping on something) here: https://github.com/Expensify/App/issues/34300
Do you think the root cause would be the same?
@ntdiary I got assigned a similar action (i.e. shaking occurs when tapping on something) here: #34300
Do you think the root cause would be the same?
Hi, @jliexpensify, I'm still OOO. If this is a urgent issue, please feel free to reassign another c+, or maybe I'll have 1-2 hours to dig deeper tomorrow. :)
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External
)
Than ks @ntdiary - going to reassign for now! @s77rt - please see my question here!
@jliexpensify No they seem different. This one is related to the main composer getting hidden which makes the editing composer change position (jump)
@m-natarajan you checked the ios: native
box but your video seems to be iOS Safari (or another browser).
I also can't really reproduce this, @s77rt could this issue be related to how the keyboard pops up?
@jliexpensify No, it's only due to the fact that we are hiding the main composer so everything shift down including the edit composer
https://github.com/Expensify/App/assets/16493223/52a8a3e2-8790-4a9a-abdc-6fa04bcdc79e
Before | After |
---|---|
Thanks for sharing that video @s77rt - I can see it a bit more clearly now. Is it something that is a pretty simple/straightforward fix?
@jliexpensify I didn't check in depth but I don't think fixing this would be straightforward.
Cool, lets wait for some proposals then - thanks!
EDIT: posted here - https://expensify.slack.com/archives/C066HJM2CAZ/p1707880547642609
Not overdue. Looking for proposals
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Waiting for proposals!
Still looking for proposals
@s77rt @jliexpensify 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!
@s77rt, @jliexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Still looking for proposals
Still looking for proposals
Same ^
@s77rt @jliexpensify this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@s77rt can you reproduce this one? I tried again and don't see the jump on Android. I wonder if this is just a mobile limitation with the keyboard pushing the edited sentence up and then down?
@jliexpensify The jump behaviour is more noticeable on mWeb. Though this seems a minor bug, do you think we should close the issue?
I think we should still keep it open, I'll post to the Open-Source channel since we haven't had any proposals yet!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@s77rt @jliexpensify this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @s77rt is eligible for the Internal assigner, not assigning anyone new.
Still looking for proposals. Should we make this External
again?
Although I'm aware that there isn't an External + Help Wanted tag, I went ahead and drafted a proposal for the issue. I would appreciate any feedback.
The problem is the unexpected jump in the composer when editing messages in a chat with numerous text messages.
I see two problems here:
1 - When rendering the ReportActionItemMessageEdit composer
, we always start with two lines and then update the numberOfLines
later.
The flicker that this issue causes is small (more noticeable when we have multiple lines) but I believe it is worth fixing.
2 - Today we also deal with ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT
when editing message:
https://github.com/Expensify/App/blob/4ac2dd7d391b53b5b8afc480cae61d8335da3209/src/pages/home/report/ReportActionItemMessageEdit.tsx#L428 and https://github.com/Expensify/App/blob/4ac2dd7d391b53b5b8afc480cae61d8335da3209/src/pages/home/report/ReportActionItemMessageEdit.tsx#L445
Generating a 'out of sync' behavior when rendering/hiding both edit and main composers, which leads to this 'flicking' feeling.
Also the use of setShouldShowComposeInputKeyboardAware(true)
on composer blur creates another issue, steps to reproduce:
Press X to cancel editing one message, note that the main composer appears, but it should remain hidden, since we still have another edit composer opened.
The root cause is the dynamic hiding of the main composer when editing a message/comment:
https://github.com/Expensify/App/blob/4ac2dd7d391b53b5b8afc480cae61d8335da3209/src/pages/home/report/ReportFooter.tsx#L134 Leading to abrupt movements during message editing.
Implemented dynamic calculation of Composer component's number of lines based on draft content length. I couldn't put the videos side by side :p
Here is a branch/commit that I used on the videos above.
The idea is to pass the numberOfLines
to the edit composer as props. However, the way I calculated the numberOfLines
in ReportActionItemMessageEdit
can/should be reviewed and confirmed that it is in accordance with Expensify best practices.
Still working on the solution, I believe we need to update how we handle draftMessage
and setShouldShowComposeInputKeyboardAware
in ReportActionItem
and ReportActionItemMessageEdit
respectively. Create animations/transitions conditional on these variations, Using import * as Animatable from 'react-native-animatable';
. I'm working on it and will have a POC soon.
@brunovjk Thanks for the proposal. Your RCA makes sense. Regarding the suggested solution I'm not sure if animation would help much here. Were you able to work on a PoC? As for the alternative solution we don't want to use the main composer because we want to have the ability to edit multiple messages at the same time.
Current assignee @s77rt is eligible for the External assigner, not assigning anyone new.
Made this one External
, hopefully we get some more input!
@jliexpensify No, it's only due to the fact that we are hiding the main composer so everything shift down including the edit composer
Screen.Recording.2024-02-14.at.2.13.26.AM.mov Before After
In this video, would you want the keyboard to pop up?
@jeremy-croff I don't want the keyboard to pop up. That was a demonstration that the location of the edit input changes.
Were you able to work on a PoC? As for the alternative solution we don't want to use ...
Working on it. Thank you for the feedback.
The composer jumps or shifts abruptly when a user starts editing a message in a chat with many messages. This creates a jarring user experience.
The root cause is that the main composer is abruptly hidden without any animation when the shouldShowComposeInput
prop changes to false
. This sudden hiding causes the chat area and the editing composer to jump upwards to fill the vacated space.
We should use the react-native-reanimated
library to smoothly animate the main composer's visibility and height when the shouldShowComposeInput
prop changes.
Add a new animated value mainComposerVisible
that's initialized based on shouldShowComposeInput
.
Create an animated style mainComposerStyle
that animates the opacity and height of the main composer based on mainComposerVisible
.
Use useSharedValue
, useAnimatedStyle
, and withTiming
to define the animations.
Add a useEffect
hook that animates mainComposerVisible
when shouldShowComposeInput
changes.
Use the measure
method to get the actual height of the main composer and animate to that height.
Apply the mainComposerStyle
to the main composer view.
Note: in my PR, I created a RNView
for an Animated View component, very similar to the RNTextInput
that we have the Animated Text Input setup. This will be needed so we keep this change specific to native
https://github.com/Expensify/App/assets/15656774/2077b54a-c53c-41a9-8025-d528787d2cc2
https://github.com/Expensify/App/assets/15656774/f60f4669-113e-4eaf-800e-3565a9f3663a
Conditionally rendering the main composer based on shouldShowComposeInput
. However, this caused visual glitches and didn't allow for smooth animations.
Using the Animated
API directly on the style props. But using react-native-reanimated
provides better performance and more flexibility for complex animations.
Animating the height and opacity separately. But combining them into a single animated style resulted in cleaner and more synchronized animations.
@brandonhenry Thanks for the proposal. Your RCA is correct. Regarding the solution can you please attach a before and after videos for comparison?
@s77rt updated proposal
@brandonhenry Thanks for the update. I'm not sure how is new behaviour better than what we have now. It kinda makes the app feel slower. cc @Expensify/design https://github.com/Expensify/App/issues/36374#issuecomment-1995705491
@s77rt I'm still working on this, and it looks like we have more problems:
1 - The first render of the ReportActionItemMessageEdit composer
has 2 lines by default, and a moment later we calculate the number of lines correctly. I believe this is helping a little with the 'jumping' feeling, but it is not the main cause.
2 - When start and finish the edit, there are times with 2 composers rendered and times with 0 composers. I wonder if there is a way to render composers synchronously, with a smooth transition or something, still testing.
3 - If you edit two separate messages, press X to cancel (blur) on one of them, the main composer appears.
I believe it's related to setShouldShowComposeInputKeyboardAware
and ComposerActions.setShouldShowComposeInput
in ReportActionItemMessageEdit
and how we handle rendering/hide composers on ReportActionItem
, but I am still working on solutions that do not cause regressions. I will be back as soon as I have it. Any help/feedback is welcome.
I don't mind this solution at all. Yes there's a slight animation delay but it feels right to me and this isn't the most common action so I'm okay with it. Keen to hear what the other @Expensify/design thinks
We can also adjust the delay so its not too "slow" @s77rt , the main thing is just having an animation in general. We can adjust speed in PR if this is route we're looking to go. Right now, code is purposefully using CONST.ANIMATED_TRANSITION (300ms)
@s77rt I believe we have some questions/issue here:
ReportActionItemMessageEdit composer
, we always start with two lines and then update the numberOfLines
later, generating a small flick, more noticeable in messages with multiple lines.ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT
@brunovjk Thanks for the update. Good catch with the multiline issue. Can you please outline how we will fix that without PRs / code diffs?
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: 1.4.40-0 Reproducible in staging?: y Reproducible in production?: y 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 Expensify/Expensify Issue URL: Issue reported by: Applause internal team Slack conversation:
Action Performed:
Expected Result:
It shouldn't shake or jump
Actual Result:
The composer jumps when editing a message - see this video for an example
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/38435837/f101889f-6e39-46c6-9ceb-9bcea89cd234
View all open jobs on GitHub
Upwork Automation - Do Not Edit