Bidirectional pagination#26166
Conversation
…into feat/#Expensify#23220-bidirectional-pagination
…pensify#23220-bidirectional-pagination
…pensify#23220-bidirectional-pagination
…pensify#23220-bidirectional-pagination
…pensify#23220-bidirectional-pagination
…into feat/#Expensify#23220-bidirectional-pagination
…into feat/#Expensify#23220-bidirectional-pagination
…into feat/#Expensify#23220-bidirectional-pagination
…into feat/#Expensify#23220-bidirectional-pagination
|
@perunt Is there any issue to link to this PR? |
|
yes, added to the description. I'll also add the main issue link for clarification, thanks! |
|
@pecanoro I can help review this one since I have context. |
|
@roryabraham I'm back from my vacation, so I'll put all my efforts to deliver comment linking asap. |
|
Just two small styling changes, everything else looked good to me |
…pensify#23220-bidirectional-pagination
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.91-0 🚀
|
|
This PR caused #30423 |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀
|
| onStartReached={loadNewerChats} | ||
| onStartReachedThreshold={0.75} |
There was a problem hiding this comment.
May I ask why this is needed?
I mean why we need to load newer actions? When we open report, I think we get all the latest actions.
@perunt Will you explain?
|
I think this is very likely causing this: #30729 |
|
We also had caused #30395, which we fixed by adding |
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`, | ||
| value: { | ||
| isLoadingNewerReportActions: true, |
There was a problem hiding this comment.
This caused a regression when we try to load more while the device is offline it will cause a loop setting the value of isLoadingNewerReportActions creating a flicker #30503
| // Determines the number of content items based on container height | ||
| const possibleVisibleContentItems = Math.ceil(Dimensions.get('window').height / CONST.CHAT_SKELETON_VIEW.AVERAGE_ROW_HEIGHT); | ||
| function ReportActionsSkeletonView({shouldAnimate, possibleVisibleContentItems}) { | ||
| const contentItems = possibleVisibleContentItems || Math.ceil(Dimensions.get('window').height / CONST.CHAT_SKELETON_VIEW.AVERAGE_ROW_HEIGHT); |
There was a problem hiding this comment.
Coming from #59608 checklist: On mobile web the height from window depends on visualViewport which changes when the keyboard open/hide. Given our current logic for calculating the number of loading items based on height we should switch to using screen.height
It's a part of the 'comment linking' feature. In this PR, we're only addressing the ability to fetch elements from both sides. There's no gap detection here (by 'gap detection,' I mean distinguishing where we have inconsistent messages and fetching the proper piece of them). Right now, it only fetches an element if it reaches the start or end of the list
Details
Fixed Issues
$ #23223
PROPOSAL:
Tests
Offline tests
QA Steps
Open Chat:
Check for Absence of Bottom Loader:
Scroll to the Top:
Scroll Back to the Bottom:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Untitled.2.mov
Mobile Web - Chrome
telegram-cloud-document-2-5210708448685077299.mp4
Mobile Web - Safari
111.mov
Desktop
11.mov
iOS
Simulator_Screen_Recording_iPhone_14_Pro_2023_09_18_at_15_58_51.mov
Android
telegram-cloud-document-2-5210708448685076822.mp4