-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD on #16660][$1000] Web – Assign Task – Whole page jitter on check and uncheck of checkbox. #22656
Comments
Triggered auto assignment to @michaelhaxhiu ( |
Bug0 Triage Checklist (Main S/O)
|
@michaelhaxhiu Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@michaelhaxhiu 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
Job added to Upwork: https://www.upwork.com/jobs/~0156490fa397b075d8 |
Current assignee @michaelhaxhiu is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik ( |
Indeed very tough to repro, I'll keep it under on radar and wait for any proposals 👌🏼 |
ProposalPlease re-state the problem that we are trying to solve in this issue.In task page, the page jitters when the user clicks(check & uncheck) the checkbox continuously. (Approximately, more than 10~14 times) What is the root cause of that problem?App/src/components/InvertedFlatList/BaseInvertedFlatList.js Lines 136 to 138 in 8dcad16
I think it's because of getItemLayout in FlatList .Currently, we save size & offset of each item using measureItemLayout function while rendering and we input them using getItemLayout function in next rendering.We use sizeMap array to save size & offset of items.
But all these code was assumed and written as if new item will be added to the last element of the item array in What changes do you think we should make in order to solve the problem?We need to update I updated the code and I wasn't able to see jitter issue. What alternative solutions did you explore? (Optional)We may not use |
Hi @akamefi202, thanks for your proposal. First of all, I've tried to test your approach on my end, but it causes an error for me. I've attached a diff which I used. Later, I'm not sure about the root cause you have written. As, most likely, you pinpointed the faulty code correctly, but you didn't provide an answer as to why it only occurs after spamming check/uncheck. If we were wrongly saving measurements, shouldn't it cause problems way earlier, not only after clicking multiple times? diff --git a/src/components/InvertedFlatList/BaseInvertedFlatList.js b/src/components/InvertedFlatList/BaseInvertedFlatList.js
index d3fcda0ea5..e941933cec 100644
--- a/src/components/InvertedFlatList/BaseInvertedFlatList.js
+++ b/src/components/InvertedFlatList/BaseInvertedFlatList.js
@@ -53,13 +53,14 @@ class BaseInvertedFlatList extends Component {
* @return {Object}
*/
getItemLayout(data, index) {
- const size = this.sizeMap[index];
+ const sizeMapIndex = this.props.data.length - index - 1;
+ const size = this.sizeMap[sizeMapIndex];
if (size) {
return {
length: size.length,
offset: size.offset,
- index,
+ index: sizeMapIndex,
};
}
@@ -76,7 +77,7 @@ class BaseInvertedFlatList extends Component {
// initialRowHeight since we can only assume that all previous items
// have not yet been measured
offset: _.isUndefined(lastMeasuredItem) ? this.props.initialRowHeight * index : lastMeasuredItem.offset + this.props.initialRowHeight,
- index,
+ index: sizeMapIndex,
};
}
@@ -88,20 +89,22 @@ class BaseInvertedFlatList extends Component {
*/
measureItemLayout(nativeEvent, index) {
const computedHeight = nativeEvent.layout.height;
+ const sizeMapIndex = this.props.data.length - index - 1;
// We've already measured this item so we don't need to
// measure it again.
- if (this.sizeMap[index]) {
+ if (this.sizeMap[sizeMapIndex]) {
return;
}
- const previousItem = this.sizeMap[index - 1] || {};
+ const previousItem = this.sizeMap[sizeMapIndex - 1] || {};
// If there is no previousItem this can mean we haven't yet measured
// the previous item or that we are at index 0 and there is no previousItem
const previousLength = previousItem.length || 0;
const previousOffset = previousItem.offset || 0;
- this.sizeMap[index] = {
+ this.sizeMap[sizeMapIndex] = {
length: computedHeight,
offset: previousLength + previousOffset,
}; |
@robertKozik
And About root cause, One more thing is we're adding new items to invisible viewport when we check & uncheck the checkbox. This is just my analysis and other engineer might find more accurate reason. |
@michaelhaxhiu, @robertKozik Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
ProposalPlease re-state the problem that we are trying to solve in this issue.After checking/unchecking the task the page jitter. What is the root cause of that problem?The heights/offsets of the elements in the inverted What changes do you think we should make in order to solve the problem?Previously, we used the Solution:
<FlatList
inverted
{...otherProps}
/> However, there are some dependency-related issues here. What alternative solutions did you explore? (Optional)We can add to the I created a short PoC video showing the results. PoC videofix1.mov |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@akamefi202 Your proposal has some strange behaviour when the message list is very long: diff-solution.mov@kosmydel I think we have bumping the |
@michaelhaxhiu @robertKozik 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! |
Working on proposals 👀 |
Still on hold |
hold |
Triggered auto assignment to @adelekennedy ( |
I'm re-assigning this to another BZ as part of my preparation for Sabbatical (starting Friday). Next steps:
|
linked issue is still in progress |
Hey, Videofixed.mov |
I can't reproduce so closing makes sense to me, gut check with you @allroundexperts |
So in that case, can we close this issue? |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Page should not start to jitter upon check and uncheck of checkbox.
Actual Result:
Page starts to jitter upon selection check and uncheck of checkbox.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.39-5
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
Notes/Photos/Videos: Any additional supporting documentation
Bug.11.mp4
Recording.3551.mp4
Expensify/Expensify Issue URL:
Issue reported by: @usmantariq96
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689069224351539
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: