-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
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.
- Have fetch report actions load actions 50 to 100 than 250 to 300. Or,
- Load 100 to 300 actions.
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?
I've posted a job for the research side of this discussion, you can view it here https://www.upwork.com/jobs/~01b0e6a74cd4c83a19