-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Implement bidirectional scrolling in ecash #2985
Comments
Triggered auto assignment to @michaelhaxhiu ( |
cc @marcaaron I know you showed me a gist or draft PR a while back with an outline of an implementation. Do you still have that? |
Do you know the total size of chat items before or when the chat loads?
What's the problem with starting in the middle and then append/prepend to the FlatList - you can (fetch and) insert more items to the bottom when you start to reach the bottom or insert more items to the top when you start to reach the top |
I'm 95% sure we could easily provide this information from the API. |
Yes, we already know since the entire |
append works fine since there is an prepend not so much for a couple of reasons:
|
This is something new I just noticed in the past few months that looks interesting https://github.com/GetStream/react-native-bidirectional-infinite-scroll
|
This library seems to support everything you need at the moment
It also supports the same virtualization props as the FlatList
Is it possible to create a new ChatList component based on that library and use it for Android and iOS, while desktop and web continue to use the existing FlatList (ReportActionsView) implementation. The point is if you try to create your own solution you'll basically create the same thing and have the same problems e.g. make it work for web |
I can't speak for everyone, but I'm not sure if we would commit to using a library on the mobile side with only the hope that the web side would work out for us eventually (maybe if we can also test the web PR in progress and deem that it's heading in the right direction). In any case, the first step would be to evaluate if such a library exists and can actually work for us (cross platform or not).
An alternative way to frame this is that if we create our own solution, we might have the same problems, but nothing can stop us from solving them. |
Triggered auto assignment to @stitesExpensify ( |
Triggered auto assignment to @tgolen ( |
What are the limits for this ticket. Can we use a library? @marcaaron The library that you found seems to be the real deal
I think this is a leftover from when the ticket was internal, as an external contributor, I can spend a lot of time to do a PR only to be rejected. How should this ticket be handled? |
Using the library and making a web specific implementation (that we can contribute to that library) can be a lot less coding: This is because we have much more flexibility coding for web |
@kidroca I think what you've suggested sounds pretty reasonable. I would love to see a solution that forks https://github.com/GetStream/react-native-bidirectional-infinite-scroll and implements a shim to make it compatible with react-native-web. We can use that fork ourselves and try to get it merged into the parent repo. Alternatively, we can just create the shim directly in Expensify.cash but I would prefer the first option. Given your history of excellent work, I would feel comfortable hiring you for that task. Then if you produce a proof-of-concept and we decide that we'd still rather implement a bidirectional paginated FlatList from scratch, you'd still be paid for that work. It would still be valuable research to push this issue forward. cc @jboniface @marcaaron @chiragsalian – sound reasonable to you? |
Yes, I love the idea of forking and contributing a RN4W version of https://github.com/GetStream/react-native-bidirectional-infinite-scroll. Great! |
As for proposing a web implementation it might be worth inquiring on the status of this PR -> GetStream/react-native-bidirectional-infinite-scroll#16 Maybe we can build on that work, propose an alternative, or help get it prioritized. But verifying if this project suits our needs sounds like a good first step. |
Sounds great! @roryabraham I can make a POC implementation where we can see how it goes for native and make further plans if it's worth it Setting:
|
@kidroca Sounds great as a first step. So let's do that first and then discuss. However, I think it's also in-scope for this job to test the web beta (i.e: point E.cash at the latest commit on this PR)? If it doesn't work and we can create a reproducible test case, then that's valuable information to provide to the PR author. Let me know if you have any other questions. |
Good idea
|
@kidroca tbh, I was going to raise the value on this job right before you accepted it, and it does sound like more work than i originally proposed, so I'll just throw a bonus on to double the payout for you when it's done. Just link back to this comment if I forget somehow and we'll figure it out. |
Thanks for your continued work and interest @azimgd. Here's are my thoughts: Working on this issue has been a humbling experience for me – I've tried many different approaches over several months and unfortunately have not been able to successfully implement the feature. During that time, I have successfully produced several POC's that, like the one you're showing us, work in a sandboxed environment using mock data and simple square components. Each time, I have discovered some unforeseen bug or bugs that surfaced at a later step that invalidated my POC to some degree. It's totally possible that the solution you've been working on solves all the problems we've faced in implementing bidirectional scrolling in this repo and doesn't introduce other unseen ones, but there's no way I can reliably validate that without implementing your solution in our product. I for one still have greater confidence that fixing this bug and completing the If you believe that your react-virtual approach can solve this issue on all platforms without introducing other bugs, that is great. But if you want to pursue that route, you'll need to provide not just a proof-of-concept, but a full-fledged implementation of your approach in our app. However, I unfortunately have not seen enough to make me confident that your POC will be more successful than my several others (though I would love to be proven wrong). So given that, I am not currently comfortable assigning this issue to you or agreeing on a price for that work at this time. I will say that, for a full-fledged solution we would be happy to pay at least the sticker price for this issue, provided that we have not hired someone else for that issue at the time the solution is delivered. So if you want to keep working on that, I encourage you to do so, as long as you understand that such work is not officially sanctioned at this time, so there is some risk that it won't be used or you won't be paid for it. Hopefully that all makes sense and transparently expresses our position here. |
Guess we'll keep this one open for now, the main issue we're addressing now is #7925 |
#7925 is moving along (but also on hold...) |
Rory "Made some great progress on Android implementation last week, posted update here" |
Making a note here that whenever this is done, there's this other initial consideration we punted. |
Meeting with Margelo today, we are making slow-and-steady progress. Almost all the pieces are in place now |
@roryabraham , can you provide a quick update when ya can? (Mostly cuz i'm curious how close we are) |
Bidirectional scrolling features are live in NewDot production. Now we are waiting for @chiragsalian to re-implement comment linking using the new bidirectional scrolling features so we can battle-test them. Last I heard, he was prioritizing finishing API refactors first. |
Yup its what rory said. I went ahead and closed my previous PR. Mostly because there was a lot that wasn't ideal about it and it wasn't in any super rush like it was when we originally created the issue so it would be nice to do it better this round. I'm currently focusing on API refactors but will work on this right after. This time i'll focus on doing very small parts at a time so that reviewing and testing becomes a lot easier. Additionally i wanted to ask. Do we feel like a design doc is needed to discuss technical implementation using bidirectional scrolling to get more eyes on this or for each task should i just post a plan of action to have it approved before implementing or just implement each task and discuss improvements during review? Any preferences? |
Missed your comment @chiragsalian , thanks for the ping @michaelhaxhiu Chirag, any update since your last one?
Has much changed since the comment linking portion in the comment actions design doc was created? It's been a bit. Maybe a mini doc is in order? Maybe a post in #expensify-open-source with CMEs tagged if you/we are unsure? |
Well the design doc was pretty light on the technical details for comment linking. So from just that high-level idea, it hasn't changed much. But comment linking has a lot of nuances that I feel should be discussed either in more detail in a doc or in a GH plan of action comment. Sure okay, I can ask CMEs. I'm not sure why to post in #expensify-open-source just yet though since atm the task is internal. If CMEs decide its external then I think it makes more sense to post in #expensify-open-source. |
I think I maybe accidentally said #expensify-open-source when I meant #engineering. If there hasn't been a detailed section written to specifically address comment linking, it sounds like it's be useful. Maybe it'll help with splitting up internal/external issues too |
For clarity bidirectional scrolling already exists in /App, and more recently, we've confirmed it'll be compatible with the Fabric upgrade. Right? Can we rename this issue to focus on comment linking as a result? |
My understanding is this issue is still open since we can't prove everything works with bidirectional scrolling yet, even through it should. This is the main tracking issue for Comment Linking, we could close this then move discussion there, if/when needed. ¯_(ツ)_/¯ |
@roryabraham @chiragsalian I stumbled upon this issue again and I still feel we should close it since nothing is actually happening here. As noted, we already have an issue for comment linking in https://github.com/Expensify/Expensify/issues/147480. Re-open if you disagree. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Problem
We're trying to enable comment linking in Cash, and while developing the solution, we've hit a snag : in short, we're unsure how to load the specific report comment. At the moment, because of pagination when the
fetchReportActions
we’re just fetching 50 results. So if the report had 300 comments and we want the comment link to go to comment sequence number 100 it gets tricky because we have two options.If we go with option 2 it would be extremely slow since we load bottom to top so it would be a bad user experience to load the desired comment action last.
Option 1 sounds like the better user experience but then our current FlatList only loads more comments if you scroll up. This means the user can scroll up to load report comments between 1-50 but they will never be able to scroll down to load report comments between 100 - 150.
Solution ?
Create a PR to build bidirectional scrolling so that we can load comments onStart or onEnd and then we continue with comment linking. This way even if the comment is pretty old the user will be able to scroll up and down to load additional comments using pagination.
Discussion
As per above, we're exploring whether we want to build our own FlatList component to support bidirectional scrolling, but we need to plot out the actual approach for implementation to determine if it would be feasible.
Ultimately, the question is, does it make sense to build the features we want into FlatList, or should we build our own component?
cc @chiragsalian
I've posted a job for the research side of this discussion, you can view it here https://www.upwork.com/jobs/~01b0e6a74cd4c83a19
The text was updated successfully, but these errors were encountered: