Remove unused pageSize from enableLoadMore#196
Remove unused pageSize from enableLoadMore#196matthewrfennell wants to merge 1 commit intoexyte:mainfrom
Conversation
Pagination offset (the distance from the top message before we start
loading more) used to be determined by the offset parameter passed to
enableLoadMore, like so:
if ids.prefix(offset + 1).contains(message.id) {
onEvent?(message)
}
This got changed in 568d00d. Now, we
rely on paginationTargetIndexPath instead, which is hardcoded to be the
last already loaded message:
IndexPath(row: lastSection.rows.count - 1, section: sections.count - 1)
As a result, pageSize is no longer used. Remove it to make sure that
consumers do not expect different behaviour when they modify the
parameter.
71871bf to
0847045
Compare
|
Hey @matthewrfennell, this comment just means that we should store the target index, and can't rely on easy math on the fly, because of some swiftUI shenanigans. I think it's better to restore trigger offset functionality if at all possible, it will help preserve the API if nothing else. If you're willing to work on that, please remember to test the initial calling of pagination when there are <= paginationThresholdValue cells in the table (including zero). But if you think that just using the last cell is ok in most cases, I can merge this PR. Have a fantastic day! |
|
what is the route going forward here? @matthewrfennell merge it or change it? |
|
To decide, I'd like to test with/without the offset and see how it affects the UX. I'm presuming it would have an impact, in which case I'd be in favour of changing the PR. There are a couple of other things I want to do first, so I probably won't have time to pick this up for at least another month, but I'm happy if anyone else wants to pick it up in the meantime. |
Description
Pagination offset (by which I mean the distance from the top message before we start loading more) used to be determined by the
offsetparameter passed toenableLoadMore, like so:This got changed in 568d00d. Now, we rely on
paginationTargetIndexPathinstead, which is hardcoded to be the last already loaded message:As a result,
pageSizeis no longer used. Remove it to make sure that consumers do not expect different behaviour when they modify the parameter.Comments
I was tempted to re-add that
offsetfunctionality, but this comment made me pause:I didn't quite understand it, is it saying that we don't want to call the pagination handler at all before we reach the last already loaded message?
Anyway, if you'd like me to look at adding that functionality back, I'd be more than happy to take a look, just didn't want to start making changes without understanding the history first :)