Open m-natarajan opened 3 weeks ago
Triggered auto assignment to @lschurr (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.
CC: @rushatgabhane @mananjadhav @hungvu193 seen this before?
@trjExpensify haven't seen before but i can reproduce this janky-ness
Job added to Upwork: https://www.upwork.com/jobs/~01894cdf15ac4a5e92
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (External
)
Let's send it external then!
There is a slight flashing/janky animation of the collapse component
The bug is in react-native-collapsible
There's a condition mismatch between https://github.com/oblador/react-native-collapsible/blob/2bd7f8d50c2f3d876119bc65da8e7681c38563ad/Collapsible.js#L188 and https://github.com/oblador/react-native-collapsible/blob/2bd7f8d50c2f3d876119bc65da8e7681c38563ad/Collapsible.js#L194.
The hasKnownHeight
is used to render the parent view with fixed height or not. So when hasKnownHeight
is false
initially when collapsed
becomes false
, there will be no style here. At the same time, the measuring doesn't start yet, so the measuring
here is false
, so the content becomes rendered.
Right after that the measuring
becomes true
and the content becomes hidden, then after measuring completed, the content becomes visible again.
So the root cause is that although the hasKnownHeight
is false
(the parent view is not ready to be shown yet), we're still showing the content (because measuring didn't start).
Make the condition between https://github.com/oblador/react-native-collapsible/blob/2bd7f8d50c2f3d876119bc65da8e7681c38563ad/Collapsible.js#L188 and https://github.com/oblador/react-native-collapsible/blob/2bd7f8d50c2f3d876119bc65da8e7681c38563ad/Collapsible.js#L194 consistent.
If hasKnownHeight
is false (the parent view is not ready to be shown yet), the content should also not show.
This condition can be updated to:
if (!hasKnownHeight) {
The !hasKnownHeight
condition is inclusive of the existing (measuring)
condition because if measuring
is true
, hasKnownHeight
will be false
and !hasKnownHeight
will also be true
. So this will not cause any problem.
To test this locally, please modify the same condition in node_modules/react-native-collapsible/Collapsible.js
Update the logic here https://github.com/oblador/react-native-collapsible/blob/2bd7f8d50c2f3d876119bc65da8e7681c38563ad/Collapsible.js#L189-L192 so if hasKnownHeight
is false
, the parent view will have invisible style
const style = hasKnownHeight ? {
overflow: 'hidden',
height: height,
} : {
overflow: 'hidden',
height: 0,
};
Or just
const style = {
overflow: 'hidden',
height: height,
};
As when hasKnownHeight
is false
, the height
will also be 0
The problem is that when a user navigates to "Other integrations" in the accounting section of the workspace, the animation is not smooth. Instead, there is a slight flashing animation.
The root cause of the janky animation could be due to:
What changes do you think we should make in order to solve the problem? To address this issue, we need to:
const OtherIntegrations = React.memo(() => {
return (
<View>
{/* Other integration components */}
</View>
);
});
Load heavy components or data asynchronously.
useEffect(() => {
const loadHeavyComponents = async () => {
await loadData();
};
loadHeavyComponents();
}, []);
.integration-animation {
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
Please note that the above explanation outlines only the technical approach I plan to take. If my proposal gets accepted, I will submit the finalized solution, as mentioned.
Thanks!
@Pujan92 can you take a look at the proposals here?
As @truph01's mentioned in their proposal the bug seems to be in react-native-collapsible
. A similar issue https://github.com/oblador/react-native-collapsible/issues/473 is raised in the same repo.
I agree with @truph01's RCA where due to those conditions the content gets rendered before the parent View style has been assigned. I like their alternative solution to provide overflow: 'hidden'
in each cases for the parent to avoid overflowing the content. I believe hasKnownHeight
part can be omitted.
For this we need to raise a PR in react-native-collapsible
and I think the reviewer will help there in case hasKnownHeight
is required.
πππ C+ reviewed
Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@neil-marcellini - can you take a quick look at this one?
As @truph01's mentioned in their proposal the bug seems to be in
react-native-collapsible
. A similar issue oblador/react-native-collapsible#473 is raised in the same repo.I agree with @truph01's RCA where due to those conditions the content gets rendered before the parent View style has been assigned. I like their alternative solution to provide
overflow: 'hidden'
in each cases for the parent to avoid overflowing the content. I believehasKnownHeight
part can be omitted. For this we need to raise a PR inreact-native-collapsible
and I think the reviewer will help there in casehasKnownHeight
is required.πππ C+ reviewed
Sounds good, hiring @truph01
π£ @Pujan92 π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @truph01 π 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 π
@Pujan92 @neil-marcellini With this issue, should I create a pull request (PR) to fix the library directly or create a patch package?
I prefer to create PR in the lib but since long the repo isn't been updated, so we can proceed with the patch package option. WDYT @neil-marcellini ?
@Pujan92 i think it's best that we discuss on opensource channel. We have precedents for this
Thanks @rushatgabhane, I will check and raise it on the open-source channel.
@truph01 Based on the discussion here, let's raise a PR in the library repo and we try to inform the maintainer to review it.
Any update on this one @truph01?
@lschurr I created PR in that lib https://github.com/oblador/react-native-collapsible/pull/475
Thanks @truph01. On Twitter, they have responded to me and I have shared the PR link. They will check the PR after their vacation. Let's wait for some days.
Waiting for a lib PR to be reviewed.
@Pujan92 @neil-marcellini @lschurr @truph01 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!
@Pujan92 Do you know when the lib's author can review the PR?
I sent a bump message yesterday, we will ask in the slack thread if we don't get a response untill Monday.
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.81-1 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: @shawnborton Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1718032595682989
Action Performed:
Have a QBO connection
Expected Result:
There should be smooth animation
Actual Result:
There is a slight flashing/janky animation
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/Expensify/App/assets/38435837/11478888-3152-4781-8904-cc48f40cbad2
https://github.com/Expensify/App/assets/38435837/596bb9bc-8801-4bdc-8b56-9a2d69ce75a6
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Pujan92